2012-09-11 Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
815a1205
AM
12012-09-11 Alan Modra <amodra@gmail.com>
2
3 PR gold/14566
4 * layout.cc (Layout::set_segment_offsets): When using
5 common-page-size alignment, ensure we are on a new max-page-size
6 page.
7 * output.cc (Output_segment::set_section_addresses): Use
8 abi_pagesize, not common_pagesize for relro boundary.
9 (Output_segment::set_offset): Likewise.
10
bd73a62d
AM
112012-09-11 Alan Modra <amodra@gmail.com>
12
13 * output.h (Output_data_got::add_global_tls, add_local_tls,
14 add_local_tls_pair): New functions.
15 (Output_data_got::add_local_pair_with_rel): Remove second
16 reloc param. Expand comment.
17 (Output_data_got::Got_entry): Rename use_plt_offset_ to
18 use_plt_or_tls_offset_, similarly for constructor param.
19 (Output_data_got::Got_entry::write): Add got_index param.
20 * output.cc (Output_data_got::add_global_tls, add_local_tls,
21 add_local_tls_pair): New functions.
22 (Output_data_got::Got_entry::write): Handle tls symbols
23 with use_plt_or_tls_offset_ set specially.
24 (Output_data_got::add_local_pair_with_rel): Only one reloc.
25 (Output_data_got::do_write): Replace iterator with index, pass
26 index to entry write function.
27 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
28 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
29 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
30 call.
31 * i386.cc (Target_i386::Scan::local): Likewise.
32 * sparc.cc (Target_sparc::Scan::local): Likewise.
33 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
34 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
35 do_tls_offset_for_global): New functions.
36 (Target_powerpc::Scan::local): Correct TLS relocations and got
37 entry values.
38 (Target_powerpc::Scan::global): Don't emit unnecessary
39 dynamic relocations on TLS GOT entries.
40
00716ab1
AM
412012-09-10 Matthias Klose <doko@ubuntu.com>
42
43 * config.in: Disable sanity check for kfreebsd.
44
c891b3f9
SA
452012-09-10 Sterling Augustine <saugustine@google.com>
46
47 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
48 (Gdb_index::pubtypes_read): New parameter.
49 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
50 to calls.
51 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
52 pubtypes_object_.
53
e81fea4d
AM
542012-09-09 Alan Modra <amodra@gmail.com>
55
56 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
57 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
58 * gc.h (gc_process_relocs): Call target gc_add_reference.
59 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
60 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
61 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
62 unnecessary cast.
63 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
64 to cater for when we don't need code offset. Update use.
65 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
66 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
67 set_opd_valid): New functions.
68 (Target_powerpc::do_gc_add_reference): New function.
69 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
70 stashed refs.
71 (Target_powerpc::do_gc_mark_symbol): New function.
72
d2d60eef
CC
732012-09-06 Cary Coutant <ccoutant@google.com>
74
75 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
76 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
77 (Dwarf_die::skip_attributes): Likewise.
78 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
79 * testsuite/gdb_index_test.cc (inline_func_1): New function.
80 (main): Call it.
81 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
82
32ed4573
L
832012-09-05 H.J. Lu <hongjiu.lu@intel.com>
84
85 * testsuite/script_test_3.t: Add .got.plt output section
86 statement.
87 * testsuite/script_test_4.t: Likewise.
88
f4baf0d4
AM
892012-09-05 Alan Modra <amodra@gmail.com>
90
91 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
92 update all uses and lose "enum" when using type.
93
864a1b56
AM
942012-09-05 Alan Modra <amodra@gmail.com>
95
96 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
97 * configure: Regenerate.
98 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
99 (plugin_final_layout.stdout): Likewise.
100 (memory_test): Set page sizes to 0x1000.
101 * testsuite/Makefile.in: Regenerate.
102 * testsuite/discard_locals_test.sh: Add FIXME comment.
103 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
104 * testsuite/pr14265.t: Add .got output section statement.
105 * testsuite/script_test_2.t: Likewise.
106 * testsuite/script_test_3.t: Likewise.
107 * testsuite/script_test_4.t: Likewise.
108 * testsuite/script_test_5.t: Likewise.
109 * testsuite/script_test_6.t: Likewise.
110 * testsuite/script_test_7.t: Likewise.
111 * testsuite/script_test_9.t: Likewise.
112
3ea0a085
AM
1132012-09-05 Alan Modra <amodra@gmail.com>
114
115 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
116 (Powerpc_relocate_functions::Status): New typedef.
117 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
118 (Target_powerpc::Scan::local): Handle REL64.
119 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
120 for REL32 and REL64.
121 (Target_powerpc::symval_for_branch): New function, extracted from..
122 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
123 checks. Report overflow errors.
124
7404fe1b
AM
1252012-09-05 Alan Modra <amodra@gmail.com>
126
127 * object.h (Sized_relobj_file::emit_relocs): Delete.
128 (Sized_relobj_file::emit_relocs_reltype): Delete.
129 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
130 relocate_relocs for --emit-relocs.
131 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
132 * output.h: Update comment.
133 (Output_segment::first_section): New function.
134 (Output_segment::first_section_load_address): Use first_section.
135 * output.cc (Output_segment::first_section): New function extracted..
136 (Output_segment::first_section_load_address): ..from here. Delete.
137 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
138 * target.h (Sized_target::relocate_for_relocatable): Likewise.
139 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
140 adjust call to target.h function.
141 * i386.cc (Target_i386): Likewise.
142 * sparc.cc (Target_sparc): Likewise.
143 * x86_64.cc (Target_x86_64): Likewise.
144 * powerpc.cc (Target_powerpc): Likewise.
145 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
146 first tls section has section symbol for optimised local dynamic
147 output relocs.
148 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
149 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
150 optimised tls code.
151 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
152 Rename to relocate_relocs. Update error message.
153
957564c9
AS
1542012-09-04 Andreas Schwab <schwab@linux-m68k.org>
155
156 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
157 --just-symbols.
158
dd93cd0a
AM
1592012-08-31 Alan Modra <amodra@gmail.com>
160
161 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
162 (Powerpc_relobj::toc_base_offset): New stub function.
163 (Target_powerpc): Add tp_offset, dtp_offset. Rename
164 got_mod_index_offset to tlsld_got_offset. Update all refs.
165 (Target_powerpc::Relocate::enum skip_tls): New.
166 (Target_powerpc::call_tls_get_addr_): New var.
167 (Target_powerpc::is_branch_reloc): Move to file scope.
168 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
169 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
170 New functions.
171 (Target_powerpc::enum Got_type): Delete old values, add new ones.
172 (powerpc_info): Correct common_pagesize for ppc64.
173 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
174 (Powerpc_relocate_functions): Add overflow check enums and functions.
175 Add non-shift version of rela, rela_ua. Delete all rel public
176 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
177 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
178 addr16_ha3, addr14 functions.
179 (Output_data_got_powerpc::add_constant_pair): New function.
180 (Output_data_got_powerpc::got_base_offset): Likewise.
181 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
182 (instruction constants): Sort, add some more.
183 (Output_data_glink::do_write): Add and use Address typedef. Use
184 object->toc_base_offset() stub for 64-bit.
185 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
186 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
187 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
188 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
189 Always treat .opd relocs as against locally defined symbol.
190 Correct condition for RELATIVE relocs.
191 (Target_powerpc::do_finalize_sections): Test for NULL sections.
192 (Target_powerpc::Relocate::relocate): Use plt call stub as value
193 for 32-bit syms with a plt entry. Correct ppc64 toc base
194 calculations. Handle TLS relocs, and more. Add overflow
195 checking and adjust for Powerpc_relocate_functions changes.
196 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
197 Reinstate --emit-relocs code with FIXME.
198
a1373b60
AM
1992012-08-30 Alan Modra <amodra@gmail.com>
200
201 * layout.cc (Layout::set_segment_offsets): Set p_align to
202 abi_pagesize, not common_pagesize.
203 (Layout::relaxation_loop_body): Similarly use abi_pagesize
204 to determine whether file header can go in segment.
205
703d02da
AM
2062012-08-30 Alan Modra <amodra@gmail.com>
207
208 * output.h (Output_reloc::Output_reloc <output section>): Add
209 is_relative param. Adjust calls.
210 (Output_reloc::add_output_section_relative): New functions.
211 * output.cc (Output_reloc::Output_reloc <output section>): Handle
212 is_relative.
213 (Output_reloc::symbol_value): Handle SECTION_CODE.
214
16164a6b
ST
2152012-08-24 Sriraman Tallam <tmsriram@google.com>
216
217 * gold.cc (queue_middle_tasks): Call layout again when unique
218 segments for sections is desired.
219 * layout.cc (Layout::Layout): Initialize new members.
220 (Layout::get_output_section_flags): New function.
221 (Layout::choose_output_section): Call get_output_section_flags.
222 (Layout::layout): Make output section for mapping to a unique segment.
223 (Layout::insert_section_segment_map): New function.
224 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 225 output sections marked so.
16164a6b
ST
226 (Layout::segment_precedes): Check for unique segments when sorting.
227 * layout.h (Layout::Unique_segment_info): New struct.
228 (Layout::Section_segment_map): New typedef.
229 (Layout::insert_section_segment_map): New function.
230 (Layout::get_output_section_flags): New function.
231 (Layout::is_unique_segment_for_sections_specified): New function.
232 (Layout::set_unique_segment_for_sections_specified): New function.
233 (Layout::unique_segment_for_sections_specified_): New member.
234 (Layout::section_segment_map_): New member.
235 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
236 Rename is_gc_pass_one to is_pass_one.
237 Rename is_gc_pass_two to is_pass_two.
238 Rename is_gc_or_icf to is_two_pass.
239 Check for which pass based on whether symbols data is present.
240 Make it two pass when unique segments for sections is desired.
241 * output.cc (Output_section::Output_section): Initialize new
242 members.
243 * output.h (Output_section::is_unique_segment): New function.
244 (Output_section::set_is_unique_segment): New function.
245 (Output_section::is_unique_segment_): New member.
246 (Output_section::extra_segment_flags): New function.
247 (Output_section::set_extra_segment_flags): New function.
248 (Output_section::extra_segment_flags_): New member.
249 (Output_section::segment_alignment): New function.
250 (Output_section::set_segment_alignment): New function.
251 (Output_section::segment_alignment_): New member.
252 (Output_segment::Output_segment): Initialize is_unique_segment_.
253 (Output_segment::is_unique_segment): New function.
254 (Output_segment::set_is_unique_segment): New function.
255 (Output_segment::is_unique_segment_): New member.
256 * plugin.cc (allow_unique_segment_for_sections): New function.
257 (unique_segment_for_sections): New function.
258 (Plugin::load): Add new functions to transfer vector.
259 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
260 * Makefile.in: Regenerate.
261 * testsuite/plugin_final_layout.sh: Check if unique segment
262 functionality works.
263 * testsuite/plugin_section_order.c (onload): Check if new interfaces
264 are available.
265 (allow_unique_segment_for_sections): New global.
266 (unique_segment_for_sections): New global.
267 (claim_file_hook): Call allow_unique_segment_for_sections.
268 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 269
1e2bee4f
CC
2702012-08-22 Cary Coutant <ccoutant@google.com>
271
272 * layout.cc (Layout::include_section): Don't assert on GROUP
273 sections with --emit-relocs.
274
1d5dfe78
CC
2752012-08-21 Cary Coutant <ccoutant@google.com>
276
277 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
278 if --export-dynamic-symbol names an undef symbol.
279
c9269dff
AM
2802012-08-18 Alan Modra <amodra@gmail.com>
281
282 * powerpc.cc: Formatting and white space.
283 (Powerpc_relobj): Rename got2_section_ to special_.
284 Add opd_ent_shndx_ and opd_ent_off_ vectors.
285 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
286 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
287 (Target_powerpc): Add Address typedef and invalid_address. Use
288 throughout.
289 (Target_powerpc::is_branch_reloc): New function.
290 (Powerpc_relocate_functions): Add Address typedef, use throughout.
291 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
292 for dst_mask, value and addend.
293 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
294 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
295 (Output_data_glink::do_write): Correct toc base. Don't try to use
296 uint16_t for 24-bit offset. Use get_output_section_offset and
297 check return.
298 (Target_powerpc::Scan::local): Handle more relocs.
299 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
300 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
301 Plug in toc restoring insn after plt calls. Translate branches
302 to function descriptor symbols to corresponding entry point.
303 (Target_powerpc::relocate_for_relocatable): Check return from
304 get_output_section_offset.
305 * symtab.h: Comment typo.
306
b1759dce
ILT
3072012-08-14 Ian Lance Taylor <iant@google.com>
308
309 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
310 unsupported_relocal_local to call unsupported_reloc_global.
311
b9b2ae8b
NC
3122012-08-14 Nick Clifton <nickc@redhat.com>
313
314 PR ld/14265
315 * script-sections.cc (Sections_element::output_section_name): Add
316 keep return parameter.
317 (Output_section_element::match_name): Add keep return parameter.
318 Return the value of the keep_ member.
319 * script-sections.h (class Output_section): Update
320 output_section_name prototype.
321 * layout.cc (Layout::keep_input_section): New public member
322 function.
323 (Layout::choose_output_section): Pass keep parameter to
324 output_section_name.
325 * layout.h (class Layout): Add keep_input_section.
326 * object.cc (Sized_relobj_file::do_layout): Check for kept input
327 sections.
328 * testsuite/Makefile.am: Add a test.
329 * testsuite/Makefile.in: Regenerate.
330 * testsuite/pr14265.c: Source file for the test.
331 * testsuite/pr14265.t: Linker script for the test.
332 * testsuite/pr14265.sh: Shell script for the test.
333
921b5322
AM
3342012-08-14 Alan Modra <amodra@gmail.com>
335
336 * target.h (Target::output_section_name): New function.
337 (Target::do_output_section_name): New function.
338 * layout.cc (Layout::choose_output_section): Call the above.
339 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
340
6ce78956
AM
3412012-08-14 Alan Modra <amodra@gmail.com>
342
343 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
344 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
345 for replace_constant call.
346 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
347 (Output_data_glink::do_print_to_mapfile): New function.
348 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
349 (Target_powerpc::Relocate::relocate): Likewise.
350
d1a8cabd
AM
3512012-08-14 Alan Modra <amodra@gmail.com>
352
353 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
354 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
355 (Output_data_glink::add_entry,find_entry): Remove shndx param.
356 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
357 all references to shndx_. Handle special case for R_PPC_PLTREL24
358 here.
359 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
360 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
361 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
362 here.
363 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
364 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
365
d83ce4e3
AM
3662012-08-12 Alan Modra <amodra@gmail.com>
367
368 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
369 (glink insn constants): Use uint32_t.
370 (Output_data_glink::add_entry): Use insert, not [] operator.
371
cf43a2fe
AM
3722012-08-11 Alan Modra <amodra@gmail.com>
373
374 * object.h (Sized_relobj_file::find_shdr): New function.
375 (Sized_relobj_file::find_special_sections): New function.
376 * object.cc (Sized_relobj_file::find_shdr): New function.
377 (Sized_relobj_file::find_eh_frame): Use find_shdr.
378 (Sized_relobj_file::find_special_sections): New function, split out..
379 (Sized_relobj_file::do_read_symbols): ..from here.
380 * output.h (Output_data_got::replace_constant): New function.
381 (Output_data_got::num_entries): New function.
382 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
383 (Output_data_got::got_offset): Protected rather than private.
384 (Output_data_got::replace_got_entry): New function.
385 * output.cc (Output_data_got::replace_got_entry): New function.
386 * powerpc.cc (class Powerpc_relobj): New.
387 (class Powerpc_relocate_functions): Delete all psymval variants or
388 convert to value,addend type. Delete pcrela, pcrela_unaligned.
389 Implement _ha functions using corresponding _hi function.
390 (Powerpc_relobj::find_special_sections): New function.
391 (Target_powerpc::do_make_elf_object): New function.
392 (class Output_data_got_powerpc): New.
393 (class Output_data_glink): New.
394 (class Powerpc_scan_relocatable_reloc): New.
395 Many more changes througout file.
396
3c892704
NC
3972012-08-09 Nick Clifton <nickc@redhat.com>
398
399 * po/vi.po: Updated Vietnamese translation.
400
82435b3b
ILT
4012012-08-07 Ian Lance Taylor <iant@google.com>
402
403 * layout.cc (Layout::add_target_dynamic_tags): If
404 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
405 plt_rel.
406
a6dc81d2
NC
4072012-07-30 Nick Clifton <nickc@redhat.com>
408
409 * po/gold.pot: Updated template.
410 * po/es.po: Updated Spanish translation.
411
f1415016
CC
4122012-07-18 Cary Coutant <ccoutant@google.com>
413
414 PR gold/14344
415 * configure.ac: Add check for -gpubnames support.
416 * configure: Regenerate.
417 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
418 support; force -gno-pubnames.
419 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
420 support.
421 (gdb_index_test_4): New test.
422 * testsuite/Makefile.in: Regenerate.
423 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
424 * testsuite/gdb_index_test_2.sh: Likewise.
425 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
426 * testsuite/gdb_index_test_4.sh: New script.
427 * testsuite/gdb_index_test_comm.sh: New script with common code;
428 don't look for space after colon.
429
b7fd7c37
ST
4302012-07-16 Sriraman Tallam <tmsriram@google.com>
431
432 * gold.cc (queue_middle_tasks): Update function order only after
433 deferred objects due to plugins are processed.
434
1f3212db
ILT
4352012-07-11 Ian Lance Taylor <iant@google.com>
436
437 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
438 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
439 (Target_arm::scan_reloc_for_stub): Likewise.
440 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
441 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
442 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
443 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
444 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
445
81c82a68
ILT
4462012-07-10 Dodji Seketeli <dodji@redhat.com>
447 Ian Lance Taylor <iant@google.com>
448
449 PR gold/14309
450 * configure.ac: Test whether std::tr1::hash<off_t> works.
451 * gold.h: Add a specialization for std::tr1::hash<off_t> if
452 needed.
453 * output.h (class Output_fill): Add virtual destructor.
454 * configure, config.in: Rebuild.
455
eabc84f4
RM
4562012-06-22 Roland McGrath <mcgrathr@google.com>
457
458 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
459
370e30b6
RÁE
4602012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
461
462 * plugin.cc (Plugin::load): Handle position independent executables.
463
fb1b895d
CC
4642012-06-06 Cary Coutant <ccoutant@google.com>
465
466 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
467 add .debug_macro.
468 (lines_only_debug_sections): Likewise.
469 (gdb_fast_lookup_sections): New static array.
470 (is_gdb_debug_section): Rename formal parameter.
471 (is_lines_only_debug_section): Likewise.
472 (is_gdb_fast_lookup_section): New function.
473 (Layout::include_section): Check for ".zdebug_" prefix; pass
474 section name suffix to is_gdb_debug_section, et al.; check for
475 fast-lookup sections when building .gdb_index.
476 * options.h (--strip-debug-gdb): Update GDB version number.
477
7c0640fa
CC
4782012-06-06 Cary Coutant <ccoutant@google.com>
479
480 * configure.ac: Add check for fallocate.
481 * configure: Regenerate.
482 * config.in: Regenerate.
483
484 * options.h (class General_options): Add --mmap-output-file and
485 --posix-fallocate options.
486 * output.cc: (posix_fallocate): Remove; replace with...
487 (gold_fallocate): New function.
488 (Output_file::map_no_anonymous): Call gold_fallocate.
489 (Output_file::map): Check --mmap-output-file option.
490
2a49eb69
DK
4912012-06-05 Jing Yu <jingyu@google.com>
492
493 * gold.h (textdomain): Add do {} to empty while(0).
494 (bindtextdomain): Likewise.
495
fad072ac
CC
4962012-06-04 Cary Coutant <ccoutant@google.com>
497
498 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
499 has_dynsym_index.
500
8cc69fb6
ST
5012012-05-25 Sriraman Tallam <tmsriram@google.com>
502
503 * symtab.cc (Symbol_table::define_special_symbol):
504 Initialize *poldsym to prevent uninitialized variable errors.
505
1be75daa
CC
5062012-05-23 Cary Coutant <ccoutant@google.com>
507
508 * layout.cc (Layout::section_name_mapping): Add rules to handle
509 exact match on .data.rel.ro.local or .data.rel.ro.
510 (Layout::output_section_name): Check for exact matches.
511
9b689de0
CC
5122012-05-23 Cary Coutant <ccoutant@google.com>
513
514 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
515 more carefully.
516
b24fdbf5
CC
5172012-05-22 Cary Coutant <ccoutant@google.com>
518
519 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
520 object before exporting symbol.
521
e550e1a2
L
5222012-05-21 H.J. Lu <hongjiu.lu@intel.com>
523
524 * testsuite/tls_test.cc: Include "config.h" first.
525 * testsuite/tls_test_c.c: Likewise.
526
df7b86aa
NC
5272012-05-17 Daniel Richard G. <skunk@iskunk.org>
528 Nick Clifton <nickc@redhat.com>
529
530 PR 14072
531 * configure.in: Add check that sysdep.h has been included before
532 any system header files.
533 * configure: Regenerate.
534 * config.in: Regenerate.
535
1007b503
CC
5362012-05-14 Cary Coutant <ccoutant@google.com>
537
538 * layout.cc (Layout::make_output_section): Mark .tdata section
539 as RELRO.
540 * testsuite/relro_test.cc: Add a TLS variable.
541
fd885f3a
L
5422012-05-10 H.J. Lu <hongjiu.lu@intel.com>
543
544 PR gold/14091
545 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
546 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
547 R_X86_64_64.
548
80f5885c
CC
5492012-05-08 Cary Coutant <ccoutant@google.com>
550
551 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
552 (lines_only_debug_sections): Likewise.
553
2e702c99
RM
5542012-05-02 Roland McGrath <mcgrathr@google.com>
555
556 * nacl.cc: New file.
557 * nacl.h: New file.
558 * Makefile.am (CCFILES, HFILES): Add them.
559 * Makefile.in: Regenerate.
560 * i386.cc (Output_data_plt_i386_nacl): New class.
561 (Output_data_plt_i386_nacl_exec): New class.
562 (Output_data_plt_i386_nacl_dyn): New class.
563 (Target_i386_nacl): New class.
564 (Target_selector_i386_nacl): New class.
565 (target_selector_i386): Use it instead of Target_selector_i386.
566 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
567 (Target_x86_64_nacl): New class.
568 (Target_selector_x86_64_nacl): New class.
569 (target_selector_x86_64, target_selector_x32): Use it instead of
570 Target_selector_x86_64.
571 * arm.cc (Output_data_plt_arm_nacl): New class.
572 (Target_arm_nacl): New class.
573 (Target_selector_arm_nacl): New class.
574 (target_selector_arm, target_selector_armbe): Use it instead of
575 Target_selector_arm.
576
577 * target-select.cc (select_target): Take new Input_file* and off_t
578 arguments, pass them on to recognize method of selector.
579 * object.cc (make_elf_sized_object): Update caller.
580 * parameters.cc (parameters_force_valid_target): Likewise.
581 * incremental.cc (make_sized_incremental_binary): Likewise.
582 * target-select.h: Update decl.
583 (Target_selector::recognize): Take new Input_file* argument,
584 pass it on to do_recognize.
585 (Target_selector::do_recognize): Take new Input_file* argument.
586 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
587 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
588 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
589 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
590
591 * target.h (Target::Target_info): New members isolate_execinstr
592 and rosegment_gap.
593 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
594 * arm.cc (Target_arm::arm_info): Update initializer.
595 * i386.cc (Target_i386::i386_info): Likewise.
596 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
597 * sparc.cc (Target_sparc::sparc_info): Likewise.
598 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
599 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
600 * layout.cc (Layout::attach_allocated_section_to_segment):
601 Take new const Target* argument. If target->isolate_execinstr(), act
602 like --rosegment.
603 (Layout::find_first_load_seg): Take new const Target* argument;
604 if target->isolate_execinstr(), reject PF_X segments.
605 (Layout::relaxation_loop_body): Update caller.
606 (Layout::set_segment_offsets): If target->isolate_execinstr(),
607 reset file offset to zero when we hit LOAD_SEG, and then do a second
608 loop over the segments before LOAD_SEG to reassign offsets after
609 addresses have been determined. Handle target->rosegment_gap().
610 (Layout::attach_section_to_segment): Take new const Target* argument;
611 pass it to attach_allocated_section_to_segment.
612 (Layout::make_output_section): Update caller.
613 (Layout::attach_sections_to_segments): Take new const Target* argument;
614 pass it to attach_section_to_segment.
615 * gold.cc (queue_middle_tasks): Update caller.
616 * layout.h (Layout): Update method decls with new arguments.
617
618 * arm.cc (Target_arm::Target_arm): Take optional argument for the
619 Target_info pointer to use.
620 (Target_arm::do_make_data_plt): New virtual method.
621 (Target_arm::make_data_plt): New method that calls it.
622 (Target_arm::make_plt_entry): Use it.
623 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
624 for the section alignment.
625 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
626 method.
627 (Output_data_plt_arm::first_plt_entry_offset): Call it.
628 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
629 method.
630 (Output_data_plt_arm::get_plt_entry_size): Call it.
631 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
632 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
633 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
634 method.
635 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
636 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
637 method instead of sizeof(plt_entry).
638 (Output_data_plt_arm::add_entry): Likewise.
639 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
640 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
641 than static method.
642 (Target_arm::plt_entry_size): Likewise.
643 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
644 Move to ...
645 (Output_data_plt_arm_standard): ... here, new class.
646 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
647 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
648 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
649
650 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
651 Take additional argument for the PLT entry size.
652 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
653 Use get_plt_entry_size method rather than plt_entry_size variable.
654 (Output_data_plt_x86_64::reserve_slot): Likewise.
655 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
656 (Output_data_plt_x86_64::add_entry): Likewise.
657 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
658 (Output_data_plt_x86_64::address_for_global): Likewise.
659 (Output_data_plt_x86_64::address_for_local): Likewise.
660 (Output_data_plt_x86_64::set_final_data_size): Likewise.
661 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
662 Make method non-static.
663 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
664 method.
665 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
666 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
667 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
668 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
669 virtual method.
670 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
671 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
672 virtual method.
673 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
674 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
675 virtual method.
676 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
677 (Output_data_plt_x86_64::plt_entry_size)
678 (Output_data_plt_x86_64::first_plt_entry)
679 (Output_data_plt_x86_64::plt_entry)
680 (Output_data_plt_x86_64::tlsdesc_plt_entry)
681 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
682 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
683 (Output_data_plt_x86_64_standard): ... here, new class.
684 (Target_x86_64::Target_x86_64): Take optional argument for the
685 Target_info pointer to use.
686 (Target_x86_64::do_make_data_plt): New virtual method.
687 (Target_x86_64::make_data_plt): New method to call it.
688 (Target_x86_64::init_got_plt_for_update): Use that.
689 Call this->plt_->add_eh_frame method here.
690 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
691 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
692 rather than static method.
693 (Target_x86_64::plt_entry_size): Likewise.
694 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
695 rather than plt_entry_size variable. Move guts of PLT filling to...
696 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
697 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
698 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
699
700 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
701 additional argument for the section alignment.
702 Don't do add_eh_frame_for_plt here.
703 (Output_data_plt_i386::first_plt_entry_offset): Make the method
704 non-static. Use get_plt_entry_size method rather than plt_entry_size
705 variable.
706 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
707 method.
708 (Output_data_plt_i386::get_plt_entry_size): Call it.
709 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
710 (Output_data_plt_i386::add_eh_frame): New method to call it.
711 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
712 method.
713 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
714 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
715 method.
716 (Output_data_plt_i386::fill_plt_entry): New method to call it.
717 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
718 method instead of plt_entry_size.
719 (Output_data_plt_i386::plt_entry_size)
720 (Output_data_plt_i386::plt_eh_frame_fde_size)
721 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
722 (Output_data_plt_i386_standard): ... here, new class.
723 (Output_data_plt_i386_exec): New class.
724 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
725 (Output_data_plt_i386_exec::first_plt_entry): ... here.
726 (Output_data_plt_i386::exec_plt_entry): Move to ...
727 (Output_data_plt_i386_exec::plt_entry): ... here.
728 (Output_data_plt_i386_dyn): New class.
729 (Output_data_plt_i386::first_plt_entry): Move to ...
730 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
731 (Output_data_plt_i386::dyn_plt_entry): Move to ...
732 (Output_data_plt_i386_dyn::plt_entry): ... here.
733 (Target_i386::Target_i386): Take optional argument for the Target_info
734 pointer to use.
735 (Target_i386::do_make_data_plt): New virtual method.
736 (Target_i386::make_data_plt): New method to call it.
737 (Target_i386::make_plt_section): Use that.
738 Call this->plt_->add_eh_frame method here.
739 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
740 rather than plt_entry_size variable.
741 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
742 (Output_data_plt_i386::address_for_local): Likewise.
743 (Output_data_plt_i386::do_write): Likewise.
744 Move guts of PLT filling to...
745 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
746 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
747 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
748 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
749
b9b9f2ee
CC
7502012-05-01 Cary Coutant <ccoutant@google.com>
751
752 * dwarf_reader.cc (Dwarf_die::read_attributes)
753 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
754 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
755 * reduced_debug_output.cc
756 (Output_reduced_debug_info_section::get_die_end): Remove
757 DW_FORM_GNU_ref_index. Add default case.
758
57923f48
MW
7592012-04-26 Mark Wielaard <mjw@redhat.com>
760
761 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
762 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
763 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
764 DW_AT_high_pc as offset from DW_AT_low_pc.
765
766 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
767 * testsuite/Makefile.in: Regenerate.
768 * testsuite/gdb_index_test_3.c: New test source file.
769 * testsuite/gdb_index_test_3.sh: New test source file.
770
2c54b4f4
ILT
7712012-04-25 Ian Lance Taylor <iant@google.com>
772
773 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
774 pointer.
775 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
776 as a class, not a struct.
777 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
778 (Target_arm::apply_cortex_a8_workaround): Likewise.
779 * gc.h: Declare Reloc_types as a struct, not a class.
780 * object.h: Declare Symbols_data as a struct.
781 * reloc.h: Declare Read_relocs_data as a struct.
782 * target.h: Declare Relocate_info as a struct.
783
a5a5f7a3
DM
7842012-04-24 David S. Miller <davem@davemloft.net>
785
786 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
787 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
788 and R_SPARC_WPLT30.
789
f038d496
CC
7902012-04-24 Cary Coutant <ccoutant@google.com>
791
792 * incremental-dump.cc (find_input_containing_global): Replace
793 magic number with symbolic constant.
794 (dump_incremental_inputs): Update version number.
795 * incremental.cc (Output_section_incremental_inputs): Update version
796 number; import symbolic constants from Incremental_inputs_reader.
797 (Incremental_inputs::create_data_sections): Align relocations
798 section correctly for 64-bit targets.
799 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
800 constants; add padding.
801 (Output_section_incremental_inputs::write_header): Add assert for
802 header_size.
803 (Output_section_incremental_inputs::write_input_files): Add assert
804 for input_entry_size.
805 (Output_section_incremental_inputs::write_info_blocks): Add padding;
806 add assert for object_info_size, input_section_entry_size,
807 global_sym_entry_size.
808 * incremental.h (Incremental_inputs_reader): Add symbolic constants
809 for data structure sizes; use them.
810 (Incremental_input_entry_reader): Import symbolic constants from
811 Incremental_inputs_reader; use them.
812
a4d85145
DM
8132012-04-23 David S. Miller <davem@davemloft.net>
814
815 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
816 and elf_flags_set_.
817 (Target_sparc::Target_sparc): Initialize new fields.
818 (Target_sparc::do_make_elf_object): New function.
819 (Target_sparc::do_adjust_elf_header): New function.
820
1d509098
CC
8212012-04-23 Cary Coutant <ccoutant@google.com>
822
823 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
824 CU range table of gdb index.
825
7ebeff7f
DM
8262012-04-20 David S. Miller <davem@davemloft.net>
827
828 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
829 instead of false.
830
13cf9988
DM
8312012-04-16 David S. Miller <davem@davemloft.net>
832
2a1079e8
DM
833 * sparc.cc (Target_sparc::got_address): New function.
834 (Sparc_relocate_functions::gdop_hix22): New function.
835 (Sparc_relocate_functions::gdop_lox10): New function.
836 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
837 relocs.
838 (Target_sparc::Scan::local): Likewise if the global symbol is not
839 preemptible and is not IFUNC.
840 (Target_sparc::Relocate::relocate): Perform GOTDATA code
841 transformations for local and non-preemptible non-IFUNC global
842 symbols.
843
0bc964fc
DM
844 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
845 writing out 64-bit part of ranges.
846
661d7a80
DM
847 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
848 -fpic and -fpie respectively.
849 * Makefile.in: Regenerate.
850
8c2bf391
DM
851 * sparc.cc (class Target_sparc): Add rela_ifunc_.
852 (Target_sparc::Target_sparc): Initialize new field.
853 (Target_sparc::do_plt_section_for_global): New function.
854 (Target_sparc::do_plt_section_for_local): New function.
855 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
856 (Target_sparc::make_plt_section): New function, broken out of
857 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
858 (Target_sparc::make_plt_entry): Call make_plt_section.
859 (Target_sparc::make_local_ifunc_plt_entry): New function.
860 (Target_sparc::rela_ifunc_section): New function.
861 (Target_sparc::plt_section): Remove const.
862 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
863 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
864 and ifunc_count_ fields.
865 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
866 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
867 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
868 (Output_data_plt_sparc::rela_ifunc): New function.
869 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
870 (Output_data_plt_sparc::has_ifunc_section): New function.
871 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
872 (Output_data_plt_sparc::address_for_global): New function.
873 (Output_data_plt_sparc::address_for_local): New function.
874 (Output_data_plt_sparc::plt_index_to_offset): New function.
875 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
876 and entry_count.
877 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
878 entry_count.
879 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
880 R_SPARC_JMP_IREL to switch.
881 (Target_sparc::Scan::check_non_pic): Likewise.
882 (Target_sparc::Scan::local): Handle IFUNC symbols.
883 (Target_sparc::Scan::local): Likewise.
884 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
885 and plt_address_for_local.
886 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
887 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
888
13cf9988
DM
889 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
890 (class Output_data_reloc): Adjust calls to Output_reloc_type.
891 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
892 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
893 global relocs too.
894 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
895 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
896 calls.
897 * sparc.cc (Target_sparc::Scan::global): Likewise.
898 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
899
31821be0
CC
9002012-04-16 Cary Coutant <ccoutant@google.com>
901
902 * archive.cc (Library_base::should_include_member): Check for
903 --export-dynamic-symbol.
904 * options.h (class General_options): Add --export-dynamic-symbol.
905 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
906 --export-dynamic-symbol.
907 (Symbol_table::gc_mark_undef_symbols): Likewise.
908 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
909
2615994e
DM
9102012-04-12 David S. Miller <davem@davemloft.net>
911
912 * sparc.cc (Reloc::wdisp10): New relocation method.
913 (Reloc::h34): Likewise.
914 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
915 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
916 R_SPARC_WDISP10.
917 (Target_sparc::Scan::local): Likewise.
918 (Target_sparc::Scan::global): Likewise.
919 (Target_sparc::Relocate::relocate): Likewise.
920
6782735d
CC
9212012-04-09 Cary Coutant <ccoutant@google.com>
922
923 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
924 low_pc == 0.
925
8c7a0b00
ILT
9262012-04-06 Ian Lance Taylor <iant@google.com>
927
928 * timer.cc: #include <unistd.h>.
929
58797674
RM
9302012-04-06 Roland McGrath <mcgrathr@google.com>
931
932 * configure.in (AC_CHECK_HEADERS): Add locale.h.
933 * config.in: Regenerate.
934 * configure: Regenerate.
935
44350750
NC
9362012-04-05 Nick Clifton <nickc@redhat.com>
937
938 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
939 (AM_LC_MESSAGES): Add.
940 * aclocal.m4: Regenerate.
941 * config.in: Regenerate.
942 * configure: Regenerate.
943
c1027032
CC
9442012-03-21 Cary Coutant <ccoutant@google.com>
945
946 * Makefile.am: Add gdb-index.cc, gdb-index.h.
947 * Makefile.in: Regenerate.
948 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
949 (Sized_elf_reloc_mapper::symbol_section): New function.
950 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
951 (make_elf_reloc_mapper): New function.
952 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
953 (Dwarf_abbrev_table::do_read_abbrevs): New function.
954 (Dwarf_abbrev_table::do_get_abbrev): New function.
955 (Dwarf_ranges_table::read_ranges_table): New function.
956 (Dwarf_ranges_table::read_range_list): New function.
957 (Dwarf_pubnames_table::read_section): New function.
958 (Dwarf_pubnames_table::read_header): New function.
959 (Dwarf_pubnames_table::next_name): New function.
960 (Dwarf_die::Dwarf_die): New function.
961 (Dwarf_die::read_attributes): New function.
962 (Dwarf_die::skip_attributes): New function.
963 (Dwarf_die::set_name): New function.
964 (Dwarf_die::set_linkage_name): New function.
965 (Dwarf_die::attribute): New function.
966 (Dwarf_die::string_attribute): New function.
967 (Dwarf_die::int_attribute): New function.
968 (Dwarf_die::uint_attribute): New function.
969 (Dwarf_die::ref_attribute): New function.
970 (Dwarf_die::child_offset): New function.
971 (Dwarf_die::sibling_offset): New function.
972 (Dwarf_info_reader::check_buffer): New function.
973 (Dwarf_info_reader::parse): New function.
974 (Dwarf_info_reader::do_parse): New function.
975 (Dwarf_info_reader::do_read_string_table): New function.
976 (Dwarf_info_reader::lookup_reloc): New function.
977 (Dwarf_info_reader::get_string): New function.
978 (Dwarf_info_reader::visit_compilation_unit): New function.
979 (Dwarf_info_reader::visit_type_unit): New function.
980 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
981 Sized_elf_reloc_mapper.
982 (Sized_dwarf_line_info::symbol_section): Remove function.
983 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
984 (Sized_dwarf_line_info::read_line_mappings): Remove object
985 parameter, adjust callers.
986 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
987 * dwarf_reader.h: Include <sys/types.h>.
988 (class Track_relocs): Remove forward declaration.
989 (class Elf_reloc_mapper): New class.
990 (class Sized_elf_reloc_mapper): New class.
991 (class Dwarf_abbrev_table): New class.
992 (class Dwarf_range_list): New class.
993 (class Dwarf_ranges_table): New class.
994 (class Dwarf_pubnames_table): New class.
995 (class Dwarf_die): New class.
996 (class Dwarf_info_reader): New class.
997 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
998 (Sized_dwarf_line_info::symbol_section): Remove member function.
999 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
1000 base class.
1001 * gdb-index.cc: New source file.
1002 * gdb-index.h: New source file.
1003 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
1004 and .debug_types sections, call Layout::add_to_gdb_index.
1005 (Sized_relobj_incr::do_section_name): Implement.
1006 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
1007 return type; Implement.
1008 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
1009 return type.
1010 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
1011 parameter list and return type.
1012 (Sized_incr_dynobj::do_section_contents): Likewise.
1013 * layout.cc: Include gdb-index.h.
1014 (Layout::Layout): Initialize gdb_index_data_.
1015 (Layout::init_fixed_output_section): Check for .gdb_index section.
1016 (Layout::add_to_gdb_index): New function. Instantiate.
1017 * layout.h: Add forward declaration for class Gdb_index.
1018 (Layout::add_to_gdb_index): New member function.
1019 (Layout::gdb_index_data_): New data member.
1020 * main.cc: Include gdb-index.h.
1021 (main): Print statistics for gdb index.
1022 * object.cc (Object::section_contents): Move code into
1023 do_section_contents.
1024 (need_decompressed_section): Check for sections needed when building
1025 gdb index.
1026 (build_compressed_section_map): Likewise.
1027 (Sized_relobj_file::do_read_symbols): Need local symbols when building
1028 gdb index.
1029 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
1030 sections; call Layout::add_to_gdb_index.
1031 (Sized_relobj_file::do_decompressed_section_contents): Call
1032 do_section_contents directly.
1033 * object.h (Object::do_section_contents): Adjust parameter list and
1034 return type.
1035 (Object::do_decompressed_section_contents): Call do_section_contents
1036 directly.
1037 (Sized_relobj_file::do_section_contents): Adjust parameter list and
1038 return type.
1039 * options.h (class General_options): Add --gdb-index option.
1040 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
1041 list and return type.
1042 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
1043 * reloc.h (Track_relocs::checkpoint): New function.
1044 (Track_relocs::reset): New function.
1045
1046 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
1047 New test cases.
1048 * testsuite/Makefile.in: Regenerate.
1049 * testsuite/gdb_index_test.cc: New test source file.
1050 * testsuite/gdb_index_test_1.sh: New test source file.
1051 * testsuite/gdb_index_test_2.sh: New test source file.
1052
647f1574
DK
10532012-03-19 Doug Kwan <dougkwan@google.com>
1054
1055 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 1056 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
1057 __exidx_start and __exidx_end. Make symbol table parameter
1058 anonymous as it is not used.
1059 * gold.cc (queue_middle_tasks): Call target hook to define any
1060 target-specific symbols.
1061 * target.h (Target::define_standard_symbols): New method.
1062 (Target::do_define_standard_symbols): Same.
1063 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
1064 * testsuite/Makefile.in: Regenerate.
1065 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
1066 and __exidx_end.
1067 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
1068 relocations are generated for __exidx_start and __exidx_end.
1069
7c6109da
DK
10702012-03-16 Doug Kwan <dougkwan@google.com>
1071
1072 * testsuite/Makefile.am: Disable test initpri3b.
1073 * testsuite/Makefile.in: Regenerate.
1074
7b8957f8
DK
10752012-03-15 Doug Kwan <dougkwan@google.com>
1076
1077 * arm.cc (Target_arm::got_section): Make .got section read-only
1078 if -z now is given.
1079
14dc9ef7
ILT
10802012-03-15 Ian Lance Taylor <iant@google.com>
1081
1082 PR gold/13850
1083 * layout.cc (Layout::make_output_section): Correctly mark
1084 SHT_INIT_ARRAY, et. al., as relro.
1085
fa40b62a
DK
10862012-03-14 Doug Kwan <dougkwan@google.com>
1087
1088 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
1089 dynamic relocations for protected symbols in shared objects.
1090
fd325007
ILT
10912012-03-13 Ian Lance Taylor <iant@google.com>
1092
1093 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1094 keep the larger alignment.
1095
e8dd54e1
CC
10962012-03-12 Cary Coutant <ccoutant@google.com>
1097
1098 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1099 handling of DW_LNE_define_file.
1100
feb5f3b0
CC
11012012-03-12 Cary Coutant <ccoutant@google.com>
1102
1103 * reduced_debug_output.cc
1104 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1105 codes to switch.
1106
a1fb4256
CC
11072012-02-29 Cary Coutant <ccoutant@google.com>
1108
1109 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1110
5dd8762a
CC
11112012-02-29 Cary Coutant <ccoutant@google.com>
1112
1113 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1114 Call Object::decompressed_section_contents.
1115 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1116 New dtor.
1117 (Sized_dwarf_line_info::buffer_start_): New data member.
1118 * merge.cc (Output_merge_data::do_add_input_section): Call
1119 Object::decompressed_section_contents.
1120 (Output_merge_string::do_add_input_section): Likewise.
1121 * object.cc (need_decompressed_section): New function.
1122 (build_compressed_section_map): Decompress sections needed later.
1123 (Sized_relobj_file::do_decompressed_section_contents): New function.
1124 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1125 * object.h (Object::decompressed_section_contents): New function.
1126 (Object::discard_decompressed_sections): New function.
1127 (Object::do_decompressed_section_contents): New function.
1128 (Object::do_discard_decompressed_sections): New function.
1129 (Compressed_section_info): New type.
1130 (Compressed_section_map): Include decompressed section contents.
1131 (Sized_relobj_file::do_decompressed_section_contents): New function.
1132 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1133
7b5de7ee
CC
11342012-02-16 Cary Coutant <ccoutant@google.com>
1135
1136 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1137 * testsuite/Makefile.in: Regenerate.
1138
f9fa4a63
CC
11392012-02-14 Cary Coutant <ccoutant@google.com>
1140
1141 * options.cc (General_options::finalize): Disallow -pie and -static.
1142
2c175ebc
DK
11432012-02-03 Doug Kwan <dougkwan@google.com>
1144
1145 * arm.cc (Arm_relocate_functions::abs8,
1146 Arm_relocate_functions::abs16): Use
1147 Bits::has_signed_unsigned_overflow32.
1148 (Arm_relocate_functions::thm_abs8): Correct range of
1149 overflow check.
1150 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1151 in assertions.
1152
90cff06f
DK
11532012-02-02 Doug Kwan <dougkwan@google.com>
1154
1155 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1156 position independent outputs, not just shared objects.
1157
63887f3d
L
11582012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1159
1160 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1161 * configure: Regenerated.
1162
bef2b434
ILT
11632012-01-27 Ian Lance Taylor <iant@google.com>
1164
1165 * reloc.h (Bits): New class with static functions, copied from
1166 namespace utils in arm.cc.
1167 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1168 instead.
1169
c335b55d
L
11702012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1171
1172 * incremental.cc (write_info_blocks): Correct relocation offset.
1173
41194d9f
L
11742012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1175
1176 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1177 (Relocate::tls_gd_to_le): Likewise.
1178
1bae613c
L
11792012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1180
1181 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1182
24482ca0
L
11832012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1184
1185 * configure.ac: Check if -mcmodel=medium works.
1186 * configure: Regenerated.
1187
c2c7840a
CC
11882012-01-24 Cary Coutant <ccoutant@google.com>
1189
1190 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1191 definition and ...
1192 (read_unsigned_LEB_128_x): ... this new function.
1193 (read_signed_LEB_128): Replaced with inline definition and ...
1194 (read_signed_LEB_128_x): ... this new function.
1195 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1196 (read_unsigned_LEB_128): Add inline definition.
1197 (read_signed_LEB_128_x): New function.
1198 (read_signed_LEB_128): Add inline definition.
1199 * testsuite/Makefile.am (leb128_unittest): New unit test.
1200 * testsuite/Makefile.in: Regenerate.
1201 * testsuite/leb128_unittest.cc: New unit test.
1202
833de760 12032012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1204
1205 PR gold/13617
1206 * i386.cc (Target_i386::do_code_fill): When using a jmp
1207 instruction, pad with nop instructions.
1208 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1209
618d6666
L
12102012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1211
1212 * x86_64.cc (gc_process_relocs): Add typename on types used in
1213 template.
1214 (scan_relocs): Likewise.
1215 (relocate_section): Likewise.
1216 (apply_relocation): Likewise.
1217
3660ff06
L
12182012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1219
1220 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1221 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1222 under x32.
1223
fc51264f
L
12242012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1225
1226 * x86_64.cc: Initial support for x32.
1227
dd74ae06
CC
12282012-01-03 Cary Coutant <ccoutant@google.com>
1229
1230 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1231 Use abstract base class for GOT.
1232 * gold/output.h (class Output_data_got_base): New abstract base class.
1233 (class Output_data_got): Derive from new base class, adjust ctors.
1234 (Output_data_got::reserve_slot): Make virtual; rename to
1235 do_reserve_slot; Adjust callers.
1236 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1237 pointer to abstract base class.
1238 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1239
83896202
ILT
12402011-12-18 Ian Lance Taylor <iant@google.com>
1241
1242 * object.h (Relobj::local_symbol_value): New function.
1243 (Relobj::local_plt_offset): New function.
1244 (Relobj::local_has_got_offset): New function.
1245 (Relobj::local_got_offset): New function.
1246 (Relobj::set_local_got_offset): New function.
1247 (Relobj::do_local_symbol_value): New pure virtual function.
1248 (Relobj::do_local_plt_offset): Likewise.
1249 (Relobj::do_local_has_got_offset): Likewise.
1250 (Relobj::do_local_got_offset): Likewise.
1251 (Relobj::do_set_local_got_offset): Likewise.
1252 (Sized_relobj::do_local_has_got_offset): Rename from
1253 local_has_got_offset.
1254 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1255 (Sized_relobj::do_set_local_got_offset): Rename from
1256 set_local_got_offset.
1257 (Sized_relobj_file::do_local_plt_offset): Rename from
1258 local_plt_offset.
1259 (Sized_relobj_file::do_local_symbol_value): New function.
1260 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1261 local_plt_offset.
1262 * output.cc (Output_data_got::Got_entry::write): Change object to
1263 Relobj. Use local_symbol_value.
1264 (Output_data_got::add_global_with_rel): Change rel_dyn to
1265 Output_data_reloc_generic*. Use add_global_generic.
1266 (Output_data_got::add_global_with_rela): Remove. Change all
1267 callers to use add_global_with_rel.
1268 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1269 Output_data_reloc_generic*. Use add_global_generic.
1270 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1271 callers to use add_global_pair_with_rel.
1272 (Output_data_got::add_local): Change object to Relobj*.
1273 (Output_data_got::add_local_plt): Likewise.
1274 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1275 change rel_dyn to Output_data_reloc_generic*. Use
1276 add_local_generic.
1277 (Output_data_got::add_local_with_rela): Remove. Change all
1278 callers to use all_local_with_rel.
1279 (Output_data_got::add_local_pair_with_rel): Change object to
1280 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1281 add_output_section_generic.
1282 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1283 callers to use add_local_pair_with_rel.
1284 (Output_data_got::reserve_local): Change object to Relobj*.
1285 * output.h: (class Output_data_reloc_generic): Add pure virtual
1286 declarations for add_global_generic, add_local_generic,
1287 add_output_section_generic.
1288 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1289 functions for Output_data_reloc_generic. Update declarations for
1290 changes listed in output.cc.
1291 (class Output_data_got): Change template parameter to got_size.
1292 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1293 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1294 function.
1295 (Sized_relobj_incr::do_local_plt_offset): New function.
1296 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1297 add_global_generic.
1298
76677ad0
CC
12992011-12-17 Cary Coutant <ccoutant@google.com>
1300
1301 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1302 * resolve.cc (Symbol_table::resolve): Likewise.
1303 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1304 arrays.
1305 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1306
8b8dd8d5
ILT
13072011-12-16 Ian Lance Taylor <iant@google.com>
1308
1309 * output.h (Output_data_reloc_generic::add): Only call
1310 add_dynamic_reloc if this is a dynamic reloc section.
1311
d55525b9
L
13122011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1313
1314 PR gold/13505
1315 * target-reloc.h (apply_relocation): Replace <64, false> with
1316 <size, big_endian>.
1317
ff81c7c1
NC
13182011-11-25 Nick Clifton <nickc@redhat.com>
1319
1320 * po/it.po: New Italian translation.
1321
628f39be
SA
13222011-11-17 Sterling Augustine <saugustine@google.com>
1323
1324 * script.cc (script_include_directive): Implement.
1325 (read_script_file): New local variables name and search_path. Update
1326 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1327 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1328 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1329
98ef3ea4
SA
13302011-11-11 Sterling Augustine <saugustine@google.com>
1331
1332 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1333 (file_or_sections_cmd): Likewise.
1334
f4a8b6d7
DK
13352011-11-11 Doug Kwan <dougkwan@google.com>
1336
1337 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1338 if --just-symbols is given.
1339
29ab395d
DK
13402011-11-10 Doug Kwan <dougkwan@google.com>
1341
1342 PR gold/13362
1343 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1344 when processing data relocs.
1345 * reloc.h (Relocate_functions::rel_unaligned): New method.
1346 (Relocate_functions::pcrel_unaligned): Ditto.
1347 (Relocate_functions::rel32_unaligned): Ditto.
1348 (Relocate_functions::pcrel32_unaligned): Ditto.
1349
2c339f71
DK
13502011-11-09 Doug Kwan <dougkwan@google.com>
1351
1352 PR gold/13362
1353 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1354 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1355 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1356 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1357 (Relocate_functions::rel_unaligned): New.
1358 (Relocate_functions::rel32_unaligned): New.
1359 * target-reloc.h (relocate_for_relocatable): Add code to handle
1360 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1361 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1362 arm_unaligned_reloc_r): New targets.
1363 * testsuite/Makefile.in: Regenerate.
1364 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1365 linking.
1366
3f3cddf1
ILT
13672011-11-02 Ian Lance Taylor <iant@google.com>
1368
1369 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1370 NATIVE_LINKER.
1371 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1372 * options.cc (General_options::finalize): Use library search path
1373 from configure script if specified. If not native and no sysroot,
1374 only search TOOLLIBDIR.
1375 * options.h (Search_directory::Search_directory): Change name to
1376 const std::string&.
1377 (General_options::add_to_library_path_with_sysroot): Change arg to
1378 const std::string&.
1379 * configure, Makefile.in, config.in: Rebuild.
1380
a8e2273b
ILT
13812011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1382
1383 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1384 we are working around the ARM1176 Erratum.
1385 * options.h (General_options::fix_arm1176): Add option.
1386 * testsuite/Makefile.am: Add testcases, and keep current ones
1387 working.
1388 * testsuite/Makefile.in: Regenerate.
1389 * testsuite/arm_fix_1176.s: New file.
1390 * testsuite/arm_fix_1176.sh: Likewise.
1391
cd6eab1c
ILT
13922011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1393
1394 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1395 may_use_blx_.
1396 (Target_arm::may_use_blx): Remove method.
1397 (Target_arm::set_may_use_blx): Likewise.
1398 (Target_arm::may_use_v4t_interworking): New method.
1399 (Target_arm::may_use_v5t_interworking): Likewise.
1400 (Target_arm::may_use_blx_): Remove member variable.
1401 (Arm_relocate_functions::arm_branch_common): Check for v5T
1402 interworking.
1403 (Arm_relocate_functions::thumb_branch_common): Likewise.
1404 (Reloc_stub::stub_type_for_reloc): Likewise.
1405 (Target_arm::do_finalize_sections): Correct interworking checks.
1406 * testsuite/Makefile.am: Add new tests.
1407 * testsuite/Makefile.in: Regenerate.
1408 * testsuite/arm_farcall_arm_arm.s: New test.
1409 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1410 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1411 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1412 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1413 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1414 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1415 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1416
286adcf4
CC
14172011-10-31 Cary Coutant <ccoutant@google.com>
1418
1419 PR gold/13023
1420 * expression.cc (Expression::eval_with_dot): Add
1421 is_section_dot_assignment parameter.
1422 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1423 absolute and assigning to dot within a section.
1424 * script-sections.cc
1425 (Output_section_element_assignment::set_section_addresses): Pass
1426 dot_section to set_if_absolute.
1427 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1428 as is_section_dot_assignment flag to eval_with_dot.
1429 (Output_section_element_dot_assignment::set_section_addresses):
1430 Likewise.
1431 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1432 parameter. Also set value if relative to dot_section; set the
1433 symbol's output_section.
1434 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1435 parameter. Adjust all callers.
1436 (Expression::eval_maybe_dot): Likewise.
1437 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1438 Adjust all callers.
1439 * testsuite/script_test_2.t: Test assignment of an absolute value
1440 to dot within an output section element.
1441
9634ed06
CC
14422011-10-31 Cary Coutant <ccoutant@google.com>
1443
1444 * options.h (class General_options): Add --[no-]gnu-unique options.
1445 * symtab.cc (Symbol_table::sized_write_globals): Convert
1446 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1447
de4101c7
CC
14482011-10-31 Cary Coutant <ccoutant@google.com>
1449
1450 PR gold/13359
1451 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1452 unnecessary assertion.
1453 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1454
7257cc92
ST
14552011-10-31 Sriraman Tallam <tmsriram@google.com>
1456
1457 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1458 gc_mark_symbol.
1459 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1460 gc_mark_symbol.
1461 Change to just keep the section associated with symbol.
1462 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1463 they are externally visible and --export-dynamic is turned on.
1464 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1465
bfc34b3f
ILT
14662011-10-19 Ian Lance Taylor <iant@google.com>
1467
1468 PR gold/13163
1469 * script-sections.cc
1470 (Output_section_element_dot_assignment::needs_output_section): New
1471 function.
1472
ea0d8c47
ILT
14732011-10-19 Ian Lance Taylor <iant@google.com>
1474
1475 PR gold/13204
1476 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1477 --section-start option was seen.
1478 * options.h (General_options::any_section_start): New function.
1479
abd242a9
DM
14802011-10-18 David S. Miller <davem@davemloft.net>
1481
1482 PR binutils/13301
1483 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1484 member to track relocation locations that have moved during TLS
1485 reloc optimizations.
1486 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1487 (Target_sparc::Relocate::relocate): Adjust view down by 4
1488 bytes if it matches reloc_adjust_addr_.
1489 (Target_sparc::Relocate::relocate_tls): Always move the
1490 __tls_get_addr call delay slot instruction forward 4 bytes when
1491 performing relaxation.
1492
bab9090f
CC
14932011-10-18 Cary Coutant <ccoutant@google.com>
1494
1495 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1496 (Output_file::map_no_anonymous): Check for non-zero
1497 return code from posix_fallocate.
1498
f7c5b166
CC
14992011-10-17 Cary Coutant <ccoutant@google.com>
1500
1501 PR gold/13245
1502 * plugin.cc (is_visible_from_outside): Check for symbols
1503 referenced from dynamic objects.
1504 * resolve.cc (Symbol_table::resolve): Don't count references
1505 from dynamic objects as references from real ELF files.
1506 * testsuite/plugin_test_2.sh: Adjust expected result.
1507
b490c0bb
CC
15082011-10-17 Cary Coutant <ccoutant@google.com>
1509
1510 * gold.cc: Include timer.h.
1511 (queue_middle_tasks): Stamp time.
1512 (queue_final_tasks): Likewise.
1513 * main.cc (main): Store timer in parameters. Print timers
1514 for each pass.
1515 * parameters.cc (Parameters::Parameters): Initialize timer_.
1516 (Parameters::set_timer): New function.
1517 (set_parameters_timer): New function.
1518 * parameters.h (Parameters::set_timer): New function.
1519 (Parameters::timer): New function.
1520 (Parameters::timer_): New data member.
1521 (set_parameters_timer): New function.
1522 * timer.cc (Timer::stamp): New function.
1523 (Timer::get_pass_time): New function.
1524 * timer.h (Timer::stamp): New function.
1525 (Timer::get_pass_time): New function.
1526 (Timer::pass_times_): New data member.
1527
f475cf7b
CC
15282011-10-17 Cary Coutant <ccoutant@google.com>
1529
1530 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1531 task for members of lib groups.
1532
cdd7e244
CC
15332011-10-17 Cary Coutant <ccoutant@google.com>
1534
1535 PR gold/13288
4f95c8b4 1536 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1537 (File_read::make_view): Move bounds check (replace with assert)...
1538 (File_read::find_or_make_view): ... to here.
1539
dfb45471
CC
15402011-10-12 Cary Coutant <ccoutant@google.com>
1541
4f95c8b4 1542 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1543 ::read returns less than requested size.
1544
53bbcc1b
CC
15452011-10-10 Cary Coutant <ccoutant@google.com>
1546
4f95c8b4 1547 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1548 Initialize defined_count_.
1549 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1550 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1551 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1552 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1553 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1554 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1555 member.
1556 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1557 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1558 Return zeroes instead of internal error.
1559
397b129b
CC
15602011-10-10 Cary Coutant <ccoutant@google.com>
1561
1562 PR gold/13249
4f95c8b4 1563 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1564 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1565 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1566 (Output_reloc::type_): Adjust size of bit field.
1567 (Output_reloc::use_plt_offset_): New bit field.
1568 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1569 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1570 flag. Adjust all callers.
4f95c8b4 1571 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1572 creating RELATIVE relocations.
1573
d5698657
NC
15742011-10-10 Nick Clifton <nickc@redhat.com>
1575
1576 * po/es.po: Updated Spanish translation.
1577 * po/fi.po: Updated Finnish translation.
1578
6a59a5c2
DN
15792011-10-03 Diego Novillo <dnovillo@google.com>
1580
1581 * options.cc (parse_uint): Fix dereference of RETVAL.
1582
f0558624
ST
15832011-09-29 Sriraman Tallam <tmsriram@google.com>
1584
1585 * layout.h (section_order_map_): New member.
1586 (get_section_order_map): New member function.
1587 * output.cc (Output_section::add_input_section): Check for patterns
1588 only when --section-ordering-file is specified.
1589 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1590 output_sections have been formed.
1591 * layout.cc (Layout_Layout): Initialize section_order_map_.
1592 * plugin.cc (update_section_order): Store order in order_map. Do not
1593 update the order.
1594 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1595 * testsuite/Makefile.in: Regenerate.
1596 * testsuite/plugin_section_order.c: New file.
1597 * testsuite/plugin_final_layout.cc: New file.
1598 * testsuite/plugin_final_layout.sh: New file.
1599
a7dac153
CC
16002011-09-29 Cary Coutant <ccoutant@google.com>
1601
4f95c8b4 1602 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1603 Check for NULL.
4f95c8b4 1604 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1605 symbols during incremental update.
1606 (Symbol_table::add_from_dynobj): Likewise.
1607
eebd87a5
ILT
16082011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1609 Ian Lance Taylor <iant@google.com>
1610
1611 * symtab.cc (Symbol_table::define_special_symbol): Always
1612 canonicalize version string.
1613
403a3331
CC
16142011-09-26 Cary Coutant <ccoutant@google.com>
1615
4f95c8b4
CC
1616 * gold.cc (queue_initial_tasks): Move option checks ...
1617 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1618 some options; make others fatal.
1619
235061c2
CC
16202011-09-26 Cary Coutant <ccoutant@google.com>
1621
1622 gcc PR lto/47247
1623 * plugin.cc (get_symbols_v2): New function.
1624 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1625 (is_referenced_from_outside): New function.
1626 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1627 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1628 (get_symbols): Pass version parameter.
1629 (get_symbols_v2): New function.
1630 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1631 parameter.
1632 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1633 (onload): Add LDPT_GET_SYMBOLS_V2.
1634 (all_symbols_read_hook): Use get_symbols_v2; check for
1635 LDPR_PREVAILING_DEF_IRONLY_EXP.
1636 * testsuite/plugin_test_3.sh: Update expected results.
1637
dc87f620
ILT
16382011-09-23 Simon Baldwin <simonb@google.com>
1639
1640 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1641 configuration options.
1642 * configure: Regenerate.
1643 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1644 * Makefile.in: Regenerate.
1645 * testsuite/Makefile.in: Regenerate.
1646
a8279f82
ST
16472011-09-19 Sriraman Tallam <tmsriram@google.com>
1648
1649 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1650
0c9350c8
CC
16512011-09-19 Cary Coutant <ccoutant@google.com>
1652
1653 * incremental.cc (can_incremental_update): Fix typo in comment.
1654 * incremental.h (can_incremental_update): Likewise.
1655
aa06ae28
CC
16562011-09-18 Cary Coutant <ccoutant@google.com>
1657
1658 * incremental.cc (can_incremental_update): New function.
1659 * incremental.h (can_incremental_update): New function.
1660 * layout.cc (Layout::init_fixed_output_section): Call it.
1661 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1662 * object.cc (Sized_relobj_file::do_layout): Call
1663 can_incremental_update.
1664
ebb300b2
CC
16652011-09-13 Cary Coutant <ccoutant@google.com>
1666
1667 * configure.ac: Check for glibc support for gnu_indirect_function
1668 support with static linking, setting automake conditional
1669 IFUNC_STATIC.
1670 * Makefile.in: Regenerate.
1671 * configure: Regenerate.
1672
1673 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1674 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1675 for IFUNC_STATIC.
1676 * testsuite/Makefile.in: Regenerate.
1677
1206d0d5
CC
16782011-09-13 Cary Coutant <ccoutant@google.com>
1679
1680 * incremental.cc (Sized_relobj_incr::do_layout): Call
1681 report_comdat_group for kept comdat sections.
1682 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1683 * testsuite/Makefile.in: Regenerate.
1684 * testsuite/incr_comdat_test_1.cc: New source file.
1685 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1686 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1687 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1688
40b29874
ILT
16892011-09-13 Ian Lance Taylor <iant@google.com>
1690
1691 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1692 variable external_symbols_offset.
1693
1b045aac
ILT
16942011-09-12 Ian Lance Taylor <iant@google.com>
1695
1696 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1697 triggered if object has no symbols.
1698
24c6c55a
DM
16992011-09-09 David S. Miller <davem@davemloft.net>
1700
1701 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1702 (Output_fill_debug_line::do_write): Likewise.
1703
66570254
CC
17042011-08-29 Cary Coutant <ccoutant@google.com>
1705
1706 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1707 casts to match formatting specs.
1708 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1709
8ea8cd50
CC
17102011-08-26 Cary Coutant <ccoutant@google.com>
1711
1712 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1713 remaining hole size when allocating.
1714 (Layout::make_output_section): Set fill methods for debug sections.
1715 * layout.h (Free_list::Free_list_node): Move from private to
1716 public.
1717 (Free_list::set_min_hole_size): New function.
1718 (Free_list::begin, Free_list::end): New functions.
1719 (Free_list::min_hole_): New data member.
1720 * output.cc: Include dwarf.h.
1721 (Output_fill_debug_info::do_minimum_hole_size): New function.
1722 (Output_fill_debug_info::do_write): New function.
1723 (Output_fill_debug_line::do_minimum_hole_size): New function.
1724 (Output_fill_debug_line::do_write): New function.
1725 (Output_section::Output_section): Initialize new data member.
1726 (Output_section::set_final_data_size): Ensure patch space is larger
1727 than minimum hole size.
1728 (Output_section::do_write): Fill holes in debug sections.
1729 * output.h (Output_fill): New class.
1730 (Output_fill_debug_info): New class.
1731 (Output_fill_debug_line): New class.
1732 (Output_section::set_free_space_fill): New function.
1733 (Output_section::free_space_fill_): New data member.
1734 * testsuite/Makefile.am (incremental_test_3): Add
1735 --incremental-patch option.
1736 (incremental_test_4): Likewise.
1737 (incremental_test_5): Likewise.
1738 (incremental_test_6): Likewise.
1739 (incremental_copy_test): Likewise.
1740 (incremental_common_test_1): Likewise.
1741 * testsuite/Makefile.in: Regenerate.
1742
7cf80422
NC
17432011-08-26 Nick Clifton <nickc@redhat.com>
1744
1745 * po/es.po: Updated Spanish translation.
1746
c3f7b0e5
CC
17472011-08-01 Cary Coutant <ccoutant@google.com>
1748
1749 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1750 * gold/testsuite/Makefile.in: Regenerate.
1751 * gold/testsuite/justsyms_exec.c: New source file.
1752 * gold/testsuite/justsyms_lib.c: New source file.
1753
9590bf25
CC
17542011-08-01 Cary Coutant <ccoutant@google.com>
1755
1756 * layout.cc (Layout::set_segment_offsets): Don't realign text
1757 segment if -Ttext was specified.
1758 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1759 file type.
1760 * object.h (Sized_relobj_file::e_type): New function.
1761 (Sized_relobj_file::e_type_): New data member.
1762 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1763 base address for ET_EXEC files.
1764 * target.cc (Target::do_make_elf_object_implementation): Allow
1765 ET_EXEC files with --just-symbols option.
1766
dcd8d12e
CC
17672011-07-28 Cary Coutant <ccoutant@google.com>
1768
1769 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1770 Add thread_number parameter.
1771 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1772 * workqueue-threads.cc
1773 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1774 current thread if its thread number is greater than desired thread
1775 count.
1776 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1777 Add thread_number parameter.
1778 (Workqueue::should_cancel_thread): Likewise.
1779 (Workqueue::find_runnable_or_wait): Pass thread_number to
1780 should_cancel_thread.
1781 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1782 parameter.
1783
804eb480
ST
17842011-07-22 Sriraman Tallam <tmsriram@google.com>
1785
1786 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1787 only after checking if it cannot be forced local.
1788 * symtab.h (is_externally_visible): Check if the symbol is not forced
1789 local.
1790
f1ddb600
ILT
17912011-07-15 Ian Lance Taylor <iant@google.com>
1792
1793 * options.h (class General_options): Add --print-output-format.
1794 Move -EL next to -EB, for better --help output.
1795 * target-select.cc: Include <cstdio>, "options.h", and
1796 "parameters.h".
1797 (Target_selector::do_target_bfd_name): New function.
1798 (print_output_format): New function.
1799 * target-select.h (class Target_selector): Update declarations.
1800 (Target_selector::target_bfd_name): New function.
1801 (print_output_format): Declare.
1802 * main.cc: Include "target-select.h".
1803 (main): Handle --print-output-format.
1804 * gold.cc: Include "target-select.h".
1805 (queue_initial_tasks): Handle --print-output-format when there are
1806 no input files.
1807 * parameters.cc (parameters_force_valid_target): Give a better
1808 error message if -EB/-EL does not match target.
1809 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1810 function.
1811
7d172687
ILT
18122011-07-15 Ian Lance Taylor <iant@google.com>
1813
1814 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1815 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1816 (Output_data_plt_i386::do_write): Write address of .dynamic
1817 section to first entry in .got.plt section.
1818 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1819 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1820 Initialize layout_.
1821 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1822 section to first entry in .got.plt section.
1823 * layout.h (Layout::dynamic_section): New function.
1824
e9552f7e
ST
18252011-07-13 Sriraman Tallam <tmsriram@google.com>
1826
1827 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1828 to claim_file call.
1829 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1830 input_section_position_, and input_section_glob_.
1831 (read_layout_from_file): Call function section_ordering_specified.
1832 * layout.h (is_section_ordering_specified): New function.
1833 (section_ordering_specified): New function.
1834 (section_ordering_specified_): New boolean member.
1835 * main.cc(main): Call load_plugins after layout object is defined.
1836 * output.cc (Output_section::add_input_section): Use
1837 function section_ordering_specified to check if section ordering is
1838 needed.
1839 * output.cc (Output_section::add_relaxed_input_section): Use
1840 function section_ordering_specified to check if section ordering is
1841 needed.
1842 (Output_section::update_section_layout): New function.
1843 (Output_section::sort_attached_input_sections): Check if input section
1844 must be reordered.
1845 * output.h (Output_section::update_section_layout): New function.
1846 * plugin.cc (get_section_count): New function.
1847 (get_section_type): New function.
1848 (get_section_name): New function.
1849 (get_section_contents): New function.
1850 (update_section_order): New function.
58797674 1851 (allow_section_ordering): New function.
e9552f7e
ST
1852 (Plugin::load): Add the new interfaces to the transfer vector.
1853 (Plugin_manager::load_plugins): New parameter.
1854 (Plugin_manager::all_symbols_read): New parameter.
1855 (Plugin_manager::claim_file): New parameter. Save the elf object for
1856 unclaimed objects.
1857 (Plugin_manager::get_elf_object): New function.
1858 (Plugin_manager::get_view): Change to directly use the bool to check
1859 if get_view is called from claim_file_hook.
1860 * plugin.h (input_objects): New function
1861 (Plugin__manager::load_plugins): New parameter.
1862 (Plugin_manager::claim_file): New parameter.
1863 (Plugin_manager::get_elf_object): New function.
1864 (Plugin_manager::in_claim_file_handler): New function.
1865 (Plugin_manager::in_claim_file_handler_): New member.
1866 (layout): New function.
1867 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1868 handler with an extra parameter. Make the elf object before calling
1869 claim_file handler.
1870 * testsuite/plugin_test.c (get_section_count): New function pointer.
1871 (get_section_type): New function pointer.
1872 (get_section_name): New function pointer.
1873 (get_section_contents): New function pointer.
1874 (update_section_order): New function pointer.
1875 (allow_section_ordering): New function pointer.
1876 (onload): Check if the new interfaces exist.
1877
9446efde
ILT
18782011-07-13 Ian Lance Taylor <iant@google.com>
1879
1880 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1881 relro section.
1882 * x86_64.cc (Target_x86_64::got_section): Likewise.
1883 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1884 (relro_now_test_SOURCES): New variable.
1885 (relro_now_test_DEPENDENCIES): New variable.
1886 (relro_now_test_LDFLAGS): New variable.
1887 (relro_now_test_LDADD): New variable.
1888 (relro_now_test.so): New target.
1889 * testsuite/Makefile.in: Rebuild.
1890
07aa62f2
ILT
18912011-07-12 Ian Lance Taylor <iant@google.com>
1892
1893 PR gold/12980
1894 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1895 GLOB_DAT relocation rather than a RELATIVE relocation for a
1896 protected symbol when creating a shared library.
1897 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1898 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1899 * testsuite/protected_main_1.cc (main): Test that protected
1900 function has same address.
1901
e2153196
ILT
19022011-07-11 Ian Lance Taylor <iant@google.com>
1903
1904 PR gold/12979
1905 * options.h (class General_options): Add -Bgroup.
1906 * options.cc (General_options::finalize): If -Bgroup is set,
1907 default to --unresolved-symbols=report-all.
1908 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1909 * target-reloc.h (issue_undefined_symbol_error): Handle
1910 --unresolved-symbols=report-all.
1911
6daf5215
ILT
19122011-07-08 Ian Lance Taylor <iant@google.com>
1913
1914 PR gold/11985
1915 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1916 if linker script discards key sections.
1917 (Layout::create_dynamic_symtab): Likewise.
1918 (Layout::assign_local_dynsym_offsets): Likewise.
1919 (Layout::sized_create_version_sections): Likewise.
1920 (Layout::create_interp): Likewise.
1921 (Layout::finish_dynamic_section): Likewise.
1922 (Layout::set_dynamic_symbol_size): Likewise.
1923
beabb2c6
ILT
19242011-07-08 Ian Lance Taylor <iant@google.com>
1925
1926 PR gold/12386
1927 * options.h (class General_options): Add --unresolved-symbols.
1928 * target-reloc.h (issue_undefined_symbol_error): Check
1929 --unresolved-symbols. Add comments.
1930
9c16daf1
ILT
19312011-07-08 Ian Lance Taylor <iant@google.com>
1932
1933 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1934 expression more complex.
1935
191f1a2d
ILT
19362011-07-08 Ian Lance Taylor <iant@google.com>
1937
1938 PR gold/11317
1939 * target-reloc.h (issue_undefined_symbol_error): New inline
1940 function, broken out of relocate_section.
1941 (relocate_section): Call issue_undefined_symbol_error.
1942 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1943 there is no TLS segment if we are about to issue an undefined
1944 symbol error.
1945 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1946
62855347
ILT
19472011-07-08 Ian Lance Taylor <iant@google.com>
1948
1949 PR gold/12279
1950 * resolve.cc (Symbol_table::should_override): Add fromtype
1951 parameter. Change all callers. Give error when linking together
1952 TLS and non-TLS symbol.
1953 (Symbol_table::should_override_with_special): Add fromtype
1954 parameter. Change all callers.
1955 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1956 there is no TLS segment if we have reported some errors.
1957 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1958
67181c72
ILT
19592011-07-08 Ian Lance Taylor <iant@google.com>
1960
1961 PR gold/12372
1962 * target.h (Target::plt_address_for_global): New function.
1963 (Target::plt_address_for_local): New function.
1964 (Target::plt_section_for_global): Remove.
1965 (Target::plt_section_for_local): Remove.
1966 (Target::do_plt_address_for_global): New virtual function.
1967 (Target::do_plt_address_for_local): New virtual function.
1968 (Target::do_plt_section_for_global): Remove.
1969 (Target::do_plt_section_for_local): Remove.
1970 (Target::register_global_plt_entry): Add Symbol_table and Layout
1971 parameters.
1972 * output.cc (Output_data_got::Got_entry::write): Use
1973 plt_address_for_global and plt_address_for_local.
1974 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1975 address of output section.
1976 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1977 got_irelative_, and irelative_count_ fields. Update
1978 declarations.
1979 (Output_data_plt_i386::has_irelative_section): New function.
1980 (Output_data_plt_i386::entry_count): Add irelative_count_.
1981 (Output_data_plt_i386::set_final_data_size): Likewise.
1982 (class Target_i386): Add got_irelative_ and rel_irelative_
1983 fields. Update declarations.
1984 (Target_i386::Target_i386): Initialize new fields.
1985 (Target_i386::do_plt_address_for_global): New function replacing
1986 do_plt_section_for_global.
1987 (Target_i386::do_plt_address_for_local): New function replacing
1988 do_plt_section_for_local.
1989 (Target_i386::got_section): Create got_irelative_.
1990 (Target_i386::rel_irelative_section): New function.
1991 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1992 fields. Don't define __rel_iplt_{start,end}.
1993 (Output_data_plt_i386::add_entry): Add symtab and layout
1994 parameters. Change all callers. Use different PLT and GOT for
1995 IFUNC symbols.
1996 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1997 layout parameters. Change all callers. Use different PLT and
1998 GOT.
1999 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
2000 (Output_data_plt_i386::rel_irelative): New function.
2001 (Output_data_plt_i386::address_for_global): New function.
2002 (Output_data_plt_i386::address_for_local): New function.
2003 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
2004 IRELATIVE GOT when changing IFUNC GOT entries.
2005 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
2006 reloc.
2007 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
2008 if we didn't create an IRELATIVE GOT.
2009 (Target_i386::Relocate::relocate): Use plt_address_for_global and
2010 plt_address_for_local.
2011 (Target_i386::do_dynsym_value): Use plt_address_for_global.
2012 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
2013 got_irelative_, and irelative_count_ fields. Update
2014 declarations.
2015 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
2016 Initialize new fields. Remove symtab parameter. Change all
2017 callers.
2018 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
2019 irelative_count_.
2020 (Output_data_plt_x86_64::has_irelative_section): New function.
2021 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
2022 (class Target_x86_64): Add got_irelative_ and rel_irelative_
2023 fields. Update declarations.
2024 (Target_x86_64::Target_x86_64): Initialize new fields.
2025 (Target_x86_64::do_plt_address_for_global): New function replacing
2026 do_plt_section_for_global.
2027 (Target_x86_64::do_plt_address_for_local): New function replacing
2028 do_plt_section_for_local.
2029 (Target_x86_64::got_section): Create got_irelative_.
2030 (Target_x86_64::rela_irelative_section): New function.
2031 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
2032 all callers. Don't create __rel_iplt_{start,end}.
2033 (Output_data_plt_x86_64::add_entry): Add symtab and layout
2034 parameters. Change all callers. Use different PLT and GOT for
2035 IFUNC symbols.
2036 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
2037 layout parameters. Change all callers. Use different PLT and
2038 GOT.
2039 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
2040 parameters. Change all callers. Use different PLT and GOT for
2041 IFUNC symbols.
2042 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
2043 (Output_data_plt_x86_64::rela_irelative): New function.
2044 (Output_data_plt_x86_64::address_for_global): New function.
2045 (Output_data_plt_x86_64::address_for_local): New function.
2046 (Output_data_plt_x86_64::set_final_data_size): Likewise.
2047 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
2048 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
2049 (Target_x86_64::register_global_plt_entry): Add symtab and layout
2050 parameters.
2051 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
2052 reloc.
2053 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
2054 symbols if we didn't create an IRELATIVE GOT.
2055 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
2056 plt_address_for_local.
2057 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
2058 * testsuite/ifuncvar1.c: New test file.
2059 * testsuite/ifuncvar2.c: New test file.
2060 * testsuite/ifuncvar3.c: New test file.
2061 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
2062 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
2063 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
2064 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
2065 * testsuite/Makefile.in: Rebuild.
2066
33c15b45
CC
20672011-07-07 Cary Coutant <ccoutant@google.com>
2068
2069 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
2070 (two_file_test_1_ndebug.o): Likewise.
2071 (two_file_test_1b_ndebug.o): Likewise.
2072 (two_file_test_2_ndebug.o): Likewise.
2073 (two_file_test_main_ndebug.o): Likewise.
2074 (incremental_test_2): Link with no-debug versions.
2075
f48b5fb7
CC
20762011-07-06 Cary Coutant <ccoutant@google.com>
2077
2078 * gold/incremental.cc
2079 (Output_section_incremental_inputs::write_info_blocks): Check for
2080 hidden and internal symbols.
2081
221597a5
CC
20822011-07-06 Cary Coutant <ccoutant@google.com>
2083
2084 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
2085 Check disposition for startup file.
2086 (Incremental_inputs::report_command_line): Ignore
2087 --incremental-startup-unchanged option.
2088 * options.cc (General_options::parse_incremental_startup_unchanged):
2089 New function.
2090 (General_options::General_options): Initialize new data member.
2091 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
2092 (General_options): Add --incremental-startup-unchanged option.
2093 (General_options::incremental_startup_disposition): New function.
2094 (General_options::incremental_startup_disposition_): New data member.
2095
e24719f6
CC
20962011-07-06 Cary Coutant <ccoutant@google.com>
2097
2098 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2099 input file index to Script_info ctor.
2100 (Sized_incremental_binary::do_file_has_changed): Find the
2101 command-line argument for files named in scripts.
2102 * incremental.h (Script_info::Script_info): New ctor
2103 with input file index.
2104 (Script_info::input_file_index): New function.
2105 (Script_info::input_file_index_): New data member.
2106 (Incremental_binary::get_library): Add const.
2107 (Incremental_binary::get_script_info): Add const.
2108 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2109 * testsuite/Makefile.am (incremental_test_5): New test case.
2110 (incremental_test_6): New test case.
2111 * testsuite/Makefile.in: Regenerate.
2112
8f7c81e8
CC
21132011-07-06 Cary Coutant <ccoutant@google.com>
2114
2115 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2116 debug output when command lines differ.
2117
9fbd3822
CC
21182011-07-06 Cary Coutant <ccoutant@google.com>
2119
2120 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2121 --incremental-patch option.
2122 * layout.cc (Free_list::allocate): Extend allocation beyond original
2123 end if enabled.
2124 (Layout::make_output_section): Mark sections that should get
2125 patch space.
2126 * options.cc (parse_percent): New function.
2127 * options.h (parse_percent): New function.
2128 (DEFINE_percent): New macro.
2129 (General_options): Add --incremental-patch option.
2130 * output.cc (Output_section::Output_section): Initialize new data
2131 members.
2132 (Output_section::add_input_section): Print section name when out
2133 of patch space.
2134 (Output_section::add_output_section_data): Likewise.
2135 (Output_section::set_final_data_size): Add patch space when
2136 doing --incremental-full.
2137 (Output_section::do_reset_address_and_file_offset): Remove patch
2138 space.
2139 (Output_segment::set_section_list_addresses): Print debug output
2140 only if --incremental-update.
2141 * output.h (Output_section::set_is_patch_space_allowed): New function.
2142 (Output_section::is_patch_space_allowed_): New data member.
2143 (Output_section::patch_space_): New data member.
2144 * parameters.cc (Parameters::incremental_full): New function.
2145 * parameters.h (Parameters::incremental_full): New function
2146 * testsuite/Makefile.am (incremental_test_2): Add test for
2147 --incremental-patch option.
2148 * testsuite/Makefile.in: Regenerate.
2149 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2150 (t18): Remove function body.
2151
f6cccc2c
DK
21522011-07-05 Doug Kwan <dougkwan@google.com>
2153
2154 PR gold/12771
2155 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2156 Arm_Address type for relocation result.
2157 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2158 overflow check.
2159 (Arm_relocate_functions::abs32): Use unaligned access.
2160 (Arm_relocate_functions::rel32): Ditto.
2161 (Arm_relocate_functions::prel31): Ditto.
2162 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2163 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2164 static data relocations.
2165 * testsuite/Makefile.in: Regnerate.
2166 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2167
28a13fec
ILT
21682011-07-05 Ian Lance Taylor <iant@google.com>
2169
2170 PR gold/12392
2171 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2172 symbols if necessary.
2173 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2174
24d47b34
ILT
21752011-07-05 Ian Lance Taylor <iant@google.com>
2176
2177 PR gold/12952
2178 * resolve.cc (Symbol::override_base_with_special): Simply override
2179 version with special symbol version, ignoring previous version.
2180
41f9cbbe
ILT
21812011-07-05 Ian Lance Taylor <iant@google.com>
2182
2183 * object.cc (Sized_relobj_file::include_section_group): Add
2184 information to comment about signature location.
2185
886288f1
ILT
21862011-07-02 Ian Lance Taylor <iant@google.com>
2187
2188 PR gold/12957
2189 * options.h (class General_options): Add -f and -F.
2190 * options.cc (General_options::finalize): Fatal error if -f/-F
2191 are used without -shared.
2192 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2193
ae3a6d4f
ILT
21942011-07-02 Ian Lance Taylor <iant@google.com>
2195
2196 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2197
21131061
ILT
21982011-07-01 Ian Lance Taylor <iant@google.com>
2199
2200 PR gold/12525
2201 PR gold/12952
2202 * resolve.cc (Symbol::override_base_with_special): Don't override
2203 the version if the overriding symbol has a different name.
2204 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2205 all callers. If we give an error about an undefined version,
2206 define the base version if necessary.
2207 * dynobj.h (class Versions): Update declaration.
2208 * testsuite/weak_alias_test_5.cc: New file.
2209 * testsuite/weak_alias_test.script: New file.
2210 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2211 and versioned_alias have the right value, and call t2.
2212 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2213 weak_alias_test_5.so.
2214 (weak_alias_test_LDADD): Likewise.
2215 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2216 * testsuite/Makefile.in: Rebuild.
2217
611062c0
ILT
22182011-07-01 Ian Lance Taylor <iant@google.com>
2219
2220 PR gold/12525
2221 * options.h (class General_options): Support -z notext.
2222 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2223 -Wl,-z,notext.
2224 (two_file_shared_nonpic.so): Likewise.
2225 (two_file_shared_mixed.so): Likewise.
2226 (two_file_shared_mixed_1.so): Likewise.
2227 (weak_undef_lib_nonpic.so): Likewise.
2228 (alt/weak_undef_lib_nonpic.so): Likewise.
2229 (tls_test_shared_nonpic.so): Likewise.
2230 * testsuite/Makefile.in: Rebuild.
2231
328c7c2f
ILT
22322011-07-01 Ian Lance Taylor <iant@google.com>
2233
2234 PR gold/12525
2235 * configure.ac: Test whether static linking works, setting
2236 the automake conditional HAVE_STATIC.
2237 * testsuite/Makefile.am: Disable tests using -static if
2238 HAVE_STATIC is not true.
2239 * configure, testsuite/Makefile.in: Rebuild.
2240
02d7cd44
ILT
22412011-07-01 Ian Lance Taylor <iant@google.com>
2242
2243 PR gold/12525
2244 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2245 Assert if we see DW_EH_PE_indirect.
2246 * target.h (Target::ehframe_datarel_base): New function.
2247 (Target::do_ehframe_datarel_base): New target function.
2248 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2249 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2250 function.
2251
07a60597
ILT
22522011-07-01 Ian Lance Taylor <iant@google.com>
2253
2254 PR gold/12571
2255 * options.h (class General_options): Add
2256 --ld-generated-unwind-info.
2257 * ehframe.cc (Fde::write): Add address parameter. Change all
2258 callers. If associated with PLT, fill in address and size.
2259 (Cie::set_output_offset): Only add merge mapping if there is an
2260 object.
2261 (Cie::write): Add address parameter. Change all callers.
2262 (Eh_frame::add_ehframe_for_plt): New function.
2263 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2264 input_offset_ fields into union u_, with new plt field.
2265 (Fde::Fde): Adjust for new union field.
2266 (Fde::Fde) [Output_data version]: New constructor.
2267 (Fde::add_mapping): Only add merge mapping if there is an object.
2268 (class Cie): Update declarations.
2269 (class Eh_frame): Declare add_ehframe_for_plt.
2270 * layout.cc (Layout::layout_eh_frame): Break out code into
2271 make_eh_frame_section, and call it.
2272 (Layout::make_eh_frame_section): New function.
2273 (Layout::add_eh_frame_for_plt): New function.
2274 * layout.h (class Layout): Update declarations.
2275 * merge.cc (Merge_map::add_mapping): Add assertion.
2276 * i386.cc: Include "dwarf.h".
2277 (class Output_data_plt_i386): Make first_plt_entry,
2278 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2279 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2280 and plt_eh_frame_fde.
2281 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2282 boundary. Call add_eh_frame_for_plt if appropriate.
2283 * x86_64.cc: Include "dwarf.h".
2284 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2285 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2286 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2287 and plt_eh_frame_fde.
2288 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2289 appropriate.
2290
14788a3f
ILT
22912011-06-29 Ian Lance Taylor <iant@google.com>
2292
2293 PR gold/12629
2294 * object.cc (Sized_relobj_file::layout_section): Change shdr
2295 parameter to be const.
2296 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2297 out of do_layout.
2298 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2299 appropriate. Call layout_eh_frame_section.
2300 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2301 sections.
2302 * object.h (class Sized_relobj_file): Update declarations.
2303
6c21fce1
ILT
23042011-06-29 Ian Lance Taylor <iant@google.com>
2305
37e41b03 2306 PR gold/12652
6c21fce1
ILT
2307 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2308 modifier.
2309 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2310
4d5e4e62
ILT
23112011-06-29 Ian Lance Taylor <iant@google.com>
2312
2313 PR gold/12675
2314 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2315 SHT_X86_64_UNWIND.
2316 * layout.cc (Layout::layout_eh_frame): Likewise.
2317
886f533a
ILT
23182011-06-29 Ian Lance Taylor <iant@google.com>
2319
2320 PR gold/12695
2321 * layout.cc (Layout::symtab_section_shndx): New function.
2322 * layout.h (class Layout): Declare symtab_section_shndx.
2323 * output.cc (Output_section::write_header): Call it.
2324
f3ae1b28
ILT
23252011-06-29 Ian Lance Taylor <iant@google.com>
2326
2327 PR gold/12818
2328 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2329 symbols which are not used in a relocation.
2330
aecf301f
ILT
23312011-06-28 Ian Lance Taylor <iant@google.com>
2332
2333 PR gold/12898
2334 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2335 script create indistinguishable segments.
2336 (Layout::set_segment_offsets): Use stable_sort when sorting
2337 segments. Pass this to Compare_segments constructor.
2338 * layout.h (class Layout): Make segment_precedes non-static.
2339 (class Compare_segments): Change from struct to class. Add
2340 layout_ field. Add constructor.
2341 * script-sections.cc
2342 (Script_sections::attach_sections_using_phdrs_clause): Rename
2343 local orphan to is_orphan. Don't report failure to put empty
2344 section in segment. On attachment failure, report name of
2345 section, and attach to first PT_LOAD segment.
2346
03ef7571
ILT
23472011-06-28 Ian Lance Taylor <iant@google.com>
2348
2349 PR gold/12934
2350 * target-select.cc (Target_selector::Target_selector): Add
2351 emulation parameter. Change all callers.
2352 (select_target_by_bfd_name): Rename from select_target_by_name.
2353 Change all callers.
2354 (select_target_by_emulation): New function.
2355 (supported_emulation_names): New function.
2356 * target-select.h (class Target_selector): Add emulation_ field.
2357 Update declarations.
2358 (Target_selector::recognize_by_bfd_name): Rename from
2359 recognize_by_name. Change all callers.
2360 (Target_selector::supported_bfd_names): Rename from
2361 supported_names. Change all callers.
2362 (Target_selector::recognize_by_emulation): New function.
2363 (Target_selector::supported_emulations): New function.
2364 (Target_selector::emulation): New function.
2365 (Target_selector::do_recognize_by_bfd_name): Rename from
2366 do_recognize_by_name. Change all callers.
2367 (Target_selector::do_supported_bfd_names): Rename from
2368 do_supported_names. Change all callers.
2369 (Target_selector::do_recognize_by_emulation): New function.
2370 (Target_selector::do_supported_emulations): New function.
2371 (select_target_by_bfd_name): Change name in declaration.
2372 (select_target_by_emulation): Declare.
2373 (supported_emulation_names): Declare.
2374 * parameters.cc (parameters_force_valid_target): Try to find
2375 target based on emulation from -m option.
2376 * options.h (class General_options): Change doc string for -m.
2377 * options.cc (help): Print emulations.
2378 (General_options::parse_V): Likewise.
2379 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2380 Add emulation parameter. Change all callers.
2381
200b2bb9
ILT
23822011-06-28 Ian Lance Taylor <iant@google.com>
2383
2384 * target.h (class Target): Add osabi_ field.
2385 (Target::osabi): New function.
2386 (Target::set_osabi): New function.
2387 (Target::Target): Initialize osabi_.
2388 (Target::do_adjust_elf_header): Make pure virtual.
2389 (Sized_target::do_adjust_elf_header): Declare.
2390 * target.cc (Sized_target::do_adjust_elf_header): New function.
2391 (class Sized_target): Instantiate all versions.
2392 * freebsd.h (class Target_freebsd): Remove.
2393 (Target_selector_freebsd::do_recognize): Call set_osabi on
2394 Target.
2395 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2396 (Target_selector_freebsd::set_osabi): Remove.
2397 * i386.cc (class Target_i386): Inherit from Sized_target rather
2398 than Target_freebsd.
2399 * x86_64.cc (class Target_x86_64): Likewise.
2400
b3ce541e
ILT
24012011-06-28 Ian Lance Taylor <iant@google.com>
2402
2403 * target.h (Target::can_check_for_function_pointers): Rewrite.
2404 Make non-virtual.
2405 (Target::can_icf_inline_merge_sections): Likewise.
2406 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2407 (Target::Target_info): Add can_icf_inline_merge_sections field.
2408 (Target::do_can_check_for_function_pointers): New virtual
2409 function.
2410 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2411 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2412 from can_check_for_function_pointers, move in file.
2413 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2414 section_may_have_icf_unsafe_poineters, move in file.
2415 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2416 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2417 Rename from can_check_for_function_pointers, move in file.
2418 (Target_i386::can_icf_inline_merge_sections): Remove.
2419 (Target_i386::i386_info): Initialize
2420 can_icf_inline_merge_sections.
2421 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2422 Initialize can_icf_inline_merge_sections.
2423 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2424 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2425 Rename from can_check_for_function_pointers, move in file.
2426 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2427 (Target_x86_64::x86_64_info): Initialize
2428 can_icf_inline_merge_sections.
2429 * testsuite/testfile.cc (Target_test::test_target_info):
2430 Likewise.
2431 * icf.cc (get_section_contents): Correct formatting.
2432
6d1c4efb
ILT
24332011-06-27 Ian Lance Taylor <iant@google.com>
2434
2435 * symtab.cc (Symbol::versioned_name): New function.
2436 (Symbol_table::add_to_final_symtab): Use versioned_name when
2437 appropriate.
2438 (Symbol_table::sized_write_symbol): Likewise.
2439 * symtab.h (class Symbol): Declare versioned_name.
2440 * stringpool.h (class Stringpool_template): Add variant of add
2441 which takes a std::basic_string.
2442 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2443 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2444 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2445 (ver_test_12.o): New target.
2446 * testsuite/Makefile.in: Rebuild.
2447
57eb9b50
DK
24482011-06-27 Doug Kwan <dougkwan@google.com>
2449
2450 * arm.cc (Arm_relocate_functions::thm_jump8,
2451 Arm_relocate_functions::thm_jump11): Use a wider signed
2452 type to compute offset.
2453 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2454 arm_thm_jump8.
2455 * testsuite/Makefile.in: Regenerate.
2456 * testsuite/arm_branch_in_range.sh: Check test results of
2457 arm_thm_jump11 and arm_thm_jump8.
2458 * testsuite/arm_thm_jump11.s: New test source file.
2459 * testsuite/arm_thm_jump11.t: New linker script.
2460 * testsuite/arm_thm_jump8.s: New test source file.
2461 * testsuite/arm_thm_jump8.t: New linker script.
2462
487b39df
ILT
24632011-06-24 Ian Lance Taylor <iant@google.com>
2464
2465 * layout.cc: Include "object.h".
2466 (ctors_sections_in_init_array): New static variable.
2467 (Layout::is_ctors_in_init_array): New function.
2468 (Layout::layout): Add entry to ctors_sections_in_init_array if
2469 appropriate.
2470 * layout.h (class Layout): Declare is_ctors_in_init_array.
2471 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2472 is_ctors_reverse_view is set.
2473 (Sized_relobj_file::write_sections): Add layout parameter. Change
2474 all callers. Set is_ctors_reverse_view field of View_size.
2475 (Sized_relobj_file::reverse_words): New function.
2476 * object.h (Sized_relobj_file::View_size): Add
2477 is_ctors_reverse_view field.
2478 (class Sized_relobj_file): Update declarations.
2479 * testsuite/initpri3.c: New test.
2480 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2481 initpri3b.
2482 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2483 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2484 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2485 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2486 * testsuite/Makefile.in: Rebuild.
2487
472076e4
CC
24882011-06-24 Cary Coutant <ccoutant@google.com>
2489
2490 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2491 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2492 (debug_msg_cdebug.err): New targets.
2493 * testsuite/Makefile.in: Regenerate.
2494 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2495 Fix checks for link with shared library.
2496
a60af0db
DK
24972011-06-24 Doug Kwan <dougkwan@google.com>
2498
2499 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2500 skip empty text sections.
2501 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2502
5393d741
ILT
25032011-06-22 Ian Lance Taylor <iant@google.com>
2504
2505 PR gold/12910
2506 * options.h (class General_options): Add --ctors-in-init-array.
2507 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2508 friends as SHT_PROGBITS for merging sections.
2509 (Layout::layout): Remove special handling of .init_array and
2510 friends. Don't sort if doing relocatable link. Sort for .ctors
2511 and .dtors if ctors_in_init_array.
2512 (Layout::make_output_section): Force correct section types for
2513 .init_array and friends. Don't sort if doing relocatable link,
2514 Don't sort .ctors and .dtors if ctors_in_init_array.
2515 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2516 (Layout::output_section_name): Add relobj parameter. Change all
2517 callers. Handle .ctors. and .dtors. in code rather than table.
2518 Handle .ctors and .dtors if ctors_in_init_array.
2519 (Layout::match_file_name): New function, moved from output.cc.
2520 * layout.h (class Layout): Update declarations.
2521 * output.cc: Include "layout.h".
2522 (Input_section_sort_entry::get_priority): New function.
2523 (Input_section_sort_entry::match_file_name): Just call
2524 Layout::match_file_name.
2525 (Output_section::Input_section_sort_init_fini_compare::operator()):
2526 Handle .ctors and .dtors. Sort by explicit priority rather than
2527 by name.
2528 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2529 * testsuite/initpri2.c: New test.
2530 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2531 (check_PROGRAMS): Add initpri2.
2532 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2533 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2534 * configure, testsuite/Makefile.in: Rebuild.
2535
e1f74f98
ILT
25362011-06-19 Ian Lance Taylor <iant@google.com>
2537
2538 PR gold/12880
2539 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2540 .interp section to a PT_INTERP segment even if we have seen a
2541 --dynamic-linker option. Don't do it if we have seen a PHDRS
2542 clause in a linker script.
2543 (Layout::finalize): Don't create a .interp section if we've
2544 already create a PT_INTERP segment.
2545 (Layout::create_interp): Always call choose_output_section (revert
2546 patch of 2011-06-17). Don't create PT_INTERP segment.
2547 * script-sections.cc
2548 (Script_sections::create_note_and_tls_segments): Add a .interp
2549 section to a PT_INTERP segment even if we have seen a
2550 --dynamic-linker option.
2551
766f91bb
ILT
25522011-06-18 Ian Lance Taylor <iant@google.com>
2553
2554 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2555 merely because a non-PT_LOAD segment has a dynamic reloc.
2556
0d212c3a
ILT
25572011-06-18 Ian Lance Taylor <iant@google.com>
2558
2559 * layout.cc (Layout::finish_dynamic_section): Don't create
2560 DT_FLAGS entry if not needed.
2561
911a5072
ILT
25622011-06-18 Ian Lance Taylor <iant@google.com>
2563
2564 PR gold/12745
2565 * layout.cc (Layout::layout_eh_frame): Correct handling of
2566 writable .eh_frame section.
2567
534b4e5f
ILT
25682011-06-17 Ian Lance Taylor <iant@google.com>
2569
2570 PR gold/12893
2571 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2572 symbol is redefined with the exact same object and value.
2573
10b4f102
ILT
25742011-06-17 Ian Lance Taylor <iant@google.com>
2575
2576 PR gold/12880
2577 * layout.h (class Layout): Add interp_segment_ field.
2578 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2579 (Layout::attach_allocated_section_to_segment): If making shared
2580 library, put .interp section in PT_INTERP segment.
2581 (Layout::finalize): Also call create_interp if -dynamic-linker
2582 option was used.
2583 (Layout::create_interp): Assert that there is no PT_INTERP
2584 segment. If not using a SECTIONS clause, use make_output_section.
2585 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2586 * script-sections.cc
2587 (Script_sections::create_note_and_tls_segments): If making shared
2588 library, put .interp section in PT_INTERP segment.
2589
a29b0dad
ILT
25902011-06-17 Ian Lance Taylor <iant@google.com>
2591
e588ea8d
ILT
2592 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2593 when making a shared library.
2594
25952011-06-17 Ian Lance Taylor <iant@google.com>
2596
2597 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2598 parameter. Change all callers. Don't issue warning about PC32
2599 against locally defined symbol.
a29b0dad 2600
9d3b0698
ILT
26012011-06-16 Ian Lance Taylor <iant@google.com>
2602
2603 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2604 occurs in same object.
2605
85b0f90c
AM
26062011-06-14 Alan Modra <amodra@gmail.com>
2607
2608 * po/POTFILES.in: Regenerate.
2609
a94907d9
ILT
26102011-06-09 Ian Lance Taylor <iant@google.com>
2611
2612 * script-sections.cc
2613 (Orphan_output_section::set_section_addresses): For a relocatable
2614 link set address to 0.
2615
4fb3a1c3
CC
26162011-06-09 Cary Coutant <ccoutant@google.com>
2617
2618 PR gold/12804
2619 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2620 used with --compress-debug-sections.
2621 * gold/object.cc (Sized_relobj_file::do_layout): Report
2622 uncompressed size of compressed input sections.
2623
61220854
CC
26242011-06-08 Cary Coutant <ccoutant@google.com>
2625
2626 PR gold/12804
2627 * testsuite/two_file_test_2_v1.cc: Change initialization of
2628 v2 to keep it in .data.
2629
e6455dfb
CC
26302011-06-07 Cary Coutant <ccoutant@google.com>
2631
2632 * common.cc (Symbol_table::do_allocate_commons_list): Call
2633 gold_fallback.
2634 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2635 (Errors::fallback): New function.
2636 (gold_fallback): New function.
2637 * errors.h (Errors::fallback): New function.
2638 * gold.cc (gold_exit): Change status parameter to enum; adjust
2639 all callers.
2640 (queue_initial_tasks): Call gold_fallback.
2641 * gold.h: Include cstdlib.
2642 (Exit_status): New enum type.
2643 (gold_exit): Change status parameter to enum.
2644 (gold_fallback): New function.
2645 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2646 (Layout::create_symtab_sections): Likewise.
2647 (Layout::create_shdrs): Likewise.
2648 * main.cc (main): Adjust call to gold_exit.
2649 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2650 (Output_data_got::add_got_entry_pair): Likewise.
2651 (Output_section::add_input_section): Likewise.
2652 (Output_section::add_output_section_data): Likewise.
2653 (Output_segment::set_section_list_addresses): Likewise.
2654 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2655
fb0e076f
CC
26562011-06-07 Cary Coutant <ccoutant@google.com>
2657
2658 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2659 for incremental links.
2660 * output.cc (Output_segment::set_section_list_addresses): Remove
2661 FIXME and test for TLS or BSS.
2662
a5ee4d5d
CC
26632011-06-07 Cary Coutant <ccoutant@google.com>
2664
2665 * testsuite/Makefile.am: Add incremental_copy_test,
2666 incremental_common_test_1.
2667 * testsuite/Makefile.in: Regenerate.
2668 * testsuite/common_test_1_v1.c: New source file.
2669 * testsuite/common_test_1_v2.c: New source file.
2670 * testsuite/copy_test_v1.cc: New source file.
2671
5146f448
CC
26722011-06-07 Cary Coutant <ccoutant@google.com>
2673
2674 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2675 update, allocate common from bss section's free list.
2676 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2677 linker-defined symbols.
2678 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2679 Skip GOT and PLT entries that are no longer referenced.
2680 (Output_section_incremental_inputs::write_info_blocks): Mark
2681 linker-defined symbols.
2682 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2683 * output.cc (Output_section::allocate): New function.
2684 * output.h (Output_section::allocate): New function.
2685 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2686 linker-defined symbols.
2687 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2688 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2689 (Symbol::init_base_output_data): Likewise.
2690 (Symbol::init_base_output_segment): Likewise.
2691 (Symbol::init_base_constant): Likewise.
2692 (Sized_symbol::init_output_data): Likewise.
2693 (Sized_symbol::init_output_segment): Likewise.
2694 (Sized_symbol::init_constant): Likewise.
2695 (Symbol_table::do_define_in_output_data): Likewise.
2696 (Symbol_table::do_define_in_output_segment): Likewise.
2697 (Symbol_table::do_define_as_constant): Likewise.
2698 * symtab.h (Symbol::is_predefined): New function.
2699 (Symbol::init_base_output_data): Add is_predefined parameter.
2700 (Symbol::init_base_output_segment): Likewise.
2701 (Symbol::init_base_constant): Likewise.
2702 (Symbol::is_predefined_): New data member.
2703 (Sized_symbol::init_output_data): Add is_predefined parameter.
2704 (Sized_symbol::init_output_segment): Likewise.
2705 (Sized_symbol::init_constant): Likewise.
2706 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2707
26d3c67d
CC
27082011-06-07 Cary Coutant <ccoutant@google.com>
2709
2710 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2711 instead of emit_copy_reloc.
2712 (Copy_relocs::emit_copy_reloc): Refactor.
2713 (Copy_relocs::make_copy_reloc): New function.
2714 (Copy_relocs::add_copy_reloc): Remove.
2715 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2716 section.
2717 (Copy_relocs::make_copy_reloc): New function.
2718 (Copy_relocs::add_copy_reloc): Remove.
2719 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2720 unchanged input files.
2721 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2722 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2723 Reserve BSS space for COPY relocations.
2724 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2725 (Output_section_incremental_inputs::write_info_blocks): Record
2726 whether a symbol is copied from a shared object.
2727 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2728 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2729 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2730 (Incremental_input_entry_reader::get_output_symbol_index): Add
2731 is_copy parameter.
2732 (Incremental_binary::emit_copy_relocs): New function.
2733 (Incremental_binary::do_emit_copy_relocs): New function.
2734 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2735 new data member.
2736 (Sized_incremental_binary::add_copy_reloc): New function.
2737 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2738 (Sized_incremental_binary::Copy_reloc): New struct.
2739 (Sized_incremental_binary::Copy_relocs): New typedef.
2740 (Sized_incremental_binary::copy_relocs_): New data member.
2741 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2742 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2743 * target.h (Sized_target::emit_copy_reloc): New function.
2744 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2745
7cdb37d9
CC
27462011-06-02 Cary Coutant <ccoutant@google.com>
2747
2748 PR gold/12163
2749 * gold/archive.cc (Archive::Archive): Initialize new data member.
2750 (Archive::include_all_members): Return if archive has already been
2751 included.
2752 * gold/archive.h (Archive::include_all_members_): New data member.
2753
cc643b88
NC
27542011-06-02 Nick Clifton <nickc@redhat.com>
2755
2756 * dynobj.h: Fix spelling mistake in comment.
2757 * output.cc: Likewise.
2758
f62a3ca7 27592011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2760 Asier Llano
f62a3ca7
DK
2761
2762 PR gold/12826
cc643b88 2763 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2764 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2765 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2766 redundant arm_exidx_test.so.
2767 * testsuite/Makefile.in: Regenerate.
2768 (check_SCRIPTS): Add pr12826.sh
2769 (check_DATA): Add pr12826.stdout
2770 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2771 * testsuite/pr12826.sh: New file.
2772 * testsuite/pr12826_1.s: Ditto.
2773 * testsuite/pr12826_1.s: Ditto.
2774
8dbe1edc
ILT
27752011-05-30 Ian Lance Taylor <iant@google.com>
2776
2777 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2778 sections.
2779
c49875be
ILT
27802011-05-29 Ian Lance Taylor <iant@google.com>
2781
2782 PR gold/12804
2783 * testsuite/Makefile.am: Use different file name for two_file_test
2784 temporary file for each incremental test.
2785 * testsuite/Makefile.in: Rebuild.
2786
69d53f7a
ILT
27872011-05-29 Ian Lance Taylor <iant@google.com>
2788
2789 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2790 binary input file is empty.
2791
41d0ab5f
ILT
27922011-05-27 Ian Lance Taylor <iant@google.com>
2793
2794 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2795 (ver_test_9.so): Likewise.
2796 * testsuite/Makefile.in: Rebuild.
2797
89d8a36b
CC
27982011-05-26 Cary Coutant <ccoutant@google.com>
2799
2800 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2801 * incremental.cc (Incremental_inputs::report_input_section): Fix
2802 comment, indentation.
2803 (Incremental_inputs::report_comdat_group): New function.
2804 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2805 of data for incremental input file entry.
2806 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2807 group count, COMDAT group signatures.
2808 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2809 an unchanged input file.
2810 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2811 Initialize new data member.
2812 (Incremental_object_entry::add_comdat_group): New function.
2813 (Incremental_object_entry::get_comdat_group_count): New function.
2814 (Incremental_object_entry::get_comdat_signature_key): New function.
2815 (Incremental_object_entry::groups_): New data member.
2816 (Incremental_inputs::report_comdat_group): New function.
2817 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2818 data for incremental input file entry.
2819 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2820 (Incremental_input_entry_reader::get_input_section): Adjust size of
2821 data for incremental input file entry.
2822 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2823 (Incremental_input_entry_reader::get_comdat_group_signature): New
2824 function.
2825 * object.cc (Sized_relobj::include_section_group): Report kept
2826 COMDAT groups for incremental links.
2827
1706a06f
ILT
28282011-05-24 David Meyer <pdox@google.com>
2829
2830 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2831 with name parameter. Add found_name parameter.
2832 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2833 * dirsearch.h (class Dirsearch): Update declaration.
2834
a10ae760
ILT
28352011-05-24 Ian Lance Taylor <iant@google.com>
2836
2837 * archive.cc (Library_base::should_include_member): Pull in object
2838 from archive if it defines the entry symbol.
2839 * parameters.cc (Parameters::entry): New function.
2840 * parameters.h (class Parameters): Declare entry.
2841 * output.h (class Output_file_header): Remove entry_ field.
2842 * output.cc (Output_file_header::Output_file_header): Remove entry
2843 parameter. Change all callers.
2844 (Output_file_header::entry): Use parameters->entry.
2845 * gold.cc (queue_middle_tasks): Likewise.
2846 * plugin.cc (Plugin_hook::run): Likewise.
2847
aa92d6ed
CC
28482011-05-24 Cary Coutant <ccoutant@google.com>
2849
2850 * gold.cc (queue_initial_tasks): Pass incremental base filename
2851 to Output_file::open_base_file; don't print error message.
2852 * incremental-dump.cc (main): Adjust call to
2853 Output_file::open_for_modification.
2854 * incremental-dump.cc (main): Likewise.
2855 * incremental.cc (Incremental_inputs::report_command_line):
2856 Ignore --incremental-base option when comparing command lines.
2857 Ignore parameter when given as separate argument.
2858 * options.h (class General_options): Add --incremental-base.
2859 * output.cc (Output_file::Output_file):
2860 (Output_file::open_base_file): Add base_name and writable parameters;
2861 read base file into new file; print error message here.
2862 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2863 callers.
2864 * output.h (Output_file::open_for_modification): Rename to...
2865 (Output_file::open_base_file): ...this; add base_name and
2866 writable parameters; adjust all callers.
2867 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2868 callers.
2869 * testsuite/Makefile.am (incremental_test_4): Test
2870 --incremental-base.
2871 * testsuite/Makefile.in: Regenerate.
2872
2eedd706
CC
28732011-05-24 Cary Coutant <ccoutant@google.com>
2874
2875 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2876 incremental_test_4.
2877 * testsuite/Makefile.in: Regenerate.
2878 * testsuite/two_file_test_1_v1.cc: New test source file.
2879 * testsuite/two_file_test_1b_v1.cc: New test source file.
2880 * testsuite/two_file_test_2_v1.cc: New test source file.
2881
0f1c85a6
CC
28822011-05-24 Cary Coutant <ccoutant@google.com>
2883
2884 * dynobj.h (Dynobj::do_dynobj): New function.
2885 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2886 flag and soname for shared objects.
2887 * incremental.cc (Incremental_inputs::report_object): Make
2888 either Incremental_object_entry or Incremental_dynobj_entry; add
2889 soname to string table.
2890 (Incremental_inputs::report_input_section): Add assertion.
2891 (Output_section_incremental_inputs::set_final_data_size): Adjust
2892 type of input file entry for shared libraries; adjust size of
2893 shared library info entry.
2894 (Output_section_incremental_inputs::write_input_files): Write
2895 as_needed flag for shared libraries.
2896 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2897 of input file entry for shared libraries; write soname.
2898 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2899 soname from incremental info.
2900 * incremental.h (enum Incremental_input_flags): Add
2901 INCREMENTAL_INPUT_AS_NEEDED.
2902 (Incremental_input_entry::Incremental_input_entry): Initialize new
2903 data member.
2904 (Incremental_input_entry::set_as_needed): New function.
2905 (Incremental_input_entry::as_needed): New function.
2906 (Incremental_input_entry::do_dynobj_entry): New function.
2907 (Incremental_input_entry::as_needed_): New data member.
2908 (Incremental_object_entry::Incremental_object_entry): Don't check
2909 for shared library.
2910 (Incremental_object_entry::do_type): Likewise.
2911 (class Incremental_dynobj_entry): New class.
2912 (Incremental_input_entry_reader::as_needed): New function.
2913 (Incremental_input_entry_reader::get_soname): New function.
2914 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2915 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2916 size of shared library info entry.
58797674 2917 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2918 incremental link when adding DT_NEEDED entries.
2919 * object.h (Object::Object): Initialize new data member.
2920 (Object::dynobj): New function.
2921 (Object::set_as_needed): New function.
2922 (Object::as_needed): New function.
2923 (Object::do_dynobj): New function.
2924 (Object::as_needed_): New data member.
2925
6fa2a40b
CC
29262011-05-24 Cary Coutant <ccoutant@google.com>
2927
2928 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2929 info; adjust display of GOT entries.
2930 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2931 vector of input objects; remove file_status_.
2932 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2933 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2934 got_plt reader; call target hooks to reserve GOT entries.
2935 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2936 of input file info header and GOT info entry.
2937 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2938 relocation info.
2939 (Got_plt_view_info::got_descriptor): Remove.
2940 (Got_plt_view_info::sym_index): New data member.
2941 (Got_plt_view_info::input_index): New data member.
2942 (Local_got_offset_visitor::visit): Write input file index.
2943 (Global_got_offset_visitor::visit): Write 0 for input file index.
2944 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2945 with sym_index and input_index.
2946 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2947 incremental info GOT entry; replace got_descriptor with input_index.
2948 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2949 map from input file index to object.
2950 (Sized_relobj_incr::do_layout): Replace direct data member reference
2951 with accessor function.
2952 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2953 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2954 Adjust size of input file info header.
2955 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2956 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2957 (Incremental_input_entry_reader::get_input_section): Adjust size of
2958 input file info header.
2959 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2960 of incremental info GOT entry.
2961 (Incremental_got_plt_reader::get_got_desc): Remove.
2962 (Incremental_got_plt_reader::get_got_symndx): New function.
2963 (Incremental_got_plt_reader::get_got_input_index): New function.
2964 (Sized_incremental_binary::Sized_incremental_binary): Remove
2965 file_status_; add input_objects_.
2966 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2967 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2968 (Sized_incremental_binary::file_is_unchanged): Remove.
2969 (Sized_incremental_binary::set_input_object): New function.
2970 (Sized_incremental_binary::input_object): New function.
2971 (Sized_incremental_binary::file_status_): Remove.
2972 (Sized_incremental_binary::input_objects_): New data member.
2973 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2974 references.
2975 (Sized_relobj_incr::invalid_address): Move to base class.
2976 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2977 class.
2978 (Sized_relobj_incr::do_output_section_offset): Likewise.
2979 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2980 (Sized_relobj_incr::section_offsets_): Likewise.
2981 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2982 function.
2983 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2984 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2985 with accessor function.
2986 (Sized_relobj_file::do_layout): Likewise.
2987 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2988 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2989 (Sized_relobj_file::compute_final_local_value): Replace refs to
2990 section_offsets_ with accessor function.
2991 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2992 * object.h (Relobj::Relobj): Initialize new data members.
2993 (Relobj::add_dyn_reloc): New function.
2994 (Relobj::first_dyn_reloc): New function.
2995 (Relobj::dyn_reloc_count): New function.
2996 (Relobj::first_dyn_reloc_): New data member.
2997 (Relobj::dyn_reloc_count_): New data member.
2998 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2999 references.
3000 (Sized_relobj::Address): New typedef.
3001 (Sized_relobj::invalid_address): Move here from child class.
3002 (Sized_relobj::Sized_relobj): Initialize new data members.
3003 (Sized_relobj::sized_relobj): New function.
3004 (Sized_relobj::is_output_section_offset_invalid): Move here from
3005 child class.
3006 (Sized_relobj::get_output_section_offset): Likewise.
3007 (Sized_relobj::local_has_got_offset): Likewise.
3008 (Sized_relobj::local_got_offset): Likewise.
3009 (Sized_relobj::set_local_got_offset): Likewise.
3010 (Sized_relobj::do_for_all_local_got_entries): Likewise.
3011 (Sized_relobj::clear_got_offsets): New function.
3012 (Sized_relobj::section_offsets): Move here from child class.
3013 (Sized_relobj::do_output_section_offset): Likewise.
3014 (Sized_relobj::do_set_section_offset): Likewise.
3015 (Sized_relobj::Local_got_offsets): Likewise.
3016 (Sized_relobj::local_got_offsets_): Likewise.
3017 (Sized_relobj::section_offsets_): Likewise.
3018 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
3019 references.
3020 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
3021 class.
3022 (Sized_relobj_file::sized_relobj): New function
3023 (Sized_relobj_file::local_has_got_offset): Move to base class.
3024 (Sized_relobj_file::local_got_offset): Likewise.
3025 (Sized_relobj_file::set_local_got_offset): Likewise.
3026 (Sized_relobj_file::get_output_section_offset): Likewise.
3027 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
3028 (Sized_relobj_file::do_output_section_offset): Likewise.
3029 (Sized_relobj_file::do_set_section_offset): Likewise.
3030 (Sized_relobj_file::Local_got_offsets): Likewise.
3031 (Sized_relobj_file::local_got_offsets_): Likewise.
3032 (Sized_relobj_file::section_offsets_): Likewise.
3033 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
3034 (all constructors).
3035 (set_needs_dynsym_index): Convert relobj to derived class pointer.
3036 (Output_reloc::get_symbol_index): Likewise.
3037 (Output_reloc::local_section_offset): Likewise.
3038 (Output_reloc::get_address): Likewise.
3039 (Output_reloc::symbol_value): Likewise.
3040 (Output_data_got::reserve_slot): Move to class definition.
3041 (Output_data_got::reserve_local): New function.
3042 (Output_data_got::reserve_slot_for_global): Remove.
3043 (Output_data_got::reserve_global): New function.
3044 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
3045 (all constructors, two instantiations).
3046 (Output_reloc::get_relobj): New function (two instantiations).
3047 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
3048 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
3049 (Output_data_reloc::add_global): Adjust type of relobj.
3050 (Output_data_reloc::add_global_relative): Likewise.
3051 (Output_data_reloc::add_symbolless_global_addend): Likewise.
3052 (Output_data_reloc::add_local): Likewise.
3053 (Output_data_reloc::add_local_relative): Likewise.
3054 (Output_data_reloc::add_symbolless_local_addend): Likewise.
3055 (Output_data_reloc::add_local_section): Likewise.
3056 (Output_data_reloc::add_output_section): Likewise.
3057 (Output_data_reloc::add_absolute): Likewise.
3058 (Output_data_reloc::add_target_specific): Likewise.
3059 (Output_data_got::reserve_slot): Move definition here.
3060 (Output_data_got::reserve_local): New function.
3061 (Output_data_got::reserve_global): New function.
3062 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
3063 section_offsets_ with accessor function.
3064 (Sized_relobj_file::write_sections): Likewise.
3065 (Sized_relobj_file::do_relocate_sections): Likewise.
3066 * target.h (Sized_target::reserve_local_got_entry): New function.
3067 (Sized_target::reserve_global_got_entry): New function.
3068 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
3069 (Target_x86_64::reserve_global_got_entry): New function.
3070 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
3071
4829d394
CC
30722011-05-23 Cary Coutant <ccoutant@google.com>
3073
3074 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
3075 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
3076 bit when checking got_type.
3077 * incremental.cc (Sized_incremental_binary::setup_readers):
3078 Store symbol table and string table locations; initialize bit vector
3079 of file status flags.
3080 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
3081 unchanged files.
3082 (Sized_incremental_binary::do_process_got_plt): New function.
3083 (Sized_incremental_binary::get_symtab_view): Use stored locations.
3084 (Output_section_incremental_inputs::set_final_data_size): Record
3085 file index for each input file.
3086 (Output_section_incremental_inputs::write_got_plt): Store file index
3087 instead of input entry offset for each GOT entry.
3088 * incremental.h
3089 (Incremental_input_entry::Incremental_input_entry): Initialize new
3090 data member.
3091 (Incremental_input_entry::set_offset): Store file index.
3092 (Incremental_input_entry::get_file_index): New function.
3093 (Incremental_input_entry::file_index_): New data member.
3094 (Incremental_binary::process_got_plt): New function.
3095 (Incremental_binary::do_process_got_plt): New function.
3096 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3097 data members.
3098 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3099 (Sized_incremental_binary::set_file_is_unchanged): New function.
3100 (Sized_incremental_binary::file_is_unchanged): New function.
3101 (Sized_incremental_binary::do_process_got_plt): New function.
3102 (Sized_incremental_binary::file_status_): New data member.
3103 (Sized_incremental_binary::main_symtab_loc_): New data member.
3104 (Sized_incremental_binary::main_strtab_loc_): New data member.
3105 * output.cc (Output_data_got::Got_entry::write): Add case
3106 RESERVED_CODE.
3107 (Output_data_got::add_global): Call add_got_entry.
3108 (Output_data_got::add_global_plt): Likewise.
3109 (Output_data_got::add_global_with_rel): Likewise.
3110 (Output_data_got::add_global_with_rela): Likewise.
3111 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3112 (Output_data_got::add_global_pair_with_rela): Likewise.
3113 (Output_data_got::add_local): Call add_got_entry.
3114 (Output_data_got::add_local_plt): Likewise.
3115 (Output_data_got::add_local_with_rel): Likewise.
3116 (Output_data_got::add_local_with_rela): Likewise.
3117 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3118 (Output_data_got::add_local_pair_with_rela): Likewise.
3119 (Output_data_got::reserve_slot): New function.
3120 (Output_data_got::reserve_slot_for_global): New function.
3121 (Output_data_got::add_got_entry): New function.
3122 (Output_data_got::add_got_entry_pair): New function.
3123 (Output_section::add_output_section_data): Edit FIXME.
3124 * output.h
3125 (Output_section_data_build::Output_section_data_build): New
3126 constructor with size parameter.
3127 (Output_data_space::Output_data_space): Likewise.
3128 (Output_data_got::Output_data_got): Initialize new data member; new
3129 constructor with size parameter.
3130 (Output_data_got::add_constant): Call add_got_entry.
3131 (Output_data_got::reserve_slot): New function.
3132 (Output_data_got::reserve_slot_for_global): New function.
3133 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3134 (Output_data_got::add_got_entry): New function.
3135 (Output_data_got::add_got_entry_pair): New function.
3136 (Output_data_got::free_list_): New data member.
3137 * target.h (Sized_target::init_got_plt_for_update): New function.
3138 (Sized_target::register_global_plt_entry): New function.
3139 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3140 Initialize new data member; call init; add constructor with PLT count.
3141 (Output_data_plt_x86_64::init): New function.
3142 (Output_data_plt_x86_64::add_relocation): New function.
3143 (Output_data_plt_x86_64::reserve_slot): New function.
3144 (Output_data_plt_x86_64::free_list_): New data member.
3145 (Target_x86_64::init_got_plt_for_update): New function.
3146 (Target_x86_64::register_global_plt_entry): New function.
3147 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3148 incremental updates.
3149 (Output_data_plt_x86_64::add_relocation): New function.
3150 * testsuite/object_unittest.cc (Object_test): Set default options.
3151
ec69d6da
ILT
31522011-05-16 Ian Lance Taylor <iant@google.com>
3153
3154 * options.h (class General_options): Make -i a synonym for -r.
3155
732e31de
ILT
31562011-05-16 Ian Lance Taylor <iant@google.com>
3157
3158 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3159
403676b5
CC
31602011-05-10 Cary Coutant <ccoutant@google.com>
3161
3162 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3163 strip_all (-s).
3164
5b7b7d6e
ILT
31652011-05-06 Ian Lance Taylor <iant@google.com>
3166
3167 * layout.cc (Layout::layout): If the output section flags change,
3168 update the ordering.
3169
f0f9babf
CC
31702011-04-25 Cary Coutant <ccoutant@google.com>
3171
3172 * incremental-dump.cc (dump_incremental_inputs): Print local
3173 symbol info for each input file.
3174 * incremental.cc
3175 (Output_section_incremental_inputs::set_final_data_size): Add local
3176 symbol info to input file entries in incremental info.
3177 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3178 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3179 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3180 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3181 implementation.
3182 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3183 (Sized_incr_relobj::do_relocate): Write the local symbols.
3184 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3185 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3186 Adjust size of input file header.
3187 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3188 (Incremental_inputs_reader::get_local_symbol_count): New function.
3189 (Incremental_inputs_reader::get_input_section): Adjust size of input
3190 file header.
3191 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3192 (Sized_incr_relobj::This): New typedef.
3193 (Sized_incr_relobj::sym_size): New const data member.
3194 (Sized_incr_relobj::Local_symbol): New struct.
3195 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3196 (Sized_incr_relobj::do_local_symbol_offset): New function.
3197 (Sized_incr_relobj::local_symbol_count_): New data member.
3198 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3199 (Sized_incr_relobj::local_symbol_index_): New data member.
3200 (Sized_incr_relobj::local_symbol_offset_): New data member.
3201 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3202 (Sized_incr_relobj::local_symbols_): New data member.
3203 * object.h (Relobj::output_local_symbol_count): New function.
3204 (Relobj::local_symbol_offset): New function.
3205 (Relobj::do_output_local_symbol_count): New function.
3206 (Relobj::do_local_symbol_offset): New function.
3207 (Sized_relobj::do_output_local_symbol_count): New function.
3208 (Sized_relobj::do_local_symbol_offset): New function.
3209
d0a9ace3
ILT
32102011-04-22 Vladimir Simonov <sv@sw.ru>
3211
3212 * descriptors.cc (set_close_on_exec): New function.
3213 (Descriptors::open): Use set_close_on_exec.
3214 * output.cc (S_ISLNK): Define if not defined.
3215
94a3fc8b
CC
32162011-04-22 Cary Coutant <ccoutant@google.com>
3217
3218 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3219 global symbol map.
3220 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3221 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3222 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3223 relocations.
3224 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3225 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3226 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3227 * incremental.h
3228 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3229 function.
3230 (Incremental_binary::apply_incremental_relocs): New function.
3231 (Incremental_binary::do_apply_incremental_relocs): New function.
3232 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3233 data member.
3234 (Sized_incremental_binary::add_global_symbol): New function.
3235 (Sized_incremental_binary::global_symbol): New function.
3236 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3237 (Sized_incremental_binary::symbol_map_): New data member.
3238 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3239 * target.h (Sized_target::apply_relocation): New function.
3240 * target-reloc.h (apply_relocation): New function.
3241 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3242
c87e4302
DK
32432011-04-22 Doug Kwan <dougkwan@google.com>
3244
3245 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3246 flag of a SHT_ARM_EXIDX section.
2e702c99 3247 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3248 * testsuite/Makefile.in: Regenerate.
3249 * testsuite/arm_exidx_test.s: New file.
3250 * testsuite/arm_exidx_test.sh: Same.
3251
e7782cf6
CC
32522011-04-20 Cary Coutant <ccoutant@google.com>
3253
3254 PR gold/12689
3255 * archive.h (Incremental_archive_entry::Archive_member):
3256 Initialize arg_serial_ (second constructor).
3257
308ecdc7
ILT
32582011-04-17 Ian Lance Taylor <iant@google.com>
3259
3260 * object.cc (Relocate_info::location): Simplify location string.
3261 * errors.cc (Errors::error_at_location): Don't print program
3262 name.
3263 (Errors::warning_at_location): Likewise.
3264 (Errors::undefined_symbol): Likewise.
3265 * testsuite/debug_msg.sh: Update accordingly.
3266
bec5b579
CC
32672011-04-14 Cary Coutant <ccoutant@google.com>
3268
3269 * gold/layout.cc (Layout::symtab_section_offset): New function.
3270 * gold/layout.h (Layout::symtab_section_offset): New function.
3271 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3272
88597d34
ILT
32732011-04-12 Ian Lance Taylor <iant@google.com>
3274
3275 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3276 with MREMAP_MAYMOVE.
3277 * output.h (class Output_file): Add map_is_allocated_ field.
3278 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3279 not available, provide stubs. If mremap is not available, #define
3280 it to gold_mremap.
3281 (MREMAP_MAYMOVE): Define if not defined.
3282 (Output_file::Output_file): Initialize map_is_allocated_.
3283 (Output_file::resize): Check map_is_allocated_.
3284 (Output_file::map_anonymous): If mmap fails, use malloc.
3285 (Output_file::unmap): Don't do anything for an anonymous map.
3286 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3287 is not available, provide stubs.
3288 (File_read::View::~View): Use free rather than delete[].
3289 (File_read::make_view): Use malloc rather than new[]. If mmap
3290 fails, use malloc.
3291 (File_read::find_or_make_view): Use malloc rather than new[].
3292 * gold.h: Remove HAVE_REMAP code.
3293 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3294 exists. Rename mremap to gold_mremap. If mmap is not available
3295 don't do anything.
3296 * configure, config.in: Rebuild.
3297
11e361bc
ILT
32982011-04-11 Ian Lance Taylor <iant@google.com>
3299
3300 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3301 initialize local variable v.
3302
cdc29364
CC
33032011-04-11 Cary Coutant <ccoutant@google.com>
3304
3305 * archive.cc (Archive::include_member): Adjust call to
3306 report_object.
3307 (Add_archive_symbols::run): Track argument serial numbers.
3308 (Lib_group::include_member): Likewise.
3309 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3310 * archive.h (Incremental_archive_entry::Archive_member):
3311 Initialize arg_serial_.
3312 (Archive_member::arg_serial_): New data member.
3313 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3314 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3315 incremental link.
3316 (Sized_dynobj::do_for_all_local_got_entries): New function.
3317 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3318 function.
3319 * fileread.cc (get_mtime): New function.
3320 * fileread.h (get_mtime): New function.
3321 * gold.cc (queue_initial_tasks): Check for incremental update.
3322 (process_incremental_input): New function.
3323 (queue_middle_tasks): Don't force valid target for incremental
3324 update.
3325 * incremental-dump.cc (find_input_containing_global): Adjust
3326 size of symbol info entry.
3327 (dump_incremental_inputs): Dump argument serial number and
3328 in_system_directory flag; bias shndx by 1; print symbol names
3329 when dumping per-file symbol lists; use new symbol info readers.
3330 * incremental.cc
3331 (Output_section_incremental_inputs:update_data_size): New function.
3332 (Sized_incremental_binary::setup_readers): Setup input readers
3333 for each input file; build maps for files added from libraries
3334 and scripts.
3335 (Sized_incremental_binary::check_input_args): New function.
3336 (Sized_incremental_binary::do_check_inputs): Build map of argument
3337 serial numbers to input arguments.
3338 (Sized_incremental_binary::do_file_has_changed): Rename
3339 do_file_is_unchanged to this; compare file modification times.
3340 (Sized_incremental_binary::do_init_layout): New function.
3341 (Sized_incremental_binary::do_reserve_layout): New function.
3342 (Sized_incremental_binary::do_get_input_reader): Remove.
3343 (Sized_incremental_binary::get_symtab_view): New function.
3344 (Incremental_checker::can_incrementally_link_output_file): Remove.
3345 (Incremental_inputs::report_command_line): Exclude --debug options.
3346 (Incremental_inputs::report_archive_begin): Add parameter; track
3347 argument serial numbers; don't put input file entry for archive
3348 before archive members.
3349 (Incremental_inputs::report_archive_end): Put input file entry
3350 for archive after archive members.
3351 (Incremental_inputs::report_object): Add parameter; track argument
3352 serial numbers and in_system_directory flag.
3353 (Incremental_inputs::report_script): Add parameter; track argument
3354 serial numbers.
3355 (Output_section_incremental_inputs::set_final_data_size): Adjust
3356 size of symbol info entry; check for forwarding symbols.
3357 (Output_section_incremental_inputs::write_input_files): Write
3358 in_system_directory flag and argument serial number.
3359 (Output_section_incremental_inputs::write_info_blocks): Map section
3360 indices between incremental info and original input file; store
3361 input section index for each symbol.
3362 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3363 change operator() to visit().
3364 (class Global_got_offset_visitor): Likewise.
3365 (class Global_symbol_visitor_got_plt):
3366 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3367 classes.
3368 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3369 (Sized_incr_relobj::do_read_symbols): New function.
3370 (Sized_incr_relobj::do_layout): New function.
3371 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3372 (Sized_incr_relobj::do_add_symbols): New function.
3373 (Sized_incr_relobj::do_should_include_member): New function.
3374 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3375 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3376 (Sized_incr_relobj::do_section_size): New function.
3377 (Sized_incr_relobj::do_section_name): New function.
3378 (Sized_incr_relobj::do_section_contents): New function.
3379 (Sized_incr_relobj::do_section_flags): New function.
3380 (Sized_incr_relobj::do_section_entsize): New function.
3381 (Sized_incr_relobj::do_section_address): New function.
3382 (Sized_incr_relobj::do_section_type): New function.
3383 (Sized_incr_relobj::do_section_link): New function.
3384 (Sized_incr_relobj::do_section_info): New function.
3385 (Sized_incr_relobj::do_section_addralign): New function.
3386 (Sized_incr_relobj::do_initialize_xindex): New function.
3387 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3388 (Sized_incr_relobj::do_read_relocs): New function.
3389 (Sized_incr_relobj::do_gc_process_relocs): New function.
3390 (Sized_incr_relobj::do_scan_relocs): New function.
3391 (Sized_incr_relobj::do_count_local_symbols): New function.
3392 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3393 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3394 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3395 (Sized_incr_relobj::do_relocate): New function.
3396 (Sized_incr_relobj::do_set_section_offset): New function.
3397 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3398 (Sized_incr_dynobj::do_read_symbols): New function.
3399 (Sized_incr_dynobj::do_layout): New function.
3400 (Sized_incr_dynobj::do_add_symbols): New function.
3401 (Sized_incr_dynobj::do_should_include_member): New function.
3402 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3403 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3404 (Sized_incr_dynobj::do_section_size): New function.
3405 (Sized_incr_dynobj::do_section_name): New function.
3406 (Sized_incr_dynobj::do_section_contents): New function.
3407 (Sized_incr_dynobj::do_section_flags): New function.
3408 (Sized_incr_dynobj::do_section_entsize): New function.
3409 (Sized_incr_dynobj::do_section_address): New function.
3410 (Sized_incr_dynobj::do_section_type): New function.
3411 (Sized_incr_dynobj::do_section_link): New function.
3412 (Sized_incr_dynobj::do_section_info): New function.
3413 (Sized_incr_dynobj::do_section_addralign): New function.
3414 (Sized_incr_dynobj::do_initialize_xindex): New function.
3415 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3416 (make_sized_incremental_object): New function.
3417 (Incremental_library::copy_unused_symbols): New function.
3418 (Incremental_library::do_for_all_unused_symbols): New function.
3419 * incremental.h (enum Incremental_input_flags): New type.
3420 (class Incremental_checker): Remove.
3421 (Incremental_input_entry::Incremental_input_entry): Add argument
3422 serial number.
3423 (Incremental_input_entry::arg_serial): New function.
3424 (Incremental_input_entry::set_is_in_system_directory): New function.
3425 (Incremental_input_entry::is_in_system_directory): New function.
3426 (Incremental_input_entry::arg_serial_): New data member.
3427 (Incremental_input_entry::is_in_system_directory_): New data member.
3428 (class Script_info): Move here from script.h.
3429 (Script_info::Script_info): Add filename parameter.
3430 (Script_info::filename): New function.
3431 (Script_info::filename_): New data member.
3432 (Incremental_script_entry::Incremental_script_entry): Add argument
3433 serial number.
3434 (Incremental_object_entry::Incremental_object_entry): Likewise.
3435 (Incremental_object_entry::add_input_section): Build list of input
3436 sections with map to original shndx.
3437 (Incremental_object_entry::get_input_section_index): New function.
3438 (Incremental_object_entry::shndx_): New data member.
3439 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3440 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3441 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3442 serial number.
3443 (Incremental_inputs::report_archive_begin): Likewise.
3444 (Incremental_inputs::report_object): Likewise.
3445 (Incremental_inputs::report_script): Likewise.
3446 (class Incremental_global_symbol_reader): New class.
3447 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3448 and store flags and input file type.
3449 (Incremental_input_entry_reader::arg_serial): New function.
3450 (Incremental_input_entry_reader::type): Extract type from flags.
3451 (Incremental_input_entry_reader::is_in_system_directory): New function.
3452 (Incremental_input_entry_reader::get_input_section_count): Call
3453 accessor function for type.
3454 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3455 function for type; adjust size of global symbol entry.
3456 (Incremental_input_entry_reader::get_global_symbol_count): Call
3457 accessor function for type.
3458 (Incremental_input_entry_reader::get_object_count): Likewise.
3459 (Incremental_input_entry_reader::get_object_offset): Likewise.
3460 (Incremental_input_entry_reader::get_member_count): Likewise.
3461 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3462 (Incremental_input_entry_reader::get_member_offset): Likewise.
3463 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3464 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3465 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3466 (Incremental_input_entry_reader::get_global_symbol_reader): New
3467 function.
3468 (Incremental_input_entry_reader::get_output_symbol_index): New
3469 function.
3470 (Incremental_input_entry_reader::type_): Remove.
3471 (Incremental_input_entry_reader::flags_): New data member.
3472 (Incremental_inputs_reader::input_file_offset): New function.
3473 (Incremental_inputs_reader::input_file_index): New function.
3474 (Incremental_inputs_reader::input_file): Call input_file_offset.
3475 (Incremental_inputs_reader::input_file_at_offset): New function.
3476 (Incremental_relocs_reader::get_r_type): Reformat.
3477 (Incremental_relocs_reader::get_r_shndx): Reformat.
3478 (Incremental_relocs_reader::get_r_offset): Reformat.
3479 (Incremental_relocs_reader::data): New function.
3480 (Incremental_binary::Incremental_binary): Initialize new data members.
3481 (Incremental_binary::check_inputs): Add cmdline parameter.
3482 (Incremental_binary::file_is_unchanged): Remove.
3483 (Input_reader::arg_serial): New function.
3484 (Input_reader::get_unused_symbol_count): New function.
3485 (Input_reader::get_unused_symbol): New function.
3486 (Input_reader::do_arg_serial): New function.
3487 (Input_reader::do_get_unused_symbol_count): New function.
3488 (Input_reader::do_get_unused_symbol): New function.
3489 (Incremental_binary::input_file_count): New function.
3490 (Incremental_binary::get_input_reader): Change signature to use
3491 index instead of filename.
3492 (Incremental_binary::file_has_changed): New function.
3493 (Incremental_binary::get_input_argument): New function.
3494 (Incremental_binary::get_library): New function.
3495 (Incremental_binary::get_script_info): New function.
3496 (Incremental_binary::init_layout): New function.
3497 (Incremental_binary::reserve_layout): New function.
3498 (Incremental_binary::output_file): New function.
3499 (Incremental_binary::do_check_inputs): New function.
3500 (Incremental_binary::do_file_is_unchanged): Remove.
3501 (Incremental_binary::do_file_has_changed): New function.
3502 (Incremental_binary::do_init_layout): New function.
3503 (Incremental_binary::do_reserve_layout): New function.
3504 (Incremental_binary::do_input_file_count): New function.
3505 (Incremental_binary::do_get_input_reader): Change signature.
3506 (Incremental_binary::input_args_map_): New data member.
3507 (Incremental_binary::library_map_): New data member.
3508 (Incremental_binary::script_map_): New data member.
3509 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3510 new data members.
3511 (Sized_incremental_binary::output_section): New function.
3512 (Sized_incremental_binary::inputs_reader): Add const.
3513 (Sized_incremental_binary::symtab_reader): Add const.
3514 (Sized_incremental_binary::relocs_reader): Add const.
3515 (Sized_incremental_binary::got_plt_reader): Add const.
3516 (Sized_incremental_binary::get_symtab_view): New function.
3517 (Sized_incremental_binary::Inputs_reader): New typedef.
3518 (Sized_incremental_binary::Input_entry_reader): New typedef.
3519 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3520 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3521 (Sized_incremental_binary::do_file_has_changed): New function.
3522 (Sized_incremental_binary::do_init_layout): New function.
3523 (Sized_incremental_binary::do_reserve_layout): New function.
3524 (Sized_input_reader::Inputs_reader): Remove.
3525 (Sized_input_reader::Input_entry_reader): Remove.
3526 (Sized_input_reader::do_arg_serial): New function.
3527 (Sized_input_reader::do_get_unused_symbol_count): New function.
3528 (Sized_input_reader::do_get_unused_symbol): New function.
3529 (Sized_incremental_binary::do_input_file_count): New function.
3530 (Sized_incremental_binary::do_get_input_reader): Change signature;
3531 use index instead of filename.
3532 (Sized_incremental_binary::section_map_): New data member.
3533 (Sized_incremental_binary::input_entry_readers_): New data member.
3534 (class Sized_incr_relobj): New class.
3535 (class Sized_incr_dynobj): New class.
3536 (make_sized_incremental_object): New function.
3537 (class Incremental_library): New class.
3538 * layout.cc (Free_list::num_lists): New static data member.
3539 (Free_list::num_nodes): New static data member.
3540 (Free_list::num_removes): New static data member.
3541 (Free_list::num_remove_visits): New static data member.
3542 (Free_list::num_allocates): New static data member.
3543 (Free_list::num_allocate_visits): New static data member.
3544 (Free_list::init): New function.
3545 (Free_list::remove): New function.
3546 (Free_list::allocate): New function.
3547 (Free_list::dump): New function.
3548 (Free_list::print_stats): New function.
3549 (Layout_task_runner::run): Resize output file for incremental updates.
3550 (Layout::Layout): Initialize new data members.
3551 (Layout::set_incremental_base): New function.
3552 (Layout::init_fixed_output_section): New function.
3553 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3554 incremental updates.
3555 (Layout::create_gold_note): Do not create gold note section for
3556 incremental updates.
3557 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3558 for incremental updates.
3559 (Layout::set_section_offsets): For incremental updates, allocate space
3560 from free list.
3561 (Layout::create_symtab_sections): Layout with offsets relative to
3562 start of section; for incremental updates, allocate space from free
3563 list.
3564 (Layout::create_shdrs): For incremental updates, allocate space from
3565 free list.
3566 (Layout::finish_dynamic_section): For incremental updates, do not
3567 check --as-needed (fixed in subsequent patch).
3568 * layout.h (class Free_list): New class.
3569 (Layout::set_incremental_base): New function.
3570 (Layout::incremental_base): New function.
3571 (Layout::init_fixed_output_section): New function.
3572 (Layout::allocate): New function.
3573 (Layout::incremental_base_): New data member.
3574 (Layout::free_list_): New data member.
3575 * main.cc (main): Print Free_list statistics.
3576 * object.cc (Relobj::finalize_incremental_relocs): Add
3577 clear_counts parameter; clear counts only when clear_counts is set.
3578 (Sized_relobj::Sized_relobj): Initialize new base class.
3579 (Sized_relobj::do_layout): Don't report special sections.
3580 (Sized_relobj::do_for_all_local_got_entries): New function.
3581 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3582 symtab_off to all symbol table offsets.
3583 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3584 * object.h (class Got_offset_list): Move to top of file.
3585 (Object::Object): Allow case where input_file == NULL.
3586 (Object::~Object): Likewise.
3587 (Object::input_file): Assert that input_file != NULL.
3588 (Object::lock): Allow case where input_file == NULL.
3589 (Object::unlock): Likewise.
3590 (Object::is_locked): Likewise.
3591 (Object::token): Likewise.
3592 (Object::release): Likewise.
3593 (Object::is_incremental): New function.
3594 (Object::get_mtime): New function.
3595 (Object::for_all_local_got_entries): New function.
3596 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3597 (Object::set_is_in_system_directory): New function.
3598 (Object::is_in_system_directory): New function.
3599 (Object::do_is_incremental): New function.
3600 (Object::do_get_mtime): New function.
3601 (Object::do_for_all_local_got_entries): New function.
3602 (Object::is_in_system_directory_): New data member.
3603 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3604 (class Sized_relobj_base): New class.
3605 (class Sized_relobj): Derive from Sized_relobj_base.
3606 (class Sized_relobj::Symbols): Redeclare from base class.
3607 (class Sized_relobj::local_got_offset_list): Remove.
3608 (class Sized_relobj::Output_sections): Redeclare from base class.
3609 (class Sized_relobj::do_for_all_local_got_entries): New function.
3610 (class Sized_relobj::write_local_symbols): Add offset parameter.
3611 (class Sized_relobj::local_symbol_offset_): Update comment.
3612 (class Sized_relobj::local_dynsym_offset_): Update comment.
3613 * options.cc (Input_arguments::add_file): Remove const.
3614 * options.h (Input_file_argument::Input_file_argument):
3615 Initialize arg_serial_ (all constructors).
3616 (Input_file_argument::set_arg_serial): New function.
3617 (Input_file_argument::arg_serial): New function.
3618 (Input_file_argument::arg_serial_): New data member.
3619 (Input_arguments::Input_arguments): Initialize file_count_.
3620 (Input_arguments::add_file): Remove const.
3621 (Input_arguments::number_of_input_files): New function.
3622 (Input_arguments::file_count_): New data member.
3623 (Command_line::number_of_input_files): Call
3624 Input_arguments::number_of_input_files.
3625 * output.cc (Output_segment_headers::Output_segment_headers):
3626 Set current size.
3627 (Output_section::Input_section::current_data_size): New function.
3628 (Output_section::Output_section): Initialize new data members.
3629 (Output_section::add_input_section): Don't do merge sections for
3630 an incremental link; allocate space from free list for an
3631 incremental update.
3632 (Output_section::add_output_section_data): Allocate space from
3633 free list for an incremental update.
3634 (Output_section::update_data_size): New function.
3635 (Output_section::set_fixed_layout): New function.
3636 (Output_section::reserve): New function.
3637 (Output_segment::set_section_addresses): Remove const.
3638 (Output_segment::set_section_list_addresses): Remove const; allocate
3639 space from free list for an incremental update.
3640 (Output_segment::set_offset): Adjust size of RELRO segment for an
3641 incremental update.
3642 * output.h (Output_data::current_data_size): Move here from
3643 child classes.
3644 (Output_data::pre_finalize_data_size): New function.
3645 (Output_data::update_data_size): New function.
3646 (Output_section_headers::update_data_size): new function.
3647 (Output_section_data_build::current_data_size): Move to Output_data.
3648 (Output_data_strtab::update_data_size): New function.
3649 (Output_section::current_data_size): Move to Output_data.
3650 (Output_section::set_fixed_layout): New function.
3651 (Output_section::has_fixed_layout): New function.
3652 (Output_section::reserve): New function.
3653 (Output_section::update_data_size): New function.
3654 (Output_section::has_fixed_layout_): New data member.
3655 (Output_section::free_list_): New data member.
3656 (Output_segment::set_section_addresses): Remove const.
3657 (Output_segment::set_section_list_addresses): Remove const.
3658 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3659 New function.
3660 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3661 New function.
3662 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3663 parameter when calling Add_symbols constructor; store argument
3664 serial number for members of a lib group.
3665 (Add_symbols::locks): Allow case where token == NULL.
3666 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3667 (Read_member::~Read_member): New function.
3668 (Read_member::is_runnable): New function.
3669 (Read_member::locks): New function.
3670 (Read_member::run): New function.
3671 (Check_script::~Check_script): New function.
3672 (Check_script::is_runnable): New function.
3673 (Check_script::locks): New function.
3674 (Check_script::run): New function.
3675 (Check_library::~Check_library): New function.
3676 (Check_library::is_runnable): New function.
3677 (Check_library::locks): New function.
3678 (Check_library::run): New function.
3679 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3680 (Add_symbols::library_): New data member.
3681 (class Read_member): New class.
3682 (class Check_script): New class.
3683 (class Check_library): New class.
3684 * reloc.cc (Read_relocs::is_runnable): Allow case where
3685 token == NULL.
3686 (Read_relocs::locks): Likewise.
3687 (Scan_relocs::locks): Likewise.
3688 (Relocate_task::locks): Likewise.
3689 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3690 to clear counters.
3691 (Sized_relobj::incremental_relocs_scan): Fix comment.
3692 (Sized_relobj::do_relocate): Pass output file offset to
3693 write_local_symbols.
3694 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3695 from class declaration.
3696 * script.cc (read_input_script): Allocate Script_info; pass
3697 argument serial number to report_script.
3698 * script.h (class Script_info): Move to incremental.h.
3699 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3700 * symtab.h (Symbol_table::add_from_incrobj): New function.
3701 (Symbol_table::set_file_offset): New function.
3702
b961d0d7
CC
37032011-04-05 Cary Coutant <ccoutant@google.com>
3704
3705 * incremental-dump.cc (dump_incremental_inputs): Change signature
3706 to take a Sized_incremental_binary; change caller. Use readers
3707 in Sized_incremental_binary.
3708 * incremental.cc
3709 (Sized_incremental_binary::find_incremental_inputs_sections):
3710 Rename do_find_incremental_inputs_sections to this.
3711 (Sized_incremental_binary::setup_readers): New function.
3712 (Sized_incremental_binary::do_check_inputs): Check
3713 has_incremental_info_ flag; move setup code to setup_readers;
3714 use input readers.
3715 (Sized_incremental_binary::do_file_is_unchanged): New function.
3716 (Sized_incremental_binary::do_get_input_reader): New function.
3717 * incremental.h (class Incremental_binary): Move to end of file.
3718 (Incremental_binary::file_is_unchanged): New function.
3719 (Incremental_binary::do_file_is_unchanged): New function.
3720 (Incremental_binary::Input_reader): New class.
3721 (Incremental_binary::get_input_reader): New function.
3722 (class Sized_incremental_binary): Move to end of file.
3723 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3724 input section reader classes.
3725 (Sized_incremental_binary::has_incremental_info): New function.
3726 (Sized_incremental_binary::inputs_reader): New function.
3727 (Sized_incremental_binary::symtab_reader): New function.
3728 (Sized_incremental_binary::relocs_reader): New function.
3729 (Sized_incremental_binary::got_plt_reader): New function.
3730 (Sized_incremental_binary::do_file_is_unchanged): New function.
3731 (Sized_incremental_binary::Sized_input_reader): New class.
3732 (Sized_incremental_binary::get_input_reader): New function.
3733 (Sized_incremental_binary::find_incremental_inputs_sections):
3734 Rename do_find_incremental_inputs_sections to this.
3735 (Sized_incremental_binary::setup_readers): New function.
3736 (Sized_incremental_binary::has_incremental_info_): New data member.
3737 (Sized_incremental_binary::inputs_reader_): New data member.
3738 (Sized_incremental_binary::symtab_reader_): New data member.
3739 (Sized_incremental_binary::relocs_reader_): New data member.
3740 (Sized_incremental_binary::got_plt_reader_): New data member.
3741 (Sized_incremental_binary::current_input_file_): New data member.
3742
a869183f
PP
37432011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3744
3745 PR gold/12640
3746 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3747 violation.
3748
37492011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3750
3751 * archive.cc (Archive::include_member): Adjust call to report_object.
3752 (Add_archive_symbols::run): Add script_info to call to
3753 report_archive_begin.
3754 (Lib_group::include_member): Adjust call to report_object.
3755 (Add_lib_group_symbols::run): Adjust call to report_object.
3756 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3757 blocks. Add object count for script input files.
3758 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3759 script_info parameter; change all callers.
3760 (Incremental_inputs::report_object): Add script_info parameter;
3761 change all callers.
3762 (Incremental_inputs::report_script): Store backpointer to
3763 incremental info entry.
3764 (Output_section_incremental_inputs::set_final_data_size): Record
3765 additional information for scripts.
3766 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3767 * incremental.h (Incremental_script_entry::add_object): New function.
3768 (Incremental_script_entry::get_object_count): New function.
3769 (Incremental_script_entry::get_object): New function.
3770 (Incremental_script_entry::objects_): New data member; adjust
3771 constructor.
3772 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3773 (Incremental_inputs::report_object): Add script_info parameter.
3774 (Incremental_inputs_reader::get_object_count): New function.
3775 (Incremental_inputs_reader::get_object_offset): New function.
3776 * options.cc (Input_arguments::add_file): Return reference to
3777 new input argument.
3778 * options.h (Input_argument::set_script_info): New function.
3779 (Input_argument::script_info): New function.
3780 (Input_argument::script_info_): New data member; adjust all
3781 constructors.
3782 (Input_file_group::add_file): Return reference to new input argument.
3783 (Input_file_lib::add_file): Likewise.
3784 (Input_arguments::add_file): Likewise.
3785 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3786 * script.cc (Parser_closure::Parser_closure): Add script_info
3787 parameter; adjust all callers.
3788 (Parser_closure::script_info): New function.
3789 (Parser_closure::script_info_): New data member.
3790 (read_input_script): Report scripts earlier to incremental info.
3791 (script_add_file): Set script_info in Input_argument.
3792 (script_add_library): Likewise.
3793 * script.h (Script_options::Script_info): Rewrite class.
3794
a869183f 37952011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3796
3797 * archive.cc (Library_base::should_include_member): Move
3798 method here from class Archive.
3799 (Archive::Archive): Initialize base class.
3800 (Archive::should_include_member): Move to base class.
3801 (Archive::do_for_all_unused_symbols): New function.
3802 (Add_archive_symbols::run): Remove redundant access to
3803 incremental_inputs.
3804 (Lib_group::Lib_group): Initialize base class.
3805 (Lib_group::do_filename): New function.
3806 (Lib_group::include_member): Pass pointer to Lib_group to
3807 report_object.
3808 (Lib_group::do_for_all_unused_symbols): New function.
3809 (Add_lib_group_symbols::run): Report archive information for
3810 incremental links.
3811 * archive.h (class Library_base): New base class.
3812 (class Archive): Derive from Library_base.
3813 (Archive::filename): Move to base class.
3814 (Archive::set_incremental_info): Likewise.
3815 (Archive::incremental_info): Likewise.
3816 (Archive::Should_include): Likewise.
3817 (Archive::should_include_member): Likewise.
3818 (Archive::Armap_entry): Remove.
3819 (Archive::Unused_symbol_iterator): Remove.
3820 (Archive::unused_symbols_begin): Remove.
3821 (Archive::unused_symbols_end): Remove.
3822 (Archive::do_filename): New function.
3823 (Archive::do_get_mtime): New function.
3824 (Archive::do_for_all_unused_symbols): New function.
3825 (Archive::task_): Move to base class.
3826 (Archive::incremental_info_): Likewise.
3827 (class Lib_group): Derive from Library_base.
3828 (Lib_group::do_filename): New function.
3829 (Lib_group::do_get_mtime): New function.
3830 (Lib_group::do_for_all_unused_symbols): New function.
3831 (Lib_group::task_): Move to base class.
3832 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3833 function.
3834 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3835 function.
3836 * incremental.cc (Incremental_inputs::report_archive_begin):
3837 Use Library_base; call library's get_mtime; add incremental inputs
3838 entry before members.
3839 (class Unused_symbol_visitor): New class.
3840 (Incremental_inputs::report_archive_end): Use Library_base; use
3841 visitor class to record unused symbols; don't add incremental inputs
3842 entry after members.
3843 (Incremental_inputs::report_object): Use Library_base.
3844 * incremental.h
3845 (Incremental_archive_entry::Incremental_archive_entry): Remove
3846 unused Archive parameter.
3847 (Incremental_inputs::report_archive_begin): Use Library_base.
3848 (Incremental_inputs::report_archive_end): Likewise.
3849 (Incremental_inputs::report_object): Likewise.
3850 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3851 function.
3852 * object.h (Object::for_all_global_symbols): New function.
3853 (Object::do_for_all_global_symbols): New function.
3854 (Sized_relobj::do_for_all_global_symbols): New function.
3855 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3856 function.
3857 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3858 function.
3859
61ab3e40
ILT
38602011-03-27 Ian Lance Taylor <iant@google.com>
3861
3862 * archive.cc (Archive::interpret_header): Return -1 if something
3863 goes wrong. Change callers accordingly.
3864
30e1f9e6
CC
38652011-03-25 Cary Coutant <ccoutant@google.com>
3866
3867 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3868 * testsuite/Makefile.in: Regenerate.
3869
9370ce59 38702011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3871
3872 * plugin.cc (get_view): New.
3873 (Plugin::load): Pass get_view to the plugin.
3874 (Plugin_manager::get_view): New.
3875
9312bb0a
ILT
38762011-03-21 Ian Lance Taylor <iant@google.com>
3877
3878 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3879 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3880
7e12ba9e
ST
38812011-03-21 Sriraman Tallam <tmsriram@google.com>
3882
3883 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3884 Change == to -eq.
3885 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3886 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3887 Change == to -eq.
3888 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3889 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3890
fd7a005d
ILT
38912011-03-14 Ian Lance Taylor <iant@google.com>
3892
3893 * script-sections.cc (Sort_output_sections::script_compare):
3894 Rename from is_before, change return type.
3895 (Sort_output_sections::operator()): Adjust accordingly.
3896
ed16fd1b
ILT
38972011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3898
3899 PR gold/12572
3900 * testsuite/odr_violation2.cc: Add comment to make all error line
3901 numbers double digits.
3902 * testsuite/debug_msg.sh: Adjust expected errors.
3903
71ff8986
ILT
39042011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3905
3906 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3907 but mark earlier ones as non-canonical
3908 (offset_to_iterator): Update search target and example
3909 (do_addr2line): Return extra lines in a vector*
3910 (format_file_lineno): Extract from do_addr2line
3911 (one_addr2line): Add vector* out-param
3912 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3913 when a lineno entry appeared last for its instruction
3914 (Dwarf_line_info): Add vector* out-param
3915 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3916 * symtab.cc (Odr_violation_compare): Include the lineno in the
3917 comparison again.
3918 (linenos_from_loc): New. Combine the canonical line for an
3919 address with its other lines.
3920 (True_if_intersect): New. Helper functor to make
3921 std::set_intersection a query.
3922 (detect_odr_violations): Compare sets of lines instead of just
3923 one line for each function. This became less deterministic, but
3924 has fewer false positives.
3925 * symtab.h: Declarations.
3926 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3927 mix an optimized and non-optimized object in the same binary
3928 (odr_violation2.so): Same.
3929 * testsuite/Makefile.in: Regenerate from Makefile.am.
3930 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3931 * testsuite/debug_msg.sh: Update line numbers and add
3932 assertions.
3933 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3934 non-optimized context.
3935 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3936 isn't inlined, and use OdrDerived in an optimized context.
3937 * testsuite/odr_header1.h: Defines OdrDerived, where
3938 optimization will change the
3939 first-instruction-in-the-destructor's file and line number.
3940 * testsuite/odr_header2.h: Defines OdrBase.
3941
a19fefdc
ILT
39422011-03-09 Ian Lance Taylor <iant@google.com>
3943
3944 * fileread.cc (File_read::clear_views): Don't delete the whole
3945 file view.
3946
ecb351e9
ILT
39472011-03-08 Ian Lance Taylor <iant@google.com>
3948
3949 PR gold/12525
3950 * fileread.cc: #include <climits>.
3951 (GOLD_IOV_MAX): Define.
3952 (File_read::read_multiple): Limit number of entries by iov_max.
3953 * fileread.h (class File_read): Always set max_readv_entries to
3954 128.
3955
b821d13c
ILT
39562011-03-07 Ian Lance Taylor <iant@google.com>
3957
3958 PR gold/12525
3959 * options.h (class General_options): Add -dy and -dn.
3960
89243142
CC
39612011-03-02 Cary Coutant <ccoutant@google.com>
3962
3963 * testsuite/script_test_9.t: Add TLS segment.
3964
d0773f31
ILT
39652011-03-02 Simon Baldwin <simonb@google.com>
3966
3967 * configure.ac: Add check for gnu_indirect_function support in
3968 the toolchain building binutils.
3969 * configure: Rebuild.
3970
9370ce59 39712011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3972
3973 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3974 plugin only symbols.
3975 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3976 in plugin files as not needed in the symbol table.
3977
4cf7a849
ST
39782011-02-11 Sriraman Tallam <tmsriram@google.com>
3979
3980 * output.cc (Output_section::add_input_section): Delay fill
3981 generation for section ordering.
3982
b578bd7d
ILT
39832011-02-09 Ian Lance Taylor <iant@google.com>
3984
3985 PR gold/12316
3986 * object.h (class Sized_relobj): Remove clear_local_symbols.
3987 * reloc.cc (Sized_relobj::do_relocate): Don't call
3988 clear_local_symbols.
3989
9370ce59 39902011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3991
3992 * plugin.cc (is_visible_from_outside): Return true for symbols
3993 in the -u option.
3994
55382fb7
ILT
39952011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3996
3997 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3998 filename.
3999
4e271fff
ST
40002011-02-02 Sriraman Tallam <tmsriram@google.com>
4001
4002 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 4003 to std::string.
4e271fff 4004 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 4005 section_name to be std::string.
4e271fff
ST
4006 (is_function_ctor_or_dtor): Change type of parameter to std::string.
4007
d433c3ac
ILT
40082011-01-25 Ian Lance Taylor <iant@google.com>
4009
4010 * script.cc (script_add_extern): Rewrite to use
4011 add_symbol_reference.
4012
880473a6
DK
40132011-01-25 Doug Kwan <dougkwan@google.com>
4014
d433c3ac 4015 * icf.cc (get_section_contents): Always lock section's object.
880473a6 4016
f30f86fa
ILT
40172011-01-24 Ian Lance Taylor <iant@google.com>
4018
4019 * options.h (class General_options): Accept
4020 --no-detect-odr-violations.
4021
8e51a0b9
ILT
40222011-01-24 Ian Lance Taylor <iant@google.com>
4023
4024 * version.cc (version_string): Bump to 1.11.
4025
0f3b89d8
ILT
40262011-01-24 Ian Lance Taylor <iant@google.com>
4027
4028 * plugin.cc (class Plugin_rescan): Define new class.
4029 (Plugin_manager::claim_file): Set any_claimed_.
4030 (Plugin_manager::save_archive): New function.
4031 (Plugin_manager::save_input_group): New function.
4032 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
4033 necessary.
4034 (Plugin_manager::new_undefined_symbol): New function.
4035 (Plugin_manager::rescan): New function.
4036 (Plugin_manager::rescannable_defines): New function.
4037 (Plugin_manager::add_input_file): Set any_added_.
4038 * plugin.h (class Plugin_manager): define new fields rescannable_,
4039 undefined_symbols_, any_claimed_, and any_added_. Declare
4040 Plugin_rescan as friend. Declare new functions.
4041 (Plugin_manager::Rescannable): Define type.
4042 (Plugin_manager::Rescannable_list): Define type.
4043 (Plugin_manager::Undefined_symbol_list): Define type.
4044 (Plugin_manager::Plugin_manager): Initialize new fields.
4045 * archive.cc (Archive::defines_symbol): New function.
4046 (Add_archive_symbols::run): Pass archive to plugins if any.
4047 * archive.h (class Archive): Declare defines_symbol.
4048 * readsyms.cc (Input_group::~Input_group): New function.
4049 (Finish_group::run): Pass input_group to plugins if any.
4050 * readsyms.h (class Input_group): Declare destructor.
4051 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
4052 any.
4053
3bb951e5
ILT
40542011-01-10 Ian Lance Taylor <iant@google.com>
4055
4056 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
4057 section as relro.
4058 (Layout::set_segment_offsets): Reset increase_relro before calling
4059 set_section_addresses a second time.
4060
0aa45fac
CC
40612011-01-04 Cary Coutant <ccoutant@google.com>
4062
4063 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
4064 sections before NOBITS sections.
4065
0db46eb4
L
40662011-01-01 H.J. Lu <hongjiu.lu@intel.com>
4067
4068 * version.cc (print_version): Update copyright to 2011.
4069
829c9745
CC
40702010-12-23 Cary Coutant <ccoutant@google.com>
4071
4072 * output.h (Output_data_reloc::add_output_section): Pass OD instead
4073 of OS to this->add. Add OD parameter to second form of the function.
4074
7500420b
ILT
40752010-12-20 Ian Lance Taylor <iant@google.com>
4076
4077 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
4078 second of two consecutive entries with same offset.
4079
f8e9a930
RW
40802010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4081
4082 * testsuite/Makefile.am (ifuncmain2static_LDADD)
4083 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
4084 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
4085 to avoid unneeded links against $(LDADD).
4086 * testsuite/Makefile.in: Regenerate.
4087
2fbb4320
ILT
40882010-12-15 Ian Lance Taylor <iant@google.com>
4089
4090 PR gold/12324
4091 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
4092 for R_X86_64_32 and R_X86_64_PC32.
4093 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4094 ver_matching_def_pic.o.
4095 (ver_matching_def_pic.o): New target.
4096
fedb228d
RW
40972010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4098
4099 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4100 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4101 Move definition before File_read::View member definitions.
4102 (File_read::View::~View): Initialize and hold lock before
4103 updating current_mapped_bytes.
4104
9b547ce6
RW
41052010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4106
4107 * dwarf_reader.cc: Remove outdated comment.
4108 * gold-threads.cc: Fix typo in error message.
4109 * archive.cc: Fix typos in comments.
4110 * archive.h: Likewise.
4111 * arm-reloc-property.cc: Likewise.
4112 * arm-reloc-property.h: Likewise.
4113 * arm-reloc.def: Likewise.
4114 * arm.cc: Likewise.
4115 * attributes.h: Likewise.
4116 * cref.cc: Likewise.
4117 * ehframe.cc: Likewise.
4118 * fileread.h: Likewise.
4119 * gold.h: Likewise.
4120 * i386.cc: Likewise.
4121 * icf.cc: Likewise.
4122 * incremental.h: Likewise.
4123 * int_encoding.cc: Likewise.
4124 * layout.h: Likewise.
4125 * main.cc: Likewise.
4126 * merge.h: Likewise.
4127 * object.cc: Likewise.
4128 * object.h: Likewise.
4129 * options.cc: Likewise.
4130 * readsyms.cc: Likewise.
4131 * reduced_debug_output.cc: Likewise.
4132 * reloc.cc: Likewise.
4133 * script-sections.cc: Likewise.
4134 * sparc.cc: Likewise.
4135 * symtab.h: Likewise.
4136 * target-reloc.h: Likewise.
4137 * target.cc: Likewise.
4138 * target.h: Likewise.
4139 * timer.cc: Likewise.
4140 * timer.h: Likewise.
4141 * x86_64.cc: Likewise.
4142
83e17bd5
CC
41432010-12-09 Cary Coutant <ccoutant@google.com>
4144
4145 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4146 stack.
4147 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4148 parameter; change all callers.
4149 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4150 * options.h (warn_execstack): New option.
4151
017257f8
DK
41522010-12-07 Doug Kwan <dougkwan@google.com>
4153
4154 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4155 like function call relocations.
4156
c20cbc06
ILT
41572010-12-07 Ian Lance Taylor <iant@google.com>
4158
4159 * archive.cc (Archive::get_elf_object_for_member): Permit
4160 punconfigured to be NULL.
4161 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4162 (Archive::include_member): Pass NULL to get_elf_object_for_member
4163 if we searched for the archive and this is the first included
4164 object.
4165
4dbfafcc
ILT
41662010-12-01 Ian Lance Taylor <iant@google.com>
4167
4168 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4169 track_relocs_type_ field.
4170 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4171 Set track_relocs_type_.
4172 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4173 contents when using RELA relocs.
4174 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4175 reloc_map_.
4176 * reloc.cc (Track_relocs::next_addend): New function.
4177 * reloc.h (class Track_relocs): Declare next_addend.
4178
e5e19edd
ILT
41792010-12-01 Ian Lance Taylor <iant@google.com>
4180
4181 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4182 virtual destructor.
4183
9a5ce24c
ILT
41842010-12-01 Ian Lance Taylor <iant@google.com>
4185
4186 * README: Update compilers known to work and fail.
4187
c7791212
NC
41882010-11-23 Matthias Klose <doko@ubuntu.com>
4189
4190 * configure.in: For --enable-gold, handle value `default' instead of
4191 `both*'. Always install ld as ld.bfd, install as ld if gold is
4192 not the default.
4193 * configure: Regenerate.
4194
0ad220c9
DK
41952010-11-18 Doug Kwan <dougkwan@google.com>
4196
4197 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4198 and right_alignment to be zero. Store result alignment only if it is
4199 greater than existing alignment.
4200
ab8056e0
CC
42012010-11-16 Cary Coutant <ccoutant@google.com>
4202
4203 PR gold/12220
4204 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4205 Check for ".zdebug_line".
4206
fd064a5b
CC
42072010-11-16 Doug Kwan <dougkwan@google.com>
4208 Cary Coutant <ccoutant@google.com>
4209
4210 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4211 by reference; adjust all callers.
4212 * output.cc (Output_segment::set_section_addresses): Adjust references
4213 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4214 list is empty.
4215 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4216 end at page boundary.
4217
6fc6ea19
CC
42182010-11-16 Cary Coutant <ccoutant@google.com>
4219
4220 PR gold/12220
4221 * layout.cc (Layout::choose_output_section): Transform names of
4222 compressed sections even when using a script with a SECTIONS clause.
4223 (Layout::output_section_name): Remove code to transform
4224 compressed debug section names.
4225 * output.cc (Output_section::add_input_section): Use uncompressed
4226 section size when tracking input sections.
4227
95a2c8d6
RS
42282010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4229
4230 * symtab.h (Symbol::NON_PIC_REF): Remove.
4231 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4232 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4233 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4234 (Symbol::use_plt_offset): Take a flags argument and pass it
4235 directly to needs_dynamic_reloc. Restrict check for undefined
4236 weak symbols to function calls.
4237 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4238 (Target_arm::Scan::global): Use it.
4239 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4240 (Target_arm::Relocate::relocate): Likewise.
4241 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4242 parameter with an r_type parameter. Use get_reference_flags
4243 to get the flags.
4244 (Target_arm::Relocate::relocate): Update accordingly.
4245 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4246 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4247 (Target_i386::Scan::global): Likewise.
4248 (Target_i386::Relocate::relocate): Likewise.
4249 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4250 parameter with an r_type parameter. Use get_reference_flags
4251 to get the flags.
4252 (Target_i386::Relocate::relocate): Update accordingly.
4253 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4254 (Target_powerpc::Scan::global): Use it.
4255 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4256 (Target_powerpc::Relocate::relocate): Likewise.
4257 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4258 (Target_sparc::Scan::global): Use it.
4259 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4260 (Target_sparc::Relocate::relocate): Likewise.
4261 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4262 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4263 (Target_x86_64::Scan::global): Likewise.
4264 (Target_x86_64::Relocate::relocate): Likewise.
4265
f625ae50
DK
42662010-11-08 Doug Kwan <dougkwan@google.com>
4267 Cary Coutant <ccoutant@google.com>
4268
4269 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4270 (Arm_exidx_merge_section::section_contents_): New data member.
4271 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4272 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4273 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4274 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4275 in parameters instead of calling Object::section_contents without
4276 locking.
4277 (Arm_output_section::group_section): New parameter TASK. Pass it
4278 to callees that need locking objects.
4279 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4280 to lock EXIDX input sections. Fix a formatting issue. Call
4281 Arm_exidx_merged_section::build_contents to create merged section
4282 contents.
4283 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4284 to lock object of stub table owner.
4285 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4286 TEXT_SIZE to initialize data member TEXT_SIZE_.
4287 (Arm_exidx_input_section::addralign): Fix typo in comment.
4288 (Arm_exidx_input_section::text_size): New method.
4289 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4290 that require locking objects. Lock objects before scanning for stubs
4291 and updating local symbols.
4292 (Arm_input_section<big_endian>::init): Copy contents of original
4293 input section.
2e702c99 4294 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4295 original input section instead of calling Object::section_contents
4296 without locking.
4297 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4298 size without calling Object::section_size().
4299 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4300 for size. Allocate a buffer for merged EXIDX entries.
4301 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4302 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4303 building code to Arm_exidx_merged_section::build_contetns. Write
4304 out contetns in buffer instead of building it on the fly.
4305 (Arm_relobj::make_exidx_input_section): Also pass text section size
4306 to Arm_exidx_input_section constructor.
4307 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4308 (Arm_dynobj::do_read_symbols): Fix memory leak.
4309 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4310 * target.h: (class Task): Add forward declaration.
4311 (Target::relax): Add new parameter TASK and pass it to
4312 Target::do_relax().
4313 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4314
5f9bcf58
CC
43152010-11-05 Cary Coutant <ccoutant@google.com>
4316
4317 PR gold/10708
4318 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4319 object when reading from the file.
4320 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4321 second layout pass.
4322 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4323 when reading section contents.
4324 (get_section_contents): Likewise.
4325 (icf::find_identical_sections): Likewise.
4326 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4327 object when reading from the file.
4328 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4329 the object when doing deferred section layout.
4330
e597fa08
NC
43312010-11-03 Nick Clifton <nickc@redhat.com>
4332
4333 PR gold/12001
4334 * script.h (class Symbol_assignment: name): New member. Returns
4335 the name of the symbol.
4336 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4337 Returns true if the given symbol name is on the list of
4338 assignments wating to be processed.
4339 * archive.cc (should_incldue_member): If the symbol is undefined,
4340 check to see if it is on the list of symbols pending assignment.
4341
3f9a3278
ILT
43422010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4343
4344 * script-sections.cc (Script_sections::find_memory_region): Check
4345 for a NULL output section pointer.
4346
d06fb4d1
DK
43472010-10-29 Doug Kwan <dougkwan@google.com>
4348
4349 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4350 Output_section::add_relaxed_input_section.
4351 * output.cc (Output_section::add_relaxed_input_section): Add new
4352 arguments LAYOUT and NAME. Set section order index.
4353 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4354 Copy section order index.
4355 * output.h (Output_section::add_relaxed_input_section): Add new
4356 arguments LAYOUT and NAME.
4357
90e24de5
ILT
43582010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4359
4360 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4361 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4362 * testsuite/Makefile.in: Regenerate.
4363
c9484ea5
DK
43642010-10-20 Doug Kwan <dougkwan@google.com>
4365
4366 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4367 without SHF_LINK_ORDER flags.
4368 * layout.cc (Layout::choose_output_section): Do not filter
4369 SHF_LINK_ORDER flag in a relocatable link.
4370
5bc2f5be
CC
43712010-10-17 Cary Coutant <ccoutant@google.com>
4372
4373 * output.h (Output_segment::set_section_addresses): Change function
4374 signature. Update all callers.
4375 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4376 sections.
4377 (Output_segment::set_section_addresses): Align after last TLS
4378 section. Add padding before last relro section instead of after.
4379
0c91cf04
DK
43802010-10-17 Doug Kwan <dougkwan@google.com>
4381
4382 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4383 GOT output section to be writable.
4384
8c21d9d3
CC
43852010-10-14 Cary Coutant <ccoutant@google.com>
4386
4387 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4388 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4389 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4390 mode.
4391 * incremental.cc (report_command_line): Ignore all forms of
4392 --incremental.
4393 * layout.cc (Layout::Layout): Check parameters for incremental link
4394 mode.
4395 * options.cc (General_options::parse_incremental): New function.
4396 (General_options::parse_no_incremental): New function.
4397 (General_options::parse_incremental_full): New function.
4398 (General_options::parse_incremental_update): New function.
4399 (General_options::incremental_mode_): New data member.
4400 (General_options::finalize): Check incremental_mode_.
4401 * options.h (General_options): Update help text for --incremental.
4402 Add --no-incremental, --incremental-full, --incremental-update.
4403 (General_options::Incremental_mode): New enum type.
4404 (General_options::incremental_mode): New function.
4405 (General_options::incremental_mode_): New data member.
4406 * parameters.cc (Parameters::incremental_mode_): New data member.
4407 (Parameters::set_options): Set incremental_mode_.
4408 (Parameters::set_incremental_full): New function.
4409 (Parameters::incremental): New function.
4410 (Parameters::incremental_update): New function.
4411 (set_parameters_incremental_full): New function.
4412 * parameters.h (Parameters::set_incremental_full): New function.
4413 (Parameters::incremental): New function.
4414 (Parameters::incremental_update): New function.
4415 (Parameters::incremental_mode_): New data member.
4416 (set_parameters_incremental_full): New function.
4417 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4418 incremental link mode.
4419 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4420 (Sized_relobj::do_relocate_sections): Likewise.
4421 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4422 option.
4423 * testsuite/Makefile.in: Regenerate.
4424 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4425
bb32aa18 44262010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4427
4428 * script-sections.h (class Script_sections): Make
4429 Sections_elements typedef public.
4430 * script-sections.cc (class Sort_output_sections): Add elements_
4431 field. Add constructor which sets it; change all callers.
4432 (Sort_output_sections::is_before): New function.
4433 (Sort_output_sections::operator()): Call is_before.
4434 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4435 conditional.
4436 * testsuite/script_test_10.sh: New test. Test script section
4437 order.
4438 * testsuite/script_test_10.t: Likewise.
4439 * testsuite/script_test_10.s: Likewise.
4440 * testsuite/Makefile.am: Wrap the cross linker tests and the
4441 common tests into NATIVE_OR_CROSS_LINKER.
4442 (check_SCRIPTS): Add script_test_10.sh.
4443 (check_DATA): Add script_test_10.stdout.
4444 (script_test_10.o, script_test_10): New targets.
4445 (script_test_10.stdout): New target.
4446 * configure, testsuite/Makefile.in: Regenerate.
4447
3cef7179
ILT
44482010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4449
4450 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4451 error for the deprecated relocations.
4452 (Target_arm::Scan::global): Likewise.
4453 (Target_arm::Relocate::relocate): Likewise.
4454
7411e9a8
RS
44552010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4456
4457 * fileread.cc (Input_file::find_file): Initialize *found_name
4458 and *namep when using the fallback search for case 4.
4459
6a9da32a
CC
44602010-10-11 Cary Coutant <ccoutant@google.com>
4461
4462 * options.h (class General_options): Redefine -z lazy as an alias for
4463 the negation of -z now.
4464
ac897c20
ILT
44652010-10-11 Ian Lance Taylor <iant@google.com>
4466
4467 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4468 binding.
4469
ea5cae92
NC
44702010-10-06 Nick Clifton <nickc@redhat.com>
4471
4472 * script-sections.cc(class Memory_region): Remove
4473 current_lma_offset_ field. Rename current_vma_offset_ to
4474 current_offset_. Add last_section_ field.
4475 (Memory_region::get_current_vma_address): Rename to
4476 get_current_address.
4477 (Memory_region::get_current_lma_address): Delete.
4478 (Memory_region::increment_vma_offset): Rename to
4479 increment_offset.
4480 (Memory_region::increment_lma_offset): Delete.
4481 (Memory_region::attributes_compatible): New method. Returns
4482 true if the provided section is compatible with the region.
4483 (Memory_region::get_last_section): New method. Returns the last
4484 section to use the region.
4485 (Memory_region::set_last_section): New method. Stores the last
4486 section to use the region.
4487 (Script_sections::block_in_region): New method. Returns true if
4488 a block of memory is contained within a region.
4489 (Script_sections::find_memory_region): New method. Locates a
4490 memory region to be used to set a VMA or LMA address.
4491 (Output_section_definition::set_section_addresses): Add code to
4492 check for addresses set by memory regions.
4493 (Output_segment::set_section_addresses): Remove memory region
4494 walking code.
4495 (Script_sections::create_segment): Add a warning if a header
4496 segment is created outside of any region.
4497 * script-sections.h (class Script_sections): Add prototypes for
4498 find_memory_region and block_in_region methods.
4499 * testsuite/memory_test.s: Use .long instead of .word.
4500 * testsuite/memory_test.t: Add some more output sections.
4501 * testsuite/memory_test.sh: Update expected output.
4502
a9bfd952
DK
45032010-10-02 Doug Kwan <dougkwan@google.com>
4504
4505 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4506 defintion to symtab.h
4507 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4508 declaration to defintion.
4509
bacff3ab
NC
45102010-10-01 Nick Clifton <nickc@redhat.com>
4511
4512 * expression.cc (eval): Replace dummy argument with NULL.
4513 (eval_maybe_dot): Check for a NULL result section pointer.
4514 (Symbol_expression::value): Likewise.
4515 (Dot_expression::value): Likewise.
4516 (BINARY_EXPRESSION): Likewise.
4517 (Max_expression::value): Likewise.
4518 (Min_expression::value): Likewise.
4519 (Absolute_expression::value): Likewise.
4520 (Addr_expression::value_from_output_section): Likewise.
4521 (Loaddddr_expression::value_from_output_section): Likewise.
4522 (Segment_start_expression::value): Likewise.
4523 * script-sections.cc
4524 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4525 argument with NULL.
4526 (Sections_elememt_dot_assignment::set_section_addresses):
4527 Likewise.
4528 (Output_data_expression::do_write_to_buffer): Likewise.
4529 (Output_section_definition::finalize_symbols): Likewise.
4530 (Output_section_definition::set_section_addresses): Likewise.
4531
f81bc8b5
DK
45322010-09-30 Doug Kwan <dougkwan@google.com>
4533
4534 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4535
c95e9f27
ST
45362010-09-28 Sriraman Tallam <tmsriram@google.com>
4537
4538 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4539 function.
c95e9f27
ST
4540 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4541 virtual function.
4542 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4543 virtual function.
4544 * icf.cc (get_section_contents): Inline merge sections only when
4545 target allows it.
4546
3cac54d2
RW
45472010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4548
4549 * configure: Regenerate.
4550
2904037a
ILT
45512010-09-17 Ian Lance Taylor <iant@google.com>
4552
4553 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4554 * testsuite/Makefile.am (memory_test.o): New target.
4555 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4556 memory_test.t.
4557 * testsuite/Makefile.in: Rebuild.
2904037a 4558
bca7fb63
DK
45592010-09-17 Doug Kwan <dougkwan@google.com>
4560
4561 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4562 defintion if relocation uses GOT entries of the symbol.
4563 * testsuite/icf_safe_test.sh: Fix test.
4564 * testsuite/icf_safe_so_test.sh: Fix test.
4565
4ef28648
CC
45662010-09-16 Cary Coutant <ccoutant@google.com>
4567
4568 * script_sections.cc (class Memory_region): Remove "NULL" from
4569 vector initializations.
4570
793990de
CC
45712010-09-15 Cary Coutant <ccoutant@google.com>
4572
4573 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4574 Resolve forwarding symbols.
4575
81e015e2
DK
45762010-09-15 Doug Kwan <dougkwan@google.com>
4577
4578 * gold/testsuite/script_test_3.t: Add ARM special sections.
4579 * gold/testsuite/script_test_4.t: Same.
4580 * gold/testsuite/script_test_5.t: Same.
4581 * gold/testsuite/script_test_6.t: Same.
4582 * gold/testsuite/script_test_7.t: Same.
4583 * gold/testsuite/script_test_7.t: Same.
4584 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4585
36171d64
CC
45862010-09-14 Cary Coutant <ccoutant@google.com>
4587
4588 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4589 (Target_x86_64::Relocate::relocate_tls): Replace check for
4590 saw_tls_block_reloc_ with test for executable section.
4591
d89051bd
CC
45922010-09-12 Cary Coutant <ccoutant@google.com>
4593
4594 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4595 position-independent executables to shared libraries need dynamic
4596 relocations.
4597 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4598 position-independent executables.
4599 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4600 * testsuite/Makefile.in: Regenerate.
4601
fca41f0f
NC
46022010-09-10 Nick Clifton <nickc@redhat.com>
4603
4604 PR gold/11997
4605 * testsuite/memory_test.t: Discard any sections that are not
4606 needed.
4607
6695e4b3
L
46082010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4609
4610 PR gold/11996
4611 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4612 "This::" to work around a bug in gcc 4.2.
4613
4614 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4615
0f72bf6f
RÁE
46162010-09-09 Rafael Espindola <espindola@google.com>
4617
4618 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4619 sections with different PF_X flags in the same segment.
4620 (Layout::find_first_load_seg): Search all segments to find the first
4621 one.
4622 * options.h (rosegment): New.
4623
46242010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4625
05a79166 4626 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4627
aa98ff75
DK
46282010-09-08 Doug Kwan <dougkwan@google.com>
4629
4630 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4631 (Arm_relobj::do_relocate_sections): Add new parameter for output
4632 file to match the parent.
4633 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4634 of local symbols instead of input values. Update code to track
4635 changes in gold::relocate_section.
4636 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4637 (Sized_relobj::compute_final_local_value_internal): New methods.
4638 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4639 body into private version of Sized_relobj::compute_final_local_value.
4640 Call the inline method.
4641 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4642 merged symbol value if there is one.
4643 (Symbol_value::has_output_value): New method defintiion.
4644 (Sized_relobj::Compute_final_local_value_status): New enum type.
4645 (Sized_relobj::compute_final_local_value): New methods.
4646 (Sized_relobj::compute_final_local_value_internal): New methods.
4647 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4648 and arm_cortex_a8.sh.
4649 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4650 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4651 New tests.
4652 * Makefile.in: Regenerate.
4653 * testsuite/arm_bl_out_of_range.s: Update test.
4654 * testsuite/thumb_bl_out_of_range.s: Ditto.
4655 * testsuite/thumb_blx_out_of_range.s: Ditto.
4656 * testsuite/arm_branch_out_of_range.sh: New file.
4657 * testsuite/arm_cortex_a8.sh: Ditto.
4658 * testsuite/arm_cortex_a8_b.s: Ditto.
4659 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4660 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4661 * testsuite/arm_cortex_a8_bl.s: Ditto.
4662 * testsuite/arm_cortex_a8_blx.s: Ditto.
4663 * testsuite/arm_cortex_a8_local.s: Ditto.
4664 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4665 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4666
05a79166
L
46672010-09-08 Rafael Espindola <espindola@google.com>
4668
4669 * Makefile.am (memory_test.stdout): Run readelf with -W.
4670 * Makefile.in: Regenerate.
4671 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4672 64 bit output.
4673
33dbc701
RÁE
46742010-09-08 Rafael Espindola <espindola@google.com>
4675
4676 * script-sections.cc (Script_sections::add_memory_region): Convert
4677 field precision to int.
4678 * script.cc (script_set_section_region, script_set_section_region):
4679 Convert field precision to int.
4680
731ca54a
RÁE
46812010-09-08 Rafael Espindola <espindola@google.com>
4682
4683 * arm.cc (do_finalize_sections): Create the __exidx_start and
4684 __exdix_end symbols even when the section is missing.
4685
7f8cd844
NC
46862010-09-08 Nick Clifton <nickc@redhat.com>
4687
4688 * README: Remove claim that MEMORY is not supported.
4689 * expression.cc (script_exp_function_origin)
4690 (script_exp_function_length): Move from here to ...
4691 * script.cc: ... here.
4692 (script_set_section_region, script_add_memory)
4693 (script_parse_memory_attr, script_include_directive): New
4694 functions.
4695 * script-sections.cc
4696 (class Memory_region): New class.
4697 (class Output_section_definition): Add set_memory_region,
4698 set_section_vma, set_section_lma and get_section_name methods.
4699 (class Script_Sections): Add add_memory_region,
4700 find_memory_region, find_memory_region_origin,
4701 find_memory_region_length and set_memory_region methods.
4702 Have set_section_addresses method walk the list of set memory
4703 regions.
4704 Extend the print methos to display memory regions.
4705 * script-sections.h: Add prototypes for new methods.
4706 Add enum for MEMORY region attributes.
4707 * yyscript.y: Add support for parsing MEMORY regions.
4708 * script-c.h: Add prototypes for new functions.
4709 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4710 * testsuite/Makefile.in: Regenerate.
4711 * testsuite/memory_test.sh: New script.
4712 * testsuite/memory_test.s: New assembler source file.
4713 * testsuite/memory_test.t: New linker script.
4714
a4649286
DK
47152010-08-27 Doug Kwan <dougkwan@google.com>
4716
4717 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4718 reference override an existing dynamic weak reference.
4719 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4720 * testsuite/Makefile.in: Regenerate.
4721 * testsuite/dyn_weak_ref.sh: New file.
4722 * testsuite/dyn_weak_ref_1.c: Ditto.
4723 * testsuite/dyn_weak_ref_2.c: Ditto.
4724
b56648ad
ILT
47252010-08-27 Ian Lance Taylor <iant@google.com>
4726
4727 * incremental.h (class Incremental_input_entry): Add virtual
4728 destructor.
4729
809313cb
ILT
47302010-08-27 Ian Lance Taylor <iant@google.com>
4731
4732 * testsuite/start_lib_test_3.c: Mark t3 as used.
4733
11e32464
NC
47342010-08-27 Nick Clifton <nickc@redhat.com>
4735
4736 * options.cc (version_script): Fix small typo in previous
4737 whitespace tidyup.
4738
ca09d69a
NC
47392010-08-25 Nick Clifton <nickc@redhat.com>
4740
4741 * archive.cc: Formatting fixes: Remove whitespace between
4742 typename and following asterisk. Remove whitespace between
4743 function name and opening parenthesis.
4744 * archive.h: Likewise.
4745 * arm.cc: Likewise.
4746 * attributes.cc: Likewise.
4747 * attributes.h: Likewise.
4748 * common.cc: Likewise.
4749 * copy-relocs.cc: Likewise.
4750 * dirsearch.h: Likewise.
4751 * dynobj.cc: Likewise.
4752 * ehframe.cc: Likewise.
4753 * ehframe.h: Likewise.
4754 * expression.cc: Likewise.
4755 * fileread.cc: Likewise.
4756 * fileread.h: Likewise.
4757 * gc.h: Likewise.
4758 * gold-threads.cc: Likewise.
4759 * gold.cc: Likewise.
4760 * i386.cc: Likewise.
4761 * icf.h: Likewise.
4762 * incremental-dump.cc: Likewise.
4763 * incremental.cc: Likewise.
4764 * layout.cc: Likewise.
4765 * layout.h: Likewise.
4766 * main.cc: Likewise.
4767 * merge.cc: Likewise.
4768 * merge.h: Likewise.
4769 * object.cc: Likewise.
4770 * object.h: Likewise.
4771 * options.cc: Likewise.
4772 * options.h: Likewise.
4773 * output.cc: Likewise.
4774 * output.h: Likewise.
4775 * plugin.cc: Likewise.
4776 * plugin.h: Likewise.
4777 * powerpc.cc: Likewise.
4778 * reloc.cc: Likewise.
4779 * script-c.h: Likewise.
4780 * script-sections.cc: Likewise.
4781 * script.cc: Likewise.
4782 * stringpool.cc: Likewise.
4783 * symtab.cc: Likewise.
4784 * symtab.h: Likewise.
4785 * target.cc: Likewise.
4786 * timer.cc: Likewise.
4787 * timer.h: Likewise.
4788 * version.cc: Likewise.
4789 * x86_64.cc: Likewise.
4790
b8fa8750
NC
47912010-08-24 Nick Clifton <nickc@redhat.com>
4792
4793 PR 11899
4794 * layout.cc (segment_precedes): Sort segments by their physical
4795 addresses, if they have been set.
4796
9919d93b
CC
47972010-08-23 Cary Coutant <ccoutant@google.com>
4798
4799 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4800 symbols data.
4801 (Lib_group::include_member): Unlock object after deleting its
4802 symbols data.
4803 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4804 the bug fixed here.
4805
97b4be1c
CC
48062010-08-19 Neil Vachharajani <nvachhar@google.com>
4807 Cary Coutant <ccoutant@google.com>
4808
4809 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4810 constructor, and set_blocker.
4811 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4812 readsyms_blocker_.
4813 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4814 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4815 * testsuite/Makefile.am (start_lib_test): New test case.
4816 * testsuite/Makefile.in: Regenerate.
4817 * testsuite/start_lib_test_main.c: New file.
4818 * testsuite/start_lib_test_1.c: New file.
4819 * testsuite/start_lib_test_2.c: New file.
4820 * testsuite/start_lib_test_3.c: New file.
4821
dd0b1884
ILT
48222010-08-19 Ian Lance Taylor <iant@google.com>
4823
4824 * Makefile.in: Rebuild with automake 1.11.1.
4825 * aclocal.m4: Likewise.
4826 * testsuite/Makefile.in: Likewise.
4827
7223e9ca
ILT
48282010-08-19 Ian Lance Taylor <iant@google.com>
4829
4830 PR 10893
4831 * i386.cc (class Output_data_plt_i386): Update declarations.
4832 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4833 local_ifuncs_ fields.
4834 (Target_i386::do_plt_section_for_global): New function.
4835 (Target_i386::do_plt_section_for_local): New function.
4836 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4837 parameter; change all callers. Initialize global_ifuncs_ and
4838 local_ifuncs_. If doing a static link define __rel_iplt_start and
4839 __rel_iplt_end.
4840 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4841 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4842 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4843 symbols.
4844 (Target_i386::make_plt_section): New function, broken out of
4845 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4846 (Target_i386::make_plt_entry): Call make_plt_section.
4847 (Target_i386::make_local_ifunc_plt_entry): New function.
4848 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4849 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4850 R_386_IRELATIVE to switch.
4851 (Target_i386::Scan::global): Likewise.
4852 (Target_i386::Relocate::relocate): Likewise.
4853 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4854 switch.
4855 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4856 (Target_x86_64::do_plt_section_for_global): New function.
4857 (Target_x86_64::do_plt_section_for_local): New function.
4858 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4859 parameter; change all callers. If doing a static link define
4860 __rela_iplt_start and __rela_iplt_end.
4861 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4862 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4863 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4864 to point to .plt.
4865 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4866 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4867 switch.
4868 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4869 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4870 R_X86_64_IRELATIVE to switch.
4871 (Target_x86_64::Scan::global): Likewise.
4872 (Target_x86_64::Relocate::relocate): Likewise.
4873 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4874 switch.
4875 * target.h (class Target): Add plt_section_for_global and
4876 plt_section_for_local functions. Add do_plt_section_for_global
4877 and do_plt_section_for_local virtual functions.
4878 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4879 clarifying comments.
4880 (Symbol::use_plt_offset): Handle IFUNC symbol.
4881 * object.cc (Sized_relobj::Sized_relobj): Initialize
4882 local_plt_offsets_.
4883 (Sized_relobj::local_has_plt_offset): New function.
4884 (Sized_relobj::local_plt_offset): New function.
4885 (Sized_relobj::set_local_plt_offset): New function.
4886 (Sized_relobj::do_count): Handle IFUNC symbol.
4887 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4888 a bit away from input_shndx_ field. Add set_is_func_symbol and
4889 is_ifunc_symbol functions.
4890 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4891 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4892 local_plt_offsets_ field.
4893 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4894 * output.h (class Output_section_data): Add non-const
4895 output_section function.
4896 (class Output_data_got): Update declarations.
4897 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4898 Add use_plt_offset parameter to global and local constructors.
4899 Change all callers. Change local_sym_index_ field to 31 bits.
4900 Change GSYM_CODE and CONSTANT_CODE accordingly.
4901 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4902 doing a static link don't set sh_link field.
4903 (Output_data_got::Got_entry::write): Use PLT offset if
4904 appropriate.
4905 (Output_data_got::add_global_plt): New function.
4906 (Output_data_got::add_local_plt): New function.
4907 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4908 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4909 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4910 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4911 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4912 IFUNC conditional.
4913 * testsuite/ifunc-sel.h: New file.
4914 * testsuite/ifuncmain1.c: New file.
4915 * testsuite/ifuncmain1vis.c: New file.
4916 * testsuite/ifuncmod1.c: New file.
4917 * testsuite/ifuncdep2.c: New file.
4918 * testsuite/ifuncmain2.c: New file.
4919 * testsuite/ifuncmain3.c: New file.
4920 * testsuite/ifuncmod3.c: New file.
4921 * testsuite/ifuncmain4.c: New file.
4922 * testsuite/ifuncmain5.c: New file.
4923 * testsuite/ifuncmod5.c: New file.
4924 * testsuite/ifuncmain6pie.c: New file.
4925 * testsuite/ifuncmod6.c: New file.
4926 * testsuite/ifuncmain7.c: New file.
4927 * configure, testsuite/Makefile.in: Rebuild.
4928
56f75c03
ILT
49292010-08-18 Ian Lance Taylor <iant@google.com>
4930
4931 * incremental.cc
4932 (Output_section_incremental_inputs::write_input_files): Add cast
4933 to avoid signed/unsigned comparison warning.
4934 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4935
55455f89
CC
49362010-08-12 Cary Coutant <ccoutant@google.com>
4937
4938 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4939
e2054bcb
ILT
49402010-08-13 Ian Lance Taylor <iant@google.com>
4941
4942 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4943
74f67560
DK
49442010-08-12 Cary Coutant <ccoutant@google.com>
4945 Doug Kwan <dougkwan@google.com>
4946
4947 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4948 defintion overrides non-weak undef, remember that the original undef
4949 is not weak.
4950 * symtab.cc (Symbol_table::sized_write_global): For undef without
4951 an original weak binding, set binding to global in output.
4952 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4953 * testsuite/Makefile.in: Regenerate.
4954 * testsuite/strong_ref_weak_def.sh: New file.
4955 * testsuite/strong_ref_weak_def_1.c: Ditto.
4956 * testsuite/strong_ref_weak_def_2.c: Ditto.
4957
d1238d12
CC
49582010-08-12 Cary Coutant <ccoutant@google.com>
4959
4960 * testsuite/incremental_test.sh: Rewrite.
4961 * testsuite/incremental_test_1.c: Rewrite.
4962 * testsuite/incremental_test_2.c: Rewrite.
4963
0e70b911
CC
49642010-08-12 Cary Coutant <ccoutant@google.com>
4965
4966 * arm.cc (Target_arm::got_size): Add const.
4967 (Target_arm::got_entry_count): New function.
4968 (Target_arm::plt_entry_count): New function.
4969 (Target_arm::first_plt_entry_offset): New function.
4970 (Target_arm::plt_entry_size): New function.
4971 (Output_data_plt_arm::entry_count): New function.
4972 (Output_data_plt_arm::first_plt_entry_offset): New function.
4973 (Output_data_plt_arm::get_plt_entry_size): New function.
4974 * i386.cc (Target_i386::got_size): Add const.
4975 (Target_i386::got_entry_count): New function.
4976 (Target_i386::plt_entry_count): New function.
4977 (Target_i386::first_plt_entry_offset): New function.
4978 (Target_i386::plt_entry_size): New function.
4979 (Output_data_plt_i386::entry_count): New function.
4980 (Output_data_plt_i386::first_plt_entry_offset): New function.
4981 (Output_data_plt_i386::get_plt_entry_size): New function.
4982 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4983 find_incremental_inputs_sections. Dump incremental_got_plt section.
4984 * incremental.cc: Include target.h.
4985 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4986 parameter. Adjust all callers. Find incremental_got_plt section.
4987 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4988 section.
4989 (Output_section_incremental_inputs::set_final_data_size): Calculate
4990 size of incremental_got_plt section.
4991 (Output_section_incremental_inputs::do_write): Write the
4992 incremental_got_plt section.
4993 (Got_plt_view_info): New struct.
4994 (Local_got_offset_visitor): New class.
4995 (Global_got_offset_visitor): New class.
4996 (Global_symbol_visitor_got_plt): New class.
4997 (Output_section_incremental_inputs::write_got_plt): New function.
4998 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4999 Add parameter. Adjust all callers.
5000 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5001 (Incremental_inputs::got_plt_section): New function.
5002 (Incremental_inputs::got_plt_section_): New data member.
5003 (Incremental_got_plt_reader): New class.
5004 * layout.cc (Layout::create_incremental_info_sections): Add the
5005 incremental_got_plt section.
5006 * object.h (Got_offset_list::get_list): New function.
5007 (Got offset_list::for_all_got_offsets): New function.
5008 (Sized_relobj::local_got_offset_list): New function.
5009 * powerpc.cc (Target_powerpc::got_size): Add const.
5010 (Target_powerpc::got_entry_count): New function.
5011 (Target_powerpc::plt_entry_count): New function.
5012 (Target_powerpc::first_plt_entry_offset): New function.
5013 (Target_powerpc::plt_entry_size): New function.
5014 (Output_data_plt_powerpc::entry_count): New function.
5015 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
5016 (Output_data_plt_powerpc::get_plt_entry_size): New function.
5017 * sparc.cc (Target_sparc::got_size): Add const.
5018 (Target_sparc::got_entry_count): New function.
5019 (Target_sparc::plt_entry_count): New function.
5020 (Target_sparc::first_plt_entry_offset): New function.
5021 (Target_sparc::plt_entry_size): New function.
5022 (Output_data_plt_sparc::entry_count): New function.
5023 (Output_data_plt_sparc::first_plt_entry_offset): New function.
5024 (Output_data_plt_sparc::get_plt_entry_size): New function.
5025 * symtab.h (Symbol::got_offset_list): New function.
5026 (Symbol_table::for_all_symbols): New function.
5027 * target.h (Sized_target::got_entry_count): New function.
5028 (Sized_target::plt_entry_count): New function.
5029 (Sized_target::plt_entry_size): New function.
5030 * x86_64.cc (Target_x86_64::got_size): Add const.
5031 (Target_x86_64::got_entry_count): New function.
5032 (Target_x86_64::plt_entry_count): New function.
5033 (Target_x86_64::first_plt_entry_offset): New function.
5034 (Target_x86_64::plt_entry_size): New function.
5035 (Output_data_plt_x86_64::entry_count): New function.
5036 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
5037 (Output_data_plt_x86_64::get_plt_entry_size): New function.
5038
09ec0418
CC
50392010-08-12 Cary Coutant <ccoutant@google.com>
5040
5041 * archive.cc: Include incremental.h.
5042 (Archive::Archive): Initialize incremental_info_.
5043 (Archive::include_member): Record archive members in incremental info.
5044 (Add_archive_symbols::run): Record begin and end of an archive in
5045 incremental info.
5046 (Lib_group::include_member): Record objects in incremental info.
5047 * archive.h (Incremental_archive_entry): Forward declaration.
5048 (Archive::set_incremental_info): New member function.
5049 (Archive::incremental_info): New member function.
5050 (Archive::Unused_symbol_iterator): New class.
5051 (Archive::unused_symbols_begin): New member function.
5052 (Archive::unused_symbols_end): New member function.
5053 (Archive::incremental_info_): New data member.
5054 * incremental-dump.cc (find_input_containing_global): New function.
5055 (dump_incremental_inputs): Dump new incremental info sections.
5056 * incremental.cc: Include symtab.h.
5057 (Output_section_incremental_inputs): New class.
5058 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
5059 new incremental info sections.
5060 (Sized_incremental_binary::do_check_inputs): Likewise.
5061 (Incremental_inputs::report_archive): Remove.
5062 (Incremental_inputs::report_archive_begin): New function.
5063 (Incremental_inputs::report_archive_end): New function.
5064 (Incremental_inputs::report_object): New function.
5065 (Incremental_inputs::finalize_inputs): Remove.
5066 (Incremental_inputs::report_input_section): New function.
5067 (Incremental_inputs::report_script): Rewrite.
5068 (Incremental_inputs::finalize): Do nothing but finalize string table.
5069 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5070 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5071 (Incremental_inputs::create_data_sections): New function.
5072 (Incremental_inputs::relocs_entsize): New function.
5073 (Output_section_incremental_inputs::set_final_data_size): New function.
5074 (Output_section_incremental_inputs::do_write): New function.
5075 (Output_section_incremental_inputs::write_header): New function.
5076 (Output_section_incremental_inputs::write_input_files): New function.
5077 (Output_section_incremental_inputs::write_info_blocks): New function.
5078 (Output_section_incremental_inputs::write_symtab): New function.
5079 * incremental.h (Incremental_script_entry): Forward declaration.
5080 (Incremental_object_entry): Forward declaration.
5081 (Incremental_archive_entry): Forward declaration.
5082 (Incremental_inputs): Forward declaration.
5083 (Incremental_inputs_header_data): Remove.
5084 (Incremental_inputs_header): Remove.
5085 (Incremental_inputs_header_write): Remove.
5086 (Incremental_inputs_entry_data): Remove.
5087 (Incremental_inputs_entry): Remove.
5088 (Incremental_inputs_entry_write): Remove.
5089 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
5090 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
5091 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
5092 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5093 Likewise.
5094 (Incremental_input_entry): New class.
5095 (Incremental_script_entry): New class.
5096 (Incremental_object_entry): New class.
5097 (Incremental_archive_entry): New class.
5098 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5099 (Incremental_inputs::report_inputs): Remove.
5100 (Incremental_inputs::report_archive): Remove.
5101 (Incremental_inputs::report_archive_begin): New function.
5102 (Incremental_inputs::report_archive_end): New function.
5103 (Incremental_inputs::report_object): Change prototype.
5104 (Incremental_inputs::report_input_section): New function.
5105 (Incremental_inputs::report_script): Change prototype.
5106 (Incremental_inputs::get_reloc_count): New function.
5107 (Incremental_inputs::set_reloc_count): New function.
5108 (Incremental_inputs::create_data_sections): New function.
5109 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5110 (Incremental_inputs::inputs_section): New function.
5111 (Incremental_inputs::symtab_section): New function.
5112 (Incremental_inputs::relocs_section): New function.
5113 (Incremental_inputs::get_stringpool): Add const.
5114 (Incremental_inputs::command_line): Add const.
5115 (Incremental_inputs::inputs): Remove.
5116 (Incremental_inputs::command_line_key): New function.
5117 (Incremental_inputs::input_file_count): New function.
5118 (Incremental_inputs::input_files): New function.
5119 (Incremental_inputs::relocs_entsize): New function.
5120 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5121 (Incremental_inputs::finalize_inputs): Remove.
5122 (Incremental_inputs::Input_info): Remove.
5123 (Incremental_inputs::lock_): Remove.
5124 (Incremental_inputs::inputs_): Change type.
5125 (Incremental_inputs::inputs_map_): Remove.
5126 (Incremental_inputs::current_object_entry_): New data member.
5127 (Incremental_inputs::inputs_section_): New data member.
5128 (Incremental_inputs::symtab_section_): New data member.
5129 (Incremental_inputs::relocs_section_): New data member.
5130 (Incremental_inputs::reloc_count_): New data member.
5131 (Incremental_inputs_reader): New class.
5132 (Incremental_symtab_reader): New class.
5133 (Incremental_relocs_reader): New class.
5134 * layout.cc (Layout::finalize): Move finalization of incremental info
5135 and creation of incremental info sections to follow finalization of
5136 symbol table. Set offsets for postprocessing sections.
5137 (Layout::create_incremental_info_sections): Call
5138 Incremental_inputs::create_data_sections. Add incremental symtab
5139 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5140 sections to layout after input sections.
5141 * layout.h (struct Timespec): Forward declaration.
5142 (Layout::incremental_inputs): Add const.
5143 (Layout::create_incremental_info_sections): Add parameter.
5144 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5145 * object.cc: Include incremental.h.
5146 (Relobj::finalize_incremental_relocs): New function.
5147 (Sized_relobj::do_layout): Record input sections in incremental info.
5148 * object.h (Object::output_section): New function.
5149 (Object::output_section_offset): Moved from Relobj.
5150 (Object::get_incremental_reloc_base): New function.
5151 (Object::get_incremental_reloc_count): New function.
5152 (Object::do_output_section): New function.
5153 (Object::do_output_section_offset): Moved from Relobj.
5154 (Object::do_get_incremental_reloc_base): New function.
5155 (Object::do_get_incremental_reloc_count): New function.
5156 (Object::Object): Initialize new data members.
5157 (Relobj::output_section): Renamed do_output_section and moved to
5158 protected.
5159 (Relobj::output_section_offset): Moved to Object.
5160 (Relobj::do_get_incremental_reloc_base): New function.
5161 (Relobj::do_get_incremental_reloc_count): New function.
5162 (Relobj::allocate_incremental_reloc_counts): New function.
5163 (Relobj::count_incremental_reloc): New function.
5164 (Relobj::finalize_incremental_relocs): New function.
5165 (Relobj::next_incremental_reloc_index): New function.
5166 (Relobj::reloc_counts_): New data member.
5167 (Relobj::reloc_bases_): New data member.
5168 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5169 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5170 (Sized_relobj::incremental_relocs_scan): New function.
5171 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5172 (Sized_relobj::incremental_relocs_write): New function.
5173 (Sized_relobj::incremental_relocs_write_reltype): New function.
5174 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5175 incremental link.
5176 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5177 archives and object files elsewhere.
5178 (Add_symbols::run): Report object files here.
5179 (Finish_group::run): Report end of archive at end of group.
5180 * reloc.cc: Include layout.h, incremental.h.
5181 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5182 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5183 (Sized_relobj::incremental_relocs_scan): New function.
5184 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5185 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5186 (Sized_relobj::incremental_relocs_write): New function.
5187 (Sized_relobj::incremental_relocs_write_reltype): New function.
5188 * script.cc (read_input_script): Rewrite test for incremental link.
5189 Change call to Incremental_inputs::report_script.
5190 * symtab.h (Symbol_table::first_global_index): New function.
5191 (Symbol_table::output_count): New function.
5192
ce0d1972
DK
51932010-08-12 Doug Kwan <dougkwan@google.com>
5194
5195 * arm.cc (Target_arm::merge_object_attributes): Check command line
5196 options --no-wchar-size-warning and --no-enum-size-warning.
5197 * options.h (General_options): Add ld-compatible options
5198 --no-enum-size-warning and --no-wchar-size-warning.
5199
6e5710ce
ILT
52002010-08-04 Ian Lance Taylor <iant@google.com>
5201
5202 * x86_64.cc (Target_x86_64::Scan::local): Use
5203 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5204 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5205 (Target_x86_64::Scan::global): Likewise.
5206 (Target_x86_64::Relocate::relocate): Likewise.
5207 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5208 Likewise.
5209
fef830db
CC
52102010-08-03 Cary Coutant <ccoutant@google.com>
5211
5212 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5213 to reserve space in merged_strings vector. Keep total input size
5214 for stats.
5215 (Output_merge_string::do_print_merge_stats): Print total input size.
5216 * merge.h (Output_merge_string): Add input_size_ field.
5217 * stringpool.cc (Stringpool_template::string_length): Move
5218 implementations out of Stringpool_template class and place in
5219 stringpool.h.
5220 * stringpool.h (string_length): Move out of Stringpool_template.
5221
1e3811b0
ILT
52222010-08-03 Ian Lance Taylor <iant@google.com>
5223
5224 PR 11712
5225 * layout.cc (relaxation_loop_body): If address of load segment is
5226 set, adjust address to include headers if possible.
5227
7af0c620
ILT
52282010-08-03 Ian Lance Taylor <iant@google.com>
5229
5230 * version.cc (version_string): Bump to 1.10.
5231
22f0da72
ILT
52322010-08-03 Ian Lance Taylor <iant@google.com>
5233
5234 PR 11805
5235 * layout.h (enum Output_section_order): Define.
5236 (class Layout): Update declarations.
5237 * layout.cc (Layout::get_output_section): Add order parameter.
5238 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5239 is_first_non_relro parameters. Change all callers.
5240 (Layout::choose_output_section): Likewise.
5241 (Layout::add_output_section_data): Likewise.
5242 (Layout::make_output_section): Likewise. Set order.
5243 (Layout::default_section_order): New function.
5244 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5245 * output.cc (Output_section::Output_section): Initialize order_.
5246 Don't initialize deleted fields.
5247 (Output_segment::Output_segment): Don't initialize deleted
5248 fields.
5249 (Output_segment::add_output_section_to_load): New function
5250 replacing add_output_section. Change all callers to call this or
5251 add_output_section_to_nonload.
5252 (Output_segment::add_output_section_to_nonload): New function.
5253 (Output_segment::remove_output_section): Rewrite.
5254 (Output_segment::add_initial_output_data): Likewise.
5255 (Output_segment::has_any_data_sections): Likewise.
5256 (Output_segment::is_first_section_relro): Likewise.
5257 (Output_segment::maximum_alignment): Likewise.
5258 (Output_segment::has_dynamic_reloc): New function replacing
5259 dynamic_reloc_count. Change all callers.
5260 (Output_segment::has_dynamic_reloc_list): New function replacing
5261 dynamic_reloc_count_list. Change all callers.
5262 (Output_segment::set_section_addresses): Rewrite.
5263 (Output_segment::set_offset): Rewrite.
5264 (Output_segment::find_first_and_last_list): Remove.
5265 (Output_segment::set_tls_offsets): Rewrite.
5266 (Output_segment::first_section_load_address): Likewise.
5267 (Output_segment::output_section_count): Likewise.
5268 (Output_segment::section_with_lowest_load_address): Likewise.
5269 (Output_segment::write_section_headers): Likewise.
5270 (Output_segment::print_sections_to_map): Likewise.
5271 * output.h (class Output_data): Remove dynamic_reloc_count_
5272 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5273 (Output_data::add_dynamic_reloc): Rewrite.
5274 (Output_data::has_dynamic_reloc): New function.
5275 (Output_data::dynamic_reloc_count): Remove.
5276 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5277 is_last_relro_, is_first_non_relro_, is_interp_,
5278 is_dynamic_linker_section_ fields. Add order and set_order
5279 functions. Remove is_relro_local, set_is_relro_local,
5280 is_last_relro, set_is_last_relro, is_first_non_relro,
5281 set_is_first_non_relro functions, is_interp, set_is_interp,
5282 is_dynamic_linker_section, and set_is_dynamic_linker_section
5283 functions.
5284 (class Output_segment): Change Output_data_list from std::list to
5285 std:;vector. Add output_lists_ field. Remove output_data_ and
5286 output_bss_ fields. Update declarations.
5287
3ff2ccb0
ILT
52882010-08-02 Ian Lance Taylor <iant@google.com>
5289
5290 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5291 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5292 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5293
88a4108b
ILT
52942010-08-02 Ian Lance Taylor <iant@google.com>
5295
5296 PR 11855
5297 * script.cc (Script_options::Script_options): Initialize
5298 symbol_definitions_ and symbol_references_.
5299 (Script_options::add_symbol_assignment): Update
5300 symbol_definitions_ and symbol_references_.
5301 (Script_options::add_symbol_reference): New function.
5302 (script_symbol): New function.
5303 * script.h (class Script_options): Add symbol_definitions_ and
5304 symbol_references_ fields.
5305 (Script_options::referenced_const_iterator): New type.
5306 (Script_options::referenced_begin): New function.
5307 (Script_options::referenced_end): New function.
5308 (Script_options::is_referenced): New function.
5309 (Script_options::any_unreferenced): New function.
5310 * script-c.h (script_symbol): Declare.
5311 * yyscript.y (exp): Call script_symbol.
5312 * symtab.cc: Include "script.h".
5313 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5314 Change all callers. Check symbols referenced by scripts.
5315 (Symbol_table::add_undefined_symbols_from_command_line): Add
5316 layout parameter. Change all callers.
5317 (Symbol_table::do_add_undefined_symbols_from_command_line):
5318 Likewise. Break out loop body. Check symbols referenced by
5319 scripts.
5320 (Symbol_table::add_undefined_symbol_from_command_line): New
5321 function broken out of
5322 do_add_undefined_symbols_from_command_line.
5323 * symtab.h (class Symbol_table): Update declarations.
5324 * archive.cc: Include "layout.h".
5325 (Archive::should_include_member): Add layout parameter. Change
5326 all callers. Check for symbol mentioned in expression.
5327 * archive.h (class Archive): Update declaration.
5328 * object.cc (Sized_relobj::do_should_include_member): Add layout
5329 parameter.
5330 * object.h (Object::should_include_member): Add layout parameter.
5331 Change all callers.
5332 (Object::do_should_include_member): Add layout parameter.
5333 (class Sized_relobj): Update declaration.
5334 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5335 parameter.
5336 * dynobj.h (class Sized_dynobj): Update declaration.
5337 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5338 layout parameter.
5339 * plugin.h (class Sized_pluginobj): Update declaration.
5340
5f1ab67a
ILT
53412010-08-02 Ian Lance Taylor <iant@google.com>
5342
5343 PR 11866
5344 * output.cc (Output_segment::set_offset): Search for the first and
5345 last sections rather than assuming that the list is in order.
5346 (Output_segment::find_first_and_last_list): New function.
5347 * output.h (class Output_segment): Update declarations.
5348 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5349 (relro_strip_test_SOURCES): New variable.
5350 (relro_strip_test_DEPENDENCIES): New variable.
5351 (relro_strip_test_LDFLAGS): New variable.
5352 (relro_strip_test_LDADD): New variable.
5353 (relro_strip_test.so): New target.
5354
a8df5856
ILT
53552010-08-02 Ian Lance Taylor <iant@google.com>
5356
5357 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5358 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5359 (Target_i386::got_tlsdesc_section): New function.
5360 (Target_i386::got_section): Create space for GOT entries for
5361 TLSDESC relocations.
5362 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5363 R_386_TLS_GOTDESC.
5364 (Target_i386::Scan::global): Likewise.
5365 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5366 using TLSDESC GOT.
5367 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5368 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5369 (Target_x86_64::got_tlsdesc_section): New function.
5370 (Target_x86_64::got_section): Create space for GOT entries for
5371 TLSDESC relocations.
5372 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5373 R_386_TLS_GOTDESC.
5374 (Target_x86_64::Scan::global): Likewise.
5375 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5376 using TLSDESC GOT.
5377
0c10a0a6
ILT
53782010-08-02 Ian Lance Taylor <iant@google.com>
5379
5380 * testsuite/final_layout.sh: Use dc to convert from hex to
5381 decimal.
5382
41cbeecc
ST
53832010-07-29 Sriraman Tallam <tmsriram@google.com>
5384
5385 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5386 paramter to the call to gold::gc_process_relocs.
5387 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5388 paramter to the call to gold::gc_process_relocs.
5389 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5390 parameter to the call to gold::gc_process_relocs.
5391 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5392 template parameter to the call to gold::gc_process_relocs.
5393 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5394 paramter to the call to gold::gc_process_relocs.
5395 * gc.h (get_embedded_addend_size): New function.
5396 (gc_process_relocs): Save the size of the reloc for use by ICF.
5397 * icf.cc (get_section_contents): Get the addend from the text section
5398 for SHT_REL relocation sections.
5399 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5400 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5401 * int_encoding.h (read_from_pointer): New overloaded function.
5402 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5403 * testsuite/icf_sht_rel_addend_test.sh: New file.
5404 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5405 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5406
6ea55b82
RW
54072010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5408
5409 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5410 * Makefile.in: Regenerate.
5411 * testsuite/Makefile.in: Regenerate.
5412
9691462b
ILT
54132010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5414
5415 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5416 * gold/testsuite/debug_msg.cc: Likewise.
5417 * gold/testsuite/odr_violation1.cc
5418 * gold/testsuite/odr_violation2.cc
5419
76897331
CC
54202010-07-21 Cary Coutant <ccoutant@google.com>
5421
5422 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5423 string, and length fields.
5424 (Output_merge_string::Merged_strings_list): New type.
5425 (Output_merge_string::Merged_strings_lists): New typedef.
5426 (Output_merge_string): Replace merged_strings_ with
5427 merged_strings_lists_.
5428 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5429 Merged_strings_list per input object and section. Don't store pointer
5430 to the string. Don't store length with each merged string entry.
5431 (Output_merge_string::finalize_merged_data): Loop over list of merged
5432 strings lists. Recompute length of each merged string.
5433
78384e8f
CC
54342010-07-15 Cary Coutant <ccoutant@google.com>
5435
5436 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5437 here.
5438
783659f9
ILT
54392010-07-14 Ian Lance Taylor <iant@google.com>
5440
5441 * descriptors.cc (Descriptors::open): Report correct name in error
5442 message.
5443
131687b4
DK
54442010-07-13 Doug Kwan <dougkwan@google.com>
5445
5446 * arm.cc (Arm_input_section::Arm_input_section): For a
5447 SHT_ARM_EXIDX section, always keeps the input sections.
5448 (Arm_input_section::set_exidx_section_link): New method.
5449 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5450 has_errors_ to false.
5451 (Arm_exidx_input_section::has_errors,
5452 Arm_exidx_input_section::set_has_errors): New methods.
5453 (Arm_exidx_input_section::has_errors_): New data member.
5454 (Arm_relobj::get_exidx_shndx_list): New method.
5455 (Arm_output_section::append_text_sections_to_list): Do not skip
5456 section without SHF_EXECINSTR.
5457 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5458 errors.
2e702c99 5459 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5460 section header. Make error messages more verbose. Check for
5461 a non-executable section linked to an EXIDX section.
5462 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5463 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5464 check that there is no deferred EXIDX section if we exit early.
5465 Instead of not making an EXIDX section in case of an error, make one
5466 and set the has_errors flag of it.
5467 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5468 in a relocatable link.
5469 (Target_arm::do_relax): Look for the EXIDX output section instead of
5470 assuming that it is called .ARM.exidx.
2e702c99 5471 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5472 section list. Do not check for SHF_EXECINSTR section flags but
5473 skip any input section with errors.
5474 * output.cc (Output_section::Output_section): Initialize
5475 always_keeps_input_sections_ to false.
5476 (Output_section::add_input_section): Check for
5477 always_keeps_input_sections_.
5478 * output.h (Output_section::always_keeps_input_sections,
5479 Output_section::set_always_keeps_input_sections): New methods.
5480 (Output_section::always_keeps_input_sections): New data member.
5481
69517287
RÁE
54822010-07-13 Rafael Espindola <espindola@google.com>
5483
5484 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5485 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5486
82742395
ILT
54872010-07-13 Philip Herron <herron.philip@googlemail.com>
5488 Ian Lance Taylor <iant@google.com>
5489
5490 * output.h (Output_section_lookup_maps::add_merge_section):
5491 Correct check of whether value was inserted.
5492 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5493 (Output_section_lookup_maps::add_relaxed_input_section):
5494 Likewise.
5495 * arm.cc (Target_arm::got_section): Remove used local os.
5496 * i386.cc (Target_i386::got_section): Likewise.
5497 * x86_64.cc (Target_x86_64::got_section): Likewise.
5498 * sparc.cc (Target_sparc::got_section): Likewise.
5499 (Target_sparc::relocate): Remove unused local have_got_offset.
5500 * powerpc.cc (Target_powerpc::relocate): Likewise.
5501
f2d707b5
ILT
55022010-07-13 Ian Lance Taylor <iant@google.com>
5503
241531d6
ILT
5504 * compressed_output.cc (zlib_decompress): Fix signature in
5505 !HAVE_ZLIB_H case.
5506
f2d707b5
ILT
5507 * archive.cc (Archive::include_member): Unlock an external member
5508 of a thin archive. Don't bother to delete an object we know is
5509 NULL.
5510
a2e47362
CC
55112010-07-12 Cary Coutant <ccoutant@google.com>
5512
5513 * compressed_output.cc (zlib_decompress): New function.
5514 (get_uncompressed_size): New function.
5515 (decompress_input_section): New function.
5516 * compressed_output.h (get_uncompressed_size): New function.
5517 (decompress_input_section): New function.
5518 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5519 Handle compressed debug sections.
5520 * layout.cc (is_compressed_debug_section): New function.
5521 (Layout::output_section_name): Map compressed section names to
5522 canonical names.
5523 * layout.h (is_compressed_debug_section): New function.
5524 (is_debug_info_section): Recognize compressed debug sections.
5525 * merge.cc: Include compressed_output.h.
5526 (Output_merge_data::do_add_input_section): Handle compressed
5527 debug sections.
5528 (Output_merge_string::do_add_input_section): Handle compressed
5529 debug sections.
5530 * object.cc: Include compressed_output.h.
5531 (Sized_relobj::Sized_relobj): Initialize new data members.
5532 (build_compressed_section_map): New function.
5533 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5534 * object.h (Object::section_is_compressed): New method.
5535 (Object::do_section_is_compressed): New method.
5536 (Sized_relobj::Compressed_section_map): New type.
5537 (Sized_relobj::do_section_is_compressed): New method.
5538 (Sized_relobj::compressed_sections_): New data member.
5539 * output.cc (Output_section::add_input_section): Handle compressed
5540 debug sections.
5541 * reloc.cc: Include compressed_output.h.
5542 (Sized_relobj::write_sections): Handle compressed debug sections.
5543
ce279a62
CC
55442010-07-08 Cary Coutant <ccoutant@google.com>
5545
5546 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5547 weak when resolving to a dynamic def.
5548 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5549 for weak undef/dynamic def cases. Adjust callers.
5550 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5551 undef_binding_weak_.
5552 (Symbol_table::sized_write_globals): Adjust symbol binding.
5553 (Symbol_table::sized_write_symbol): Add binding parameter.
5554 * symtab.h (Symbol::set_undef_binding): New method.
5555 (Symbol::is_undef_binding_weak): New method.
5556 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5557 (Symbol_table::should_override): Add new parameter.
5558 (Symbol_table::sized_write_symbol): Add new parameter.
5559
5560 * testsuite/weak_undef_file1.cc: Add new test case.
5561 * testsuite/weak_undef_file2.cc: Fix header comment.
5562 * testsuite/weak_undef_test.cc: Add new test case.
5563
b2286c10
DK
55642010-06-29 Doug Kwan <dougkwan@google.com>
5565
5566 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5567 Initialize USE_SYMBOL_.
5568 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5569 definition.
5570 (Arm_reloc_property::uses_symbol_): New data member declaration.
5571 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5572 uses symbol value and symbol is undefined but not weakly undefined.
5573
4802450a
RÁE
55742010-06-28 Rafael Espindola <espindola@google.com>
5575
5576 * plugin.cc (Plugin::load): Use dlerror.
5577
e5ca47ba
ILT
55782010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5579
5580 * symtab.cc (detect_odr_violations): When reporting an ODR
5581 violation, report an object where the symbol is defined.
5582
8a75a161
DK
55832010-06-25 Doug Kwan <dougkwan@google.com>
5584
5585 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5586 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5587 definition.
5588 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5589 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5590 target hook to detect function points.
5591 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5592 * icf.h (Icf::check_section_for_function_pointers): Change type of
5593 parameter SECTION_NAME to const reference to std::string. Use
5594 target hook to determine if section may have unsafe pointers.
5595 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5596 method definition.
5597
42218b9f
RÁE
55982010-06-21 Rafael Espindola <espindola@google.com>
5599
5600 * fileread.cc (Input_file::find_fie): New
5601 (Input_file::open): Use Input_file::find_fie.
5602 * fileread.h (Input_file::find_fie): New
5603 * plugin.cc (set_extra_library_path): New.
5604 (Plugin::load): Add set_extra_library_path to the transfer vector.
5605 (Plugin_manager::set_extra_library_path): New.
5606 (Plugin_manager::add_input_file): Use the extra search path if set.
5607 (set_extra_library_path(): New.
5608 * plugin.h (Plugin_manager): Add set_extra_library_path and
5609 extra_search_path_.
5610
a0506cca
CC
56112010-06-19 Cary Coutant <ccoutant@google.com>
5612
5613 * layout.cc (gdb_sections): Add .debug_types.
5614 (lines_only_debug_sections): Likewise.
5615
6508b958
RÁE
56162010-06-18 Rafael Espindola <espindola@google.com>
5617
5618 * plugin.cc (add_input_file,add_input_library)
5619 (Plugin_manager::add_input_file): Make filename arguments const.
5620 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5621 const.
5622
3e235302
DK
56232010-06-16 Doug Kwan <dougkwan@google.com>
5624
5625 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5626 .ARM.attributes section if we have not merged any input
5627 attributes sections.
5628
106e8a6c
DK
56292010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5630
5631 * arm.cc: Allow combining objects with no EABI version
5632 information.
5633
91ff43fe
RÁE
56342010-06-15 Rafael Espindola <espindola@google.com>
5635
5636 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5637
68ed838c
ILT
56382010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5639
5640 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5641 (struct iovec): Correct !HAVE_READV definition.
5642
f3a2388f
CC
56432010-06-10 Cary Coutant <ccoutant@google.com>
5644
5645 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5646 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5647 reloc sections.
5648 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5649
5650 PR 11683
5651 * symtab.h (Symbol::is_placeholder): New member function.
5652 * target-reloc.h (relocate_section): Check for placeholder symbols.
5653
5654 * testsuite/Makefile.am (plugin_test_8): New test.
5655 (plugin_test_9): New test.
5656 * testsuite/Makefile.in: Regenerate.
5657
e1df38aa
NC
56582010-06-09 Nick Clifton <nickc@redhat.com>
5659
5660 * yyscript.y (input_list_element): Allow strings prefixed with
5661 the '-' character. Treat these as libraries.
5662 * script.cc (script_add_library): New function. Adds a library
5663 specified by "-l<name>" found in an input script.
5664 * script-c.h: Add prototype for script_add_library.
5665
25bbe950
DK
56662010-06-07 Doug Kwan <dougkwan@google.com>
5667
5668 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5669 Restrict stub-group size to be within long conditional branch
5670 range when working around cortex-A8 erratum.
5671
0f32ea4c
ILT
56722010-06-07 Damien Diederen <dd@crosstwine.com>
5673
5674 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5675 #ifdef typo.
5676
8fe2a369
ST
56772010-06-03 Sriraman Tallam <tmsriram@google.com>
5678
5679 PR gold/11658
5680 * output.cc
5681 (Output_section::Input_section_sort_entry::compare_section_ordering):
5682 Change to return non-zero correctly.
5683 (Output_section::Input_section_sort_section_order_index_compare
5684 ::operator()): Change to fix ambiguity in comparisons.
5685
6e9ba2ca
ST
56862010-06-01 Sriraman Tallam <tmsriram@google.com>
5687
5688 * gold.h (is_wildcard_string): New function.
5689 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5690 (Layout::layout_eh_frame): Ditto.
5691 (Layout::find_section_order_index): New method.
5692 (Layout::read_layout_from_file): New method.
5693 * layout.h (Layout::find_section_order_index): New method.
5694 (Layout::read_layout_from_file): New method.
5695 (Layout::input_section_position_): New private member.
5696 (Layout::input_section_glob_): New private member.
5697 * main.cc (main): Call read_layout_from_file here.
5698 * options.h (--section-ordering-file): New option.
5699 * output.cc (Output_section::input_section_order_specified_): New
5700 member.
5701 (Output_section::Output_section): Initialize new member.
5702 (Output_section::add_input_section): Add new parameter.
5703 Keep input sections when --section-ordering-file is used.
5704 (Output_section::set_final_data_size): Sort input sections when
5705 section ordering file is specified.
5706 (Output_section::Input_section_sort_entry): Add new parameter.
5707 Check sorting type.
5708 (Output_section::Input_section_sort_entry::compare_section_ordering):
5709 New method.
5710 (Output_section::Input_section_sort_compare::operator()): Change to
5711 consider section_order_index.
5712 (Output_section::Input_section_sort_init_fini_compare::operator()):
5713 Change to consider section_order_index.
5714 (Output_section::Input_section_sort_section_order_index_compare
5715 ::operator()): New method.
5716 (Output_section::sort_attached_input_sections): Change to sort
5717 according to section order when specified.
e1df38aa
NC
5718 (Output_section::add_input_section<32, true>): Add new parameter.
5719 (Output_section::add_input_section<64, true>): Add new parameter.
5720 (Output_section::add_input_section<32, false>): Add new parameter.
5721 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5722 * output.h (Output_section::add_input_section): Add new parameter.
5723 (Output_section::input_section_order_specified): New
5724 method.
5725 (Output_section::set_input_section_order_specified): New method.
5726 (Input_section::Input_section): Initialize section_order_index_.
5727 (Input_section::section_order_index): New method.
5728 (Input_section::set_section_order_index): New method.
5729 (Input_section::section_order_index_): New member.
5730 (Input_section::Input_section_sort_section_order_index_compare): New
5731 struct.
5732 (Output_section::input_section_order_specified_): New member.
5733 * script-sections.cc (is_wildcard_string): Delete and move modified
5734 method to gold.h.
5735 (Output_section_element_input::Output_section_element_input): Modify
5736 call to is_wildcard_string.
5737 (Output_section_element_input::Input_section_pattern
5738 ::Input_section_pattern): Ditto.
5739 (Output_section_element_input::Output_section_element_input): Ditto.
5740 * testsuite/Makefile.am (final_layout): New test case.
5741 * testsuite/Makefile.in: Regenerate.
5742 * testsuite/final_layout.cc: New file.
5743 * testsuite/final_layout.sh: New file.
5744
3537c84b
RÁE
57452010-06-01 Rafael Espindola <espindola@google.com>
5746
5747 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5748
105b6afd
RÁE
57492010-06-01 Rafael Espindola <espindola@google.com>
5750
5751 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5752 visibility of symbols.
5753
29e11421
DK
57542010-05-27 Doug Kwan <dougkwan@google.com>
5755
5756 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5757 from start of output section instead of address for a local symbol
5758 in a merged or relaxed section when doing a relocatable link.
5759
5e0f337e
RÁE
57602010-05-26 Rafael Espindola <espindola@google.com>
5761
703d02da 5762 PR 11604
5e0f337e
RÁE
5763 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5764 adding sections the garbage collector removed.
5765 * gold/testsuite/Makefile.am: Add test.
5766 * gold/testsuite/Makefile.in: Regenerate.
5767 * gold/testsuite/plugin_test_7.sh: New.
5768 * gold/testsuite/plugin_test_7_1.c: New.
5769 * gold/testsuite/plugin_test_7_2.c: New.
5770
f4187277
RÁE
57712010-05-26 Rafael Espindola <espindola@google.com>
5772
5773 * script-sections.cc (Output_section_definition::set_section_addresses):
5774 Check for --section-start.
5775
5c388529
DK
57762010-05-26 Doug Kwan <dougkwan@google.com>
5777
5778 * arm.cc (Arm_scan_relocatable_relocs): New class.
5779 (Target_arm::relocate_special_relocatable): New method.
5780 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5781 (Arm_relocate_functions::thumb_branch_common): Same.
5782 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5783 instead of Default_scan_relocatable_relocs.
5784 * target-reloc.h (relocate_for_relocatable): Let target handle
5785 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5786 * target.h (Sized_target::relocate_special_relocatable): New method.
5787
bca1c3ae
ILT
57882010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5789
5790 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5791
0439c796
DK
57922010-05-23 Doug Kwan <dougkwan@google.com>
5793
5794 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5795 instead of a cast.
5796 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5797 with a direct branch, not a conditional branch, to a stub.
5798 * merge.cc (Output_merge_base::record_input_section): New method
5799 defintion.
5800 (Output_merge_data::do_add_input_section): Record input section if
5801 keeps-input-sections flag is set.
5802 (Output_merge_string::do_add_input_section): Ditto.
5803 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5804 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5805 INPUT_SECTIONS_.
5806 (Output_merge_base::keeps_input_sections,
5807 Output_merge_base::set_keeps_input_sections,
5808 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5809 method definitions.
5810 (Output_merge_base::Input_sections): New type declaration.
5811 (Output_merge_base::input_sections_begin,
5812 Output_merge_base::input_sections_end,
5813 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5814 (Output_merge_base::bool keeps_input_sections_,
5815 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5816 Output_merge_base::input_sections_): New data members.
5817 (Output_merge_data::do_set_keeps_input_sections): New method
5818 defintion.
5819 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5820 * output.cc (Output_section::Input_section::relobj): Move method
5821 defintion from class declaration to here and handle merge sections.
5822 (Output_section::Input_section::shndx): Ditto.
5823 (Output_section::Output_section): Remove initializations of removed
5824 data members and initialize new data member LOOKUP_MAPS_.
5825 (Output_section::add_input_section): Set keeps-input-sections flag
5826 for a newly created merge output section as appropriate. Adjust code
5827 to use Output_section_lookup_maps class.
5828 (Output_section::add_relaxed_input_section): Adjst code for lookup
5829 maps code refactoring.
2e702c99 5830 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5831 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5832 class. If adding input section to a newly created merge output
5833 section fails, remove the new merge section.
5834 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5835 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5836 (Output_section::find_merge_section): Ditto.
0439c796 5837 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5838 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5839 Output_section_lookup_maps class.
5840 (Output_section::get_input_sections): Export merge sections. Adjust
5841 code to use Output_section_lookup_maps class.
5842 (Output_section:::add_script_input_section): Adjust code to use
5843 Output_section_lookup_maps class. Update lookup maps for merge
5844 sections also.
5845 (Output_section::discard_states): Use Output_section_lookup_maps.
5846 (Output_section::restore_states): Same.
5847 * output.h (Merge_section_properties): Move class defintion out of
5848 Output_section.
5849 (Output_section_lookup_maps): New class.
5850 (Output_section::Input_section::is_merge_section): New method
5851 defintion.
5852 (Output_section::Input_section::relobj): Move defintion out of class
5853 defintion. Declare method only.
5854 (Output_section::Input_section::shndx): Ditto.
5855 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5856 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5857 (Output_section::Merge_section_by_properties_map,
5858 Output_section::Output_section_data_by_input_section_map,
5859 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5860 Remove types.
2e702c99 5861 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5862 KEEPS_INPUT_SECTIONS.
5863 (Output_section::build_lookup_maps): New method declaration.
5864 (Output_section::merge_section_map_,
5865 Output_section::merge_section_by_properties_map_,
5866 Output_section::relaxed_input_section_map_,
5867 Output_section::is_relaxed_input_section_map_valid_): Remove data
5868 members.
5869 (Output_section::lookup_maps_): New data member.
5870
76295588
L
58712010-05-21 Doug Kwan <dougkwan@google.com>
5872
5873 PR gold/11619
5874 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5875 avoid a compilation error.
5876
d103a984
RÁE
58772010-05-19 Rafael Espindola <espindola@google.com>
5878
5879 * script-sections.cc (Output_section_definition::allocate_to_segment):
5880 Update the phdrs_list even when the output section is NULL.
5881 * testsuite/Makefile.am: Add test.
5882 * testsuite/Makefile.in: Regenerate.
5883 * testsuite/script_test_9.cc: New.
5884 * testsuite/script_test_9.sh: New.
5885 * testsuite/script_test_9.t: New.
5886
6625d24e
DK
58872010-05-19 Doug Kwan <dougkwan@google.com>
5888
5889 * arm.cc (Arm_input_section::original_size): New method.
5890 (Arm_input_section::do_addralign): Add a cast.
5891 (Arm_input_section::do_output_offset): Remove static cast.
5892 (Arm_input_section::original_addralign,
5893 Arm_input_section::original_size_): Change type to uint32_t.
5894 (Arm_input_section::init): Add safe casts for section alignment
5895 and size.
5896 (Arm_input_section::set_final_data_size): Do not set address and
5897 offset of stub table.
5898 (Arm_output_section::fix_exidx_coverage): Change use of of
5899 Output_section::Simple_input_section to that of
5900 Output_section::Input_section.
5901 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5902 except for the first pass.
5903 * output.cc (Output_section::get_input_sections): Change type of
5904 input_sections to std::list<Input_section>.
5905 (Output_section::add_script_input_section): Rename from
5906 Output_section::add_simple_input_section. Change type of SIS
5907 parameter from Simple_input_section to Input_section.
5908 * output.h (Output_section::Simple_input_section): Remove class.
5909 (Output_section::Input_section): Change class visibility to public.
5910 (Output_section::Input_section::addralign): Use stored alignments
5911 for special input sections if set.
5912 (Output_section::Input_section::set_addralign): New method.
5913 (Output_section::get_input_sections): Change parameter type from
5914 list of Simple_input_section to list of Input_section.
5915 (Output_section::add_script_input_section): Rename from
5916 Output_section::add_simple_input_section. Change first parameter's
5917 type from Simple_input_section to Input_section and remove the
5918 second and third parameters.
5919 * script-sections.cc (Input_section::Input_section_list): Change
5920 type to list of Output_section::Input_section/
5921 (Input_section_info::Input_section_info): Change parameter type of
5922 INPUT_SECTION to Output_section::Input_section.
5923 (Input_section_info::input_section): Change return type.
5924 (Input_section_info::input_section_): Change type to
5925 Output_section::Input_section.
5926 (Output_section_element_input::set_section_addresses): Adjust code
5927 to use Output_section::Input_section instead of
5928 Output_section::Simple_input_section. Adjust code for renaming
5929 of Output_section::add_simple_input_section.
5930 (Orphan_output_section::set_section_addresses): Ditto.
5931
e1e82ea4
RW
59322010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5933
5934 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5935 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5936
91e75c8a
RÁE
59372010-05-18 Rafael Espindola <espindola@google.com>
5938
5939 * options.cc (General_options::finalize): Handle -nostdlib.
5940 * options.h (nostdlib): New option.
5941 * script.cc (script_add_search_dir): Handle -nostdlib.
5942
da59ad79
DK
59432010-05-12 Doug Kwan <dougkwan@google.com>
5944
5945 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5946 attributes section only if there no attributes section after merging.
5947 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5948 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5949 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5950 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5951 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5952 and arm_attr_merge_7.stdout.
5953 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5954 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5955 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5956 arm_attr_merge_7b.o): New rules.
5957 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5958 arm_attr_merge_7
5959 * testsuite/Makefile.in: Regenerate.
5960 * testsuite/arm_attr_merge.sh: New file.
5961 * testsuite/arm_attr_merge_[67][ab].s: Same.
5962
3e01a7fd
NC
59632010-05-05 Nick Clifton <nickc@redhat.com>
5964
5965 * po/es.po: Updated Spanish translation.
5966
7ad2014a
L
59672010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5968
5969 * Makefile.am (install-exec-local): Properly install gold as
5970 default cross linker.
5971 * Makefile.in: Regenerated.
5972
4fda8867
NC
59732010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5974 Nick Clifton <nickc@redhat.com>
5975
5976 * configure.ac (install_as_default): Define and set to false
5977 unless --enable-gold or --enable-gold=both/gold has been
5978 specified.
5979 * configure: Regenerate.
5980
5981 * Makefile.am (install-exec-local): Install the executable as
5982 'ld.gold'. If install_as_default is true then also install it as
5983 'ld'.
5984 * Makefile.in: Regenerated.
5985
bd288ea2
ILT
59862010-04-24 Ian Lance Taylor <iant@google.com>
5987
5988 * layout.cc (Layout::layout_reloc): In relocatable link don't
5989 combine reloc sections for grouped sections.
5990
ef38fd8a
ST
59912010-04-23 Sriraman Tallam <tmsriram@google.com>
5992
5993 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5994 sections that are not ordinary to icf.
5995 * icf.cc (get_section_contents): Handle relocation pointing to section
5996 with no object or shndx information.
5997 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5998 * testsuite/Makefile.in: Regenerate.
5999 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
6000 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
6001
f6973bdc
ILT
60022010-04-22 Ian Lance Taylor <iant@google.com>
6003
6004 * expression.cc (Expression::Expression_eval_info): Add
6005 result_alignment_pointer field.
6006 (Expression::eval_with_dot): Add result_alignment_pointer
6007 parameter. Change all callers.
6008 (Expression::eval_maybe_dot): Likewise.
6009 (class Binary_expression): Add alignment_pointer parameter to
6010 left_value and right_value. Change all callers.
6011 (BINARY_EXPRESSION): Set result alignment.
6012 (class Trinary_expression): Add alignment_pointer parameter to
6013 arg2_value and arg3_value. Change all callers.
6014 (Trinary_cond::value): Set result alignment.
6015 (Max_expression::value, Min_expression::value): Likewise.
6016 (Align_expression::value): Likewise.
6017 * script-sections.cc (class Sections_element): Add dot_alignment
6018 parameter to set_section_addresses virtual function. Update
6019 instantiations.
6020 (class Output_section_element): Likewise.
6021 (Script_sections::create_segments): Add dot_alignment parameter.
6022 Change all callers.
6023 (Script_sections::create_segments_from_phdrs_clause): Likewise.
6024 (Script_sections::set_phdrs_clause_addresses): Likewise.
6025 * script-sections.h: Update declarations.
6026 * script.h: Update declarations.
6027 * output.h (Output_segment::set_minimum_p_align): Don't decrease
6028 min_p_align.
6029 * testsuite/script_test_3.t: Set large alignment.
6030 * testsuite/script_test_3.sh: Make sure that at least one LOAD
6031 segment has expected alignment.
6032
9c9c98a5
NC
60332010-04-22 Nick Clifton <nickc@redhat.com>
6034
6035 * po/gold.pot: Updated by the Translation project.
6036 * po/vi.po: Updated Vietnamese translation.
6037
2253bfba
L
60382010-04-22 H.J. Lu <hongjiu.lu@intel.com>
6039
6040 * testsuite/Makefile.am (check_PROGRAMS): Add
6041 icf_virtual_function_folding_test.
6042 * testsuite/Makefile.in: Regenerated.
6043
85fdf906
AH
60442010-04-15 Andrew Haley <aph@redhat.com>
6045
6046 * options.h (merge_exidx_entries): New option.
6047 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
6048 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
6049 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
6050 (Target_arm::merge_exidx_entries): New function.
6051 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
6052 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
6053 to Arm_exidx_fixup constructor.
6054 Add new arg, merge_exidx_entries.
6055 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
6056 Arm_output_section::fix_exidx_coverage.
6057
ce97fa81
ST
60582010-04-18 Sriraman Tallam <tmsriram@google.com>
6059
6060 * icf.cc (get_section_contents): Check for preemptible functions.
6061 Ignore addend when appropriate.
6062 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
6063 section folded.
6064 (add_from_relobj): Check for section folded.
6065 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
6066 * symtab.h (should_add_dynsym_entry): Add new parameter.
6067 * target-reloc.h (scan_relocs): Check for section folded.
6068 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
6069 Check reloc types for function pointers in shared objects.
6070 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
6071 case.
6072 (icf_preemptible_functions_test): New test case.
6073 (icf_string_merge_test): New test case.
6074 * testsuite.Makefile.in: Regenerate.
6075 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
6076 bar_glob. Refactor code.
6077 * testsuite/icf_preemptible_functions_test.cc: New file.
6078 * testsuite/icf_preemptible_functions_test.sh: New file.
6079 * testsuite/icf_string_merge_test.cc: New file.
6080 * testsuite/icf_string_merge_test.sh: New file.
6081 * testsuite/icf_virtual_function_folding_test.cc: New file.
6082 * testsuite/icf_virtual_function_folding_test.sh: New file.
6083
04ceb17c
DK
60842010-04-14 Doug Kwan <dougkwan@google.com>
6085
6086 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
6087 for local symbol recounting if we remove a section due to ICF.
6088 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
6089 there are no regular objects in input.
6090
153e7da4
DK
60912010-04-13 Doug Kwan <dougkwan@google.com>
6092
6093 * arm.cc (Arm_input_section::set_final_data_size): Compute
6094 accurate final data size instead of using current data size.
6095
4dbd9faf
DK
60962010-04-09 Doug Kwan <dougkwan@google.com>
6097
6098 * layout.cc (Layout::choose_output_section): Handle script section
6099 types.
6100 (Layout::make_output_section_for_script): Add section type parameter.
6101 Handle script section types.
6102 * layout.h (Layout::make_output_section_for_script): Add section
6103 type parameter.
6104 * output.cc (Output_section::Output_section): Initialize data member
6105 is_noload_.
6106 (Output_section::do_reset_address_and_file_offset): Do not set address
6107 to 0 if section is a NOLOAD section.
6108 * output.h (Output_section::is_noload): New method.
6109 (Output_section::set_is_noload): Ditto.
6110 (Output_section::is_noload_): New data member.
6111 * script-c.h (Script_section_type): New enum type.
6112 (struct Parser_output_section_header): Add new file section_type.
6113 * script-sections.cc (Sections_element::output_section_name): Add
6114 parameter for returning script section type.
6115 (Output_section_definition::output_section_name): Ditto.
6116 (Output_section_definition::section_type)P; New method.
6117 (Output_section_definiton::script_section_type_name): Ditto.
6118 (Output_section_definition::script_section_type_): New data member.
6119 (Output_section_definition::Output_section_definition): Initialize
6120 data member Output_section_definition::script_section_type_.
6121 (Output_section_definition::create_sections): Pass script section type
6122 to Layout::make_output_section_for_script.
6123 (Output_section_definition::output_section_name): Return script
6124 section type to caller.
6125 (Output_section_definition::set_section_address): Do not advance
6126 dot value and load address if section type is NOLOAD. Set address
6127 of NOLOAD sections regardless of section flags.
6128 (Output_section_definition::print): Print section type if it is
6129 not SCRIPT_SECTION_TYPE_NONE.
6130 (Output_section_definition::section_type): New method.
6131 (Output_section_definition::script_section_type_name): Ditto.
6132 (Script_sections::output_section_name): Add new parameter
6133 PSECTION_TYPE for returning script section type. Pass it to
6134 section elements. Handle discard sections.
6135 (Sort_output_sections::operator()): Handle NOLOAD sections.
6136 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6137 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6138 returning script section type.
6139 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6140 INFO and NOLOAD.
6141 * yyscript.y (union): Add new field SECTION_TYPE.
6142 (COPY, DSECT, INFO, NOLOAD): New tokens.
6143 (opt_address_and_section_type): Change type to output_section_header.
6144 (section_type): New non-terminal
6145 (section_header): Handle section type.
2253bfba 6146 (opt_address_and_section_type): Return section type value.
4dbd9faf 6147
721ea635
L
61482010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6149
6150 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6151 * testsuite/plugin_common_test_2.c (foo): Likewise.
6152
6bf924b0
DK
61532010-04-08 Doug Kwan <dougkwan@google.com>
6154
6155 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6156 Output_merge_data.
6157 * output.cc (Output_section::add_merge_input_section): Simplify
6158 code and return status of Output_merge_base::add_input_section.
e1df38aa 6159 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6160 returns true.
6161
24af6f92
DK
61622010-04-07 Doug Kwan <dougkwan@google.com>
6163
6164 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6165 if section is marked as containing instructions but has no mapping
6166 symbols.
6167 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6168 correct section index.
6169 (Arm_relobj::find_linked_text_section): Ditto.
6170
00698fc5
CC
61712010-04-07 Cary Coutant <ccoutant@google.com>
6172
6173 * archive.cc (include_member): Destroy Read_symbols_data object before
6174 releasing file.
6175 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6176 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6177 (Read_symbols_data::~Read_symbols_data) New destructor.
6178 (Section_relocs::Section_relocs) New constructor.
6179 (Section_relocs::~Section_relocs) New destructor.
6180 (Read_relocs_data::Read_relocs_data) New constructor.
6181 (Read_relocs_data::~Read_relocs_data) New destructor.
6182 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6183 pointers to NULL after deleting.
6184
7296d933
DK
61852010-04-07 Doug Kwan <dougkwan@google.com>
6186
6187 * arm.cc: Replace "endianity" with "endianness" in comments.
6188 (Arm_exidx_cantunwind): Ditto.
6189 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6190 (Arm_relobj::merge_flags_and_attributes): New method.
6191 (Arm_relobj::merge_flags_and_attributes_): New data member.
6192 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6193 (Arm_relobj::scan_sections_for_stubs): Ditto.
6194 (Arm_relobj::do_read_symbols): Check to see if we really want to
6195 merge processor-specific flags and attributes. Exit early if
6196 an object is empty except for section names and the undefined symbol.
6197 (Target_arm::do_finalize_sections): Move check for ELF format to
6198 Arm_relobj::do_read_symbols. Merge processor specific flags and
6199 attributes from a regular object only when we have determined that
6200 it is aapropriate. Do not create an .ARM.attributes section in
6201 output if there is no regular input object.
6202 (Target_arm::merge_processor_specific_flags): Check
6203 --warn-mismatch before printing any error.
6204 (Target_arm::merge_object_attributes): Ditto.
6205 * gold.cc (queue_middle_tasks): Handle the case in which there is
6206 no regular object in input.
6207 * options.cc (General_options::parse_EB): New method.
6208 (General_options::parse_EL): Same.
6209 (General_options::General_options): Initialize endianness_.
6210 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6211 New options.
6212 (General_options::Endianness): New enum.
6213 (General_options::endianness): New method.
6214 (General_options::endianness_): New data member.
6215 * parameters.cc (Parameters::set_options): Check target endianness.
6216 (Parameters::set_target_once): Ditto.
6217 (Parameters::check_target_endianness): New method.
6218 (parameters_force_valid_target): If either -EL or -EB is specified,
6219 use it to define endianness of default target.
6220 * parameters.h (Parameters::check_target_endianness): New method
6221 declaration.
6222 * target.h (class Target): Change "endianity" to "endianness"
6223 in comments.
6224
efc8d4f2
RW
62252010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6226
6227 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6228 * configure: Regenerate.
6229 * Makefile.in: Regenerate.
6230 * testsuite/Makefile.in: Regenerate.
6231
be234d88
CC
62322010-04-06 Cary Coutant <ccoutant@google.com>
6233
6234 gcc PR lto/42757
6235 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6236 prevailing definitions of common symbols.
6237 * testsuite/plugin_test_6.sh: New test case.
6238 * testsuite/plugin_common_test_1.c: New test case.
6239 * testsuite/plugin_common_test_2.c: New test case.
6240 * testsuite/Makefile.am (plugin_test_6): New test case.
6241 * testsuite/Makefile.in: Regenerate.
6242
bd32c6bd
NC
62432010-04-06 Nick Clifton <nickc@redhat.com>
6244
6245 * po/vi.po: New Vietnamese translation.
6246
323c532f
DK
62472010-03-30 Doug Kwan <dougkwan@google.com>
6248
6249 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6250
4fcd97eb
DK
62512010-03-25 Doug Kwan <dougkwan@google.com>
6252
6253 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6254 to avoid a conversion warning on a 32-bit host.
6255
4ebf39db
ILT
62562010-03-24 Ian Lance Taylor <iant@google.com>
6257
6258 * testsuite/script_test_3.t: Add a TLS segment.
6259 * testsuite/Makefile.am (check_PROGRAMS): Add
6260 tls_phdrs_script_test.
6261 (tls_phdrs_script_test_SOURCES): Define.
6262 (tls_phdrs_script_test_DEPENDENCIES): Define.
6263 (tls_phdrs_script_test_LDFLAGS): Define.
6264 (tls_phdrs_script_test_LDADD): Define.
6265 * testsuite/Makefile.in: Rebuild.
6266
4a599bdd
CC
62672010-03-23 Cary Coutant <ccoutant@google.com>
6268
6269 * fileread.cc (find_or_make_view): Fix comment.
6270
6c93b22c
ILT
62712010-03-23 Ian Lance Taylor <iant@google.com>
6272
6273 * script-sections.cc (class Orphan_section_placement): Define
6274 PLACE_TLS and PLACE_TLS_BSS.
6275 (Orphan_section_placement::Orphan_section_placement): Initialize
6276 new places.
6277 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6278 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6279 (tls_script_test_SOURCES): Define.
6280 (tls_script_test_DEPENDENCIES): Define.
6281 (tls_script_test_LDFLAGS): Define.
6282 (tls_script_test_LDADD): Define.
6283 * testsuite/Makefile.in: Rebuild.
6284
a2c7281b
DK
62852010-03-22 Doug Kwan <dougkwan@google.com>
6286
6287 * arm.cc (Arm_relocate_functions::abs8,
6288 Arm_relocate_functions::abs16): Use correct check for overflow
6289 specified in the ARM ELF specs.
6290 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6291 target of a BLX instruction specially.
6292 (Reloc_stub::stub_type_for_reloc): Ditto.
6293 (Relocate::relocate): Use symbolic names instead of numeric relocation
6294 codes to report error.
6295 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6296 workaround.
6297 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6298 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6299 thumb2_blx_out_of_range.stdout
6300 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6301 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6302 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6303 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6304 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6305 thumb2_blx_in_range, thumb2_blx_in_range.o,
6306 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6307 thumb2_blx_out_of_range.o): New rules.
2e702c99 6308 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6309 thumb2_blx_in_range and thumb2_blx_out_of_range.
6310 * testsuite/Makefile.in: Regenerate.
6311 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6312 * testsuite/thumb_blx_in_range.s: New file.
6313 * testsuite/thumb_blx_out_of_range.s: New file.
6314
b0193076
RÁE
63152010-03-22 Rafael Espindola <espindola@google.com>
6316
6317 * archive.cc (Should_include): Move to archive.h.
6318 (should_include_member): Make it a member of Archive.
6319 (Lib_group): New.
6320 (Add_lib_group_symbols): New.
6321 * archive.h: Include options.h.
6322 (Archive_member): Moved from Archive.
6323 (Should_include): Moved from archive.cc.
6324 (Lib_group): New.
6325 (Add_lib_group_symbols): New.
6326 * dynobj.cc (do_should_include_member): New.
6327 * dynobj.h (do_should_include_member): New.
6328 * gold.cc (queue_initial_tasks): Update call to queue.
6329 * main.cc (main): Print lib group stats.
6330 * object.cc (do_should_include_member): New.
6331 * object.h: Include archive.h.
6332 (Object::should_include_member): New.
6333 (Object::do_should_include_member): New.
6334 (Sized_relobj::do_should_include_member): New.
6335 * options.cc (General_options::parse_start_lib): New.
6336 (General_options::parse_end_lib): New.
6337 (Input_arguments::add_file): Handle lib groups.
6338 (Input_arguments::start_group): Check we are not in a lib.
6339 (Input_arguments::start_lib): New.
6340 (Input_arguments::end_lib): New.
6341 * options.h (General_options): Add start_lib and end_lib.
6342 (Input_argument::lib_): New.
6343 (Input_argument::lib): New.
6344 (Input_argument::is_lib): New.
6345 (Input_file_lib): New.
6346 (Input_arguments::in_lib_): New.
6347 (Input_arguments::in_lib): New.
6348 (Input_arguments::start_lib): New.
6349 (Input_arguments::end_lib_): New.
6350 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6351 in unused members as preempted.
6352 (Sized_pluginobj::do_should_include_member): New.
6353 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6354 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6355 return the blocker.
6356 (Read_symbols::do_whole_lib_group): New.
6357 (Read_symbols::do_lib_group): New.
6358 (Read_symbols::do_read_symbols): Handle lib groups.
6359 (Read_symbols::get_name): Handle lib groups.
6360 * readsyms.h (Read_symbols): Add an archive member pointer.
6361 (Read_symbols::do_whole_lib_group): New.
6362 (Read_symbols::do_lib_group): New.
6363 (Read_symbols::member_): New.
6364 * script.cc (read_input_script): Update call to queue_soon.
6365
d099120c
DK
63662010-03-19 Doug Kwan <dougkwan@google.com>
6367
6368 * arm.cc (Stub_table::Stub_table): Initialize new data members
6369 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6370 (Stub_table::add_reloc_stub): Assign stub offset and update
6371 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6372 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6373 New data members.
2e702c99 6374 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6375 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6376 instead of going over all reloc stubs.
2e702c99 6377 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6378 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6379 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6380 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6381 Stringpool_template::offset_.
6382 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6383 Stringpool_template::offset_ to zero.
6384
1aa37384
DK
63852010-03-15 Doug Kwan <dougkwan@google.com>
6386
6387 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6388 offset_.
6389 (Stringpool_template::new_key_offset): New method.
6390 (Stringpool_template::add_string): Assign offsets when adding new
6391 strings.
6392 (Stringpool_template::set_string_offsets): Do not set string offsets
6393 when not optimizing.
6394 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6395 member size_.
2e702c99
RM
6396 (Chunked_vector::clear): Clear size_.
6397 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6398 (Chunked_vector::size): Return size_.
6399 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6400 (Chunked_vector::size_): New data member.
1aa37384
DK
6401 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6402 (Stringpool_template::new_key_offset): New method declaration.
6403 (Stringpool_template::offset_): New data member.
6404
b672b057
RÁE
64052010-03-15 Rafael Espindola <espindola@google.com>
6406
6407 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6408 Add_symbols' constructor.
6409 * readsyms.h (Add_symbols): Remove the input_group member.
6410
b6848d3c
ILT
64112010-03-10 Ian Lance Taylor <iant@google.com>
6412
6413 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6414 target to ask whether a reference to a symbol requires a stack
6415 split.
6416 * target.h (Target::is_call_to_non_split): New function.
6417 (Target::do_is_call_to_non_split): Declare virtual function.
6418 * target.cc: Include "symtab.h".
6419 (Target::do_is_call_to_non_split): New function.
6420 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6421
a2a5469e
CC
64222010-03-10 Cary Coutant <ccoutant@google.com>
6423
6424 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6425 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6426 (File_read::open[2]): Add whole_file_view_ to list of views.
6427 (File_read::make_view): Remove test of whole_file_view_.
6428 (File_read::find_or_make_view): Create whole_file_view_ if
6429 necessary.
6430 (File_read::clear_views): Replace bool parameter with enum;
6431 adjust all callers. Don't delete views with permanent data;
6432 do delete cached views and views from archives if
6433 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6434 if clearing the corresponding view.
6435 * fileread.h (File_read::Clear_views_mode): New enum.
6436 (File_read::View::is_permanent_view): New method.
6437 (File_read::clear_views): Replace bool parameter
6438 with enum; adjust all callers.
6439 * options.h (General_options): Change keep_files_mapped option;
6440 add map_whole_files.
6441 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6442 releasing the file.
6443 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6444 the file.
6445
8861f32b
DM
64462010-03-10 David S. Miller <davem@davemloft.net>
6447
6448 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6449
d62d0f5f
ST
64502010-03-09 Sriraman Tallam <tmsriram@google.com>
6451
6452 * icf.cc (get_section_contents): Add '@' marker after processing the
6453 merge reloc.
6454
9177756d
DK
64552010-03-08 Doug Kwan <dougkwan@google.com>
6456
6457 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6458 due to a conversion warning.
6459 (Arm_relobj::update_output_local_symbol_count): Check for local
6460 symbol with unset output index.
6461
9e9e071b
ILT
64622010-03-05 Ian Lance Taylor <iant@google.com>
6463
6464 * options.h (class General_options): Add --spare-dynamic-tags.
6465 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6466 --spare-dynamic-tags.
6467
a81ee015
ILT
64682010-03-05 Ian Lance Taylor <iant@google.com>
6469
6470 * incremental.cc: Include "libiberty.h".
6471
44ec90b9
RO
64722010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6473
6474 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6475 function, is_info_ member.
6476 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6477 (Versions::Versions): Update caller.
6478 (Versions::define_base_version): Likewise.
6479 (Versions::add_def): Likewise.
6480
0897ed3b
ST
64812010-03-03 Sriraman Tallam <tmsriram@google.com>
6482
6483 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6484 (Scan::possible_function_pointer_reloc): New function.
6485 (Scan::local_reloc_may_be_function_pointer): Change to call
6486 possible_function_pointer_reloc.
6487 (Scan::global_reloc_may_be_function_pointer): Ditto.
6488 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6489 relocations in ".data.rel.ro._ZTV" section.
6490 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6491 * testsuite/icf_safe_so_test.cc: Ditto.
6492 * testsuite/icf_safe_test.cc: Ditto.
6493 * testsuite/icf_safe_test.sh: Ditto.
6494
d3bbad62
ILT
64952010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6496 Ian Lance Taylor <iant@google.com>
6497
6498 * target-reloc.h (relocate_section): Check the symbol table index
6499 for -1U before setting the local symbol index.
6500 (scan_relocatable_relocs): If copying the relocation, record that
6501 the local symbol is required.
6502 * object.h (Symbol_value::is_output_symtab_index_set): New
6503 function.
6504 (Symbol_value::may_be_discarded_from_output_symtab): New
6505 function.
6506 (Symbol_value::has_output_symtab_entry): New function.
6507 (Symbol_value::needs_output_symtab_entry): Remove.
6508 (Symbol_value::output_symtab_index): Make sure the symbol index is
6509 set.
6510 (Symbol_value::set_output_symtab_index): Make sure the symbol
6511 index is not set. Make sure the new index is valid.
6512 (Symbol_value::set_must_have_output_symtab_entry): New function.
6513 (Symbol_value::has_output_dynsym_entry): New function.
6514 (Symbol_value::set_output_dynsym_index): Make sure the new index
6515 is valid.
6516 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6517 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6518 local symbol if permitted.
6519 (Sized_relobj::do_finalize_local_symbols): Call
6520 is_output_symtab_index_set rather than needs_output_symtab_entry.
6521 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6522 rather than needs_output_symtab_entry. Call
6523 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6524 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6525 is_output_symtab_index_set rather than needs_output_symtab_entry.
6526 * testsuite/discard_locals_relocatable_test.c: New file.
6527 * testsuite/discard_locals_test.sh: Test -r.
6528 * testsuite/Makefile.am (check_DATA): Add
6529 discard_locals_relocatable_test1.syms,
6530 discard_local_relocatable_test2.syms.
6531 (MOSTLYCLEANFILES): Likewise. Also add
6532 discard_locals_relocatable_test1.lout and
6533 discard_locals_relocatable_test2.out.
6534 (discard_locals_relocatable_test1.syms): New target.
6535 (discard_locals_relocatable_test.o): New target.
6536 (discard_locals_relocatable_test1.out): New target.
6537 (discard_locals_relocatable_test2.syms): New target.
6538 (discard_locals_relocatable_test2.out): New target.
6539 (various): Add missing ../ld-new dependencies.
6540 * testsuite/Makefile.in: Rebuild.
6541
7e8ccf26
NC
65422010-03-03 Nick Clifton <nickc@redhat.com>
6543
6544 * po/fi.po: New Finnish translation.
6545
2a0ff005
DK
65462010-03-01 Doug Kwan <dougkwan@google.com>
6547
6548 * layout.cc (Layout::Layout): Force section types of .init_array*,
6549 .preinit_array* and .fini_array* sections.
6550 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6551 Fix check of return value of std::string::find.().
6552 (Output_section::Input_section_sort_compare::operator()): Remove
6553 comment about .init_array.
6554 (Output_section::Input_section_sort_init_fini_compare::operator()):
6555 New method.
6556 (Output_section::sort_attached_input_sections): Handle .init_array
6557 and .fini_array specially.
6558 * output.h (Output_section::Inut_section_sort_compare): Update
6559 comment.
6560 (Output_section::Input_section_sort_init_fini_compare): New struct.
6561
c3e4ae29
DK
65622010-02-26 Doug Kwan <dougkwan@google.com>
6563
6564 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6565 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6566 * testsuite/debug_msg.sh: Avoid matching source line number for
6567 use of global variable undef_int.
6568
2fd9ae7a
DK
65692010-02-26 Doug Kwan <dougkwan@google.com>
6570
6571 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6572 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6573 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6574 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6575 * options.cc (General_options::General_options): Initialize member
6576 fix_v4bx_.
6577 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6578 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6579 and rm_no_fix_v4bx.stdout
6580 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6581 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6582 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6583 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6584 and arm_no_fix_v4bx.
6585 * Makefile.in: Regenerate.
6586 * testsuite/arm_fix_v4bx.s: New file.
6587 * testsuite/arm_fix_v4bx.sh: Ditto.
6588
67ec7d0b
DK
65892010-02-24 Doug Kwan <dougkwan@google.com>
6590
6591 * arm.cc (Target_arm::got_section): Make the .got section the first
6592 non RELRO section in the data segment.
6593 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6594 suffixes of section names.
6595
10165461
DK
65962010-02-24 Doug Kwan <dougkwan@google.com>
6597
6598 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6599 flags and attributes merging if an input file is a binary file.
6600 * fileread.cc (Input_file::open): Record format of original file.
6601 * fileread.h (Input_file::Format): New enum type.
2e702c99 6602 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6603 (Input_file::format): New method definition.
6604 (Input_file::format_):: New data member.
6605
4a54abbb
DK
66062010-02-24 Doug Kwan <dougkwan@google.com>
6607
6608 * arm.cc (Arm_output_data_got): New class.
6609 (ARM_TCB_SIZE): New constant
6610 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6611 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6612 If user uses a script with a SECTIONS clause, issue only a warning
6613 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6614 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6615 garbage collection.
6616 (Target_arm::got_mode_index_entry): Handle static linking.
6617 (Target_arm::Scan::local): Ditto.
6618 (Target_arm::Scan::global): Ditto.
6619 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6620 all incorrectly implemented relocations.
e1df38aa 6621 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6622 Arm_output_section::fix_exidx_coverage.
6623 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6624 from ".ARM.exidx." and ".ARM.extab.".
6625
ca419a6f
ILT
66262010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6627
6628 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6629 section if it does not already exist.
6630 * attributes.cc (Attributes_section_data::Attributes_section_data):
6631 Don't crash if size is zero.
6632
135b9c78
ILT
66332010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6634 Ian Lance Taylor <iant@google.com>
6635
6636 * gold.cc (queue_middle_tasks): If no input files were opened,
6637 exit.
6638 * workqueue.h (Task_function::Task_function): Assert that there is
6639 a blocker.
6640
bb0bfe4f
DK
66412010-02-22 Doug Kwan <dougkwan@google.com>
6642
6643 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6644 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6645 types to avoid warnings due to different uint64_t implementations
6646 on different hosts.
6647
2a2b6d42
DK
66482010-02-21 Doug Kwan <dougkwan@google.com>
6649
6650 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6651 handling of the maximum backward branch offset.
2e702c99 6652 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6653 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6654 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6655 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6656 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6657 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6658 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6659 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6660 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6661 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6662 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6663 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6664 thumb2_bl_out_of_range.o): New rules.
6665 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6666 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6667 thumb2_bl_out_of_range
6668 * testsuite/Makefile.in: Regenerate.
6669 * testsuite/arm_bl_in_range.s: New file.
6670 * testsuite/arm_bl_out_of_range.s: Ditto.
6671 * testsuite/arm_branch_in_range.sh: Ditto.
6672 * testsuite/arm_branch_range.t: Ditto.
6673 * testsuite/thumb2_branch_range.t: Ditto.
6674 * testsuite/thumb_bl_in_range.s: Ditto.
6675 * testsuite/thumb_bl_out_of_range.s: Ditto.
6676 * testsuite/thumb_branch_range.t: Ditto.
6677
b487ad64
ST
66782010-02-20 Sriraman Tallam <tmsriram@google.com>
6679
6680 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6681 Add reloc offset information.
6682 * icf.cc (get_section_contents): Change iterators to point to the new
6683 vectors. Add reloc offset information to the contents.
6684 * icf.h (Icf::Sections_reachable_info): New typedef.
6685 (Icf::Sections_reachable_list): New typedef.
6686 (Icf::Offset_info): New typedef.
6687 (Icf::Reloc_info): New struct typedef.
6688 (Icf::Reloc_info_list): New typedef.
6689 (Icf::symbol_reloc_list): Delete method.
6690 (Icf::addend_reloc_list): Delete method.
6691 (Icf::section_reloc_list): Delete method.
6692 (Icf::reloc_info_list): New method.
6693 (Icf::reloc_info_list_): New member.
6694
f96accdf
DK
66952010-02-19 Doug Kwan <dougkwan@google.com>
6696
6697 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6698 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6699 * arm.cc (Arm_relocation_functions): New forward declaration.
6700 (Target_arm::Target_arm): Initialize new data members
6701 got_mod_index_offset_ and tls_base_symbol_defined_.
6702 (Target_arm::Relocate::relocate_tls): New method.
6703 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6704 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6705 New methods.
2e702c99 6706 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6707 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6708 (Target_arm::got_mod_index_offset_,
6709 Target_arm::tls_base_symbol_defined_): New data members.
6710 (Target_arm::Scan::local, Target::Scan::global,
6711 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6712 relocations.
6713
c8761b9a
DK
67142010-02-18 Doug Kwan <dougkwan@google.com>
6715
6716 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6717 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6718 text section as a parameter becuase some broken tools may not set
6719 the link in section header.
6720 (Target_arm::has_got_section): New method.
6721 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6722 without any mapping symbol as data only. Remove warning.
6723 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6724 link in its section header, try to discover the link by inspecting the
6725 REL31 relocation at the beginning of the section.
6726 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6727 in error message.
6728 (Target_arm::Scan::global): Treat any reference to the symbol
6729 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6730
21bb3914
ST
67312010-02-12 Sriraman Tallam <tmsriram@google.com>
6732
6733 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6734 (Scan::global_reloc_may_be_function_pointer): New function.
6735 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6736 (Scan::global_reloc_may_be_function_pointer): New function.
6737 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6738 (Scan::global_reloc_may_be_function_pointer): New function.
6739 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6740 (Scan::global_reloc_may_be_function_pointer): New function.
6741 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6742 (Scan::global_reloc_may_be_function_pointer): New function.
6743 (Scan::possible_function_pointer_reloc): New function.
6744 (Target_x86_64::can_check_for_function_pointers): New function.
6745 * gc.h (gc_process_relocs): Scan relocation types to determine if
6746 function pointers were taken for targets that support it.
6747 * icf.cc (Icf::find_identical_sections): Include functions for
6748 folding in safe ICF whose pointer is not taken.
6749 * icf.h (Secn_fptr_taken_set): New typedef.
6750 (fptr_section_id_): New member.
6751 (section_has_function_pointers): New function.
6752 (set_section_has_function_pointers): New function.
6753 (check_section_for_function_pointers): New function.
6754 * options.h: Fix comment for safe ICF option.
6755 * target.h (can_check_for_function_pointers): New function.
6756 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6757 Modify icf_safe_test for X86-64.
6758 * testsuite/Makefile.in: Regenerate.
6759 * testsuite/icf_safe_so_test.cc: New file.
6760 * testsuite/icf_safe_so_test.sh: New file.
6761 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6762 (main): Change to take pointer to function kept_func_3.
6763 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6764 folding is done correctly for X86-64.
6765
0da6fa6c
DM
67662010-02-12 David S. Miller <davem@davemloft.net>
6767
6768 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6769 is_symbolless parameter.
6770 (Output_reloc<SHT_REL>::is_symbolless): New.
6771 (Output_reloc<SHT_REL>::is_symbolless_): New.
6772 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6773 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6774 (Output_reloc<SHT_RELA>::is_symbolless): New.
6775 (Output_data_reloc::add_global): Handle is_symbolless.
6776 (Output_data_reloc::add_global_relative): Likewise.
6777 (Output_data_reloc::add_local): Likewise.
6778 (Output_data_reloc::add_local_relative): Likewise.
6779 (Output_data_reloc::add_symbolless_global_addend): New.
6780 (Output_data_reloc::add_symbolless_local_addend): New.
6781 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6782 is_symbolless.
6783 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6784 instead of ->is_relative_
6785 (Output_reloc::write): Likewise.
6786 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6787 (Output_reloc::write_rel): Simplify.
6788
6789 * sparc.cc (Target_sparc::Scan::local): Use
6790 ->add_symbolless_local_addend as needed.
6791 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6792 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6793 based upon relocation offset.
6794
e4782e83
DK
67952010-02-11 Doug Kwan <dougkwan@google.com>
6796
6797 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6798 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6799 beginning of function.
6800 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6801 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6802 parameter is_32bit in calls to should_apply_static_reloc.
6803 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6804 (check_DATA): Add arm_abs_global.stdout.
6805 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6806 arm_abs_global.stdout): New rules.
6807 (MOSTLLYCLEANFILES): Add arm_abs_global
6808 * Makefile.in: Regenerate.
6809 * testsuite/arm_abs_global.s: New file.
6810 * testsuite/arm_abs_global.sh: Ditto.
6811 * testsuite/arm_abs_lib.s: Ditto.
6812
93ceb764
ILT
68132010-02-11 Ian Lance Taylor <iant@google.com>
6814
6815 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6816 Read_relocs task.
6817 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6818 Allocate_commons_task first.
6819 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6820 task, rather than symtab_lock_.
6821 (Gc_process_relocs::~Gc_process_relocs): New function.
6822 (Gc_process_relocs::is_runnable): Check this_blocker_.
6823 (Gc_process_relocs::locks): Use next_blocker_ rather than
6824 blocker_.
6825 (Scan_relocs::~Scan_relocs): New function.
6826 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6827 symtab_lock_.
6828 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6829 next_blocker_.
6830 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6831 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6832 constructor accordingly.
6833 (class Gc_process_relocs): Likewise.
6834 (class Scan_relocs): Likewise.
6835 * common.h (class Allocate_commons_task): Remove symtab_lock_
6836 field, and corresponding constructor parameter.
6837 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6838 symtab_lock_.
6839 (Allocate_commons_task::locks): Likewise.
6840
114dfbe1
ILT
68412010-02-11 Ian Lance Taylor <iant@google.com>
6842
6843 * gold-threads.h (class Once): Define.
6844 (class Initialize_lock): Rewrite as child of Once.
6845 * gold-threads.cc (class Once_initialize): Define.
6846 (once_pointer_control): New static variable.
6847 (once_pointer, once_arg): New static variables.
6848 (c_run_once): New static function.
6849 (Once::Once, Once::run_once, Once::internal_run): New functions.
6850 (class Initialize_lock_once): Remove.
6851 (initialize_lock_control): Remove.
6852 (initialize_lock_pointer): Remove.
6853 (initialize_lock_once): Remove.
6854 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6855 (Initialize_lock::initialize): Rewrite.
6856 (Initialize_lock::do_run_once): New function.
6857 * archive.cc (Archive::interpret_header): Only clear name if it is
6858 not already empty.
6859 * fileread.cc: Include "gold-threads.h"
6860 (file_counts_lock): New static variable.
6861 (file_counts_initialize_lock): Likewise.
6862 (File_read::release): Only increment counts when using --stats.
6863 Use a lock around the increment.
6864 * parameters.cc (class Set_parameters_target_once): Define.
6865 (set_parameters_target_once): New static variable.
6866 (Parameters::Parameters): Move here from parameters.h.
6867 (Parameters::set_target): Rewrite.
6868 (Parameters::set_target_once): New function.
6869 (Parameters::clear_target): Move here and rewrite.
6870 * parameters.h (class Parameters): Update declarations. Add
6871 set_parameters_target_once_ field.
6872 (Parameters::Parameters): Move to parameters.cc.
6873 (Parameters::clear_target): Likewise.
6874 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6875 task.
6876 (Start_group::~Start_group): New function.
6877 (Start_group::is_runnable): New function.
6878 (Start_group::locks, Start_group::run): New functions.
6879 (Finish_group::run): Change saw_undefined to size_t.
6880 * readsyms.h (class Start_group): Define.
6881 (class Finish_group): Change saw_undefined_ field to size_t.
6882 (Finish_group::Finish_group): Remove saw_undefined and
6883 this_blocker parameters. Change all callers.
6884 (Finish_group::set_saw_undefined): New function.
6885 (Finish_group::set_blocker): New function.
6886 * symtab.h (class Symbol_table): Change saw_undefined to return
6887 size_t. Change saw_undefined_ field to size_t.
6888 * target-select.cc (Set_target_once::do_run_once): New function.
6889 (Target_selector::Target_selector): Initialize set_target_once_
6890 field. Don't initialize lock_ and initialize_lock_ fields.
6891 (Target_selector::instantiate_target): Rewrite.
6892 (Target_selector::set_target): New function.
6893 * target-select.h (class Set_target_once): Define.
6894 (class Target_selector): Update declarations. Make
6895 Set_target_once a friend. Remove lock_ and initialize_lock_
6896 fields. Add set_target_once_ field.
6897
fa17a3f4
ILT
68982010-02-10 Ian Lance Taylor <iant@google.com>
6899
6900 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6901 queueing any tasks.
6902 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6903 (queue_middle_tasks): Add all blockers before queueing any tasks.
6904 (queue_final_tasks): Likewise.
6905 * token.h (Task_token::add_blockers): New function.
6906 * object.h (Input_objects::number_of_relobjs): New function.
6907
c7177d31
ILT
69082010-02-10 Ian Lance Taylor <iant@google.com>
6909
5de0e392
ILT
6910 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6911 shared, not if not position independent.
6912 * x86_64.cc (Relocate::relocate_tls): Likewise.
6913 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6914 (tls_pie_pic_test): New target.
6915 * testsuite/Makefile.in: Rebuild.
6916
c7177d31
ILT
6917 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6918 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6919 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6920 * testsuite/Makefile.in: Rebuild.
6921
684b268a
DM
69222010-02-09 David S. Miller <davem@davemloft.net>
6923
6924 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6925 R_SPARC_RELATIVE using ->add_local_relative().
6926 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6927
612a8d3d
DM
6928 * output.h (Output_data_dynamic::add_section_size): New method
6929 that takes two Output_data objects.
6930 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6931 entry param. Handle it in initializers.
6932 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6933 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6934 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6935 arg.
6936 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6937 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6938 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6939 for dynrel_includes_plt.
6940 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6941 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6942 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6943 before .rela.plt
6944 (Target_sparc::do_finalize_sections): Update to pass true for
6945 dynrel_includes_plt.
6946 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6947 output before .rela.plt
6948 (Target_powerpc::do_finalize_sections): Update to pass true for
6949 dynrel_includes_plt when 32-bit.
6950
cb1be87e
DK
69512010-02-08 Doug Kwan <dougkwan@google.com>
6952
6953 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6954 method.
6955 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6956 Arm_relobj::scan_section_for_cortex_a8_stubs,
6957 Arm_relobj::do_relocation_section): Instead of calling
6958 Output_section::output_address, use faster
6959 Arm_relobj::simple_input_section_output_address.
6960
705b5121
DM
69612010-02-08 David S. Miller <davem@davemloft.net>
6962
6963 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6964 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6965 relocation helper function.
6966
024c4466
DM
6967 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6968 just like R_SPARC_GOT{10,13,22}.
6969 (Target_sparc::Scan::local): Likewise.
6970 (Target_sparc::Relocate:relocate): Likewise.
6971
9109c078
ILT
69722010-02-06 Ian Lance Taylor <iant@google.com>
6973
6974 * configure.ac: Rewrite targetobjs duplicate removal code to use
6975 only shell constructs.
6976 * configure: Rebuild.
6977
cf846138
DK
69782010-02-05 Doug Kwan <dougkwan@google.com>
6979
6980 PR 11247
6981 * arm.cc (Arm_relobj::section_is_scannable): New method.
6982 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6983 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6984
6cfaf60b
DK
69852010-02-04 Doug Kwan <dougkwan@google.com>
6986
6987 PR 11247
6988 * arm-reloc-property.cc (cstdio): Include.
6989 * configure.ac (targetobjs): Remove duplicates.
6990 * configure: Regenerate.
6991 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6992 big and little endian version for a given address size.
6993
5c57f1be
DK
69942010-02-03 Doug Kwan <dougkwan@google.com>
6995
6996 * arm-reloc-property.cc
6997 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6998 definition.
6999 * arm-reloc-property.h
7000 (Arm_reloc_property_table::get_implemented_static_reloc_property):
7001 New method definition.
7002 (Arm_reloc_property_table::reloc_name_in_error_message): New method
7003 declaration.
7004 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
7005 overflow to N.
7006 (GOT_PREL): Change implemented to Y.
7007 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
7008 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
7009 (Arm_relocate_functions::movw_abs_nc): Remove method.
7010 (Arm_relocate_functions::movt_abs): Ditto.
7011 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
7012 (Arm_relocate_functions::thm_movt_abs): Ditto.
7013 (Arm_relocate_functions::movw_rel_nc): Ditto.
7014 (Arm_relocate_functions::movw_rel): Ditto.
7015 (Arm_relocate_functions::movt_rel): Ditto.
7016 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
7017 (Arm_relocate_functions:thm_movw_rel): Ditto.
7018 (Arm_relocate_functions:thm_movt_rel): Ditto.
7019 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
7020 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
7021 New method definitions.
7022 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
7023 (Arm_relocation_functions::arm_grp_ldr): Ditto.
7024 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
7025 (Arm_relocation_functions::arm_grp_ldc): Ditto.
7026 (Target_arm::Relocate::relocate): Check for non-static or
7027 unimplemented relocation code and exit early. Change calls to
7028 Target_arm::reloc_uses_thumb_bit and
7029 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
7030 instead. Refactor code to handle similar relocations to increase
7031 code sharing. Remove check for unsupported relocation code in switch
7032 statement.
7033 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
7034 relocation property table to find out size. Change error message to
7035 print out the name of a relocation code instead of the numeric value.
7036 (Target_arm::scan_reloc_for_stub): Use relocation property table
7037 instead of calling Target_arm::reloc_uses_thumb_bit().
7038
218c5831
DK
70392010-02-02 Doug Kwan <dougkwan@google.com>
7040
7041 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
7042 types of relaxed input section.
7043
0d31c79d
DK
70442010-02-02 Doug Kwan <dougkwan@google.com>
7045
7046 * Makefile.am (HFILES): Add arm-reloc-property.h.
7047 (DEFFILES): New.
2e702c99
RM
7048 (TARGETSOURCES): Add arm-reloc-property.cc
7049 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
7050 (libgold_a_SOURCES): $(DEFFILES)
7051 * Makefile.in: Regenerate.
7052 * arm-reloc-property.cc: New file.
7053 * arm-reloc-property.h: New file.
7054 * arm-reloc.def: New file.
7055 * arm.cc: Update comments.
7056 (arm-reloc-property.h): New included header.
7057 (arm_reloc_property_table): New global variable.
7058 (Target_arm::do_select_as_default_target): New method definition.
7059 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
7060 arm-reloc-property to targ_extra_obj.
7061 * parameters.cc (set_parameters_target): Call
7062 Target::select_as_default_target().
7063 * target.h (Target::select_as_default_target): New method definition.
7064 (Target::do_select_as_default_target): Same.
7065
546c7457
DK
70662010-02-01 Doug Kwan <dougkwan@google.com>
7067
7068 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
7069 first_output_text_section_.
7070 (Arm_exidx_fixup::first_output_text_section): New method definition.
7071 (Arm_exidx_fixup::first_output_text_section_): New data member.
7072 (Arm_exidx_fixup::process_exidx_section): Record the first text
7073 output section seen.
7074 (Arm_output_section::fix_exidx_coverage): Set correct linked section
7075 and entsize in output section header.
7076
11b861d5
DK
70772010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7078
7079 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
7080 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
7081 (Arm_relocate_functions::thm_alu11): New Method.
7082 (Arm_relocate_functions::thm_pc8): New Method.
7083 (Arm_relocate_functions::thm_pc12): New Method.
7084 (Target_arm::Scan::local): Handle the relocations.
7085 (Target_arm::Scan::global): Likewise.
7086 (Target_arm::Relocate::relocate): Likewise.
7087 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7088
c9a2c125
DK
70892010-01-29 Doug Kwan <dougkwan@google.com>
7090
7091 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
7092 of relocation types as ld.
7093
1521477a
DK
70942010-01-29 Doug Kwan <dougkwan@google.com>
7095
7096 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7097 to public.
7098 (Arm_relocate_functions::thumb_branch_common): Ditto.
7099 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7100 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7101 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7102 Arm_relocate_functions::jump24): Remove.
7103 (Target_arm::Relocate::relocate): Adjust code to call
7104 Arm_relocation_functions::arm_branch_common and
7105 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7106 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7107
e7eca48c
DK
71082010-01-29 Doug Kwan <dougkwan@google.com>
7109
7110 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7111 output_local_symbol_count_needs_update_.
7112 (Arm_relobj::output_local_symbol_count_needs_update,
7113 Arm_relobj::set_output_local_symbol_count_needs_update,
7114 Arm_relobj::update_output_local_symbol_count): New methods.
7115 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7116 member.
7117 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7118 of pointed function as in a R_ARM_PREL31 relocation.
7119 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7120 for output local symbol count updating.
7121 (Target_arm::do_relax): Update output local symbol counts in objects
7122 if necessary.
7123 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7124
02961d7e
ILT
71252010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7126
7127 * arm.cc: Added support for the ARM relocations:
7128 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7129 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7130 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7131 movw_prel_nc).
7132 (Arm_relocate_functions::movw_rel): New method.
7133 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7134 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7135 thm_movw_prel_nc).
7136 (Arm_relocate_functions::thm_movw_rel): New method.
7137 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7138 thm_movt_prel).
7139 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7140 relocations.
7141 (Target_arm::Scan::global): Likewise.
7142 (Target_arm::Relocate::relocate): Likewise.
7143 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7144 Likewise.
7145
b10d2873
ILT
71462010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7147
7148 * arm.cc: Added support for ARM group relocations.
7149 (Target_arm::reloc_needs_sym_origin): New method.
7150 (Arm_relocate_functions::calc_grp_kn): New method.
7151 (Arm_relocate_functions::calc_grp_residual): New method.
7152 (Arm_relocate_functions::calc_grp_gn): New method.
7153 (Arm_relocate_functions::arm_grp_alu): New Method.
7154 (Arm_relocate_functions::arm_grp_ldr): New Method.
7155 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7156 (Arm_relocate_functions::arm_grp_ldc): New Method.
7157 (Target_arm::Scan::local): Handle the ARM group relocations.
7158 (Target_arm::Scan::global): Likewise.
7159 (Target_arm::Relocate::relocate): Likewise.
7160 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7161 Likewise.
7162
2b328d4e
DK
71632010-01-26 Doug Kwan <dougkwan@google.com>
7164
7165 * arm.cc (set): Include.
7166 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7167 pointer type.
2e702c99 7168 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7169 (Arm_output_section::append_text_sections_to_list): New method.
7170 (Arm_output_section::fix_exidx_coverage): Ditto.
7171 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7172 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7173 Relobj::set_section_offset() instead of
7174 Sized_relobj::invalidate_section_offset().
2e702c99 7175 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7176 parameter for section headers. Ignore relocation sections for
7177 unallocated sections and EXIDX sections.
7178 (Target_arm::fix_exidx_coverage): New method.
7179 (Target_arm::output_section_address_less_than): New type.
7180 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7181 linked text section instead of the EXIDX section.
7182 (Arm_output_section::create_stub_group): Add an assertion to check
7183 that this is not an EXIDX output section.
7184 (Arm_output_section::append_text_sections_to_list): New method.
7185 (Arm_output_section::fix_exidx_coverage): Ditto.
7186 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7187 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7188 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7189 first pass.
7190 (Target_arm::fix_exidx_coverage): New method.
7191 * object.h (Relobj::set_output_section): New method.
7192 (Sized_relobj::invalidate_section_offset): Remove method.
7193 (Sized_relobj::do_invalidate_section_offset): Remove method.
7194 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7195
c7f3c371
DK
71962010-01-25 Doug Kwan <dougkwan@google.com>
7197
7198 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7199 Fix warning due to signed and unsigned comparison on a 32-bit host.
7200
8923b24c
DK
72012010-01-22 Doug Kwan <dougkwan@google.com>
7202
7203 * arm.cc (Target_arm::do_relax): Record an output section for section
7204 offset adjustment it contains any stub table that has changed.
7205 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7206 offsets in an output section if necessary.
7207 * output.cc (Output_section::Output_section): Initialize
7208 section_offsets_need_adjustments_.
7209 (Output_section::add_input_section_for_script): Renamed to
7210 Output_section::add_simple_input_section.
7211 (Output_section::save_states): Add a comment.
7212 (Output_section::discard_states): New method defintion.
7213 (Output_section::adjust_section_offsets): Same.
7214 * output.h (Output_section::add_input_section_for_script): Renamed to
7215 Output_section::add_simple_input_section.
7216 (Output_section::discard_states): New method declaration.
7217 (Output_section::adjust_section_offsets): Same.
7218 (Output_section::section_offsets_need_adjustment,
7219 Output_section::set_section_offsets_need_adjustment): New method
7220 definitions.
7221 (Output_section::section_offsets_need_adjustment_): New data member.
7222 * script-sections.cc
7223 (Output_section_element_input::set_section_address): Adjust code for
7224 renaming of Output_section::add_input_section_for_script.
7225 (Orphan_output_section::set_section_address): Same.
7226
9b2fd367
DK
72272010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7228
7229 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7230 Fix_v4bx enum values .
7231 * gold/options.h (General_options): New option definitions.
7232 (General_options::fix_v4bx): New method.
7233 (General_options::Fix_v4bx): New enum.
7234 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7235 (General_options::parse_fix_v4bx_interworking): New method.
7236
80d0d023
DK
72372010-01-22 Doug Kwan <dougkwan@google.com>
7238
7239 * arm.cc (Arm_exidx_fixup): New class.
7240
af2cdeae
DK
72412010-01-21 Doug Kwan <dougkwan@google.com>
7242
7243 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7244 classes.
7245 (Arm_exidx_section_offset_map): New type.
7246
993d07c1
DK
72472010-01-21 Doug Kwan <dougkwan@google.com>
7248
7249 * arm.cc (Arm_exidx_input_section): New class.
7250 (Arm_relobj::exidx_input_section_by_link,
7251 Arm_relobj::exidx_input_section_by_shndx,
7252 Arm_relobj::make_exidx_input_section): New methods.
7253 (read_arm_attributes_section): Remove.
7254 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7255 information about them.
7256 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7257 to here.
7258
5ac169d4
DK
72592010-01-20 Doug Kwan <dougkwan@google.com>
7260
7261 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7262 Input_section_specifier to Section_id.
7263 (Target_arm::new_arm_input_section: Adjust code for change of key
7264 type.
7265 (Target_arm::find_arm_input_section): Ditto.
7266 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7267 (Section_id): Remove.
7268 (Garbage_collection::Section_id_hash): Remove.
7269 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7270 (Section_id): Remove.
7271 (Icf::Section_id_hash): Remove.
7272 * object.h (Section_id, Const_section_id, Section_id_hash,
7273 Const_section_id_hash): New type definitions.
7274 * output.cc (Output_section::add_relaxed_input_section): Change to
7275 use Const_section_id instead of Input_section_specifier as key type.
7276 (Output_section::add_merge_input_section): Ditto.
7277 (Output_section::build_relaxation_map): Change to use Section_id
7278 instead of Input_section_specifier as key type.
2e702c99 7279 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7280 Ditto.
7281 (Output_section::convert_input_sections_to_relaxed_sections): Change
7282 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7283 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7284 (Output_section::find_relaxed_input_section): Ditto.
7285 * output.h (Input_section_specifier): Remove class.
7286 (Output_section::Output_section_data_by_input_section_map): Change
7287 key type to Const_section_id.
7288 (Output_section::Output_relaxed_input_section_by_input_section_map):
7289 Ditto.
7290 (Output_section::Relaxation_map): Change key type to Section_id.
7291
a2162063
ILT
72922010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7293
7294 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7295 (class Arm_v4bx_stub): New class.
7296 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7297 (Stub_factory::make_arm_v4bx_stub): New method.
7298 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7299 (Stub_table::empty): Handle v4bx stubs.
7300 (Stub_table::add_arm_v4bx_stub): New method.
7301 (Stub_table::find_arm_v4bx_stub): New method.
7302 (Arm_relocate_functions::v4bx): New method.
7303 (Target_arm::fix_v4bx): New method.
7304 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7305 (Stub_table::relocate_stubs): Likewise.
7306 (Stub_table::do_write): Likewise.
7307 (Stub_table::update_data_size_and_addralign): Likewise.
7308 (Stub_table::finalize_stubs): Likewise.
7309 (Target_arm::Scan::local): Likewise.
7310 (Target_arm::Scan::global): Likewise.
7311 (Target_arm::do_finalize_sections): Likewise.
7312 (Target_arm::Relocate::relocate): Likewise.
7313 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7314 Likewise.
7315 (Target_arm::scan_reloc_for_stub): Likewise.
7316 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7317
5696ab0b
ILT
73182010-01-19 Ian Lance Taylor <iant@google.com>
7319
7320 * output.cc (Output_section_headers::do_sized_write): Write large
7321 segment count to sh_info field.
7322 (Output_file_header::do_sized_write): For large segment count,
7323 write PN_XNUM to e_phnum field.
7324
800d0f56
ILT
73252010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7326
7327 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7328 (Arm_relocate_functions::thm_jump8): New function.
7329 (Arm_relocate_functions::thm_jump11): New function.
7330 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7331 R_ARM_THM_JUMP11.
7332 (Target_arm::Scan::global): Likewise.
7333 (Target_arm::Relocate::relocate): Likewise.
7334 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7335 Likewise.
7336
41263c05
DK
73372010-01-14 Doug Kwan <dougkwan@google.com>
7338
7339 * arm.cc (map, utility): Include headers.
7340 (Target_arm::apply_cortex_a8_workaround): New method.
7341 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7342 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7343 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7344 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7345 the --[no-]fix-cortex-a8 command line options.
7346 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7347 (Target_arm::relocate_stub): Use addend in instruction template.
7348 * options.h (DEFINE_bool): Set the user-set flag.
7349 (General_options): Add --[no-]-fix-cortex options.
7350 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7351 : Update fast look-up map after conversion.
41263c05 7352
459e9b03
ST
73532010-01-14 Sriraman Tallam <tmsriram@google.com>
7354
7355 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7356 in the first pass of do_layout.
7357
b521dfe4
DK
73582010-01-13 Doug Kwan <dougkwan@google.com>
7359
7360 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7361 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7362 apparent compiler problem of not folding static constant integral
7363 data members of elfcpp::Elf_sizes<32>.
7364
44272192
DK
73652010-01-13 Doug Kwan <dougkwan@google.com>
7366
7367 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7368 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7369 Arm_relobj::scan_section_for_cortex_a8_erratum,
7370 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7371 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7372 sections to scan for relocation stubs into a new method
7373 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7374 relocation and Cortex-A8 stub scanning.
7375 (Target_arm::do_relax): Force stubs to be after stubbed sections
7376 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7377 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7378 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7379
44b71ece
ILT
73802010-01-12 Ian Lance Taylor <iant@google.com>
7381
7382 * target-reloc.h (visibility_error): New inline function.
7383 (relocate_section): Call visibility_error.
7384 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7385 (MOSTLYCLEANFILES): Likewise.
7386 (protected_4_pic.o, protected_3.err): New targets.
7387 * testsuite/protected_4.cc: New file.
7388
a120bc7f
DK
73892010-01-12 Doug Kwan <dougkwan@google.com>
7390
7391 * arm.cc (Cortex_a8_reloc): New class.
7392 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7393 and cortex_a8_relocs_info_.
7394 (Target_arm::fix_cortex_a8): New method definition.
7395 (Target_arm::Cortex_a8_relocs_info): New type.
7396 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7397 New data member declarations.
7398 (Target_arm::scan_reloc_for_stub): Record information about
7399 relocations for THUMB branches that might be exempted from the
7400 Cortex-A8 workaround.
7401 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7402 at the beginning of a relaxation pass.
7403
20138696
DK
74042010-01-12 Doug Kwan <dougkwan@google.com>
7405
7406 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7407 (Arm_relobj::Mapping_symbol_position,
7408 Arm_reloj::Mapping_symbol_position_less,
7409 Arm_relobj::Mapping_symbols_info): New types.
7410 (Target_arm::is_mapping_symbol_name): New method definition.
7411 (Arm_relobj::do_count_local_symbols): Save information about mapping
7412 symbols.
7413
089d69dc
DK
74142010-01-11 Doug Kwan <dougkwan@google.com>
7415
7416 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7417 Arm_relocate_functions::thumb32_branch_upper,
7418 Arm_relocate_functions::thumb32_branch_lower,
7419 Arm_relocate_functions::thumb32_cond_branch_offset,
7420 Arm_relocate_functions::thumb32_cond_branch_upper,
7421 Arm_relocate_functions::thumb32_cond_branch_lower,
7422 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7423 branch offset encoding.
7424 (Arm_relocate_functions::thumb_branch_common): Use new branch
7425 offset encoding methods to avoid code duplication.
7426 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7427 (Stub_addend_reader::operator()): Use new branch encoding method
7428 to avoid code duplication.
7429
99e5bff2
DK
74302010-01-11 Doug Kwan <dougkwan@google.com>
7431
7432 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7433 (Target_arm::do_finalize_sections): Define special EXIDX section
7434 symbols only if referenced.
7435 * gc.h (Garbage_collection::add_reference): New method.
7436 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7437 code duplication.
7438
98e090bd
ILT
74392010-01-11 Ian Lance Taylor <iant@google.com>
7440
d0a91bd8
ILT
7441 * script.cc (Version_script_info::build_expression_list_lookup):
7442 Change complaing about duplicate wildcard match from error to
7443 warning.
7444
98e090bd
ILT
7445 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7446 of 2009-12-30.
7447 (Version_script_info::Version_script_info): Initialize globs_,
7448 default_version_, default_is_global_, and exact_. Don't
7449 initialize globals_ or locals_.
7450 (Version_script_info::build_lookup_tables): Build local symbols
7451 first.
7452 (Version_script_info::unquote): New function.
7453 (Version_script_info::add_exact_match): New function.
7454 (Version_script_info::build_expression_list_lookup): Remove lookup
7455 parameter. Add is_global parameter. Change all callers. Handle
7456 wildcard pattern specially. Unquote pattern. Call
7457 add_exact_match.
7458 (Version_script_info::get_name_to_match): New function.
7459 (Version_script_info::get_symbol_version): New function.
7460 (Version_script_info::get_symbol_version_helper): Remove.
7461 (Version_script_info::check_unmatched_names): Call unquote.
7462 * script.h (class Version_script_info): Change get_symbol_version
7463 to be non-inline and add is_global parameter; change all callers.
7464 Rewrite symbol_is_local. Update declarations. Define struct
7465 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7466 Remove globals_ and locals_ members. Add exact_, globs_,
7467 default_version_, is_global_.
7468 (Version_script_info::Glob): Remove pattern, add expression and
7469 is_global. Update constructor. Change all callers.
7470 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7471 default version.
7472 (Versions::symbol_section_contents): If a symbol is undefined, or
7473 defined in a dynamic object, set the version index to
7474 VER_NDX_LOCAL.
7475 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7476 symbol_is_local.
7477 (Symbol_table::add_from_pluginobj): Likewise.
7478 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7479
d56962d3
DK
74802010-01-11 Doug Kwan <dougkwan@google.com>
7481
7482 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7483 (incremental_dump_LDADD): Add linking option for libintl.
7484 * Makefile.in: Regenerate.
7485
94e6ee91
L
74862010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7487
7488 PR gold/11144
7489 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7490 instead of -Ds.
7491 * testsuite/Makefile.in: Regenerated.
7492
e96c574b
DK
74932010-01-10 Doug Kwan <dougkwan@google.com>
7494
7495 * options.h (DEFINE_var): Use parentheses around argument varname__
7496 in macro body to avoid any unintended subsequent substitutions.
7497
7198066b
ILT
74982010-01-10 Ian Lance Taylor <iant@google.com>
7499
ba4d53bf
ILT
7500 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7501 candidates before doing symbol resolution.
7502
7198066b
ILT
7503 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7504 ODR candidates if only one is weak.
7505
a2beed37
ILT
75062010-01-08 Ian Lance Taylor <iant@google.com>
7507
7508 * script.cc (Version_script_info::build_expression_list_lookup):
7509 Don't warn about ambiguous version, just record the ambiguity.
7510 (Version_script_info::get_symbol_version_helper): Give error if
7511 version is ambiguous.
7512
2fb7225c
DK
75132010-01-08 Doug Kwan <dougkwan@google.com>
7514
7515 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7516 prev_data_size_ and prev_addralign_. Remove initializer for
7517 deleted data member has_been_changed_.
7518 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7519 to determine if the table is empty.
7520 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7521 Remove.
7522 (Stub_table::add_reloc_stub): Define method in class definition
7523 instead of just declaring it there.
7524 (Stub_table::add_cortex_a8_stub): New method definition.
7525 (Stub_table::update_data_size_and_addralign): Ditto.
7526 (Stub_table::finalize_stubs): Ditto.
7527 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7528 (Stub_table::do_addralign_): Return address alignment in the
7529 (Stub_table::do_reset_address_and_file_offset): Define method in
7530 class definition instead of declaring it there. Set current data
7531 size to be the data size of the previous pass.
7532 (Stub_table::set_final_data_size): Use current data size as the
7533 final data size.
7534 (Stub_table::relocate_stub): Change parameter type of stub from
7535 Reloc_stub pointer to Stub pointer.
7536 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7537 (Stub_table::Cortex_a8_stub_list): New typedef.
7538 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7539 Stub_table::prev_addralign_): New data member.
7540 (Arm_relobj::Arm_relobj): Initialize data member
7541 section_has_cortex_a8_workaround_.
7542 (Arm_relobj::section_has_cortex_a8_workaround,
7543 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7544 definitions.
7545 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7546 declarations.
7547 (Target_arm::relocate_stub): Change parameter type of stub from
7548 Reloc_stub pointer to Stub pointer.
7549 (Insn_template::size, Insn_template::alignment): Handle
7550 THUMB16_SPECIAL_TYPE.
7551 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7552 Stub_table::update_data_size_and_addralign,
7553 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7554 definitions.
7555 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7556 (Stub_table::do_write): Ditto.
7557 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 7558
880cd20d
ILT
75592010-01-08 Ian Lance Taylor <iant@google.com>
7560
7561 PR 11108
7562 * symtab.h (class Symbol): Remove fields is_target_special_ and
7563 has_plt_offset_. Add field is_defined_in_discarded_section_.
7564 (Symbol::is_defined_in_discarded_section): New function.
7565 (Symbol::set_is_defined_in_discarded_section): New function.
7566 (Symbol::has_plt_offset): Rewrite.
7567 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7568 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7569 Don't initialize is_target_special_ or has_plt_offset_.
7570 Initialize is_defined_in_discarded_section_.
7571 (Symbol_table::add_from_relobj): If appropriate, set
7572 is_defined_in_discarded_section.
7573 * resolve.cc (Symbol::override_base_with_special): Don't test
7574 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7575 * target-reloc.h (relocate_section): Do special handling for
7576 symbols defined in discarded sections for global symbols as well
7577 as local symbols.
7578
2703e3eb
ILT
75792010-01-08 Ian Lance Taylor <iant@google.com>
7580
7581 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7582 the SHT_SYMTAB case.
7583
339d40a3
ILT
75842010-01-08 Ian Lance Taylor <iant@google.com>
7585
7586 * object.cc (Sized_relobj::do_layout): Don't get confused if
7587 layout_eh_frame returns NULL.
7588
abecea76
ILT
75892010-01-08 Ian Lance Taylor <iant@google.com>
7590
7591 PR 11084
7592 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7593 dynamic symbol table, use the normal symbol table.
7594 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7595 symbol table.
7596
6b7dd3f3
ILT
75972010-01-08 Ian Lance Taylor <iant@google.com>
7598
7599 PR 11072
7600 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7601 sections.
7602
36c50e63
L
76032010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7604
7605 * version.cc (print_version): Change to "Copyright 2010".
7606
e291e7b9
ILT
76072010-01-08 Ian Lance Taylor <iant@google.com>
7608
7609 PR 10287
7610 PR 11063
7611 * i386.cc (class Target_i386): Change return type of plt_section
7612 to be non-const.
7613 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7614 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7615 tls_desc_rel_ field.
7616 (Output_data_plt_i386::rel_tls_desc): New function.
7617 (Target_i386::rel_tls_desc_section): New function.
7618 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7619 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7620 R_386_TLS_DESC reloc in rel_tls_desc_section.
7621 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7622 Define struct Tlsdesc_info.
7623 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7624 (Target_x86_64::do_reloc_symbol_index): New function.
7625 (Target_x86_64::add_tlsdesc_info): New function.
7626 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7627 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7628 tlsdesc_rel_ field.
7629 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7630 all callers.
7631 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7632 (Target_x86_64::rela_tlsdesc_section): New function.
7633 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7634 handling.
7635 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7636 (Target_x86_64::do_reloc_addend): New function.
7637 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7638 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7639 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7640 (Output_reloc::type): New function.
7641 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7642 (Output_reloc::is_target_specific): New function.
7643 (Output_reloc::target_arg): New function.
7644 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7645 absolute relocs and target specific relocs.
7646 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7647 add_target_specific.
7648 (class Output_data_reloc) [SHT_RELA]: Likewise.
7649 * output.cc (Output_reloc::Output_reloc): Add four new versions
7650 for absolute relocs and target specific relocs.
7651 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7652 (Output_reloc::get_symbol_index): Likewise.
7653 (Output_reloc::local_section_offset): Check that local_sym_index_
7654 is not TARGET_CODE or 0.
7655 (Output_reloc::symbol_value): Likewise.
7656 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7657 reloc.
7658 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7659 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7660 functions.
7661 * layout.cc (add_target_dynamic_tags): Use output section for
7662 DT_PLTRELSZ and DT_JMPREL.
7663
3a44184e
ILT
76642010-01-07 Ian Lance Taylor <iant@google.com>
7665
7666 PR 11061
7667 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7668 function.
7669 (class Output_data_reloc_generic): Define.
7670 (class Output_data_reloc_base): Change base class to
7671 Output_data_reloc_generic. Change add() method to call
7672 bump_relative_reloc_count for a relative reloc. Remove
7673 sort_relocs_ field.
7674 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7675 to sort_relocs().
7676 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7677 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7678 appropriate.
7679 * layout.h (class Layout): Update declaration.
7680
ea715a34
ILT
76812010-01-07 Ian Lance Taylor <iant@google.com>
7682
7683 * output.h (class Output_data): Add const version of
7684 output_section and do_output_section.
7685 (class Output_section_data): Add const version of
7686 do_output_section.
7687 (class Output_section): Likewise.
7688 * layout.cc (Layout::add_target_dynamic_tags): New function.
7689 * layout.h (class Layout): Update declarations.
7690 * arm.cc (Target_arm::do_finalize_sections): Use
7691 add_target_dynamic_tags.
7692 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7693 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7694 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7695 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7696
659948a4
ILT
76972010-01-07 Ian Lance Taylor <iant@google.com>
7698
7699 PR 11042
7700 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7701 object as needed.
7702
9d3b86f6
ILT
77032010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7704 Ian Lance Taylor <iant@google.com>
7705
7706 PR 11019
7707 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7708 Xindex::read_symtab_xindex.
7709
bb0d3eb0
DK
77102010-01-07 Doug Kwan <dougkwan@google.com>
7711
7712 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7713 (Insn_template::thumb16_bcond_insn): New method declaration.
7714 (Insn_template): Fix spelling.
7715 (Stub::thumb16_special): New method declaration.
7716 (Stub::do_write): Define virtual method which was previously pure
7717 virtual.
7718 (Stub::do_thumb16_special): New method declaration.
7719 (Stub::do_fixed_endian_write): New template member.
7720 (Reloc_stub::do_write): Remove.
7721 (Reloc_stub::do_fixed_endian_write): Remove.
7722 (Cortex_a8_stub): New class definition.
7723 (Stub_factory::make_cortex_a8_stub): New method definition.
7724 (Stub_factory::Stub_factory): Add missing static storage class
7725 qualifier for elf32_arm_stub_a8_veneer_blx.
7726
ffeef7df
ILT
77272010-01-07 Ian Lance Taylor <iant@google.com>
7728
dc3f80fe
ILT
7729 PR 10980
7730 * options.h (class General_options): Add --warn-unresolved-symbols
7731 and --error-unresolved-symbols.
7732 * errors.cc (Errors::undefined_symbol): Implement
7733 --warn-unresolved-symbols.
7734
ffeef7df
ILT
7735 * options.h (class General_options): Add -z text and -z textoff.
7736 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7737
f1ec9ded
ST
77382010-01-06 Sriraman Tallam <tmsriram@google.com>
7739
7740 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7741 (Garbage_collection::cident_sections): New function.
7742 (Garbage_collection::add_cident_section): New function.
7743 (Garbage_collection::cident_sections_): New member.
7744 (gc_process_relocs): Add references to sections whose names are C
7745 identifiers.
7746 * gold.h (cident_section_start_prefix): New constant.
7747 (cident_section_stop_prefix): New constant.
7748 (is_cident): New function.
7749 * layout.cc (Layout::define_section_symbols): Replace string constants
7750 with the newly defined constants.
7751 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7752 C identifiers.
7753 * testsuite/Makefile.am: Add gc_orphan_section_test.
7754 * testsuite/Makefile.in: Regenerate.
7755 * testsuite/gc_orphan_section_test.cc: New file.
7756 * testsuite/gc_orphan_section_test.sh: New file.
7757
6eda8c29
ILT
77582010-01-06 Ian Lance Taylor <iant@google.com>
7759
b9674e17
ILT
7760 PR 10980
7761 * options.h (class General_options): Add --warn-shared-textrel.
7762 * layout.cc (Layout::finish_dynamic_section): Implement
7763 --warn-shared-textrel.
7764
6eda8c29
ILT
7765 PR 10980
7766 * options.h (class General_options): Add --warn-multiple-gp.
7767
32dcd44e
ILT
77682010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7769
7770 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7771 $(THREADSLIB) and $(LIBDL).
7772 * Makefile.in: Rebuild.
7773
a192ba05
ILT
77742010-01-06 Ian Lance Taylor <iant@google.com>
7775
7776 PR 10980
7777 * options.cc (General_options::parse_section_start): New function.
7778 (General_options::section_start): New function.
7779 (General_options::General_options): Initialize all members.
7780 * options.h: Include <map>
7781 (class General_options): Add --section-start. Add section_starts_
7782 member.
7783 * layout.cc (Layout::attach_allocated_section_to_segment): If
7784 --section-start was used, set the address of the segment. Remove
7785 local sort_sections.
7786 (Layout::relaxation_loop_body): If the address of the load segment
7787 has been set by --section-start, don't use it.
7788 * output.h (Output_segment::update_flags_for_output_section): New
7789 function.
7790 * output.cc (Output_segment::add_output_section): Call
7791 update_flags_for_output_section.
7792
dde3f402
ILT
77932010-01-05 Ian Lance Taylor <iant@google.com>
7794
62dfdd4d
ILT
7795 PR 10980
7796 * options.h (class General_options): Add --undefined-version.
7797 * script.cc (struct Version_expression): Add was_matched_by_symbol
7798 field.
7799 (Version_script_info::matched_symbol): New function.
7800 (Version_script_info::get_symbol_version_helper): Call
7801 matched_symbol.
7802 (Version_script_info::check_unmatched_names): New function.
7803 * script.h (class Version_script_info): Update declarations.
7804 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7805
9c4ae156
ILT
7806 * options.h (class General_options): Use DEFINE_bool_alias for
7807 allow_multiple_definition.
7808 * resolve.cc (Symbol_table::should_override): Don't test
7809 allow_multiple_definition.
7810
dde3f402
ILT
7811 PR 10980
7812 * options.h (class General_options): Add --cref.
7813 * main.cc (main): Print cref table if --cref. Don't close mapfile
7814 until after printing cref table.
7815 * cref.cc: Include "symtab.h".
7816 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7817 (Cref_table_compare::operator()): New function.
7818 (Cref_inputs::gather_cref): New function.
7819 (filecol): New static const.
7820 (Cref_inputs::print_cref): New function.
7821 (Cref::print_cref): New function.
7822 * cref.h: Include <cstdio>.
7823 (class Cref): Update declarations.
7824 * mapfile.h (Mapfile::file): New function.
7825 * object.h (class Object): Define Symbols. Declare virtual
7826 do_get_global_symbols.
7827 (Object::get_global_symbols): New function.
7828 * object.cc (Input_objects::add_object): Pass object to cref_ if
7829 --cref.
7830 (Input_objects::archive_start): Likewise.
7831 (Input_objects::archive_stop): Likewise.
7832 (Input_objects::print_cref): New function.
7833 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7834 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7835 --cref.
7836 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7837 function.
7838 * plugin.h (class Sized_pluginobj): Update declarations.
7839
8781f709
ILT
78402010-01-05 Ian Lance Taylor <iant@google.com>
7841
7842 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7843 to is_default_version. Rename insdef to insdefault.
7844 (Symbol_table::add_from_relobj): Rename def to is_default_version
7845 and local to is_forced_local.
7846 (Symbol_table::add_from_pluginobj): Likewise.
7847 (Symbol_table::add_from_dynobj): Likewise.
7848 (Symbol_table::define_special_symbol): Rename insdef to
7849 insdefault.
7850
fe35d28d
ILT
78512010-01-04 Ian Lance Taylor <iant@google.com>
7852
30bc8c46
ILT
7853 PR 10980
7854 * options.h (class General_options): Add
7855 --allow-multiple-definition and -z muldefs.
7856 * resolve.cc (Symbol_table::should_override): Don't warn about a
7857 multiple symbol definition if --allow-multiple-definition or -z
7858 muldefs.
7859
7eaea549
ILT
7860 PR 10980
7861 * options.h (class General_options): Add --add-needed and
7862 --copy-dt-needed-entries. Tweak --as-needed help entry.
7863 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7864 error if --copy-dt-needed-entries aka --add-needed is used and
7865 would cause a change in behaviour.
7866
fe35d28d
ILT
7867 PR 10980
7868 * options.h (class General_options): Add -G as a short version of
7869 --shared. Add no-op options -assert, -g, and -i.
7870
55a2bb35
ST
78712010-01-04 Sriraman Tallam <tmsriram@google.com>
7872
7873 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7874 check for .text or .gnu.linkonce.t sections.
7875 * icf.cc (Icf::find_identical_sections): Ditto.
7876 Change the detection for mangled function name within the section
7877 name.
7878 * icf.h (is_section_foldable_candidate): New function.
7879
719328e1
ILT
78802009-12-30 Ian Lance Taylor <iant@google.com>
7881
7882 PR 10980
7883 * options.h (class General_options): Permit two dashes with
7884 --retain-symbols-file.
7885
d7bb5745
ILT
78862009-12-30 Ian Lance Taylor <iant@google.com>
7887
403a15dd
ILT
7888 PR 10979
7889 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7890 don't put the file header and segment headers in the text
7891 segment.
7892
eda294df
ILT
7893 PR 10979
7894 * common.cc (Sort_commons::operator()): Stabilize sort when both
7895 entries are NULL.
7896 (Symbol_table::do_allocate_commons_list): When allocating common
7897 symbols, skip a symbol which is no longer common.
7898 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7899 an object before checking its type.
7900 * testsuite/common_test_2.c: New file.
7901 * testsuite/common_test_3.c: New file.
7902 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7903 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7904 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7905 (common_test_2_pic.o, common_test_2.so): New targets.
7906 (common_test_3_pic.o, common_test_3.so): New targets.
7907 * testsuite/Makefile.in: Rebuild.
7908
d7bb5745
ILT
7909 PR 10979
7910 * script.cc (read_input_script): If we see a new SECTIONS clause,
7911 and we have added an input section, give an error.
7912 * layout.h (class Layout): Add have_added_input_section function.
7913 Add have_added_input_section_ field.
7914 * layout.cc (Layout::Layout): Initialize
7915 have_added_input_section_.
7916 (Layout::layout): Set have_added_input_section_.
7917 (Layout::layout_eh_frame): Likewise.
7918
fc59c572
ILT
79192009-12-30 Ian Lance Taylor <iant@google.com>
7920
7921 PR 10931
7922 * options.h (class General_options): Add --sort-common option.
7923 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7924 * common.cc (Sort_common): Add sort_order parameter to
7925 constructor. Add sort_order_ field.
7926 (Sort_commons::operator): Check sort_order_.
7927 (Symbol_table::allocate_commons): Determine the sort order.
7928 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7929 Change all callers.
7930 (Symbol_table::do_allocate_commons_list): Likewise.
7931
1c74fab0
ILT
79322009-12-30 Ian Lance Taylor <iant@google.com>
7933
7934 PR 10916
7935 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7936 symbols from this object, don't change the visibility of an
7937 undefined symbol.
7938 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7939
6affe781
ILT
79402009-12-30 Ian Lance Taylor <iant@google.com>
7941
7942 PR 10861
7943 * script.h (class Version_script_info): Define Language enum.
7944 Update declarations. Define Glob, Exact, and Lookup types. Add
7945 new fields globals_, locals_, and is_finalized_.
7946 * script.cc: Various formatting fixes.
7947 (class Parser_closure): Change language_stack_ from a vector of
7948 std::string to one of Version_script_info::Language. Adjust all
7949 uses accordingly.
7950 (class Lazy_demangler): Remove.
7951 (struct Version_expression): Change language from std::string to
7952 Version_script_info::Language.
7953 (Version_script_info::Version_script_info): New function.
7954 (Version_script_info::~Version_script_info): Don't call clear.
7955 (Version_script_info::finalize): New function.
7956 (Version_script_info::build_lookup_tables): New function.
7957 (Version_script_info::build_expression_list_lookup): New
7958 function.
7959 (Version_script_info::get_symbol_version_helper): Rewrite to use
7960 lookup tables.
7961 (Version_script_info::print_expression_list): Adjust to use
7962 Version_script_info::Language.
7963 (script_push_lex_into_version_mode): Check that the version script
7964 has not been finalized.
7965 (version_script_push_lang): Change language string to
7966 Version_script_info::Language.
7967 * options.cc (Command_line::version_script): New function.
7968 * options.h (class General_options): Add finalize_dynamic_list
7969 function. Change version_script from declaration to definition.
7970 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7971 * testsuite/version_script.map: Remove duplicate def of foo.
7972 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7973 version_script.map.
7974 * testsuite/Makefile.in: Rebuild.
7975
818bf354
ILT
79762009-12-30 Ian Lance Taylor <iant@google.com>
7977
7978 PR 10843
7979 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7980 if the input symbol index is 0, make the output symbol index 0.
7981
ebcc8304
ILT
79822009-12-30 Ian Lance Taylor <iant@google.com>
7983
7984 PR 10670
7985 * options.h (class General_options): Add -x/--discard-all.
7986 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7987 --discard-all. If the local symbol needs a dynamic entry, check
7988 that before handling --discard-locals.
7989
176fe33f
ILT
79902009-12-30 Ian Lance Taylor <iant@google.com>
7991
bb321bb1
ILT
7992 PR 10450
7993 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7994 flags to PF_R.
7995 (Output_segment::add_output_section): Don't change the flags if
7996 the type is PT_TLS.
7997
176fe33f
ILT
7998 PR 10450
7999 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
8000 GNU hash table if they need a dynamic value. Otherwise, don't add
8001 them if they are defined in a dynamic object or are forced local.
8002
e8cd95c7
ILT
80032009-12-29 Ian Lance Taylor <iant@google.com>
8004
1b81fb71
ILT
8005 PR 10450
8006 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
8007 .gnu.hash table for a 32-bit target.
8008
8d6d383d
ILT
8009 PR 10450
8010 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
8011 regular and a dynamic object only needs a dynamic symbol table
8012 entry if it is externally visible.
8013
e785ec03
ILT
8014 PR 10450
8015 * i386.cc (class Target_i386): Initialize global_offset_table_ in
8016 constructor. Add global_offset_table_ field.
8017 (Target_i386::got_section): Set global_offset_table_.
8018 (Target_i386::do_finalize_sections): Set global_offset_table_
8019 size.
8020 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
8021 in constructor. Add global_offset_table_ field.
8022 (Target_x86_64::got_section): Set global_offset_table_.
8023 (Target_x86_64::do_finalize_sections): Set global_offset_table_
8024 size.
8025
1a2dff53
ILT
8026 * layout.cc (Layout::Layout): Initialize increase_relro_.
8027 (Layout::get_output_section): Add is_relro, is_last_relro, and
8028 is_first_non_relro parameters. Change all callers.
8029 (Layout::choose_output_section): Likewise.
8030 (Layout::add_output_section_data): Likewise.
8031 (Layout::make_output_section): Likewise.
8032 (Layout::set_segment_offsets): Clear increase_relro when using a
8033 linker script.
8034 * layout.h (class Layout): Add increase_relro method. Add
8035 increase_relro_ field. Update declarations.
8036 * output.cc (Output_section::Output_section): Initialize
8037 is_last_relro_ and is_first_non_relro_.
8038 (Output_segment::add_output_section): Group relro sections is
8039 do_sort is true. Handle is_last_relro and is_first_non_relro.
8040 (Output_segment::maximum_alignment): Remove relro handling.
8041 (Output_segment::set_section_addresses): Add increase_relro
8042 parameter. Change all callers. Add initial alignment to align
8043 relro sections on separate page. Remove old relro handling.
8044 (Output_segment::set_section_list_addresses): Remove in_relro
8045 parameter. Change all callers.
8046 (Output_segment::set_offset): Add increase parameter. Change all
8047 callers. Remove old relro handling.
8048 * output.h (class Output_section): Add new methods: is_last_relro,
8049 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
8050 Add is_last_relro_ and is_first_non_relro_ fields.
8051 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
8052 Create separate .got.plt section. Call increase_relro.
8053 * x86_64.cc (Target_x86_64::got_section): Likewise.
8054 * testsuite/relro_script_test.t: Add .got.plt.
8055
f0ba79e2
ILT
8056 PR 10450
8057 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
8058 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
8059 (Layout::finalize): Call set_dynamic_symbol_size.
8060 (Layout::set_dynamic_symbol_size): New function.
8061 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
8062 set_dynamic_symbol_size.
8063
e8cd95c7
ILT
8064 PR 10450
8065 * output.h (class Output_section): Add is_entsize_zero_ field.
8066 * output.cc (Output_section::Output_section): Initialize
8067 is_entsize_zero_.
8068 (Output_section::set_entsize): If two different entsizes are
8069 requested, force it to zero.
8070 (Output_section::add_input_section): Set flags for .debug_str
8071 before updating section flags. Set entsize.
8072 (Output_section::update_flags_for_input_section): Set SHF_MERGE
8073 and SHF_STRING if all input sections have those flags.
8074
3e1b9a8a
RÁE
80752009-12-29 Rafael Espindola <espindola@google.com>
8076
8077 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
8078 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
8079 reporting.
3e1b9a8a 8080
3dcad376
ST
80812009-12-29 Sriraman Tallam <tmsriram@google.com>
8082
8083 * options.cc (General_options::parse_version): Allow -v to exit
8084 without an error if there is nothing to link.
8085
084e2665
ILT
80862009-12-29 Ian Lance Taylor <iant@google.com>
8087
8088 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
8089 using a version of gcc before 4.1.
8090 * configure: Rebuild.
8091
250acde3
CD
80922009-12-28 Chris Demetriou <cgd@google.com>
8093
8094 * attributes.cc (Output_attributes_section_data::do_write): Use
8095 std::vector::front rather than std::vector::data.
8096
99fff23b
ILT
80972009-12-28 Ian Lance Taylor <iant@google.com>
8098
8099 * symtab.h (class Symbol_table): Add enum Defined.
8100 * resolve.cc (Symbol_table::should_override): Add defined
8101 parameter. Change all callers. Test whether object is NULL
8102 before calling a method on it.
8103 (Symbol_table::report_resolve_problem): Add defined parameter.
8104 Change all callers.
8105 (Symbol_table::should_override_with_special): Likewise.
8106 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8107 parameter. Change all callers.
8108 (Symbol_table::do_define_in_output_data): Likewise.
8109 (Symbol_table::define_in_output_segment): Likewise.
8110 (Symbol_table::do_define_in_output_segment): Likewise.
8111 (Symbol_table::define_as_constant): Likewise.
8112 (Symbol_table::do_define_as_constant): Likewise.
8113 * script.h (class Symbol_assignment): Add is_defsym parameter to
8114 constructor; change all callers.
8115 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8116 parameter. Change all callers. Add is_defsym_ field.
8117 (class Parser_closure): Add parsing_defsym parameter to
8118 constructor; change all callers. Add parsing_defsym accessor
8119 function. Add parsing_defsym_ field.
8120
556bd683
ILT
81212009-12-28 Ian Lance Taylor <iant@google.com>
8122
8123 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8124 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8125
1782c879
ILT
81262009-12-23 Ian Lance Taylor <iant@google.com>
8127
8128 * i386.cc (Target_i386::do_calls_non_split): Recognize
8129 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8130 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8131 -fsplit-stack prologue when using %r11.
1782c879 8132
329ca2b1
ST
81332009-12-21 Sriraman Tallam <tmsriram@google.com>
8134
8135 * options.cc (General_options::parse_version): Make -v continue and do
8136 the link like GNU ld does.
8137
d675ff46
RÁE
81382009-12-17 Rafael Avila de Espindola <espindola@google.com>
8139
8140 * Makefile.am (CCFILES): Add timer.cc.
8141 (HFILES): Add timer.h.
8142 * configure.ac: Check for sysconf and times.
8143 * main.cc: include timer.h.
8144 (main): Use Timer instead of get_run_time.
8145 * timer.cc: New.
8146 * timer.h: New.
8147 * workqueue.cc: include timer.h.
8148 (Workqueue::find_and_run_task):
8149 Report user, sys and wall time.
8150 * Makefile.in: Regenerate.
8151 * config.in: Regenerate.
8152 * configure: Regenerate.
8153
d6344fb5
DK
81542009-12-16 Doug Kwan <dougkwan@google.com>
8155
8156 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8157 sections.
8158 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8159 relaxed input sections.
8160 * output.cc (Output_section::find_relaxed_input_section): Change
8161 return type to Output_relaxed_input_section pointer. Adjust code
8162 for new type of relaxed_input_section_map_.
8163 * output.h (Output_section::find_relaxed_input_section): Change
8164 return type to Output_relaxed_input_section pointer.
8165 (Output_section::Output_relaxed_input_section_by_input_section_map):
8166 New type.
8167 (Output_section::relaxed_input_section_map_): Change type to
8168 Output_section::Output_relaxed_input_section_by_input_section_map.
8169 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8170 input section.
8171
0e0d5469
ILT
81722009-12-15 Ian Lance Taylor <iant@google.com>
8173
8174 * layout.cc (Layout::create_shstrtab): Only write out after input
8175 sections if we are compressing debug sections.
8176
0649a889
ILT
81772009-12-15 Ian Lance Taylor <iant@google.com>
8178
8179 * archive.cc (Archive::add_symbols): Only look up a symbol without
8180 a version if there is, in fact, a version.
8181
2ea97941
ILT
81822009-12-14 Ian Lance Taylor <iant@google.com>
8183
8184 Revert -Wshadow changes, all changes from:
8185 2009-12-11 Doug Kwan <dougkwan@google.com>
8186 2009-12-11 Nick Clifton <nickc@redhat.com>
8187 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8188
b0eec2cc
DK
81892009-12-11 Doug Kwan <dougkwan@google.com>
8190
8191 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8192 due to -Wshadow.
8193 * attributes.cc (Object_attribute::size): Ditto.
8194 (Attributes_section_data::size): Ditto.
8195 (Attributes_section_data::Attributes_section_data): Ditto.
8196 (Output_attributes_section_data::do_write): Ditto.
8197 * attributes.h (Object_attribute::set_type): Ditto.
8198 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8199
91d6fa6a
NC
82002009-12-11 Nick Clifton <nickc@redhat.com>
8201
8202 * archive.cc: Fix shadowed variable warnings.
8203 * arm.cc: Likewise.
8204 * compressed_output.cc: Likewise.
8205 * compressed_output.h: Likewise.
8206 * configure: Likewise.
8207 * dwarf_reader.cc: Likewise.
8208 * dynobj.cc: Likewise.
8209 * dynobj.h: Likewise.
8210 * ehframe.cc: Likewise.
8211 * ehframe.h: Likewise.
8212 * errors.cc: Likewise.
8213 * expression.cc: Likewise.
8214 * fileread.cc: Likewise.
8215 * fileread.h: Likewise.
8216 * freebsd.h: Likewise.
8217 * i386.cc: Likewise.
8218 * icf.cc: Likewise.
8219 * incremental.h: Likewise.
8220 * layout.cc: Likewise.
8221 * layout.h: Likewise.
8222 * mapfile.cc: Likewise.
8223 * merge.cc: Likewise.
8224 * merge.h: Likewise.
8225 * object.cc: Likewise.
8226 * object.h: Likewise.
8227 * options.h: Likewise.
8228 * output.cc: Likewise.
8229 * output.h: Likewise.
8230 * parameters.cc: Likewise.
8231 * plugin.cc: Likewise.
8232 * powerpc.cc: Likewise.
8233 * reduced_debug_output.cc: Likewise.
8234 * reduced_debug_output.h: Likewise.
8235 * reloc.cc: Likewise.
8236 * reloc.h: Likewise.
8237 * resolve.cc: Likewise.
8238 * script-sections.cc: Likewise.
8239 * script.cc: Likewise.
8240 * script.h: Likewise.
8241 * sparc.cc: Likewise.
8242 * symtab.cc: Likewise.
8243 * symtab.h: Likewise.
8244 * target-select.cc: Likewise.
8245 * target-select.h: Likewise.
8246 * token.h: Likewise.
8247 * workqueue.cc: Likewise.
8248 * workqueue.h: Likewise.
8249 * x86_64.cc: Likewise.
8250
a0351a69
DK
82512009-12-10 Doug Kwan <dougkwan@google.com>
8252
8253 * arm.cc (attributes.h): New include.
8254 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8255 (Arm_relobj::~Arm_relobj): Delete object pointed by
8256 attributes_section_data_.
8257 (Arm_relobj::attributes_section_data): New method definition.
8258 (Arm_relobj::attributes_section_data_): New data member declaration.
8259 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8260 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8261 attributes_section_data_.
8262 (Arm_dynobj::attributes_section_data): New method definition.
8263 (Arm_dynobj::attributes_section_data_): New data member declaration.
8264 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8265 initialization value of may_use_blx_ to false.
2e702c99 8266 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8267 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8268 object attributes to compute results instead of hard-coding.
8269 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8270 Target_arm::get_secondary_compatible_arch,
8271 Target_arm::set_secondary_compatible_arch
8272 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8273 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8274 New method declarations.
8275 (Target_arm::get_aeabi_object_attribute): New method definition.
8276 (Target_arm::attributes_section_data_): New data member declaration.
8277 (read_arm_attributes_section): New template definition.
8278 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8279 (Arm_dynobj::do_read_symbols): Ditto.
8280 (Target_arm::do_finalize_sections): Merge attributes sections from
8281 input. Check for BLX use after attributes section merging.
8282 Fix __exidx_start and __exidx_end visibility. Create an
8283 .ARM.attributes section if necessary.
8284 (Target_arm::get_secondary_compatible_arch,
8285 Target_arm::set_secondary_compatible_arch,
8286 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8287 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8288 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8289 New method definitions.
8290
b59befec
ILT
82912009-12-09 Ian Lance Taylor <iant@google.com>
8292
8293 * plugin.cc (Plugin::load): Don't cast from void* to a function
8294 pointer.
8295
1276bc89
ILT
82962009-12-09 Ian Lance Taylor <iant@google.com>
8297
8298 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8299 information fields.
8300
2f2de248
L
83012009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8302
8303 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8304 Replace two_file_shared_1.so with two_file_shared_2.so.
8305 * testsuite/Makefile.in: Regenerated.
8306
4f787271
DK
83072009-12-08 Doug Kwan <dougkwan@google.com>
8308
8309 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8310 (HFILES): Add attributes.h and int_encoding.h.
8311 * Makefile.in: Regenerate.
8312 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8313 function definitions to int_encoding.cc
8314 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8315 prototypes to int_encoding.h
8316 * reduced_debug_output.cc (int_encoding.h): New include.
8317 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8318 function definitions to int_encoding.cc
8319 (insert_into_vector, read_from_pointer): Move template definitions to
8320 int_encoding.h
8321 * attributes.cc: New file.
8322 * attributes.h: New file.
8323 * int_encoding.cc: New file.
8324 * int_encoding.h: New file.
8325
20b52f1a
RÁE
83262009-12-07 Rafael Avila de Espindola <espindola@google.com>
8327
8328 PR gold/11055
8329 * incremental-dump.cc (dump_incremental_inputs): New.
8330 (main): Use dump_incremental_inputs.
8331
53d7974c
L
83322009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8333
8334 PR gold/10893
8335 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8336 checking elfcpp::STT_FUNC.
8337 (Target_i386::Relocate::relocate): Likewise.
8338 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8339
8340 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8341 symbols from shared libraries into normal FUNC symbols.
8342
8343 * symtab.h (Symbol): Add is_func and use it.
8344
05a352e6
DK
83452009-12-05 Doug Kwan <dougkwan@google.com>
8346
8347 * arm.cc (Target_arm::arm_info): Initialize new fields
8348 attributes_section and attributes_vendor.
8349 * i386.cc (Target_i386::i386_info): Same.
8350 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8351 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8352 fields attributes_section and attributes_vendor.
53d7974c 8353 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8354 * target.h (Target::attributes_section, Target::attributes_vendor,
8355 Target::is_attributes_section, Target::attribute_arg_type,
8356 Target::attributes_order): New method definitions.
8357 (Target::Target_info::attributes_section,
8358 Target::Target_info::attributes_vendor): New fields.
8359 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8360 virtual method definitions.
8361 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8362 attributes_section and attributes_vendor.
8363 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8364
f4e5969c
DK
83652009-12-05 Doug Kwan <dougkwan@google.com>
8366
8367 * arm.cc: Update comments about interworking and stub generation.
8368 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8369 considered as non-PIC.
8370 (Arm_relocate_functions::base_abs): Fix formatting.
8371 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8372 of function to use GOT entry address instead of offset.
8373 (Target_arm::Scan::global): Issue an error if a symbol would need a
8374 PLT does not get one because it is untyped. Remove code to create
8375 dynamic symbols for relative branches.
8376 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8377 takes unsigned integer instead of boolean.
8378
1abce4a6
L
83792009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8380
8381 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8382 (two_file_test_LDADD): Likewise.
8383 (common_test_1_LDADD): Likewise.
8384 (exception_test_LDADD) Likewise.
8385 (weak_test_LDADD): Likewise.
8386 (many_sections_test_LDADD): Likewise.
8387 (initpri1_LDADD): Likewise.
8388 (script_test_1_LDADD): Likewise.
8389 (script_test_2_LDADD): Likewise.
8390 (justsyms_LDADD): Likewise.
8391 (binary_test_LDADD): Likewise.
8392 (large_LDADD): Likewise.
8393 * testsuite/Makefile.in: Regenerated.
8394
adcf2816 83952009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8396
adcf2816
L
8397 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8398 (Symbol_table::override_with_special): Likewise.
8399 (Symbol_table::add_from_object): Likewise.
8400
28e67f5d
RÁE
84012009-12-04 Rafael Avila de Espindola <espindola@google.com>
8402
8403 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8404 Don't set the data_offset twice.
8405
ae10a101
RÁE
84062009-12-04 Rafael Avila de Espindola <espindola@google.com>
8407
8408 * testsuite/Makefile.in: Regenerate.
8409
f59f41f3
DK
84102009-12-03 Doug Kwan <dougkwan@google.com>
8411
8412 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8413 (Target_arm::do_finalize_sections): Add parameter for symbol table
8414 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8415 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8416 parameter for symbol table pointer.
8417 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8418 an additional parameter for a pointer to symbol table.
8419 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8420 parameter for a symbol table pointer.
8421 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8422 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8423 Ditto.
8424 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8425 parameter for a symbol table pointer.
8426
ca55d848
RÁE
84272009-12-03 Rafael Avila de Espindola <espindola@google.com>
8428
8429 * incremental.cc (Incremental_inputs_header)
8430 (Incremental_inputs_header_write, Incremental_inputs_entry)
8431 (Incremental_inputs_entry_write): Move ...
8432 * incremental.h (Incremental_inputs_header)
8433 (Incremental_inputs_header_write, Incremental_inputs_entry)
8434 (Incremental_inputs_entry_write): here.
8435
3aec4f9c
RÁE
84362009-12-02 Rafael Avila de Espindola <espindola@google.com>
8437
8438 * incremental.cc (make_sized_incremental_binary): Set the target.
8439 Error if it is incompatible.
8440 * output.h (Output_file): Add filename method.
8441
9c0ae74d
RÁE
84422009-12-02 Rafael Avila de Espindola <espindola@google.com>
8443
8444 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8445 from the get_* methods.
8446
a45500ae
RÁE
84472009-12-02 Rafael Avila de Espindola <espindola@google.com>
8448
8449 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8450 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8451 Write 0 for the data_offset of scripts.
8452
325e6408
RÁE
84532009-12-02 Rafael Avila de Espindola <espindola@google.com>
8454
8455 * testsuite/Makefile.am: Add the incremental_test.sh test.
8456 * testsuite/incremental_test.sh: New.
8457 * testsuite/incremental_test_1.c: New.
8458 * testsuite/incremental_test_2.c: New.
8459
954c3e2e
RÁE
84602009-12-01 Rafael Avila de Espindola <espindola@google.com>
8461
703d02da 8462 * incremental-dump.cc (main): Fix typos.
954c3e2e 8463
f8086623
RÁE
84642009-11-27 Rafael Avila de Espindola <espindola@google.com>
8465
8466 PR gold/11025
8467 * incremental-dump.cc (main): Use llu to print 64 bit values.
8468
3b0dd6ac
L
84692009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8470 H.J. Lu <hongjiu.lu@intel.com>
8471
8472 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8473 $(LIBDL).
8474 (incremental_dump_LDADD): Likewise.
8475 * Makefile.in: Regenerated.
8476
a6d1ef57 84772009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8478
a6d1ef57
DK
8479 Revert:
8480
8481 2009-11-25 Doug Kwan <dougkwan@google.com>
8482
8483 * arm.cc (Target_arm::Target_arm): Move method definition
8484 outside of class definition. Add code to handle
8485 --target1-rel, --target1-abs and --target2= options.
8486 (Target_arm::get_reloc_reloc_type): Change method to be
8487 non-static and const.
8488 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8489 New data member declaration.
8490 (Target_arm::Scan::local, Target_arm::Scan::global,
8491 Target_arm::Relocate::relocate,
8492 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8493 Adjust call to Target_arm::get_real_reloc_type.
8494 (Target_arm::get_real_reloc_type): Use command line options
8495 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8496 * options.h (--target1-rel, --target1-abs, --target2): New
8497 ARM-only options.
8498
50aeb7d4
DK
84992009-11-25 Doug Kwan <dougkwan@google.com>
8500
8501 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8502 class definition. Add code to handle --target1-rel, --target1-abs
8503 and --target2= options.
8504 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8505 and const.
8506 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8507 member declaration.
8508 (Target_arm::Scan::local, Target_arm::Scan::global,
8509 Target_arm::Relocate::relocate,
8510 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8511 call to Target_arm::get_real_reloc_type.
8512 (Target_arm::get_real_reloc_type): Use command line options to
8513 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8514 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8515 options.
8516
51938283
DK
85172009-11-25 Doug Kwan <dougkwan@google.com>
8518
8519 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8520 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8521 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8522 formatting.
8523 (Arm_relocate_functions::thm_call): Replace body with a call to
8524 Arm_relocate_functions::thumb_branch_common.
8525 (Arm_relocate_functions::thm_jump24,
8526 Arm_relocate_functions::thm_xpc22): New method definitions.
8527 (Arm_relocate_functions::thumb_branch_common): New method definition.
8528 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8529 operator.
8530 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8531 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8532
e2b8f3c4
RÁE
85332009-11-24 Rafael Avila de Espindola <espindola@google.com>
8534
8535 * Makefile.am: Build incremental-dump
8536 * Makefile.in: Regenerate.
8537 * incremental-dump.cc: New.
8538 * incremental.cc (Incremental_inputs_header_data,
8539 Incremental_inputs_entry_data): Move to incremental.h
8540 * incremental.h: (Incremental_inputs_header_data,
8541 Incremental_inputs_entry_data): Move from incremental.cc
8542
bcba9aec
RÁE
85432009-11-24 Rafael Avila de Espindola <espindola@google.com>
8544
8545 * incremental.cc (Incremental_inputs_header,
8546 Incremental_inputs_header_write, Incremental_inputs_entry,
8547 Incremental_inputs_entry_write): Add a typedef with the data type.
8548
7c3afe08
RÁE
85492009-11-24 Rafael Avila de Espindola <espindola@google.com>
8550
8551 * incremental.cc (Incremental_inputs_header,
8552 Incremental_inputs_header_write, Incremental_inputs_entry,
8553 Incremental_inputs_entry_write): Update comment about which
8554 type has the filed descriptions.
8555
d204b6e9
DK
85562009-11-15 Doug Kwan <dougkwan@google.com>
8557
8558 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8559 (Arm_relocate_functions::arm_branch_common): Change method defintion
8560 in class definition to a method declaration and update list of formal
8561 parameters.
8562 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8563 Arm_relocation_functions::jump24): Adjust call to
8564 Arm_relocate_functions::arm_branch_common. Update list of formal
8565 parameters.
8566 (Arm_relocate_functions::xpc25): New method definition.
8567 (Arm_relocate_functions::arm_branch_common): Move method defintion
8568 out from class definition. Use stubs for mode-switching and extending
8569 branch ranges.
8570 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8571 specially. Change code to enable use of stubs in ARM branches.
8572
43d12afe
DK
85732009-11-10 Doug Kwan <dougkwan@google.com>
8574
8575 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8576 in method declaration.
8577 (Target_arm::relocate_stub): New method declaration.
8578 (Target_arm::default_target): Change to return a pointer instead of
8579 a const reference.
8580 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8581 Target_arm::default_target.
8582 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8583 method definition.
8584 (Target_arm::relocate_section): Adjust view.
8585 (Target_arm::relocate_stub): New method definition.
8586
ac33a407
DK
85872009-11-10 Doug Kwan <dougkwan@google.com>
8588
8589 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8590 a format warning.
8591 * incremental.cc (open_incremental_binary): Initialized local
8592 variables to avoid warnings.
8593 * object.cc (make_elf_object): Ditto.
8594 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8595 a format warning.
e1df38aa 8596
88ee28e9
L
8597009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8598
8599 PR gold/10930
8600 * testsuite/plugin_test.c: Include "config.h".
8601
2daedcd6
DK
86022009-11-09 Doug Kwan <dougkwan@google.com>
8603
8604 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8605 (arm_symbol_value): Remove.
8606 (Arm_relocate_functions::arm_branch_common,
8607 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8608 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8609 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8610 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8611 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8612 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8613 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8614 Arm_relocate_functions::thm_mobw_abs_nc,
8615 Arm_relocate_functions::thm_mov_abs,
8616 Arm_relocate_functions::movw_prel_nc,
8617 Arm_relocate_functions::thm_movt_abs,
8618 Arm_relocate_functions::movt_prel,
8619 Arm_relocate_functions::thm_movw_prel_nc,
8620 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8621 (Target_arm::Relocate::relocate): Only decompose address into two
8622 parts if relocation type uses the thumb-bit and pass the actual
8623 bit instead of a flag indicating that the thumb-bit is used. Adjust
8624 calls to methods in Arm_relocate_functions for this change.
8625
1276bc89 86262009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8627
8628 PR 10925
8629 * reloc.cc: Instantiate
8630 Sized_relobj::initialize_input_to_output_maps and
8631 Sized_relobj:free_input_to_output_maps.
8632
e53ad1b5
ILT
86332009-11-06 Ian Lance Taylor <iant@google.com>
8634
8635 PR 10876
8636 * defstd.cc (in_segment): Set only_if_ref true for "end".
8637
eb44217c
DK
86382009-11-06 Doug Kwan <dougkwan@google.com>
8639
8640 * arm.cc (class Reloc_stub): Correct a comment.
8641 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8642 (Target_arm::scan_section_for_stubs): New method declaration.
8643 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8644 Change methods from private to protected.
8645 (Target_arm::do_may_relax): New method definition.
8646 (Target_arm::do_relax, Target_arm::group_sections,
8647 Target_arm::scan_reloc_for_stub,
8648 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8649 (Target_arm::arm_input_section_map_): New data member declaration.
8650 (Target_arm::scan_reloc_for_stub,
8651 Target_arm::scan_reloc_section_for_stubs,
8652 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8653 Target_arm::do_relax): New method definitions.
8654
5d329b7d
ILT
86552009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8656
8657 * configure.ac: Check for (struct stat)::st_mtim
8658 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8659 * config.in: Regenerate.
8660 * configure: Regenerate.
8661
96a0d71b
ILT
86622009-11-05 Ian Lance Taylor <iant@google.com>
8663
8664 PR 10910
8665 * output.cc (Output_segment::add_output_section): Add missing
8666 return statement.
8667
594c8e5e
ILT
86682009-11-04 Ian Lance Taylor <iant@google.com>
8669
8670 PR 10880
8671 * object.h (class Object): Add is_needed and set_is_needed
8672 methods. Add is_needed_ field. Make bool fields into bitfields.
8673 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8674 defined in a dynamic object and referenced by a regular object,
8675 set is_needed for the dynamic object.
8676 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8677 if the file is marked with as_needed and it is not needed.
8678
22b127cc
ILT
86792009-11-04 Ian Lance Taylor <iant@google.com>
8680
8681 PR 10887
8682 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8683 tags if data is discarded by linker script.
8684 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8685 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8686 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8687 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8688
f5c870d2
ILT
86892009-11-04 Ian Lance Taylor <iant@google.com>
8690
8691 * layout.cc (Layout::get_output_section): Add is_interp and
8692 is_dynamic_linker_section parameters. Change all callers.
8693 (Layout::choose_output_section): Likewise.
8694 (Layout::make_output_section): Likewise.
8695 (Layout::add_output_section_data): Add is_dynamic_linker_section
8696 parameter. Change all callers.
8697 * layout.h (class Layout): Update declarations.
8698 * output.h (class Output_section): Add is_interp, set_is_interp,
8699 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8700 Add is_interp_, is_dynamic_linker_section_ fields. Change
8701 generate_code_fills_at_write_ to a bitfield.
8702 * output.cc (Output_section::Output_sections): Initialize new
8703 fields.
8704 (Output_segment::add_output_section): Add do_sort parameter.
8705 Change all callers.
8706
1ae4d23b
ILT
87072009-11-03 Ian Lance Taylor <iant@google.com>
8708
8709 PR 10860
8710 * options.h (class General_options): Add --warn-common.
8711 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8712 merging two common symbols.
8713 (Symbol_table::should_override): Handle --warn-common when merging
8714 a common symbol with a defined symbol. Use report_resolve_problem
8715 for multiple definitions.
8716 (Symbol_table::report_resolve_problem): New function.
8717 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8718
55da9579
DK
87192009-11-03 Doug Kwan <dougkwan@google.com>
8720
8721 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8722 stub_factory_.
8723 (Target_arm::stub_factory): New method definition.
8724 (Target_arm::new_arm_input_section,
8725 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8726 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8727 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8728 New type definitions.
8729 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8730 member declarations.
8731 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8732 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8733 New method definitions.
8734
37a9ac43
ILT
87352009-11-03 Ian Lance Taylor <iant@google.com>
8736
8737 * options.h (class General_options): Add --warn_constructors.
8738
b3d6a3d4
ILT
87392009-11-03 Ian Lance Taylor <iant@google.com>
8740
8741 PR 10893
8742 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8743 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8744
934b01dd
ILT
87452009-11-03 Ian Lance Taylor <iant@google.com>
8746
8747 PR 10895
8748 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8749 --msgid-bugs-address.
8750 (install-pdf): New target.
8751 (install-data_yes): Look up one directory to find mkinstalldirs.
8752
03c1939b
L
87532009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8754
8755 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8756 tree.
8757
ebd95253
DK
87582009-10-30 Doug Kwan <dougkwan@google.com>
8759
8760 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8761
e9bbb538
DK
87622009-10-30 Doug Kwan <dougkwan@google.com>
8763
8764 * arm.cc (Stub_addend_reader): New struct template definition
8765 and partial specializations.
8766 (Stub_addend_reader::operator()): New method definition for a
8767 partially specialized template.
8768
d5b40221
DK
87692009-10-30 Doug Kwan <dougkwan@google.com>
8770
8771 * arm.cc (Arm_relobj::processor_specific_flags): New method
8772 definition.
8773 (Arm_relobj::do_read_symbols): New method declaration.
8774 (Arm_relobj::processor_specific_flags_): New data member declaration.
8775 (Arm_dynobj): New class definition.
8776 (Target_arm::do_finalize_sections): Add input_objects parameter.
8777 (Target_arm::do_adjust_elf_header): New method declaration.
8778 (Target_arm::are_eabi_versions_compatible,
8779 (Target_arm::merge_processor_specific_flags): New method declaration.
8780 (Target_arm::do_make_elf_object): New overloaded method definitions
8781 and declaration.
8782 (Arm_relobj::do_read_symbols): New method definition.
8783 (Arm_dynobj::do_read_symbols): Ditto.
8784 (Target_arm::do_finalize_sections): Add input_objects parameters.
8785 Merge processor-specific flags from all input objects.
8786 (Target_arm::are_eabi_versions_compatible,
8787 Target_arm::merge_processor_specific_flags,
8788 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8789 New method definitions.
8790 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8791 Input_objects pointer type parameter.
8792 * layout.cc (Layout::finalize): Pass input objects to target's.
8793 finalize_sections function.
8794 * output.cc (Output_file_header::do_sized_write): Set ELF file
8795 header's processor-specific flags.
8796 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8797 Input_objects pointer type parameter.
8798 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8799 * target.h (Input_objects): New forward class declaration.
8800 (Target::processor_specific_flags,
8801 Target::are_processor_specific_flags_sect): New method definitions.
8802 (Target::finalize_sections): Add input_objects parameter.
8803 (Target::Target): Initialize processor_specific_flags_ and
8804 are_processor_specific_flags_set_.
8805 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8806 parameter.
8807 (Target::set_processor_specific_flags): New method definition.
8808 (Target::processor_specific_flags_,
8809 Target::are_processor_specific_flags_set_): New data member
8810 declarations.
8811 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8812 Input_objects pointer type parameter.
8813
ebabffbd
DK
88142009-10-30 Doug Kwan <dougkwan@google.com>
8815
8816 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8817
ad0f2072
ILT
88182009-10-28 Ian Lance Taylor <iant@google.com>
8819
8820 * object.h (class Relobj): Drop options parameter from
8821 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8822 do_scan_relocs, do_relocate. Change all callers.
8823 (class Sized_relobj): Drop options parameters from
8824 do_gc_process_relocs, do_scan_relocs, do_relocate,
8825 do_relocate_sections, relocate_sections, emit_relocs_scan,
8826 emit_relocs_scan_reltype. Change all callers.
8827 (struct Relocate_info): Remove options field and all references to
8828 it.
8829 * reloc.h (class Read_relocs): Remove options constructor
8830 parameter and options_ field. Change all callers.
8831 (class Gc_process_relocs, class Scan_relocs): Likewise.
8832 (class Relocate_task): Likewise.
8833 * target-reloc.h (scan_relocs): Remove options parameter. Change
8834 all callers.
8835 (scan_relocatable_relocs): Likewise.
8836 * target.h (class Sized_target): Remove options parameter from
8837 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8838 all callers.
8839 * gc.h (gc_process_relocs): Remove options parameter. Change all
8840 callers.
8841 * arm.cc: Update functions to remove options parameters.
8842 * i386.cc: Likewise.
8843 * powerpc.cc: Likewise.
8844 * sparc.cc: Likewise.
8845 * x86_64.cc: Likewise.
8846 * testsuite/testfile.cc: Likewise.
8847
8ffa3667
DK
88482009-10-28 Doug Kwan <dougkwan@google.com>
8849
8850 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8851 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8852 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8853 New method definitions.
8854
40f36857
CC
88552009-10-28 Cary Coutant <ccoutant@google.com>
8856
8857 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8858 (Plugin::cleanup_done_): New member.
8859 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8860 (Plugin_manager::cleanup_done_): Remove.
8861 (Plugin_manager::add_input_file): Edit error message.
8862 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8863 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8864
2c849493
ILT
88652009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8866
8867 * fileread.cc: (File_read::View::~View): Use the new
8868 data_ownership_ filed.
8869 (File_read::~File_read): Dispose the new whole_file_view_.
8870 (File_read::open): Mmap the whole file if needed.
8871 (File_read::open): Use whole_file_view_ instead of contents_.
8872 (File_read::find_view): Use whole_file_view_ if applicable.
8873 (File_read::do_read): Use whole_file_view_ instead of contents_.
8874 (File_read::make_view): Use whole_file_view_ instead of contents_,
8875 update File_read::View::View call.
8876 (File_read::find_or_make_view): Update File_read::View::View
8877 call.
8878 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8879 remove contents_
8880 (File_read::View::Data_ownership): New enum.
8881 (File_read::View::View): Replace bool mapped_ with Data_ownership
8882 argument.
8883 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8884 (File_read::View::data_ownership_): New field.
8885 (File_read::contents_): Remove (replaced by whole_file_view_).
8886 (File_read::whole_file_view_): New field.
8887 * options.h (class General_options): Add --keep-files-mapped.
8888
24998053
CC
88892009-10-27 Cary Coutant <ccoutant@google.com>
8890
8891 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8892 * testsuite/Makefile.am (plugin_test_5): New test case.
8893 * testsuite/Makefile.in: Regenerate.
8894
72adc4fa
DK
88952009-10-25 Doug Kwan <dougkwan@google.com>
8896
8897 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8898 from private to protected to allow access by child class.
8899 (Sized_relobj::do_relocate_sections): New method declaration.
8900 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8901 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8902 Sized_relobj::relocate_sections. Instantiate template explicitly
8903 for different target sizes and endianity.
8904
07f508a2
DK
89052009-10-24 Doug Kwan <dougkwan@google.com>
8906
8907 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8908 (Arm_input_section::as_arm_input_section): New method.
8909 (Arm_output_section): New class definition.
8910 (Arm_output_section::create_stub_group,
8911 Arm_output_section::group_sections): New method definitions.
8912
10ad9fe5
DK
89132009-10-22 Doug Kwan <dougkwan@google.com>
8914
8915 * arm.cc (Arm_input_section): New class definition.
8916 (Arm_input_section::init, Arm_input_section:do_write,
8917 Arm_input_section::set_final_data_size,
8918 Arm_input_section::do_reset_address_and_file_offset): New method
8919 definitions.
8920
56ee5e00
DK
89212009-10-21 Doug Kwan <dougkwan@google.com>
8922
8923 * arm.cc (Stub_table, Arm_input_section): New forward class
8924 declarations.
8925 (Stub_table): New class defintion.
8926 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8927 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8928 New method definition.
8929
b569affa
DK
89302009-10-21 Doug Kwan <dougkwan@google.com>
8931
8932 * arm.cc: Update copyright comments.
8933 (Target_arm): New forward class template declaration.
8934 (Arm_address): New type.
8935 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8936 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8937 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8938 constants.
8939 (Insn_template): Same.
8940 (DEF_STUBS): New macro.
8941 (Stub_type): New enum type.
8942 (Stub_template): New class definition.
8943 (Stub): Same.
8944 (Reloc_stub): Same.
8945 (Stub_factory): Same.
8946 (Target_arm::Target_arm): Initialize may_use_blx_ and
8947 should_force_pic_veneer_.
8948 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8949 Target_arm::should_force_pic_veneer,
8950 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8951 Target_arm::using_thumb_only, Target_arm:;default_target): New
8952 method defintions.
8953 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8954 New data member declarations.
8955 (Insn_template::size, Insn_template::alignment): New method defintions.
8956 (Stub_template::Stub_template): New method definition.
8957 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8958 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8959 (Stub_factory::Stub_factory): New method definition.
8960 * gold.h (string_hash): New template.
8961 * output.h (Input_section_specifier::hash_value): Use
8962 gold::string_hash.
8963 (Input_section_specifier::string_hash): Remove.
8964 * stringpool.cc (Stringpool_template::string_hash): Use
8965 gold::string_hash.
8966
6c172549
DK
89672009-10-20 Doug Kwan <dougkwan@google.com>
8968
8969 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8970 symbols of relaxed input sections.
8971 * output.h (Output_section::find_relaxed_input_section): Make
8972 method public.
8973
c5617f2f
DK
89742009-10-16 Doug Kwan <dougkwan@google.com>
8975
8976 * dynobj.cc (Versions::Versions): Initialize version_script_.
8977 Only insert base version symbol definition for a shared object
8978 if version script defines any version versions.
8979 (Versions::define_base_version): New method definition.
8980 (Versions::add_def): Check that base version is not needed.
8981 (Versions::add_need): Define base version lazily.
8982 * dynobj.h (Versions::define_base_version): New method declaration.
8983 (Versions::needs_base_version_): New data member declaration.
8984 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8985 (check_DATA): Add no_version_test.stdout.
8986 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8987 New make rules.
8988 * testsuite/Makefile.in: Regenerate.
8989 * testsuite/no_version_test.c: New file.
8990 * testsuite/no_version_test.sh: Ditto.
8991
3c12dcdb
DK
89922009-10-16 Doug Kwan <dougkwan@google.com>
8993
8994 * expression.cc (class Segment_start_expression): New class definition.
8995 (Segment_start_expression::value): New method definition.
8996 (script_exp_function_segment_start): Return a new
8997 Segment_start_expression.
8998 * gold/script-c.h (script_saw_segment_start_expression): New function
8999 prototype.
9000 * script-sections.cc (Script_sections::Script_sections): Initialize
9001 SAW_SEGMENT_START_EXPRESSION_ to false.
9002 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
9003 and -Tbbs options to specify section addresses if given in
9004 command line and no SEGMENT_START expression is seen in a script.
9005 * script-sections.h (Script_sections::saw_segment_start_expression,
9006 Script_sections::set_saw_segment_start_expression): New method
9007 definition.
9008 (Script_sections::saw_segment_start_expression_): New data member
9009 declaration.
9010 * script.cc (script_saw_segment_start_expression): New function.
9011 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
9012 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
9013 script_test_7.sh and script_test_8.sh.
9014 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
9015 script_test_8.stdout.
9016 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
9017 (script_test_6, script_test_6.stdout, script_test_7,
9018 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
9019 * Makefile.in: Regenerate.
9020 * testsuite/script_test_6.sh: New file.
9021 * testsuite/script_test_6.t: Same.
9022 * testsuite/script_test_7.sh: Same.
9023 * testsuite/script_test_7.t: Same.
9024 * testsuite/script_test_8.sh: Same.
9025
64b1ae37
DK
90262009-10-16 Doug Kwan <dougkwan@google.com>
9027
9028 * output.cc (Output_segment::set_section_list_address): Cast
9029 expressions to unsigned long long type to avoid format warnings.
9030
661be1e2
ILT
90312009-10-15 Ian Lance Taylor <iant@google.com>
9032
12edd763 9033 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 9034 dot assignment to script_sections_.
12edd763
ILT
9035 * script-sections.cc (Script_sections::add_dot_assignment):
9036 Initialize if necessary.
9037
68b6574b
ILT
9038 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
9039 program headers with no load segment if there is a linker script.
9040
661be1e2
ILT
9041 * layout.cc (Layout::set_segment_offsets): Align the file offset
9042 to the segment aligment for -N or -n with no load segment.
9043 * output.cc (Output_segment::add_output_section): Don't crash if
9044 the first section is a TLS section.
9045 (Output_segment::set_section_list_addresses): Print an error
9046 message if the address moves backward in a linker script.
9047 * script-sections.cc
9048 (Output_section_element_input::set_section_addresses): Don't
9049 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
9050 (Orphan_output_section::set_section_addresses): Likewise.
9051
f15f61a7
DK
90522009-10-15 Doug Kwan <dougkwan@google.com>
9053
9054 * layout.cc (Layout::finish_dynamic_section): Generate tags
9055 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
9056 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
9057 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
9058
82bb573a
ILT
90592009-10-14 Ian Lance Taylor <iant@google.com>
9060
9061 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
9062 fields.
9063 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
9064 data_shdr fields of relinfo.
9065 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
9066 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
9067 R_386_TLS_LDO_32, adjust based on section flags.
9068 (Target_i386::Relocate::fix_up_ldo): Remove.
9069
374ad285
ILT
90702009-10-13 Ian Lance Taylor <iant@google.com>
9071
9072 Add support for -pie.
9073 * options.h (class General_options): Add -pie and
9074 --pic-executable.
9075 (General_options::output_is_position_independent): Test -pie.
9076 (General_options::output_is_executable): Return true if not shared
9077 and not relocatable.
9078 (General_options::output_is_pie): Remove.
9079 * options.cc (General_options::finalize): Reject incompatible uses
9080 of -pie.
9081 * gold.cc (queue_middle_tasks): A -pie link is not static.
9082 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
9083 * symtab.cc (Symbol::final_value_is_known): Return false if
9084 output_is_position_independent.
9085 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
9086 output_is_position_independent.
9087 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
9088 output_is_position_independent.
9089 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
9090 output_is_position_independent.
9091 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
9092 two_file_pie_test.
9093 (basic_pie_test.o, basic_pie_test): New targets.
9094 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9095 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9096 (two_file_pie_test): New target.
9097 * testsuite/Makefile.in: Rebuild.
9098 * README: Remove note saying that -pie is not supported.
9099
c6585162
ILT
91002009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9101
9102 * options.h (class General_options): Add -init and -fini.
9103 * layout.cc (Layout::finish_dynamic_section): Emit
9104 given init and fini functions.
9105
032ce4e9
ST
91062009-10-13 Sriraman Tallam <tmsriram@google.com>
9107
9108 * gc.h (gc_process_relocs): Check if icf is enabled using new
9109 function.
9110 * gold.cc (queue_initial_tasks): Likewise.
9111 (queue_middle_tasks): Likewise.
9112 * object.cc (do_layout): Likewise.
9113 * symtab.cc (is_section_folded): Likewise.
9114 * main.cc (main): Likewise.
9115 * reloc.cc (Read_relocs::run): Likewise.
9116 (Sized_relobj::do_scan_relocs): Likewise.
9117 * icf.cc (is_function_ctor_or_dtor): New function.
9118 (Icf::find_identical_sections): Check if function is ctor or dtor when
9119 safe icf is chosen.
9120 * options.h (General_options::icf): Change option to be an enum.
9121 (Icf_status): New enum.
9122 (icf_enabled): New method.
9123 (icf_safe_folding): New method.
9124 (set_icf_status): New method.
9125 (icf_status_): New variable.
9126 * (options.cc) (General_options::finalize): Set icf_status_.
9127 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9128 icf_test and icf_keep_unique_test to use the --icf enum flag.
9129 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9130 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9131
f345227a
ST
91322009-10-12 Sriraman Tallam <tmsriram@google.com>
9133
9134 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9135 includes to gc.h and icf.h.
9136 * arm.cc: Include gc.h.
9137 * gold.cc: Likewise.
9138 * i386.cc: Likewise.
9139 * powerpc.cc: Likewise.
9140 * sparc.cc: Likewise.
9141 * x86_64.cc: Likewise.
9142 * gc.h: Include icf.h.
9143
1c7814ed
ILT
91442009-10-11 Ian Lance Taylor <iant@google.com>
9145
9146 * plugin.cc: Include "gold.h" before other header files.
9147
ae3b5189
CD
91482009-10-10 Chris Demetriou <cgd@google.com>
9149
9150 * options.h (Input_file_argument::Input_file_type): New enum.
9151 (Input_file_argument::is_lib_): Replace with...
9152 (Input_file_argument::type_): New member.
9153 (Input_file_argument::Input_file_argument): Take Input_file_type
9154 'type' rather than boolean 'is_lib' as second argument.
9155 (Input_file_argument::is_lib): Use type_.
9156 (Input_file_argument::is_searched_file): New function.
9157 (Input_file_argument::may_need_search): Handle is_searched_file.
9158 * options.cc (General_options::parse_library): Support -l:filename.
9159 (General_options::parse_just_symbols): Update for Input_file_argument
9160 changes.
9161 (Command_line::process): Likewise.
9162 * archive.cc (Archive::get_file_and_offset): Likewise.
9163 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9164 * script.cc (read_script_file, script_add_file): Likewise.
9165 * fileread.cc (Input_file::Input_file): Likewise.
9166 (Input_file::will_search_for): Handle is_searched_file.
9167 (Input_file::open): Likewise.
9168 * readsyms.cc (Read_symbols::get_name): Likewise.
9169 * testsuite/Makefile.am (searched_file_test): New test.
9170 * testsuite/Makefile.in: Regenerate.
9171 * testsuite/searched_file_test.cc: New file.
9172 * testsuite/searched_file_test_lib.cc: New file.
9173
f3048a1d
ILT
91742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9175 Ian Lance Taylor <iant@google.com>
9176
9177 * descriptor.cc: Include <cstdio> and "binary-io.h".
9178 (Descriptors::open): Open the files in binary mode always.
9179 * script.cc (Lex::get_token): Treat \r as whitespace.
9180
d4780e57
ILT
91812009-10-09 Ian Lance Taylor <iant@google.com>
9182
9183 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9184
d9a893b8
ILT
91852009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9186 Ian Lance Taylor <iant@google.com>
9187
9188 * configure.ac: Check for readv function also.
9189 * fileread.cc (readv): Define if not HAVE_READV.
9190 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9191 does not exist.
9192 * config.in: Regenerate.
9193 * configure: Regenerate.
9194
c0a62865
DK
91952009-10-09 Doug Kwan <dougkwan@google.com>
9196
9197 * layout.cc (Layout::make_output_section): Call target hook to make
9198 ordinary output section.
9199 (Layout::finalize): Adjust parameter list of call the
9200 Target::may_relax().
9201 * layout.h (class Layout::section_list): New method.
9202 * merge.h (Output_merge_base::entsize): Change visibility to public.
9203 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9204 New methods.
9205 (Output_merge_string::do_is_string): New method.
9206 * object.cc (Sized_relobj::do_setup): renamed from
9207 Sized_relobj::set_up.
9208 * object.h (Sized_relobj::adjust_shndx,
9209 Sized_relobj::initializ_input_to_output_maps,
9210 Sized_relobj::free_input_to_output_maps): Change visibilities to
9211 protected.
9212 (Sized_relobj::setup): Virtualize.
9213 (Sized_relobj::do_setup): New method declaration.
9214 (Sized_relobj::invalidate_section_offset,
9215 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9216 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9217 * options.cc (parse_int): New function.
9218 * options.h (parse_int): New declaration.
9219 (DEFINE_int): New macro.
9220 (stub_group_size): New option.
9221 * output.cc (Output_section::Output_section): Initialize memebers
9222 merge_section_map_, merge_section_by_properties_map_,
9223 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9224 (Output_section::add_input_section): Handled deferred code-fill
9225 generation and remove an old comment.
9226 (Output_section::add_relaxed_input_section): New method definition.
9227 (Output_section::add_merge_input_section): Use merge section by
9228 properties map to speed to search. Update merge section maps
9229 as appropriate.
9230 (Output_section::build_relaxation_map): New method definition.
9231 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9232 Same.
9233 (Output_section::relax_input_section): Renamed to
9234 Output_section::convert_input_sections_to_relaxed_sections and change
9235 interface to take a vector of pointers to relaxed sections.
9236 (Output_section::find_merge_section,
9237 Output_section::find_relaxed_input_section): New method definitions.
9238 (Output_section::is_input_address_mapped,
9239 Output_section::output_offset, Output_section::output_address):
9240 Use output section data maps to speed up searching.
9241 (Output_section::find_starting_output_address): Add comments.
9242 (Output_section::do_write,
9243 Output_section::write_to_postprocessing_buffer): Do code-fill
9244 generation as appropriate.
9245 (Output_section::get_input_sections): Invalidate relaxed input section
9246 map.
9247 (Output_section::restore_states): Adjust type of checkpoint .
9248 Invalidate relaxed input section map.
9249 * output.h (Output_merge_base): New class declaration.
9250 (Input_section_specifier): New class defintion.
9251 (class Output_relaxed_input_section) Change base class to
9252 Output_section_data_build.
9253 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9254 base class initializer.
9255 (Output_section::add_relaxed_input_section): New method declaration.
9256 (Output_section::Input_section): Change visibility to protected.
2e702c99 9257 (Output_section::Input_section::relobj,
c0a62865
DK
9258 Output_section::Input_section::shndx): Handle relaxed input sections.
9259 Output_section::input_sections) Change visibility to protected. Also
9260 define overload to return a non-const pointer.
9261 (Output_section::Merge_section_properties): New class defintion.
9262 (Output_section::Merge_section_by_properties_map,
9263 Output_section::Output_section_data_by_input_section_map,
9264 Output_section::Relaxation_map): New types.
9265 (Output_section::relax_input_section): Rename method to
9266 Output_section::convert_input_sections_to_relaxed_sections and change
9267 interface to take a vector of relaxed section pointers.
9268 (Output_section::find_merge_section,
9269 Output_section::find_relaxed_input_section,
9270 Output_section::build_relaxation_map,
9271 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9272 New method declarations.
9273 (Output_section::merge_section_map_
9274 Output_section::merge_section_by_properties_map_,
9275 Output_section::relaxed_input_section_map_,
9276 Output_section::is_relaxed_input_section_map_valid_,
9277 Output_section::generate_code_fills_at_write_): New data members.
9278 * script-sections.cc
9279 (Output_section_element_input::set_section_addresses): Call
9280 current_data_size and addralign methods of relaxed input sections.
9281 (Orphan_output_section::set_section_addresses): Call current_data_size
9282 and addralign methods of relaxed input sections.
9283 * symtab.cc (Symbol_table::compute_final_value): Extract template
9284 from the body of Symbol_table::sized_finalize_symbol.
9285 (Symbol_table::sized_finalized_symbol): Call
9286 Symbol_table::compute_final_value.
9287 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9288 (Symbol_table::compute_final_value): New templated method declaration.
9289 * target.cc (Target::do_make_output_section): New method defintion.
9290 * target.h (Target::make_output_section): New method declaration.
9291 (Target::relax): Add more parameters for input objects, symbol table
9292 and layout. Adjust call to do_relax.
9293 (Target::do_make_output_section): New method declaration.
9294 (Target::do_relax): Add parameters for input objects, symbol table
9295 and layout.
9296
d446d6c4
ILT
92972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9298
9299 * pread.c: Include stdio.h.
9300
bc06c745
ILT
93012009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9302
9303 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9304 defined.
9305
75aea3d0
ILT
93062009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9307
9308 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9309 Change read_shndx type to unsigned int.
9310 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9311 int.
9312 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9313 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9314 Change read_shndx type to unsigned int.
9315 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9316 int.
9317 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9318 * layout.cc (Layout::create_symtab_sections): Cast the result of
9319 local_symcount * symsize to off_t in the gold_assert.
9320
be8fcb75
ILT
93212009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9322
9323 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9324 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9325 R_ARM_BASE_ABS.
9326 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9327 (Arm_relocate_functions::thm_abs5): New function.
9328 (Arm_relocate_functions::abs12): New function.
9329 (Arm_relocate_functions::abs16): New function.
9330 (Arm_relocate_functions::base_abs): New function.
9331 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9332 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9333 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9334 R_ARM_BASE_ABS.
9335 (Scan::global): Likewise.
9336 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9337 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9338 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9339 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9340 R_ARM_BASE_ABS.
9341
c2a122b6
ILT
93422009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9343
9344 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9345 (Arm_relocate_functions::movt_prel): New function.
9346 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9347 (Arm_relocate_functions::thm_movt_prel): New function.
9348 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9349 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9350 (Scan::global, Relocate::relocate): Likewise.
9351 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9352
c4aa1e2d
ILT
93532009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9354
9355 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9356 Incremental_checker.
9357 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9358 unsigned int.
9359 (class Incremental_inputs_header): New class.
9360 (Incremental_inputs_header_writer): Edit comment.
9361 (Incremental_inputs_entry): New class.
9362 (Incremental_inputs_entry_writer): Edit comment.
9363 (Sized_incremental_binary::do_find_incremental_inputs_section):
9364 Add *strtab_shndx parameter, fill it.
9365 (Sized_incremental_binary::do_check_inputs): New method.
9366 (Incremental_checker::can_incrementally_link_output_file): Use
9367 Sized_incremental_binary::check_inputs.
9368 (Incremental_inputs::report_command_line): Save command line in
9369 command_line_.
9370 * incremental.h:
9371 (Incremental_binary::find_incremental_inputs_section): New
9372 method.
9373 (Incremental_binary::do_find_incremental_inputs_section): Add
9374 strtab_shndx parameter.
9375 (Incremental_binary::do_check_inputs): New pure virtual method.
9376 (Sized_incremental_binary::do_check_inputs): Declare.
9377 (Incremental_checker::Incremental_checker): Add incremental_inputs
9378 parameter, use it to initialize incremental_inputs_.
9379 (Incremental_checker::incremental_inputs_): New field.
9380 (Incremental_checker::command_line): New method.
9381 (Incremental_checker::inputs): New method.
9382 (Incremental_checker::command_line_): New field.
9383
c549a694
ILT
93842009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9385
9386 * incremental.cc: Include <cstdarg> and "target-select.h".
9387 (vexplain_no_incremental): New function.
9388 (explain_no_incremental): New function.
9389 (Incremental_binary::error): New method.
9390 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9391 method.
9392 (make_sized_incremental_binary): New function.
9393 (open_incremental_binary): New function.
9394 (can_incrementally_link_file): Add checks if output is ELF and has
9395 inputs section.
9396 * incremental.h: Include "elfcpp_file.h" and "output.h".
9397 (Incremental_binary): New class.
9398 (Sized_incremental_binary): New class.
9399 (open_incremental_binary): Declare.
9400 * object.cc (is_elf_object): Use
9401 elfcpp::Elf_recognizer::is_elf_file.
9402 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9403 * output.h (Output_file::filesize): New method.
9404
fd3c5f0b
ILT
94052009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9406
9407 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9408 New function.
9409 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9410 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9411 function.
9412 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9413 function.
9414 (Arm_relocate_functions::movw_abs_nc): New function.
9415 (Arm_relocate_functions::movt_abs): New function.
9416 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9417 (Arm_relocate_functions::thm_movt_abs): New function.
9418 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9419 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9420 (Scan::global): Likewise.
9421 (Relocate::relocate): Likewise.
9422 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9423
7f5309a5
ILT
94242009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9425
9426 * arm.cc (Arm_relocate_functions::got_prel) New function.
9427 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9428 (Relocate::relocate): Likewise.
9429 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9430
364c7fa5
ILT
94312009-10-06 Ian Lance Taylor <iant@google.com>
9432
9433 * options.h (class General_options): Define
9434 split_stack_adjust_size parameter.
9435 * object.h (class Object): Add uses_split_stack_ and
9436 has_no_split_stack_ fields. Add uses_split_stack and
9437 has_no_split_stack accessor functions. Declare
9438 handle_split_stack_section.
9439 (class Reloc_symbol_changes): Define.
9440 (class Sized_relobj): Define Function_offsets. Declare
9441 split_stack_adjust, split_stack_adjust_reltype, and
9442 find_functions.
9443 * object.cc (Object::handle_split_stack_section): New function.
9444 (Sized_relobj::do_layout): Call handle_split_stack_section.
9445 * dynobj.cc (Sized_dynobj::do_layout): Call
9446 handle_split_stack_section.
9447 * reloc.cc (Sized_relobj::relocate_sections): Call
9448 split_stack_adjust for executable sections in split_stack
9449 objects. Pass reloc_map to relocate_section.
9450 (Sized_relobj::split_stack_adjust): New function.
9451 (Sized_relobj::split_stack_adjust_reltype): New function.
9452 (Sized_relobj::find_functions): New function.
9453 * target-reloc.h: Include "object.h".
9454 (relocate_section): Add reloc_symbol_changes parameter. Change
9455 all callers.
9456 * target.h (class Target): Add calls_non_split method. Declare
9457 do_calls_non_split virtual method. Declare match_view and
9458 set_view_to_nop.
9459 * target.cc: Include "elfcpp.h".
9460 (Target::do_calls_non_split): New function.
9461 (Target::match_view): New function.
9462 (Target::set_view_to_nop): New function.
9463 * gold.cc (queue_middle_tasks): Give an error if mixing
9464 split-stack and non-split-stack objects with -r.
9465 * i386.cc (Target_i386::relocate_section): Add
9466 reloc_symbol_changes parameter.
9467 (Target_i386::do_calls_non_split): New function.
9468 * x86_64.cc (Target_x86_64::relocate_section): Add
9469 reloc_symbol_changes parameter.
9470 (Target_x86_64::do_calls_non_split): New function.
9471 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9472 parameter.
9473 * powerpc.cc (Target_powerpc::relocate_section): Add
9474 reloc_symbol_changes parameter.
9475 * sparc.cc (Target_sparc::relocate_section): Add
9476 reloc_symbol_changes parameter.
9477 * configure.ac: Call AM_CONDITIONAL for the default target.
9478 * configure: Rebuild.
9479 * testsuite/Makefile.am (TEST_AS): New variable.
9480 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9481 (check_DATA): Add split_i386 and split_x86_64 files.
9482 (SPLIT_DEFSYMS): Define.
9483 (split_i386_[1234n].o): New targets.
9484 (split_i386_[124]): New targets.
9485 (split_i386_[1234r].stdout): New targets.
9486 (split_x86_64_[1234n].o): New targets.
9487 (split_x86_64_[124]): New targets.
9488 (split_x86_64_[1234r].stdout): New targets.
9489 (MOSTLYCLEANFILES): Add new executables.
9490 * testsuite/split_i386.sh: New file.
9491 * testsuite/split_x86_64.sh: New file.
9492 * testsuite/split_i386_1.s: New file.
9493 * testsuite/split_i386_2.s: New file.
9494 * testsuite/split_i386_3.s: New file.
9495 * testsuite/split_i386_4.s: New file.
9496 * testsuite/split_i386_n.s: New file.
9497 * testsuite/split_x86_64_1.s: New file.
9498 * testsuite/split_x86_64_2.s: New file.
9499 * testsuite/split_x86_64_3.s: New file.
9500 * testsuite/split_x86_64_4.s: New file.
9501 * testsuite/split_x86_64_n.s: New file.
9502 * testsuite/testfile.cc (Target_test): Update relocation_section
9503 function.
9504 * testsuite/Makefile.in: Rebuild.
9505
e8a9fcda
ILT
95062009-10-06 Ian Lance Taylor <iant@google.com>
9507
9508 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9509 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9510 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9511 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9512 the address on ldo_addrs_.
9513 (Target_i386::Relocate::fix_up_ldo): New function.
9514
e99daf92
ILT
95152009-10-06 Rafael Espindola <espindola@google.com>
9516
9517 * plugin.cc (add_input_library): New.
9518 (Plugin::load): Add add_input_library to tv.
9519 (Plugin_manager::add_input_file): Add the is_lib argument.
9520 (add_input_file): Update call to Plugin_manager::add_input_file.
9521 (add_input_library): New.
9522 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9523
966d4097
DK
95242009-09-30 Doug Kwan <dougkwan@google.com>
9525
9526 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9527 symbol and call Symbol::may_need_copy_reloc to determine if
9528 a copy reloc is needed.
9529 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9530 nocopyreloc is given in command line.
9531 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9532 given in command line.
9533 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9534 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9535 of the removed Target_i386::may_need_copy_reloc.
9536 * options.h (copyreloc): New option with default value false.
9537 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9538 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9539 instead of the removed Target_powerpc::may_need_copy_reloc.
9540 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9541 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9542 instead of the removed Target_sparc::may_need_copy_reloc.
9543 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9544 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9545 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9546 instead of the removed Target_x86_64::may_need_copy_reloc.
9547
029ba973
ILT
95482009-09-30 Ian Lance Taylor <iant@google.com>
9549
9550 * object.h (class Object): Remove target_ field, and target,
9551 sized_target, and set_target methods.
9552 (Object::sized_target): Remove.
9553 (class Sized_relobj): Update declarations. Remove sized_target.
9554 * object.cc (Sized_relobj::setup): Remove target parameter.
9555 Change all callers.
9556 (Input_objects::add_object): Don't do anything with the target.
9557 (make_elf_sized_object): Add punconfigured parameter. Change all
9558 callers. Set or test parameter target.
9559 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9560 Change all callers.
9561 * parameters.cc (Parameters::set_target): Change parameter type to
9562 be non-const.
9563 (Parameters::default_target): Remove.
9564 (set_parameters_target): Change parameter type to be non-const.
9565 (parameters_force_valid_target): New function.
9566 (parameters_clear_target): New function.
9567 * parameters.h (class Parameters): Update declarations. Remove
9568 default_target method. Add sized_target and clear_target
9569 methods. Change target_ to be non-const.
9570 (set_parameters_target): Update declaration.
9571 (parameters_force_valid_target): Declare.
9572 (parameters_clear_target): Declare.
9573 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9574 as NULL if we aren't searching.
9575 (Add_symbols::run): Don't check for compatible target.
9576 * fileread.cc (Input_file::open_binary): Call
9577 parameters_force_valid_target.
9578 * gold.cc (queue_middle_tasks): Likewise.
9579 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9580 set_target on object.
9581 * dynobj.h (class Sized_dynobj): Update declarations.
9582 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9583 make_elf_object returns NULL.
9584 (Archive::include_member): Don't check whether object target is
9585 compatible.
9586 * output.cc (Output_section::add_input_section): Get target from
9587 parameters.
9588 (Output_section::relax_input_section): Likewise.
9589 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9590 parameters.
9591 (Sized_relobj::do_scan_relocs): Likewise.
9592 (Sized_relobj::relocate_sections): Likewise.
9593 * resolve.cc (Symbol_table::resolve): Likewise.
9594 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9595 parameter. Change all callers.
9596 (Symbol_table::add_from_object): Get target from parameters.
9597 (Symbol_table::add_from_relobj): Don't check object target.
9598 (Symbol_table::add_from_dynobj): Likewise.
9599 (Symbol_table::define_special_symbol): Get target from
9600 parameters.
9601 * symtab.h (class Symbol_table): Update declaration.
9602 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9603 parameter. Change all callers. Clear parameter target.
9604 (Binary_test): Test target here.
9605 * testsuite/object_unittest.cc (gold_testsuite): Remove
9606 target_test_pointer parameter. Change all callers.
9607 (Object_test): Test target here.
9608
a6a22b83
ILT
96092009-09-26 Ian Lance Taylor <iant@google.com>
9610
9611 * testsuite/initpri1.c: Don't try to use constructor priorities if
9612 compiling with gcc before 4.3.
9613
6a8f49fe
ILT
96142009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9615
9616 * testsuite/retain_symbols_file_test.sh (check_present): Change
9617 output file name to retain_symbols_file_test.stdout.
9618 (check_absent): Likewise.
9619
8c604651
CS
96202009-09-18 Craig Silverstein <csilvers@google.com>
9621
9622 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9623 * options.cc: Include <cerrno> and <fstream>.
9624 (General_options::finalize): Parse -retain-symbols-file tag.
9625 * options.h: New flag.
9626 (General_options): New method should_retain_symbol, new
9627 variable symbols_to_retain.
9628 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9629 should_retain_symbol map.
9630 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9631 * testsuite/Makefile.in: Regenerate.
9632 * testsuite/retain_symbols_file_test.sh: New file.
9633
ca58b19f
NC
96342009-09-18 Nick Clifton <nickc@redhat.com>
9635
9636 * po/es.po: Updated Spanish translation.
9637
20e6d0d6
DK
96382009-09-17 Doug Kwan <dougkwan@google.com>
9639
9640 * debug.h (DEBUG_RELAXATION): New constant.
9641 (DEBUG_ALL): Add DEBUG_RELAXATION.
9642 (debug_string_to_enum): Add relaxation debug option.
9643 * layout.cc
9644 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9645 Layout::Relaxation_debug_check::read_sections,
9646 Layout::Relaxation_debug_check::read_sections): New method definitions.
9647 (Layout::Layout): Initialize data members
9648 record_output_section_data_from_scrips_,
9649 script_output_section_data_list_ and relaxation_debug_check_.
9650 (Layout::save_segments, Layout::restore_segments,
9651 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9652 Layout::relaxation_loop_body): New method definitions.
9653 (Layout::finalize): Support relaxation. Move section layout code to
9654 Layout::relaxation_loop_body.
9655 (Layout::set_asection_address_from_script): Move code for orphan
9656 section placement out.
9657 (Layout::place_orphan_sections_in_script): New method definition.
9658 * layout.h (Output_segment_headers, Output_file_header):
9659 New forward class declarations.
9660 (Layout::~Layout): Define.
9661 (Layout::new_output_section_data_from_script): New method definition.
9662 (Layout::place_orphan_sections_in_script): New method declaration.
9663 (Layout::Segment_states): New type declaration.
9664 (Layout::save_segments, Layout::restore_segments,
9665 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9666 Layout::relaxation_loop_body): New method declarations.
9667 (Layout::Output_section_data_list): New type declaration.
9668 (Layout::Relaxation_debug_check): New class definition.
9669 (Layout::record_output_section_data_from_script_,
9670 Layout::script_output_section_data_list_, Layout::segment_states_,
9671 Layout::relaxation_debug_check_): New data members.
9672 * output.cc: (Output_section_headers::do_size): New method definition.
9673 (Output_section_headers::Output_section_headers): Move size
9674 computation to Output_section_headers::do_size.
9675 (Output_segment_headers::do_size): New method definition.
e1df38aa 9676 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9677 Output_file_header::do_size and call it.
9678 (Output_file_header::do_size): New method definition.
9679 (Output_data_group::Output_data_group): Adjust call to
9680 Output_section_data.
9681 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9682 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9683 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9684 RELAXED_INPUT_SECTION_CODE.
9685 (Output_section::Output_section): Initialize data member checkpoint_.
9686 (Output_section::~Output_section): Delete checkpoint object pointed
9687 by checkpoint_.
9688 (Output_section::add_input_section): Always add an Input_section if
9689 relaxing.
9690 (Output_section::add_merge_input_section): Add assert.
9691 (Output_section::relax_input_section): New method definition.
9692 (Output_section::set_final_data_size): Set load address to zero for
9693 an unallocated section.
9694 (Output_section::do_address_and_file_offset_have_reset_values):
9695 New method definition.
9696 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9697 Handle relaxed input section.
9698 (Output_section::sort_attached_input_sections): Checkpoint input
9699 section list lazily.
9700 (Output_section::get_input_sections): Change type of input_sections to
9701 list of Simple_input_section pointers. Checkpoint input section list
9702 lazily. Also handle relaxed input sections.
9703 (Output_section::add_input_section_for_script): Take a reference to
9704 a Simple_input_section object instead of Relobj pointer and section
9705 index as parameter. Handle relaxed input sections.
9706 (Output_section::save_states, Output_section::restore_states): New
9707 method definitions.
9708 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9709 (Output_data::is_data_size_fixed): New method definition.
9710 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9711 if it is fixed.
9712 (Output_data::address_and_file_offset_have_reset_values): New method
9713 definition.
9714 (Output_data::do_address_and_file_offset_have_reset_values): New method
9715 definition.
9716 (Output_data::set_data_size): Check that data size is not fixed.
9717 (Output_data::fix_data_size): New method definition.
9718 (Output_data::is_data_size_fixed_): New data member.
9719 (Output_section_headers::set_final_data_size): New method definition.
9720 (Output_section_headers::do_size): New method declaration.
9721 (Output_segment_headers::set_final_data_size): New method definition.
9722 (Output_segment_headers::do_size): New method declaration.
9723 (Output_file_header::set_final_data_size)::New method definition.
9724 (Output_file_header::do_size)::New method declaration.
9725 (Output_section_data::Output_section_data): Add new parameter
9726 is_data_size_fixed and use it to fix data size.
9727 (Output_data_const::Output_data_const): Adjust call to base class
9728 constructor and fix data size.
9729 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9730 base class constructor and fix data size.
9731 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9732 base class constructor and fix data size.
9733 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9734 class constructor and fix data size.
9735 (Output_data_group::set_final_data_size): New method definition.
9736 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9737 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9738 class constructor and fix data size.
9739 (Output_relaxed_input_section): New class definition.
9740 (Output_section::Simple_input_section): New class definition.
9741 (Output_section::get_input_sections): Adjust parameter list.
9742 (Output_section::add_input_section_for_script): Same.
9743 (Output_section::save_states, Output_section::restore_states,
9744 Output_section::do_address_and_file_offset_have_reset_values,
9745 (Output_section::Input_section::Input_section): Handle
9746 RELAXED_INPUT_SECTION_CODE. Add new overload for
9747 Output_relaxed_input_section.
9748 (Output_section::Input_section::is_input_section,
9749 Output_section::Input_section::set_output_section): Handle relaxed
9750 input section.
9751 (Output_section::Input_section::is_relaxed_input_section,
9752 Output_section::Input_section::output_section_data,
9753 Output_section::Input_section::relaxed_input_section): New method
9754 definitions.
9755 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9756 value.
9757 (Output_section::Input_section::u1_): Update comments.
9758 (Output_section::Input_section::u2_): Add new union member poris.
9759 (Output_section::Checkpoint_output_section): New classs definition.
9760 (Output_section::relax_input_section): New method declaration.
9761 (Output_section::checkpoint_): New data member.
9762 (Output_segment): Update comments.
9763 (Output_segment::Output_segment): Un-privatize copy constructor.
9764 (Output_segment::operator=): Un-privatize.
9765 * script-sections.cc (Output_section_element::Input_section_list):
9766 Change element type to Output_section::Simple_input_section.
9767 (Output_section_element_dot_assignment::set_section_addresses):
9768 Register output section data for relaxation clean up.
9769 (Output_data_exression::Output_data_expression): Adjust call to base
9770 constructor to fix data size.
9771 (Output_section_element_data::set_section_addresses): Register
9772 Output_data_expression object for relaxation clean up.
9773 (struct Input_section_info): Replace Relobj pointer and section index
9774 pair with Output_section::Simple_input_section and Convert struct to a
9775 class.
9776 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9777 Input_section_info data member to use accessors.
20e6d0d6
DK
9778 (Output_section_element_input::set_section_addresses): Use layout
9779 parameter. Adjust code to use Output_section::Simple_input_section
9780 and Input_secction_info classes. Register filler for relaxation
9781 clean up.
9782 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9783 and section index pair with Output_section::Simple_input_section
9784 class. Adjust code accordingly.
9785 (Phdrs_element::release_segment): New method definition.
9786 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9787 segment list.
9788 (Script_sections::release_segments): New method definition.
9789 * gold/script-sections.h (Script_sections::release_segments): New
9790 method declaration.
9791 * gold/target.h (Target::may_relax, Target::relax,
9792 Target::do_may_relax, Target::do_relax): New method definitions.
9793
5e445df6
ILT
97942009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9795
9796 * arm.cc (has_signed_unsigned_overflow): New function.
9797 (Arm_relocate_functions::abs8): New function.
9798 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9799 (Target_arm::Scan::global): Likewise.
9800 (Target_arm::relocate::relocate): Likewise.
9801 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9802 Likewise.
9803
8c604651 98042009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9805
9806 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9807 * testsuite/Makefile.in: Regenerate.
9808
1e9cc1c2
NC
98092009-09-11 Nick Clifton <nickc@redhat.com>
9810
9811 * po/gold.pot: Updated by the Translation project.
9812
6a89f575
CC
98132009-09-08 Cary Coutant <ccoutant@google.com>
9814
9815 * output.cc (Output_file::open): Add execute permission to empty file.
9816 * testsuite/Makefile.am (permission_test): New test.
9817 * testsuite/Makefile.in: Regenerate.
9818
fdcac5af
ILT
98192009-09-02 Ian Lance Taylor <iant@google.com>
9820
9821 * output.cc (Output_file::resize): Call map_no_anonymous rather
9822 than map.
9823
44453f85
ILT
98242009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9825
9826 * gold.cc: Include "incremental.h".
9827 (queue_initial_tasks): Call Incremental_checker methods.
9828 * incremental.cc: Include "output.h".
9829 (Incremental_checker::can_incrementally_link_output_file): New
9830 method.
9831 * incremental.h (Incremental_checker): New class.
9832
9833 * output.cc (Output_file::open_for_modification): New method.
9834 (Output_file::map_anonymous): Changed return type to bool. Record
9835 map in base_ field.
9836 (Output_file::map_no_anonymous): New method, broken out of map.
9837 (Output_file::map): Use map_no_anonymous and map_anonymous.
9838 * output.h (class Output_file): Update declarations.
9839
293c1386
CC
98402009-08-24 Cary Coutant <ccoutant@google.com>
9841
9842 * options.h (Command_line::Pre_options): New class.
9843 (Command_line::pre_options): New member.
9844 * options.cc (gold::options::ready_to_register): New variable.
9845 (One_option::register_option): Do nothing if not registering options.
9846 Assert if same short option registered twice.
9847 (General_options::General_options): Turn off option registration when
9848 done constructing.
9849 (Command_line::Pre_options::Pre_options): New constructor.
9850
f773f3d2
CC
98512009-08-24 Cary Coutant <ccoutant@google.com>
9852
06a73cfe
CC
9853 * options.h (General_options::no_keep_memory): Remove incorrect
9854 short option.
f773f3d2 9855
a15af8e2
RW
98562009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9857
9858 * Makefile.am (am__skiplex, am__skipyacc): New.
9859 * Makefile.in: Regenerate.
9860
c462b41b
RW
98612009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9862
14ec8efd
RW
9863 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9864 (INCLUDES): ... this.
9865 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9866 (AM_CPPFLAGS): Renamed from ...
9867 (INCLUDE): ... this.
9868 * Makefile.in, testsuite/Makefile.in: Regenerate.
9869
81ecdfbb
RW
9870 * Makefile.in: Regenerate.
9871 * aclocal.m4: Likewise.
9872 * config.in: Likewise.
9873 * configure: Likewise.
9874 * testsuite/Makefile.in: Likewise.
9875
c462b41b
RW
9876 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9877 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9878 * Makefile.in: Regenerate.
9879 * testsuite/Makefile.in: Regenerate.
9880
2da73f13
CC
98812009-08-19 Cary Coutant <ccoutant@google.com>
9882
9883 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9884 symbols in shared libraries overridden by hidden or internal symbols
9885 in the main program.
9886
2db70501
CD
98872009-08-19 Chris Demetriou <cgd@google.com>
9888
9889 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9890 checking source file names in error messages.
9891
f733487b
DK
98922009-08-18 Doug Kwan <dougkwan@google.com>
9893
9894 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9895 an elcpp::Ehdr as parameter. Adjust call to set_target.
9896 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9897 an elfcpp::Ehdr as parameter.
9898 * object.cc (Object::set_target): Remove the version that looks up
9899 a target and sets it.
9900 (Sized_relobj::setup): Take a Target object instead of
9901 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9902 (make_elf_sized_object): Find target and ask target to
9903 make an ELF object.
9904 * object.h: (Object::set_target): Remove the version that looks up
9905 a target and sets it.
9906 (Sized_relobj::setup): Take a Target object instead of
9907 an elfcpp:Ehdr as parameter.
9908 * target.cc: Include dynobj.h.
9909 (Target::do_make_elf_object_implementation): New.
2e702c99 9910 (Target::do_make_elf_object): New.
f733487b
DK
9911 * target.h (Target::make_elf_object): New template declaration.
9912 (Target::do_make_elf_object): New method declarations.
9913 (Target::do_make_elf_object_implementation): New template declaration.
9914
cc70f101
ILT
99152009-08-14 Ian Lance Taylor <iant@google.com>
9916
9917 * gold.h (FUNCTION_NAME): Define.
9918 (gold_unreachable): Use FUNCTION_NAME.
9919
ef5e0cb1
ST
99202009-08-12 Sriraman Tallam <tmsriram@google.com>
9921
9922 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9923 symbol in the --keep-unique list is not found.
9924
48c187ce
ST
99252009-08-12 Sriraman Tallam <tmsriram@google.com>
9926
9927 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9928 been maked as --keep-unique.
9929 (Icf::unfold_section): New function.
9930 * icf.h (Icf::unfold_section): New function.
9931 * options.h (General_options::keep_unique): New option.
9932 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9933 * testsuite/Makefile.in: Regenerate.
9934 * testsuite/icf_keep_unique_test.sh: New file.
9935 * testsuite/icf_keep_unique_test.cc: New file.
9936
645afe0c
CC
99372009-08-12 Cary Coutant <ccoutant@google.com>
9938
9939 PR 10471
9940 * resolve.cc (Symbol_table::resolve): Check for references from
9941 dynamic objects to hidden and internal symbols.
9942 * testsuite/Makefile.am (hidden_test.sh): New test.
9943 * testsuite/Makefile.in: Regenerate.
9944 * testsuite/hidden_test.sh: New script.
9945 * testsuite/hidden_test_1.c: New test source.
9946 * testsuite/hidden_test_main.c: New test source.
9947
11af873f
DK
99482009-08-11 Doug Kwan <dougkwan@google.com>
9949
9950 * arm.cc: Update comments.
9951 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9952 segment to locate the .ARM.exidx section if present.
9953
b9f7d72d
DK
99542009-08-09 Doug Kwan <dougkwan@google.com>
9955
9956 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9957 patch.
9958
ddd3c53c
ST
99592009-08-07 Sriraman Tallam <tmsriram@google.com>
9960 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9961 compiler warnings.
9962
27721062
ST
99632009-08-06 Sriraman Tallam <tmsriram@google.com>
9964
9965 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9966 valid tls_segment only for non-debug-section relocations.
9967 * testsuite/Makefile.am: Add gc_tls_test.
9968 * testsuite/Makefile.in: Regenerate.
9969 * testsuite/gc_tls_test.cc: New file.
9970 * testsuite/gc_tls_test.sh: New file.
9971
ef15dade 99722009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9973
ef15dade
ST
9974 * icf.cc: New file.
9975 * icf.h: New file.
9976 * Makefile.am (CCFILES): Add icf.cc.
9977 (HFILES): Add icf.h
9978 * Makefile.in: Regenerate.
9979 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9980 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9981 section, symbol and addend information for the relocs.
9982 * gold.cc (queue_middle_tasks): Call identical code folding.
9983 * gold.h: Add defines for multimap.
9984 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9985 to the call of finalize_local_symbols.
9986 * main.cc (main): Create object of class Icf.
9987 * object.cc (Sized_relobj::do_layout): Allow this function to be
9988 called twice during icf.
9989 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9990 to sections marked as identical by icf.
9991 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9992 when available.
9993 (Sized_relobj::do_section_entsize): New function.
9994 * object.h (Object::section_entsize): New function.
9995 (Object::do_section_entsize): New pure virtual function.
9996 (Relobj::finalize_local_symbols): Add new parameter.
9997 (Relobj::do_section_entsize): New function.
9998 * options.h (General_options::icf): New option.
9999 (General_options::icf_iterations): New option.
10000 (General_options::print_icf_sections): New option.
10001 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
10002 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
10003 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
10004 icf.
10005 * symtab.cc (Symbol_table::is_section_folded): New function.
10006 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
10007 to sections marked as identical by icf.
10008 * symtab.h (Symbol_table::set_icf): New function.
10009 (Symbol_table::icf): New function.
10010 (Symbol_table::is_section_folded): New function.
10011 (Symbol_table::icf_): New data member.
10012 * target-reloc.h (relocate_section): Ignore sections folded by icf.
10013 * testsuite/Makefile.am: Add commands to build icf_test.
10014 * testsuite/Makefile.in: Regenerate.
10015 * testsuite/icf_test.sh: New file.
10016 * testsuite/icf_test.cc: New file.
10017
c3b65ac4
CD
100182009-07-24 Chris Demetriou <cgd@google.com>
10019
10020 * layout.cc (is_compressible_debug_section): Fix incorrect
10021 comment about compressed section names.
10022
1caf2c51
ILT
100232009-07-20 Ian Lance Taylor <ian@airs.com>
10024
10025 PR 10419
10026 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
10027
1ef4d87f
ILT
100282009-07-16 Ian Lance Taylor <iant@google.com>
10029
10030 PR 10400
10031 * layout.h: #include <map>.
10032 (class Kept_section): Change from struct to class. Add accessors
10033 and setters. Add section size to Comdat_group mapping. Change
10034 Comdat_group to std::map. Add is_comdat_ field. Add
10035 linkonce_size field in union.
10036 (class Layout): Update declaration of find_or_add_kept_section.
10037 Don't declare find_kept_object.
10038 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
10039 parameter. Add object, shndx, is_comdat, and is_group_name
10040 parameters. Change all callers. Adjust for new Kept_section.
10041 (Layout::find_kept_object): Remove.
10042 * object.cc (Sized_relobj::include_section_group): Update use of
10043 Kept_section. Rename secnum to shndx. Only record
10044 Kept_comdat_section if sections are the same size.
10045 (Sized_relobj::include_linkonce_section): Update use of
10046 Kept_section. Only record Kept_comdat_section if sections are the
10047 same size. Set size of linkonce section.
10048 (Sized_relobj::map_to_kept_section): Update call to
10049 get_kept_comdat_section.
10050 * object.h (class Sized_relobj): Rename fields in
10051 Kept_comdat_section to drop trailing underscores; change object
10052 field to Relobj*. Change Kept_comdat_section_table to store
10053 struct rather than pointer.
10054 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
10055 Add kept_object and kept_shndx parameters. Change all callers.
10056 (Sized_relobj::get_kept_comdat_section): Change return type to
10057 bool. Add kept_object and kept_shndx parameters. Change all
10058 callers.
10059 * plugin.cc (Pluginobj::include_comdat_group): Update call to
10060 Layout::find_or_add_kept_section.
10061
37c3b7b0
ILT
100622009-07-09 Ian Lance Taylor <iant@google.com>
10063
10064 * merge.cc (Object_merge_map::initialize_input_to_output_map):
10065 Reserve space in the hash table.
10066
98fa85cb
ILT
100672009-07-06 Mikolaj Zalewski <mikolajz@google.com>
10068
10069 * fileread.cc (File_read::get_mtime): New method.
10070 * fileread.h (Timespec): New structure.
10071 (File_read::get_mtime): New method.
10072 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
10073 Renamed from timestamp_nsec.
10074 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
10075 Elf_Xword.
e1df38aa 10076 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 10077 timestamp_nsec.
e1df38aa 10078 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
10079 (Incremental_inputs::report_obejct): Save mtime; style fix.
10080 (Incremental_inputs::report_script): Save mtime; style fix.
10081 (Incremental_inputs::finalize_inputs): Style fix.
10082 (Incremental_inputs::finalize): Style fix.
10083 (Incremental_inputs::create_input_section_data): Store inputs
10084 mtime.
10085 * incremental.h (Incremental_inputs::report_script): Add mtime
10086 argument.
10087 (Incremental_inputs::Input_info::Input_info): Intialize only one
10088 union member.
10089 (Incremental_inputs::Input_info::archive): Move to nameless
10090 union.
10091 (Incremental_inputs::Input_info::obejct): Move to nameless union.
10092 (Incremental_inputs::Input_info::script): Move to nameless union.
10093 (Incremental_inputs::mtime): New field.
10094 * script.cc (read_input_script): Pass file mtime to
10095 Incremental_input.
10096 * script.h (Script_info::inputs): Style fix.
10097
c9d70757
ILT
100982009-07-01 Ian Lance Taylor <ian@airs.com>
10099
10100 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10101 instead of 32.
10102
9c547ec3
ILT
101032009-06-24 Ian Lance Taylor <iant@google.com>
10104
10105 PR 10156
10106 * layout.cc (Layout::choose_output_section): If we find an
10107 existing section, update the flags.
10108 (Layout::create_notes): New function, broken out of
10109 Layout::finalize.
10110 (Layout::finalize): Don't create note sections.
10111 (Layout::create_note): Don't crash if linker script discards
10112 section.
10113 (Layout::create_gold_note): Likewise.
10114 (Layout::create_build_id): Likewise. Don't set
10115 after_input_sections on the section.
10116 (Layout::create_executable_stack_info): Remove target parameter.
10117 Change caller.
10118 * layout.h (class Layout): Declare create_notes. Update
10119 declaration of create_executable_stack_info.
10120 * gold.cc (queue_middle_tasks): Call create_notes.
10121 * output.cc (Output_section::update_flags_for_input_section): Move
10122 here from output.h. If SHF_ALLOC flag is newly set, mark address
10123 invalid.
10124 * output.h (Output_data::mark_address_invalid): New function.
10125 (class Output_section): Only declare, not define,
10126 update_flags_for_input_section. Remove set_flags.
10127
55458500
ILT
101282009-06-24 Ian Lance Taylor <iant@google.com>
10129
10130 * script-sections.cc (Output_section_definition::
10131 set_section_addresses): Rename shadowing local load_address to
10132 laddr.
10133
1307d6cd
ILT
101342009-06-24 Ian Lance Taylor <iant@google.com>
10135
10136 PR 10244
10137 * reloc.cc (relocate_sections): Skip empty relocation sections.
10138
ec3f783e
ILT
101392009-06-23 Ian Lance Taylor <iant@google.com>
10140
10141 PR 10156
10142 * layout.cc (Layout::create_note): Use choose_output_section
10143 rather than make_output_section.
10144
459c9f1c
ILT
101452009-06-23 Ian Lance Taylor <iant@google.com>
10146
10147 PR 10237
10148 * options.cc (General_options::parse_V): Set printed_version_.
10149 (General_options::General_options): Initialize printed_version_.
10150 * options.h (class General_options): Add printed_version_ field.
10151 * gold.cc (queue_initial_tasks): If there are no input files,
10152 don't give a fatal error if we printed the version information.
10153 (queue_middle_tasks): If using -r with a shared object, give a
10154 fatal error rather than an ordinary error.
10155
1518dc8f
ILT
101562009-06-23 Ian Lance Taylor <iant@google.com>
10157
10158 PR 10219
10159 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10160 (Layout::make_output_section): Set have_stabstr_section_ if we see
10161 a .stab*str section.
10162 (Layout::finalize): Call link_stabs_sections.
10163 (Layout::link_stabs_sections): New file.
10164 * layout.h (class Layout): Add have_stabstr_section_ field.
10165 Declare link_stabs_sections.
10166
3d857b98
DK
101672009-06-23 Doug Kwan <dougkwan@google.com>
10168
10169 * Makefile.am (libgold_a_LIBADD): New.
10170 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10171 * Makefile.in: Regenerate.
3d857b98
DK
10172 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10173 * configure: Regenerate.
10174 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10175 * fileread.cc: Include sys/state.h
10176 * gold.h: Declare memmem and strndup if found missing.
10177 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10178
0639a6f6
ILT
101792009-06-23 Ian Lance Taylor <iant@google.com>
10180
10181 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10182 * configure: Rebuild.
10183
8d63875c
ILT
101842009-06-23 Ian Lance Taylor <iant@google.com>
10185
10186 PR 10147
10187 * object.cc (Object::section_contents): Don't try to get a view if
10188 the section has length zero.
10189 (Object::handle_gnu_warning_section): If the section is empty, use
10190 the name of the section as the warning.
10191
f7c8a183
ILT
101922009-06-23 Ian Lance Taylor <iant@google.com>
10193
10194 PR 10133
10195 * stringpool.h (class Stringpool_template): Add optimize_ field.
10196 (Stringpool_template::set_optimize): New function.
10197 * stringpool.cc (Stringpool_template::Stringpool_template):
10198 Initialize optimize_ field.
10199 (Stringpool_template::set_string_offsets): Test local optimize
10200 fild rather than parameter.
10201 * layout.cc (Layout::Layout): Call set_optimize on the section
10202 name stringpool.
10203
e6a307ba
ILT
102042009-06-22 Ian Lance Taylor <iant@google.com>
10205
10206 PR 10030
10207 * yyscript.y: Parse TARGET.
10208 * script.cc (script_set_target): New function.
10209 * script-c.h (script_set_target): Declare.
10210 * options.cc (General_options::string_to_object_format): Rename
10211 from string_to_object_format in anonymous namespace. Change
10212 callers.
10213 * options.h (class General_options): Declare
10214 string_to_object_format.
10215
3ee173de
ILT
102162009-06-22 Ian Lance Taylor <iant@google.com>
10217
10218 * script-sections.cc (Script_sections::create_segments): Don't put
10219 program headers in a PT_LOAD segment if -n or -N.
10220
102212009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10222
10223 PR 10141
10224 * options.h (class General_options): Add -z lazy and -z now. Sort
10225 -z options into alphabetical order.
10226 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10227
cd6739a1 102282009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10229
10230 * layout.cc (Layout::make_output_section): Call
10231 Target::new_output_section.
10232 (Layout::attach_allocated_section_to_segment): Put large section
10233 sections in a separate load segment with the large segment flag
10234 set.
10235 (Layout::segment_precedes): Sort large data segments after other
10236 load segments.
10237 (align_file_offset): New static function.
10238 (Layout::set_segment_offsets): Use align_file_offset.
10239 * output.h (class Output_section): Add is_small_section_ and
10240 is_large_section_ fields.
10241 (Output_section::is_small_section): New function.
10242 (Output_section::set_is_small_section): New function.
10243 (Output_section::is_large_section): New function.
10244 (Output_section::set_is_large_section): New function.
10245 (Output_section::is_large_data_section): New function.
10246 (class Output_segment): Add is_large_data_segment_ field.
10247 (Output_segment::is_large_data_segment): New function.
10248 (Output_segment::set_is_large_data_segment): New function.
10249 * output.cc (Output_section::Output_section): Initialize new
10250 fields.
10251 (Output_segment::Output_segment): Likewise.
10252 (Output_segment::add_output_section): Add assertion that large
10253 data sections always go in large data segments. Force small data
10254 sections to the end of the list of data sections. Force small BSS
10255 sections to the start of the list of BSS sections. For large BSS
10256 sections to the end of the list of BSS sections.
10257 * symtab.h (class Symbol): Declare is_common_shndx.
10258 (Symbol::is_defined): Check Symbol::is_common_shndx.
10259 (Symbol::is_common): Likewise.
10260 (class Symbol_table): Define enum Commons_section_type. Update
10261 declarations. Add small_commons_ and large_commons_ fields.
10262 * symtab.cc (Symbol::is_common_shndx): New function.
10263 (Symbol_table::Symbol_table): Initialize new fields.
10264 (Symbol_table::add_from_object): Put small and large common
10265 symbols in the right list.
10266 (Symbol_table::sized_finalized_symbol): Check
10267 Symbol::is_common_shndx.
10268 (Symbol_table::sized_write_globals): Likewise.
10269 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10270 common symbol lists. Don't call do_allocate_commons_list if the
10271 list is empty.
10272 (Symbol_table::do_allocate_commons_list): Remove is_tls
10273 parameter. Add comons_section_type parameter. Change all
10274 callers. Handle small and large common symbols.
10275 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10276 Symbol::is_common_shndx.
10277 * resolve.cc (symbol_to_bits): Likewise.
10278 * target.h (Target::small_common_shndx): New function.
10279 (Target::small_common_section_flags): New function.
10280 (Target::large_common_shndx): New function.
10281 (Target::large_common_section_flags): New function.
10282 (Target::new_output_section): New function.
10283 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10284 small_common_section_flags, and large_common_section_flags
10285 fields.
10286 (Target::do_new_output_section): New virtual function.
10287 * arm.cc (Target_arm::arm_info): Initialize new fields.
10288 * i386.cc (Target_i386::i386_info): Likewise.
10289 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10290 Likewise.
10291 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10292 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10293 (Target_x86_64::do_new_output_section): New function.
10294 * configure.ac: Define conditional MCMODEL_MEDIUM.
10295 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10296 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10297 (large_LDFLAGS): Define.
10298 * testsuite/large.c: New file.
10299 * testsuite/testfile.cc (Target_test::test_target_info):
10300 Initialize new fields.
10301 * configure, testsuite/Makefile.in: Rebuild.
10302
bb04269c
DK
103032009-06-05 Doug Kwan <dougkwan@google.com>
10304
10305 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10306 * Makefile.in: Regenerate.
bb04269c
DK
10307 * i386.cc (class Target_i386): Define new virtual method to
10308 override do_is_local_label_name in parent.
10309 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10310 local symbols if --discard-locals or -X is given.
10311 * options.h (class General_options): Declare new options
10312 '--discard-locals' and '-X' for discarding locals.
10313 * target.h (class Target): Define new methods is_local_label_name.
10314 Declare new virtual method do_is_local_label_name.
10315 * target.cc: New file.
10316 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10317 (check_SCRIPTS): Add discard_locals_test.sh.
10318 (check_DATA): Add discard_local_tests.syms.
10319 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10320 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10321 * testsuite/Makefile.in: Regenerate.
10322 * testsuite/discard_locals_test.c: New file.
10323 * testsuite/discard_locals_test.sh: Same.
10324
805bb01c
DK
103252009-06-05 Doug Kwan <dougkwan@google.com>
10326
10327 * object.cc (Sized_relobj::Sized_relobj): Initialize
10328 discarded_eh_frame_shndx_ to -1U.
10329 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10330 section.
10331 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10332 a discarded .eh_frame section.
10333 (Sized_relobj::do_finalize_local_symbols): Ditto.
10334 * object.h (class Sized_relobj): Declare new member
10335 discarded_eh_frame_shndx_.
10336 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10337 (local_labels_test.o, local_labels_test): New rules.
10338 * testsuite/Makefile.in: Regenerate.
10339
1dcd334d
DK
103402009-06-04 Doug Kwan <dougkwan@google.com>
10341
10342 * layout.cc (Layout::section_name_mapping): Add mapping for
10343 special ARM sections.
10344
96d49306
DK
103452009-06-03 Doug Kwan <dougkwan@google.com>
10346
10347 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10348 (utils::has_overflow): Same.
10349
dff16297
ILT
103502009-06-03 Ian Lance Taylor <iant@google.com>
10351
10352 * layout.cc (Layout::section_name_mapping): New array, replacing
10353 Layout::linkonce_mapping.
10354 (Layout::section_name_mapping_count): New variable, replacing
10355 Layout::linkonce_mapping_count.
10356 (Layout::linkonce_output_name): Remove.
10357 (Layout::output_section_name): Rewrite.
10358 * layout.h (class Layout): Rename Linkonce_mapping to
10359 Section_name_mapping, linkonce_mapping to section_name_mapping,
10360 linkonce_mapping_count to section_name_mapping_count. Don't
10361 declare linkonce_output_name.
10362
c121c671
DK
103632009-06-03 Doug Kwan <dougkwan@google.com>
10364
10365 * gold/arm.cc (namespace utils): New.
10366 (Target_arm::reloc_is_non_pic): Define new method.
10367 (class Arm_relocate_functions): New.
10368 (Target_arm::Relocate::relocate): Handle relocation types used by
10369 Android.
10370
07800fab
ILT
103712009-06-03 Ian Lance Taylor <iant@google.com>
10372
10373 * arm.cc (Target_arm::scan::global): Use || instead of |.
10374
c121c671
DK
103752009-06-02 Doug Kwan <dougkwan@google.com>
10376
10377 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10378 issued_non_pic_error_.
10379 (class Target_arm::Scan): Declare new method check_non_pic.
10380 Define new method symbol_needs_plt_entry.
10381 Declare new data member issued_non_pic_error_.
10382 (class Target_arm::Relocate): Declare new method
10383 should_apply_static_reloc.
10384 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10385 (Target_arm::Scan::check_non_pic): Define new method.
10386 (Target_arm::Scan::local): Handle a small subset of reloc types used
10387 by Android.
10388 (Target_arm::Scan::local): Same.
10389 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10390
b19b0c6d
ILT
103912009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10392
10393 * incremental.cc (Incremental_inputs::report_command_line): Filter
10394 out --incremental-* options.
10395
94cdfcff
DK
103962009-05-29 Doug Kwan <dougkwan@google.com>
10397
10398 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10399 template class.
10400 (class Target_arm): Update comment.
10401 (Target_arm::Target_arm): Initialize new data members GOT_,
10402 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10403 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10404 and Target_arm::rel_dyn_section.
10405 Declare new_enum Target_arm::Got_type.
10406 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10407 and DYNBSS_.
10408 Update commments for member do_dynsym_value.
10409 (Target_arm::got_size, Target_arm::plt_section,
10410 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10411 new methods inside class defintion.
10412 (Target_arm::got_section): Define new method.
10413 (Target_arm::rel_dyn_section): Same.
10414 (Output_data_plt_arm): New template class.
10415 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10416 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10417 (Output_data_plt_arm::add_entry): Same.
10418 (Output_data_plt_arm::first_plt_entry): Define new
10419 static data member for PLT instruction template.
10420 (Output_data_plt_arm::plt_entry): Same.
10421 (Output_data_plt_arm::do_write): Define new method.
10422 (Target_arm::make_plt_entry): Same.
10423 (Target_arm::do_finalize_sections): Same.
10424 (Target_arm::do_dynsym_value): Same.
10425
4a657b0d
DK
104262009-05-28 Doug Kwan <dougkwan@google.com>
10427
10428 * Makefile.am (TARGETSOURCES): Add arm.cc.
10429 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10430 * Makefile.in: Regenerate.
10431 * arm.cc: New file.
10432 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10433
e7ae8c36
DK
104342009-05-26 Doug Kwan <dougkwan@google.com>
10435
10436 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10437 (General_options::check_excluded_libs): Strip off directories in
10438 archive name before matching like GNU ld does.
10439 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10440 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10441 (exclude_libs_test_LDFLAGS): Add linker option
10442 -Wl,--exclude-libs,libexclude_libs_test_3
10443 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10444 an explicit archive without using -l.
10445 (alt/libexclude_libs_test_3.a): New make rule.
10446 * testsuite/Makefile.in: Regenerate.
10447 * testsuite/exclude_libs_test.c : Declare lib3_default().
10448 (main): Call it.
10449 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10450 * exclude_libs_test_3.c: New file.
10451
f12e7348
NC
104522009-05-26 Nick Clifton <nickc@redhat.com>
10453
10454 * po/id.po: New Indonesian translation.
10455 * po/gold.pot: Updated template file.
10456
4daadc0d
ST
104572009-05-22 Sriraman Tallam <tmsriram@google.com>
10458
e1df38aa 10459 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10460 gc_comdat_test files. Add -Wl,--gc-sections to build
10461 gc_comdat_test.
10462 * testsuite/Makefile.in: Regenerate.
10463 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10464
531813ad
ST
104652009-05-21 Sriraman Tallam <tmsriram@google.com>
10466
10467 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10468 kept comdat section was garbage collected.
10469 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10470 * testsuite/Makefile.in: Regenerate.
10471 * testsuite/gc_comdat_test.sh: New file.
10472 * testsuite/gc_comdat_test_1.cc: New file.
10473 * testsuite/gc_comdat_test_2.cc: New file.
10474
65514900
CC
104752009-05-19 Doug Kwan <dougkwan@google.com>
10476
10477 * archive.cc (Archive::Archive): Move constructor from archive.h
10478 to here. Initialize no_export_.
10479 (Archive::get_elf_object_for_member): Set no_export flag of object.
10480 * archive.h (Archive::Archive): Move constructor body to
10481 archive.cc.
10482 (Archive::no_export): New method.
10483 (Archive::no_export_): New field.
10484 * object.h (Object::Object): Initialize no_export_ to false.
10485 (Object::no_export, Object::set_no_export): New methods.
10486 (Object::no_export_): New field.
10487 * options.cc (General_options::parse_exclude_libs): New method.
10488 (General_options::check_excluded_libs) Same.
10489 * options.h (exclude_libs): New option.
10490 (General_options::check_excluded_libs): New method declaration.
10491 (General_options::excluded_libs_): New field.
10492 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10493 default or protected visibility if an object has no-export flag set.
10494 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10495 (check_SCRIPTS): Add exclude_libs_test.sh.
10496 (check_DATA): Add exclude_libs_test.syms.
10497 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10498 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10499 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10500 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10501 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10502 libexclude_libs_test_2.a): New rules.
10503 * testsuite/Makefile.in: Regenerate.
10504 * testsuite/exclude_libs_test.c: New file.
10505 * testsuite/exclude_libs_test.sh: Ditto.
10506 * testsuite/exclude_libs_test_1.c: Ditto.
10507 * testsuite/exclude_libs_test_2.c: Ditto.
10508
1b77ea50
ILT
105092009-05-15 Ian Lance Taylor <iant@google.com>
10510
10511 * configure.ac: Check for declarations for cases where libiberty.h
10512 checks HAVE_DECL_xxx.
10513 * configure, config.in: Rebuild.
10514
072fe7ce
ILT
105152009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10516
10517 * gold.h (Incremental_argument_list): Remove (invalid) forward
10518 declaration.
10519 * incremental.cc (Incremental_inputs::report_achive): New method.
10520 (Incremental_inputs::report_object): New method.
10521 (Incremental_inputs::report_script): New method.
10522 (Incremental_inputs::finalize_inputs): New method.
10523 (Incremental_inputs::finalize): Call finalize_inputs().
10524 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10525 Create inputs entries.
10526 * incremental.h (Incremental_input_type): New enum.
10527 (Incremental_inputs::Incremental_input): Initialize new fields.
10528 (Incremental_inputs::report_inputs): New method.
10529 (Incremental_inputs::report_achive): New method.
10530 (Incremental_inputs::report_object): New method.
10531 (Incremental_inputs::report_script): New method.
10532 (Incremental_inputs::finalize_inputs): New method.
10533 (Incremental_inputs::Input_info): New struct.
10534 (Incremental_inputs::Input_info_map): New typedef.
10535 (Incremental_inputs::lock_): New field.
10536 (Incremental_inputs::Inputs_): New field.
10537 (Incremental_inputs::Inputs_map): New field.
10538 * main.cc (main): Call Incremental_input::report_inputs.
10539 * options.h (Input_argument_list): Typedef moved from
10540 Input_arguments.
10541 (Input_file_group::Files): Remove, use ::Input_argument_list.
10542 (Input_file_group::Input_argument_list): Remove, use
10543 ::Input_argument_list.
10544 * plugin.cc (Plugin_manager::add_input_file): Add error in
10545 incremental build.
10546 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10547 functions.
10548 * script.cc (read_input_script): Call
10549 Incremental_input::report_script.
10550 * script.h (Script_info): New class.
10551
b0481b0b
ILT
105522009-04-27 Ian Lance Taylor <iant@google.com>
10553
10554 * x86_64.cc (do_adjust_output_section): Set entsize to
10555 plt_entry_size.
10556
b22a5a41 105572009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10558
10559 * output.cc (Output_file::close): After short writes, continue
10560 writing from the correct offset in the buffer being written.
10561
40fde488
CD
105622009-04-23 Chris Demetriou <cgd@google.com>
10563
10564 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10565 * configure: Regenerate.
10566 * config.in: Regenerate.
10567 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10568 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10569
3ce2c28e
ILT
105702009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10571
10572 * incremental.cc (Incremental_inputs_header_data): Renamed from
10573 Incremental_input_header_data.
10574 (Incremental_inputs_header_data::data_size): New field.
10575 (Incremental_inputs_header_data::put_input_file_count): Renamed
10576 from input_file_count.
10577 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10578 from command_line_offset.
10579 (Incremental_inputs_header_data::put_reserved): Renamed from
10580 put_reserved.
10581 (Incremental_inputs_entry_data): Renamed from
10582 Incremental_input_entry_data.
10583 (Incremental_inputs_entry_data::data_size): New field.
10584 (Incremental_inputs::report_command_line): New method.
10585 (Incremental_inputs::finalize): New method.
10586 (Incremental_inputs::create_incremental_inputs_data): New method.
10587 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10588 * incremental.h: New file.
10589 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 10590 (Layout::finalize): Create incremental inputs section in
3ce2c28e 10591 incremental builds.
703d02da 10592 (Layout::create_incremental_info_sections): New method.
3ce2c28e 10593 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
10594 (Layout::create_incremental_info_sections): New method.
10595 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
10596 * main.cc (main): Notify Incremental_input of the command line.
10597
e55bde5e
ILT
105982009-04-01 Ian Lance Taylor <iant@google.com>
10599 Mikolaj Zalewski <mikolajz@google.com>
10600
10601 * gold.h (reserve_unordered_map): Define, three versions, one for
10602 each version of Unordered_map.
10603 * layout.cc (Layout::Layout): Remove options parameter. Add
10604 number_of_input_files parameter. Don't initialize options_.
10605 Initialize number_of_input_files_ and resized_signatures_. Move
10606 sections_are_attached_.
10607 (Layout::layout_group): Reserve space for group_signatures_.
10608 (Layout::find_or_add_kept_section): Change name parameter to be a
10609 reference. Resize signatures_ map when it gets large enough.
10610 (Layout::layout_eh_frame): Use parameters->options() instead of
10611 this->options_.
10612 (Layout::make_output_section): Likewise.
10613 (Layout::attach_allocated_section_to_segment): Likewise.
10614 (Layout::finalize, Layout::create_executable_stack): Likewise.
10615 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10616 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10617 * layout.h (class Layout): Update declarations. Remove options_
10618 field. Add number_of_input_files_ and resized_signatures_
10619 fields. Move sections_are_attached_ field.
10620 * main.cc (main): Pass number of input files to Layout
10621 constructor. Don't pass options.
10622
154b857c
ILT
106232009-03-30 Ian Lance Taylor <iant@google.com>
10624
10625 * ffsll.c (ffsll): Correct implementation.
10626
2f35ab9b
ILT
106272009-03-27 Ian Lance Taylor <iant@google.com>
10628
fd03461a
ILT
10629 * ffsll.c: New file.
10630 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10631 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10632 * ftruncate.c (ftruncate): Declare before definition.
10633 * mremap.c (mremap): Likewise.
10634 * pread.c (pread): Likewise.
10635 * configure, Makefile.in, config.in: Rebuild.
10636
2f35ab9b
ILT
10637 * mremap.c: New file.
10638 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10639 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10640 (mremap): Declare if HAVE_MREMAP is not defined.
10641 * configure, Makefile.in, config.in: Rebuild.
10642
33aea2fd
CC
106432009-03-27 Cary Coutant <ccoutant@google.com>
10644
10645 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10646 position independent.
10647 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10648 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10649
6d479619
CC
106502009-03-24 Cary Coutant <ccoutant@google.com>
10651
10652 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10653 an executable.
10654 (needs_dynamic_reloc): Likewise.
10655
afc06bb8
ILT
106562009-03-24 Ian Lance Taylor <iant@google.com>
10657
10658 * yyscript.y (file_cmd): Recognize EXTERN.
10659 (extern_name_list, extern_name_list_body): New nonterminals.
10660 * script.cc (script_add_extern): Define.
10661 * script-c.h (script_add_extern): Declare.
10662
f6060a4d
ILT
106632009-03-24 Rafael Avila de Espindola <espindola@google.com>
10664
10665 * object.cc (is_elf_object): Define.
10666 * object.h (is_elf_object): Declare.
10667 * archive.cc (Archive::get_elf_object_for_member): Call
10668 is_elf_object.
33aea2fd 10669 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10670
26736d8e
ILT
106712009-03-24 Elliott Hughes <enh@google.com>
10672
10673 * output.cc (Output_file::map_anonymous): Define.
10674 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10675 try an anonymous one. Report the size if the mmap fails.
10676 * output.h (class Output_file): Declare map_anonymous.
10677
22fd9730
ILT
106782009-03-24 Ian Lance Taylor <iant@google.com>
10679
10680 * target-select.cc (instantiate_target): Don't acquire the lock if
10681 the instantiated_target_ field has already been set.
10682
cb010894
ILT
106832009-03-23 Ian Lance Taylor <iant@google.com>
10684
7f055c20
ILT
10685 * gold-threads.h (class Initialize_lock): Define.
10686 * gold-threads.cc (class Initialize_lock_once): Define.
10687 (initialize_lock_control): New static variable.
10688 (initialize_lock_pointer): New static variable.
10689 (initialize_lock_once): New static function.
10690 (Initialize_lock::Initialize_lock): Define.
10691 (Initialize_lock::initialize): Define.
10692 * target-select.h: Include "gold-threads.h".
10693 (class Target_selector): Add lock_ and initialize_lock_ fields.
10694 Don't define instantiate_target, just declare it.
10695 * target-select.cc (Target_selector::Target_selector): Initialize
10696 new fields.
10697 (Target_selector::instantiate_target): Define.
10698 * descriptors.h: Include "gold-threads.h".
10699 (class Descriptors): Add initialize_lock_ field.
10700 * descriptors.cc (Descriptors::Descriptors): Initialize new
10701 field.
10702 (Descriptors::open): Use initialize_lock_ field
10703 * errors.h (class Errors): Add initialize_lock_ field.
10704 * errors.cc (Errors::Errors): Initialize new field.
10705 (Errors::initialize_lock): Use initialize_lock_ field.
10706 * powerpc.cc (class Target_selector_powerpc): Remove
10707 instantiated_target_ field. In do_recognize call
10708 instantiate_target rather than do_instantiate_target. In
10709 do_instantiate_target just allocate a new target.
10710 * sparc.cc (class Target_selector_sparc): Likewise.
10711
36959681
ILT
10712 * freebsd.h: New file.
10713 * i386.cc: Include "freebsd.h".
10714 (Target_i386): Derive from Target_freebsd rather than
10715 Sized_target.
10716 (Target_selector_i386): Derive from Target_selector_freebsd rather
10717 than Target_selector.
10718 * x86_64.cc: Include "freebsd.h".
10719 (Target_x86_64): Derive from Target_freebsd rather than
10720 Sized_target.
10721 (Target_selector_x86_64): Derive from Target_selector_freebsd
10722 rather than Target_selector.
10723 * target.h (class Target): Add adjust_elf_header and
10724 do_adjust_elf_header.
10725 * output.cc (Output_file_header:: do_sized_write): Call target
10726 adjust_elf_header routine.
10727 * configure.tgt: Set targ_osabi.
10728 * configure.ac: Define GOLD_DEFAULT_OSABI.
10729 * parameters.cc (Parameters::default_target): Pass
10730 GOLD_DEFAULT_OSABI to select_target.
10731 * target-select.h (class Target_selector): Make instantiate_target
10732 protected rather than private.
10733 * Makefile.am (HFILES): Add freebsd.h.
10734 * configure, Makefile.in, config.in: Rebuild.
10735
cb010894
ILT
10736 * merge.cc (do_add_input_section): Correct pend value. Change
10737 message about last entry not being null terminated from error to
10738 warning.
10739
0e879927
ILT
107402009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10741
10742 * incremental.cc: New file.
10743 * Makefile.am (CCFILES): Add incremental.cc.
10744 * Makefile.in: Rebuild.
10745
41105937
PP
107462009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10747
10748 * layout.cc (Layout::output_section_name): Preserve names
10749 of '.note.' sections.
e1df38aa 10750
60439920
ILT
107512009-03-19 Ian Lance Taylor <iant@google.com>
10752
10753 * descriptors.cc (Descriptors::open): Check that the options are
10754 valid before using them.
10755
0d371ad3
ILT
107562009-03-18 Ian Lance Taylor <iant@google.com>
10757
10758 * script-sections.h: Include <list>.
10759 (class Script_sections): Change Sections_elements from std::vector
10760 to std::list. Typedef public Elements_iterator. Add
10761 orphan_section_placement_, data_segment_align_start_, and
10762 saw_data_segment_align_ fields. Remove data_segment_align_index_
10763 field.
10764 * script-sections.cc (class Orphan_section_placement): New class.
10765 (class Sections_element): Add virtual functions is_relro and
10766 orphan_section_init. Remove virtual function place_orphan_here.
10767 (class Output_section_definition): Add is_relro and
10768 orphan_section_init. Remove place_orphan_here.
10769 (class Orphan_output_section): Likewise.
10770 (Script_sections::Script_sections): Update for field changes.
10771 (Script_sections::data_segment_align): Set saw_data_segment_align_
10772 and data_segment_align_start_, not data_segment_align_index.
10773 (Script_sections::data_segment_relro_end): Check
10774 saw_data_segment_align_. Use data_segment_align_start_ rather
10775 than data_segment_align_index_.
10776 (Script_sections::place_orphan): Rewrite to use
10777 Orphan_section_placement.
10778
9201d894
ILT
107792009-03-17 Ian Lance Taylor <iant@google.com>
10780
9c5b8369
ILT
10781 * archive.cc (Archive::add_symbols): Check for a version attached
10782 to the symbol name in the archive map.
10783 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10784 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10785 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10786 (ver_test_11.a): New target.
10787 * testsuite/Makefile.in: Rebuild.
10788
9201d894
ILT
10789 * configure.ac: Check for chsize and posix_fallocate. Replace
10790 ftruncate.
10791 * ftruncate.c: New file, from gnulib.
10792 * output.cc (posix_fallocate): Define dummy version if not
10793 HAVE_POSIX_FALLOCATE.
10794 (Output_file::map): Call posix_fallocate rather than lseek and
10795 write.
10796 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10797 * configure, Makefile.in, config.in: Rebuild.
10798
ef4ab7a8 107992009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10800
ef4ab7a8
PP
10801 * layout.h (Layout::create_note): Add section_name parameter.
10802 * layout.cc (Layout::create_note): Likewise.
10803 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10804
8c500701
ILT
108052009-03-17 Ian Lance Taylor <iant@google.com>
10806
e85b18e1
ILT
10807 * descriptors.cc: Include "options.h".
10808 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10809 (Descriptors::open): Always use O_CLOEXEC when opening a new
10810 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10811 then set FD_CLOEXEC.
10812
9efe6174
ILT
10813 * sparc.cc (class Target_sparc): Add has_got_section.
10814 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10815 make sure we have a GOT section.
10816
10817 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10818 (Target_sparc::Scan::local): Likewise.
10819 (Target_sparc::Scan::global): Likewise.
10820 (Target_sparc::Relocate::relocate): Likewise.
10821 (Target_sparc::Relocate::relocate_tls): Likewise.
10822
8c500701
ILT
10823 * symtab.cc (Symbol_table::define_default_version): New function,
10824 broken out of add_from_object.
10825 (Symbol_table::add_from_object): Call define_default_version.
10826 (Symbol_table::define_special_symbol): Add resolve_oldsym
10827 parameter. Change all callers. If the version for a symbol comes
10828 from a version script, resolve it with the symbol with the same
10829 name with no version. Also add the symbol without a version if
10830 appropriate.
10831 (do_define_in_output_data): If resolving with oldsym, don't delete
10832 sym.
10833 (do_define_in_output_segment): Likewise.
10834 (do_define_as_constant): Likewise.
10835 * symtab.h (class Symbol_table): Update declarations.
10836
f1ed28fb
ILT
108372009-03-13 Ian Lance Taylor <iant@google.com>
10838
15f8229b
ILT
10839 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10840 (Read_symbols::requeue): New function.
10841 (Read_symbols::do_read_symbols): If make_elf_object fails because
10842 the target type is not configured, and the file was searched for,
10843 issue a warning and retry with the next directory.
10844 (Add_symbols::run): If the file has an incompatible format, and
10845 it was searched for, requeue the Read_symbols task. On error,
10846 release the object.
10847 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10848 dirindex parameter to constructor. Change all callers. Declare
10849 incompatible_warning and requeue.
10850 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10851 input_argument_ and input_group_ fields. Add them to
10852 constructor. Change all callers.
10853 (class Read_script): Add dirindex_ field. Add it to constructor.
10854 Change all callers.
10855 * archive.cc (Archive::setup): Remove input_objects parameter.
10856 Change all callers.
10857 (Archive::get_file_and_offset): Likewise.
10858 (Archive::read_all_symbols): Likewise.
10859 (Archive::read_symbols): Likewise.
10860 (Archive::get_elf_object_for_member): Remove input_objects
10861 parameter. Add punconfigured parameter. Change all callers.
10862 (Archive::add_symbols): Change return type to bool. Check return
10863 value of include_member.
10864 (Archive::include_all_members): Likewise.
10865 (Archive::include_member): Change return type to bool. Return
10866 false if first included object has incompatible target. Set
10867 included_member_ field.
10868 (Add_archive_symbols::run): If add_symbols returns false, requeue
10869 Read_symbols task.
10870 * archive.h (class Archive): Add included_member_ field.
10871 Initialize it in constructor. Add input_file and searched_for
10872 methods. Update declarations.
10873 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10874 input_argument_ fields. Add them to constructor. Change all
10875 callers.
10876 * script.cc: Include "target-select.h".
10877 (class Parser_closure): Add skip_on_incompatible_target_ and
10878 found_incompatible_target_ fields. Add
10879 skip_on_incompatible_target parameter to constructor. Change all
10880 callers. Add methods skip_on_incompatible_target,
10881 clear_skip_on_incompatible_target, found_incompatible_target, and
10882 set_found_incompatible_target.
10883 (read_input_script): Add dirindex parameter. Change all callers.
10884 If parser finds an incompatible target, requeue Read_symbols
10885 task.
10886 (script_set_symbol): Clear skip_on_incompatible_target in
10887 closure.
10888 (script_add_assertion, script_parse_option): Likewise.
10889 (script_start_sections, script_add_phdr): Likewise.
10890 (script_check_output_format): New function.
10891 * script.h (read_input_script): Update declaration.
10892 * script-c.h (script_check_output_format): Declare.
10893 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10894 (ignore_cmd): Remove OUTPUT_FORMAT.
10895 * fileread.cc (Input_file::Input_file): Add explicit this.
10896 (Input_file::will_search_for): New function.
10897 (Input_file::open): Add pindex parameter. Change all callers.
10898 * fileread.h (class Input_file): Add input_file_argument method.
10899 Declare will_search_for. Update declarations.
10900 * object.cc (make_elf_object): Add punconfigured parameter.
10901 Change all callers.
10902 * object.h (class Object): Make input_file public. Add
10903 searched_for method.
10904 (make_elf_object): Update declaration.
10905 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10906 restart search.
10907 * dirsearch.h (class Dirsearch): Update declaration.
10908 * options.h (class General_options): Add --warn-search-mismatch.
10909 * parameters.cc (Parameters::is_compatible_target): New function.
10910 * parameters.h (class Parameters): Declare is_compatible_target.
10911 * workqueue.cc (Workqueue::add_blocker): New function.
10912 * workqueue.h (class Workqueue): Declare add_blocker.
10913
f1ed28fb
ILT
10914 * fileread.cc (Input_file::open): Remove options parameter.
10915 Change all callers.
10916 (Input_file::open_binary): Likewise.
10917 * script.cc (read_input_script): Likewise.
10918 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10919 options parameter from constructor. Change all callers.
10920 (class Read_script): Likewise.
10921 * fileread.h (class Input_file): Update declarations.
10922 * script.h (read_input_script): Update declaration.
10923
34dd024a
NC
109242009-03-10 Nick Clifton <nickc@redhat.com>
10925
10926 * po/es.po: New Spanish translation.
10927
6d71b17c
CC
109282009-03-06 Cary Coutant <ccoutant@google.com>
10929
10930 * options.cc (parse_short_option): Keep dash_z from registering itself.
10931
031cdbed
ILT
109322009-03-03 Ian Lance Taylor <iant@google.com>
10933
10934 PR 9918
10935 * target-reloc.h (relocate_section): Pass output_section to
10936 relocate.
10937 * i386.cc (Target_i386::should_apply_static_reloc): Add
10938 output_section parameter. Change all callers.
10939 (Target_i386::Relocate::relocate): Add output_section parameter.
10940 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10941 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10942 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10943 * testsuite/two_file_shared.sh: New script.
10944 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10945 (check_DATA): Add two_file_shared.dbg.
10946 (two_file_shared.dbg): New target.
10947 * testsuite/Makefile.in: Rebuild.
10948
15d5fa16
ILT
109492009-03-01 Ian Lance Taylor <iant@google.com>
10950
10951 * configure.ac: Check for byteswap.h.
10952 * configure: Rebuild.
10953 * config.in: Rebuild.
10954
8a4c0b0d
ILT
109552009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10956
10957 * layout.cc (Layout::find_or_add_kept_section): New function.
10958 (Layout::add_comdat): Removed.
10959 * layout.h (struct Kept_section): Move out of class Layout.
10960 Remove trailing underscores from field names. Add group_sections
10961 field. Rename group_ field to is_group. Change all uses.
10962 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10963 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10964 comdat_groups_ field.
10965 (Sized_relobj::include_section_group): Use
10966 find_or_add_kept_section and Kept_section::group_sections.
10967 (Sized_relobj::include_linkonce_section): Likewise.
10968 * object.cc (class Sized_relobj): Don't define Comdat_group or
10969 Comdat_group_table. Remove find_comdat_group and
10970 add_comdat_group. Remove comdat_groups_ field.
10971 * plugin.cc (include_comdat_group): Use
10972 Layout::find_or_add_kept_section.
10973
b4ecf66b
ILT
109742009-02-28 Ian Lance Taylor <iant@google.com>
10975
14359ca0
ILT
10976 * README: --gc-sections and map files are now supported. Document
10977 some build requirements.
10978
b4ecf66b
ILT
10979 PR 6992
10980 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10981 relocatable link set the value of the section symbol to zero.
10982 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10983 relocatable link don't include the section address in the local
10984 symbol value.
10985
0602e05a
ILT
109862009-02-27 Ian Lance Taylor <iant@google.com>
10987
fd9d194f
ILT
10988 PR 6811
10989 * options.h (class Search_directory): Add is_system_directory.
10990 (class General_options): Declare is_in_system_directory.
10991 * options.cc (get_relative_sysroot): Make static.
10992 (get_default_sysroot): Make static.
10993 (General_optoins::is_in_system_directory): New function.
10994 * fileread.cc (Input_file::is_in_system_directory): New function.
10995 * fileread.h (class Input_file): Declare is_in_system_directory.
10996 * object.h (class Object): Add is_in_system_directory.
10997 (class Input_objects): Remove system_library_directory_ field.
10998 * object.cc (Input_objects::add_object): Don't set
10999 system_library_directory_.
11000 (input_objects::found_in_system_library_directory): Remove.
11001 * symtab.cc (Symbol_table::write_globals): Remove input_objects
11002 parameter. Change all callers.
11003 (Symbol_table::sized_write_globals): Likewise.
11004 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
11005 Call Object::is_in_system_directory.
11006 * symtab.h (class Symbol_table): Update declarations.
11007
61edd21f
ILT
11008 PR 5990
11009 * descriptors.h (Open_descriptor): Add is_on_stack field.
11010 * descriptors.cc (Descriptors::open): If the descriptor is on the
11011 top of the stack, remove it. Initialize is_on_stack field.
11012 (Descriptors::release): Only add pod to stack if it is not on the
11013 stack already.
11014 (Descriptors::close_some_descriptor): Clear stack_next and
11015 is_on_stack fields.
11016
e29e076a
ILT
11017 PR 7091
11018 * output.cc (Output_section::find_starting_output_address): Rename
11019 from starting_output_address; add PADDR parameter; change return
11020 type.
11021 * output.h (class Output_section): Declare
11022 find_starting_output_address instead of starting_output_address.
11023 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
11024 section symbol for which we can't find a merge section.
11025
0602e05a
ILT
11026 PR 9836
11027 * symtab.cc (Symbol_table::add_from_object): If the visibility is
11028 hidden or internal, force the symbol to be local.
11029 * resolve.cc (Symbol::override_visibility): Define.
11030 (Symbol::override_base): Use override_visibility.
11031 (Symbol_table::resolve): Likewise.
11032 (Symbol::override_base_with_special): Likewise.
11033 (Symbol_table::override_with_special): If the visibility is hidden
11034 or internal, force the symbol to be local.
11035 * symtab.h (class Symbol): Add set_visibility and
11036 override_visibility.
11037 * testsuite/ver_test_1.sh: New file.
11038 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
11039 (check_DATA): Add ver_test_1.syms.
11040 (ver_test_1.syms): New target.
11041 * testsuite/Makefile.in: Rebuild.
11042
401a9a73
CC
110432009-02-25 Cary Coutant <ccoutant@google.com>
11044
11045 * layout.cc (Layout::choose_output_section): Don't rename sections
11046 when using a linker script that has a SECTIONS clause.
11047 * Makefile.in: Regenerate.
11048
11049 * testsuite/Makefile.am (script_test_5.sh): New test case.
11050 * testsuite/Makefile.in: Regenerate.
11051 * testsuite/script_test_5.cc: New file.
11052 * testsuite/script_test_5.sh: New file.
11053 * testsuite/script_test_5.t: New file.
11054
f488e4b0
CC
110552009-02-13 Rafael Avila de Espindola <espindola@google.com>
11056
11057 * archive.cc (Archive::include_member): Update calls to add_symbols.
11058 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
11059 the Layout argument.
11060 * dynobj.h (do_add_symbols): Add the Layout argument.
11061 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
11062 Layout argument.
11063 * object.h (Object::add_symbols): Add the Layout argument.
11064 (Object::do_add_symbols): Add the Layout argument.
11065 (Sized_relobj::do_add_symbols): Add the Layout argument.
11066 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
11067 Unify the two versions.
11068 (Add_plugin_symbols): Remove.
11069 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
11070 (Sized_pluginobj::do_add_symbols): Unify the two versions.
11071 (Add_plugin_symbols): Remove.
11072 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
11073 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
11074 (Add_symbols::run): Make it work with Pulginobj.
11075
89dd1680
ILT
110762009-02-06 Ian Lance Taylor <iant@google.com>
11077
11078 * object.cc (Sized_relobj::do_layout): Make info message start
11079 with lower case letter.
11080
266d0a74
ILT
110812009-02-06 Mikolaj Zalewski <mikolajz@google.com>
11082
602b464e
ILT
11083 * binary.cc: Fix file comment.
11084
266d0a74
ILT
11085 * options.h (enum Incremental_disposition): Define.
11086 (class General_options): Add new options: --incremental,
11087 --incremental_changed, --incremental_unchanged,
11088 --incremental_unknown. Add incremental_disposition_ and
11089 implicit_incremental_ fields.
11090 (General_options::incremental_disposition): New function.
11091 (class Position_dependent_options): Add incremental_disposition
11092 option.
11093 (Position_dependent_options::copy_from_options): Set incremental
11094 dispositions.
11095 * options.cc (General_options::parse_incremental_changed): New
11096 function.
2e702c99
RM
11097 (General_options::parse_incremental_unchanged): New function.
11098 (General_options::parse_incremental_unknown): New function.
11099 (General_options::General_options): Initialize new fields
266d0a74 11100 incremental_disposition_ and implicit_incremental_.
2e702c99 11101 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11102 without --incremental.
11103
f073bbf7
CD
111042009-02-06 Chris Demetriou <cgd@google.com>
11105
11106 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11107 pointer and to report location as the file name associated with
11108 the symbol.
11109 (gold_undefined_symbol_at_location): New function to replace the
11110 old gold_undefined_symbol functionality.
11111 * target-reloc.h (relocate_section): Update to use
11112 gold_undefined_symbol_at_location.
11113 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11114 Call gold_undefined_symbol function rather than gold_error.
11115 * errors.h (Errors::undefined_symbol): Take location as a
11116 string, rather than calculating it from a relocation.
11117 * errors.cc (Errors::fatal): Print "fatal error:" before the
11118 formatted message.
11119 (Errors::error, Errors::error_at_location): Print "error: "
11120 before the formatted message.
11121 (Errors::undefined_symbol): Take location as a string, rather
11122 than calculating it from a relocation.
11123 (gold_undefined_symbol_at_location): New function akin to
11124 old gold_undefined_symbol, calculates location from relocation.
11125 (gold_undefined_symbol): Change to take only a Symbol pointer
11126 and to report location as the file name associated with the symbol.
11127 * testsuite/debug_msg.sh: Update for changed error messages.
11128 * testsuite/undef_symbol.sh: Likewise.
11129
8e94a90c
ILT
111302009-02-04 Duncan Sands <baldrick@free.fr>
11131
11132 PR 9812
11133 * reduced_debug_output.h
11134 (Output_reduced_debug_abbrev_section::failed): Use format for
11135 gold_warning.
11136 (Output_reduced_debug_info_section::faild): Likewise.
11137
88a0e15b
ILT
111382009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11139
11140 * script.cc (Lazy_demangler): New class.
2e702c99 11141 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11142 symbol only once.
11143
5efc7cd2
CC
111442009-01-29 Cary Coutant <ccoutant@google.com>
11145
11146 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11147 to __tls_get_addr.
11148 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11149
e0ebcf42
ILT
111502009-01-28 Ian Lance Taylor <iant@google.com>
11151
5efc7cd2 11152 * version.cc (version_string): Bump to 1.9.
75fe7426 11153
e0ebcf42
ILT
11154 * gold.h: Include <cstring> and <stdint.h>.
11155 * version.cc: Include <cstdio>.
11156 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11157 warning.
11158 * reduced_debug_output.cc (insert_into_vector): Rename from
11159 Insert_into_vector; change all callers. Use Swap_unaligned to
11160 avoid aliasing issue; remove union since it is unnecessary.
11161
8e2813be 111622009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11163
11164 * Makefile.am (CCFILES): Add gc.cc.
11165 (HFILES): Add gc.h.
11166 * Makefile.in: Regenerate.
11167 * gold.cc (Gc_runner): New class.
11168 (queue_initial_tasks): Call garbage collection related tasks
11169 when corresponding options are invoked.
11170 (queue_middle_gc_tasks): New function.
11171 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11172 processed early before laying out sections during garbage collection.
11173 * gold.h (queue_middle_gc_tasks): New function.
11174 (is_prefix_of): Move from "layout.cc".
11175 * i386.cc (Target_i386::gc_process_relocs): New function.
11176 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11177 * main.cc (main): Create object of class "Garbage_collection".
11178 * object.cc (Relobj::copy_symbols_data): New function.
11179 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11180 (Sized_relobj::do_layout): Allow this function to be called twice
11181 during garbage collection and defer layout of section during the
6d03d481
ST
11182 first call.
11183 * object.h (Relobj::get_symbols_data): New function.
11184 (Relobj::is_section_name_included): New function.
11185 (Relobj::copy_symbols_data): New function.
11186 (Relobj::set_symbols_data): New function.
11187 (Relobj::get_relocs_data): New function.
11188 (Relobj::set_relocs_data): New function.
11189 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11190 (Relobj::gc_process_relocs): New function.
11191 (Relobj::do_gc_process_relocs): New pure virtual function.
11192 (Relobj::sd_): New data member.
11193 (Sized_relobj::is_output_section_offset_invalid): New function.
11194 (Sized_relobj::do_gc_process_relocs): New function.
11195 * options.h (General_options::gc_sections): Modify to not be a no-op.
11196 (General_options::print_gc_sections): New option.
11197 * plugin.cc (Plugin_finish::run): Remove function call to
11198 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11199 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11200 * reloc.cc (Read_relocs::run): Add task to process relocs and
11201 determine unreferenced sections when doing garbage collection.
11202 (Gc_process_relocs): New class.
11203 (Sized_relobj::do_gc_process_relocs): New function.
11204 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11205 sections that are garbage collected.
11206 * reloc.h (Gc_process_relocs): New class.
11207 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11208 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11209 symbols whose corresponding sections are garbage collected.
11210 (Symbol_table::Symbol_table): Add new parameter for the garbage
11211 collection object.
11212 (Symbol_table::gc_mark_undef_symbols): New function.
11213 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11214 (Symbol_table::gc_mark_dyn_syms): New function.
11215 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11216 as garbage.
11217 (Symbol_table::add_from_object): Likewise.
11218 (Symbol_table::add_from_relobj): When building shared objects, do not
11219 treat externally visible symbols as garbage.
11220 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11221 table information for static and relocatable links.
11222 * symtab.h (Symbol_table::set_gc): New function.
11223 (Symbol_table::gc): New function.
11224 (Symbol_table::gc_mark_undef_symbols): New function.
11225 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11226 (Symbol_table::gc_mark_dyn_syms): New function.
11227 (Symbol_table::gc_): New data member.
e1df38aa 11228 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11229 function.
11230 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11231 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11232
3b293544
CF
112332009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11234
11235 * options.h (General_options::gc_sections): Define as a no-op for now.
11236 (General_options::no_keep_memory): Ditto.
11237 (General_options::Bshareable): Define.
11238 * options.cc (General_options::finalize): Honor -Bshareable.
11239
83d22aa8
AS
112402009-01-20 Andreas Schwab <schwab@suse.de>
11241
11242 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11243 read the value in the contents, since we don't use it. Use the
11244 template endianness when writing.
11245 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11246
cd536b21
AS
112472009-01-19 Andreas Schwab <schwab@suse.de>
11248
11249 * configure.tgt (powerpc64-*): Fix targ_obj.
11250
99e9a495
ILT
112512009-01-15 Ian Lance Taylor <iant@google.com>
11252
11253 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11254 local symbols when stripping all symbols.
11255
bbbfea06
CC
112562009-01-14 Cary Coutant <ccoutant@google.com>
11257
99e9a495 11258 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11259
0f7c0701
CC
112602009-01-14 Cary Coutant <ccoutant@google.com>
11261
11262 * archive.cc (Archive::get_elf_object_for_member): Remove call
11263 to File_read::claim_for_plugin.
11264 * descriptors.cc (Descriptors::open): Remove reference to
11265 is_claimed.
11266 (Descriptors::claim_for_plugin): Remove.
11267 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11268 (Descriptors::is_claimed): Remove.
11269 (claim_descriptor_for_plugin): Remove.
11270 * fileread.cc (File_read::claim_for_plugin): Remove.
11271 * fileread.h (File_read::claim_for_plugin): Remove.
11272 (File_read::descriptor): Reopen descriptor if necessary.
11273 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11274 (Plugin_manager::all_symbols_read): Add task parameter. Change
11275 all callers.
11276 (Plugin_manager::get_input_file): New function.
11277 (Plugin_manager::release_input_file): New function.
11278 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11279 corresponding data member.
11280 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11281 and pass to base constructor. Change all callers.
11282 (get_input_file, release_input_file): New functions.
11283 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11284 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11285 (Plugin_manager::all_symbols_read): Add task parameter.
11286 (Plugin_manager::get_input_file): New function.
11287 (Plugin_manager::release_input_file): New function.
11288 (Plugin_manager::task_): New data member.
11289 (Pluginobj::Pluginobj): Add filesize parameter.
11290 (Pluginobj::filename): New function.
11291 (Pluginobj::descriptor): New function.
11292 (Pluginobj::filesize): New function.
11293 (Pluginobj::filesize_): New data member.
11294 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11295 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11296 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11297
11298 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11299 with archive libraries.
11300 * testsuite/Makefile.in: Regenerate.
11301 * testsuite/plugin_test.c (struct sym_info): New type.
11302 (get_input_file, release_input_file): New static variables.
11303 (onload): Capture new transfer vector entries.
11304 (claim_file_hook): Stop reading at end of file according to filesize.
11305 Factor out parsing of readelf output into separate function.
11306 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11307 APIs and get the source file name from the symbol table. Convert
11308 source file name to corresponding object file name. Print info
11309 message when adding new input files.
11310 (parse_readelf_line): New function.
11311 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11312 * testsuite/plugin_test_2.sh: Likewise.
11313 * testsuite/plugin_test_3.sh: Likewise.
11314 * testsuite/plugin_test_4.sh: New test case.
11315
62a6d109
ILT
113162009-01-07 Ian Lance Taylor <iant@google.com>
11317
11318 * version.cc (version_string): Bump to 1.8.
11319
483620e8
CC
113202008-12-23 Cary Coutant <ccoutant@google.com>
11321
11322 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11323 * plugin.cc (Plugin_manager::finish): Rename as
11324 layout_deferred_objects. Move cleanup to separate function.
11325 (Plugin_manager::cleanup): New function.
11326 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11327 separately.
11328 * plugin.h (Plugin_manager::finish): Rename as
11329 layout_deferred_objects.
11330 (Plugin_manager::cleanup): New function.
11331 (Plugin_manager::cleanup_done): New field.
11332
d66a9eb3
CC
113332008-12-23 Cary Coutant <ccoutant@google.com>
11334
11335 * plugin.cc (is_visible_from_outside): New function.
11336 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11337 so we don't return "IR only" status for exported symbols or -r links.
11338
11339 * testsuite/Makefile.am (plugin_test_3): New test case.
11340 * testsuite/Makefile.in: Regenerate.
11341 * testsuite/plugin_test_3.sh: New file.
11342
5995b570
CC
113432008-12-22 Cary Coutant <ccoutant@google.com>
11344
11345 * object.cc (Sized_relobj::layout_section): New function.
11346 (Sized_relobj::do_layout): Defer layout of input sections until after
11347 plugin has provided replacement files.
11348 (Sized_relobj::do_layout_deferred_sections): New function.
11349 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11350 (Relobj::layout_deferred_sections): New function.
11351 (Relobj::do_layout_deferred_sections): New function.
11352 (Sized_relobj::do_layout_deferred_sections): New function.
11353 (Sized_relobj::layout_section): New function.
11354 (Sized_relobj::Deferred_layout): New structure.
11355 (Sized_relobj::deferred_layout_): New field.
11356 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11357 Change all callers. Layout deferred sections.
11358 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11359 references.
11360 (Plugin_hook::run): Move code from do_plugin_hook inline.
11361 (Plugin_hook::do_plugin_hook): Remove.
11362 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11363 (Plugin_manager::finish): Renamed, was cleanup.
11364 (Plugin_manager::should_defer_layout): New function.
11365 (Plugin_manager::add_deferred_layout_object): New function.
11366 (Plugin_manager::Deferred_layout_list): New type.
11367 (Plugin_manager::deferred_layout_objects_): New field.
11368 (Plugin_hook::do_plugin_hook): Remove.
11369
ee769c88
ILT
113702008-12-17 Ian Lance Taylor <iant@google.com>
11371
11372 * options.h (class General_options): Add --no case for
11373 --export-dynamic.
11374
abc8dcba
CC
113752008-12-16 Cary Coutant <ccoutant@google.com>
11376
11377 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11378 vector.
11379 (Plugin_manager::claim_file): Create plugin object even if
11380 plugin did not call the add_symbols callback.
11381 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11382 asking for more symbols than were added.
11383 * testsuite/Makefile.am (plugin_test_1): Add test case with
11384 no global symbols.
11385 (empty.syms): New target.
11386 * testsuite/Makefile.in: Regenerate.
11387 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11388 message. Don't call add_symbols if no globals.
11389 (all_symbols_read_hook): Don't provide replacement for empty
11390 claimed file.
11391
b0074644
ILT
113922008-12-12 Ian Lance Taylor <iant@google.com>
11393
68943102
ILT
11394 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11395 r_type == 0 for a local symbol with r_sym == 0.
11396 (scan_relocatable_relocs): Pass r_sym to
11397 local_non_section_strategy.
11398 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11399 r_sym parameter.
11400
b0074644
ILT
11401 * configure.ac: Update test for TLS descriptors: they are
11402 supported as of glibc 2.9.
11403 * configure: Rebuild.
11404
c2508178
ILT
114052008-12-11 Ian Lance Taylor <iant@google.com>
11406
11407 PR 7091
11408 * target-reloc.h (Default_scan_relocatable_relocs): For each
11409 function, map r_type == 0 to RELOC_DISCARD.
11410
2756a258
CC
114112008-12-10 Cary Coutant <ccoutant@google.com>
11412
11413 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11414 object to override a kept COMDAT group from a plugin object.
11415
bb6f53d3
ILT
114162008-12-09 Ian Lance Taylor <iant@google.com>
11417
fbc558e1
ILT
11418 PR 7088
11419 * yyscript.y (file_cmd): Handle INPUT.
11420
bb6f53d3
ILT
11421 * testsuite/initpri1.c: Change all declarations to be full
11422 prototypes by adding void, to avoid compiler warnings.
11423
4674ecfc
CC
114242008-12-05 Rafael Avila de Espindola <espindola@google.com>
11425
11426 * options.cc (General_options::parse_plugin_opt): New.
11427 (General_options::add_plugin): The argument now is just the filename.
11428 (General_options::add_plugin_option): New.
11429 * options.h (plugin_opt): New.
11430 (add_plugin): Change argument name.
11431 (add_plugin_option): New.
11432 * plugin.cc (Plugin::load): Don't parse the plugin option.
11433 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11434 (Plugin::add_option): New.
11435 (Plugin::args_): Change type.
11436 (Plugin::filename_): New.
11437 (Plugin_manager::add_plugin_option): New.
11438 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11439 * testsuite/Makefile.in: Regenerate.
11440
fd06b4aa
CC
114412008-12-05 Cary Coutant <ccoutant@google.com>
11442
11443 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11444 Handle --strip-lto-sections option.
11445 * options.h (strip_lto_sections): New option.
11446
6c52134c
CC
114472008-12-01 Cary Coutant <ccoutant@google.com>
11448
11449 * plugin.cc (ld_plugin_message): Change format parameter to const.
11450 Fix mismatch between new[] and delete.
11451
a45248e0
CC
114522008-11-14 Cary Coutant <ccoutant@google.com>
11453
11454 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11455 instead of -1U.
11456
c82fbeee
CS
114572008-11-05 Craig Silverstein <csilvers@google.com>
11458
11459 * options.cc (General_options::parse_dynamic_list): New function.
11460 * options.h (General_options): New flags dynamic_list,
11461 dynamic_list_data, dynamic_list_cpp_new, and
11462 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11463 (General_options::in_dynamic_list): New function.
11464 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11465 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11466 (Lex::can_continue_name): Likewise.
11467 (yylex): Likewise.
11468 (read_script_file): New parameter script_options.
11469 (read_dynamic_list): New function.
11470 (Script_options::define_dynamic_list): New function.
11471 (dynamic_list_keyword_parsecodes): New variable.
11472 (dynamic_list_keywords): New variable.
11473 * script.h (Script_options::define_dynamic_list): New function
11474 prototype.
11475 (read_dynamic_list): New function prototype.
11476 * symtab.cc (strprefix): New macro.
11477 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11478 dynamic_list_data, dynamic_list_cpp_new, and
11479 dynamic_list_cpp_typeinfo.
11480 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11481 (dynamic_list_expr): New rule.
11482 (dynamic_list_nodes): Likewise.
11483 (dynamic_list_node): Likewise.
11484 * testsuite/Makefile.am (dynamic_list): New test.
11485 * testsuite/Makefile.in: Regenerated.
11486 * testsuite/dynamic_list.t: New file.
11487 * testsuite/dynamic_list.sh: New file.
11488
e0bb29a5
CS
114892008-11-05 Craig Silverstein <csilvers@google.com>
11490
11491 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11492 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11493 (t11_last): Likewise.
11494 * testsuite/ver_test_6.c (main): Likewise.
11495
4e1e25e0
CC
114962008-10-07 Cary Coutant <ccoutant@google.com>
11497
11498 * options.c (General_options::finalize): Add check for -static and
11499 -shared.
11500 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11501 is not empty.
11502
92f03fcb
CC
115032008-10-02 Cary Coutant <ccoutant@google.com>
11504
11505 * plugin.cc (make_sized_plugin_object): Fix conditional
11506 compilation to work when not all targets are enabled.
11507
fbd8a257
CC
115082008-09-29 Cary Coutant <ccoutant@google.com>
11509
11510 * archive.cc (Archive::get_file_and_offset): Use filename instead
11511 of name to get library path.
11512 (Archive::include_member): Unlock external member of a thin archive.
11513
11514 * testsuite/Makefile.am (TEST_AR): New variable.
11515 (thin_archive_test_1): New test.
11516 (thin_archive_test_2): New test.
81636b3f
CC
11517 * testsuite/Makefile.in: Regenerate.
11518 * testsuite/thin_archive_main.cc: New file.
11519 * testsuite/thin_archive_test_1.cc: New file.
11520 * testsuite/thin_archive_test_2.cc: New file.
11521 * testsuite/thin_archive_test_3.cc: New file.
11522 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11523
eff45813
CC
115242008-09-29 Cary Coutant <ccoutant@google.com>
11525
11526 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11527 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11528 instead of -1U.
11529 (Sized_relobj::do_finalize_local_symbols): Likewise.
11530 (Sized_relobj::map_to_kept_section): Likewise.
11531 * object.h (Sized_relobj::invalid_address): New constant.
11532 (Sized_relobj::do_output_section_offset): Check for invalid_address
11533 and return -1ULL.
11534 * output.cc (Output_reloc::local_section_offset): Use constant
11535 invalid_address instead of -1U.
11536 (Output_reloc::get_address): Likewise.
11537 (Output_section::output_address): Change -1U to -1ULL.
11538 * output.h (Output_reloc::invalid_address): New constant.
11539 * reloc.cc (Sized_relobj::write_sections): Use constant
11540 invalid_address instead of -1U.
11541 (Sized_relobj::relocate_sections): Likewise.
11542 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11543 values for merge sections.
11544 * target-reloc.h (relocate_for_relocatable): Use constant
11545 invalid_address instead of -1U.
11546
89fc3421
CC
115472008-09-19 Cary Coutant <ccoutant@google.com>
11548
11549 Add plugin functionality for link-time optimization (LTO).
11550 * configure.ac (plugins): Add --enable-plugins option.
11551 * configure: Regenerate.
11552 * config.in: Regenerate.
11553 * Makefile.am (LIBDL): New variable.
11554 (CCFILES): Add plugin.cc.
11555 (HFILES): Add plugin.h.
11556 (ldadd_var): Add LIBDL.
11557 * Makefile.in: Regenerate.
11558
11559 * archive.cc: Include "plugin.h".
11560 (Archive::setup): Don't preread archive symbols when using a plugin.
11561 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11562 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11563 files.
11564 (Archive::include_member): Add symbols from plugin objects.
11565 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11566 * descriptors.cc (Descriptors::open): Check for file descriptors
11567 abandoned by plugins.
11568 (Descriptors::claim_for_plugin): New function.
11569 * descriptors.h (Descriptors::claim_for_plugin): New function.
11570 (Open_descriptor::is_claimed): New field.
11571 (claim_descriptor_for_plugin): New function.
11572 * fileread.cc (File_read::claim_for_plugin): New function.
11573 * fileread.h (File_read::claim_for_plugin): New function.
11574 (File_read::descriptor): New function.
11575 * gold.cc: Include "plugin.h".
11576 (queue_initial_tasks): Add task to call plugin hooks for generating
11577 new object files.
11578 * main.cc: Include "plugin.h".
11579 (main): Load plugin libraries.
11580 * object.h (Pluginobj): Declare.
11581 (Object::pluginobj): New function.
11582 (Object::do_pluginobj): New function.
11583 (Object::set_target): New function.
11584 * options.cc: Include "plugin.h".
11585 (General_options::parse_plugin): New function.
11586 (General_options::General_options): Initialize plugins_ field.
11587 (General_options::add_plugin): New function.
11588 * options.h (Plugin_manager): Declare.
11589 (General_options): Add --plugin option.
11590 (General_options::has_plugins): New function.
11591 (General_options::plugins): New function.
11592 (General_options::add_plugin): New function.
11593 (General_options::plugins_): New field.
11594 * plugin.cc: New file.
11595 * plugin.h: New file.
11596 * readsyms.cc: Include "plugin.h".
11597 (Read_symbols::do_read_symbols): Check for archive before checking
11598 for ELF file. Call plugin hooks to claim files.
11599 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11600 from a real object file; force override when processing replacement
11601 files.
11602 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11603 (Symbol::init_base_object): Likewise.
11604 (Symbol::init_base_output_data): Likewise.
11605 (Symbol::init_base_output_segment): Likewise.
11606 (Symbol::init_base_constant): Likewise.
11607 (Symbol::init_base_undefined): Likewise.
11608 (Symbol::output_section): Assert that object is not a plugin.
11609 (Symbol_table::add_from_pluginobj): New function.
11610 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11611 undefined.
11612 (Symbol_table::sized_write_globals): Likewise.
11613 (Symbol_table::add_from_pluginobj): Instantiate template.
11614 * symtab.h (Sized_pluginobj): Declare.
11615 (Symbol::in_real_elf): New function.
11616 (Symbol::set_in_real_elf): New function.
11617 (Symbol::in_real_elf_): New field.
11618 (Symbol_table::add_from_pluginobj): New function.
11619
11620 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11621 (LIBDL): New variable.
11622 (LDADD): Add LIBDL.
11623 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11624 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11625 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11626 (MOSTLYCLEANFILES): Likewise.
11627 * testsuite/Makefile.in: Regenerate.
11628 * testsuite/plugin_test.c: New file.
11629 * testsuite/plugin_test_1.sh: New file.
11630 * testsuite/plugin_test_2.sh: New file.
11631
de31bda5
ILT
116322008-09-16 Ian Lance Taylor <iant@google.com>
11633
9c2d0ef9
ILT
11634 * target-reloc.h (relocate_section): Check whether a symbol is
11635 defined by the ABI before reporting an undefined symbol error.
11636 * target.h (Target::is_defined_by_abi): Make parameter const.
11637 (Target::do_is_defined_by_abi): Likewise.
11638 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11639 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11640 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11641 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11642 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11643 * testsuite/Makefile.in: Rebuild.
11644
de31bda5
ILT
11645 * fileread.cc (make_view): Add casts to avoid warning.
11646
9fa33bee
AO
116472008-09-16 Alexandre Oliva <aoliva@redhat.com>
11648
11649 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11650 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11651
183fd0e3
AO
116522008-09-16 Alexandre Oliva <aoliva@redhat.com>
11653
11654 * options.h (General_options::output_is_executable): New.
11655 (General_options::output_is_pie): New.
11656 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11657 for shared libraries.
11658 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11659
7be8330a
CD
116602008-09-11 Chris Demetriou <cgd@google.com>
11661
11662 * options.h (origin): New -z option.
11663 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11664 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11665 in DT_FLAGS_1.
11666
a9caad02
CC
116672008-09-05 Cary Coutant <ccoutant@google.com>
11668
11669 * fileread.cc (File_read::make_view): Add check for attempt to map
11670 beyond end of file.
11671
ae6dce4d
CC
116722008-09-05 Cary Coutant <ccoutant@google.com>
11673
11674 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11675 explicit instantiations.
11676
d7ab2a47
KVH
116772008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11678
11679 PR gold/6858
11680 * options.cc (General_options::finalize): Allow undefined symbols
11681 in shlibs if linking -shared.
11682
11683 PR gold/6859
11684 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11685 symbols as not needing a dynsym entry.
11686
1e52a9c1
CS
116872008-08-20 Craig Silverstein <csilvers@google.com>
11688
11689 * fileread.cc (File_read::open): Do not lock the file unless it
11690 was successfully opened.
11691
d85c80a3
CC
116922008-08-14 Cary Coutant <ccoutant@google.com>
11693
11694 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11695 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11696 * testsuite/tls_test.cc (struct int128): 128-bit struct
11697 for testing TLS relocs with non-zero addend.
11698 (v12): New TLS variable.
11699 (t12): New test.
11700 (t_last): Add check for v12.
11701 * testsuite/tls_test.h (t12): New function.
11702 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11703
2d924fd9
ILT
117042008-08-13 Ian Lance Taylor <iant@google.com>
11705
11706 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11707 set tls_segment_ or relro_segment_.
11708 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11709 when appropriate.
11710 * output.h (Output_section::clear_is_relro): New function.
11711 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11712 sections specially even when output_data_ is empty.
11713 (Output_segment::maximum_alignment): When first section is relro,
11714 only force alignment for PT_LOAD segments.
11715 * script.cc (script_data_segment_align): New function.
11716 (script_data_segment_relro_end): New function.
11717 * script-c.h (script_data_segment_align): Declare.
11718 (script_data_segment_relro_end): Declare.
11719 * script-sections.h (class Script_sections): Declare
11720 data_segment_align and data_segment_relro_end. Add fields
11721 segment_align_index_ and saw_relro_end_.
11722 * script-sections.cc (class Sections_element): Add set_is_relro
11723 virtual function. Add new bool* parameter to place_orphan_here.
11724 Add get_output_section virtual function.
11725 (class Output_section_definition): Add set_is_relro. Add new
11726 bool* parameter to place_orphan_here. Add get_output_section.
11727 Add is_relro_ field.
11728 (Output_section_definition::Output_section_definition): Initialize
11729 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11730 and is_relro_ fields.
11731 (Output_section_definition::place_orphan_here): Add is_relro
11732 parameter.
11733 (Output_section_definition::set_section_addresses): Set relro for
11734 output section.
11735 (Output_section_definition::alternate_constraint): Likewise.
11736 (class Orphan_output_section): Add new bool* parameter to
11737 place_orphan_here. Add get_output_section.
11738 (Orphan_output_section::place_orphan_here): Add is_relro
11739 parameter.
11740 (Script_sections::Script_sections): Initialize
11741 data_segment_align_index_ and saw_relro_end_.
11742 (Script_sections::data_segment_align): New function.
11743 (Script_sections::data_segment_relro_end): New function.
11744 (Script_sections::place_orphan): Set or clear is_relro.
11745 (Script_sections::set_section_addresses): Force alignment of first
11746 TLS section.
11747 * yyscript.y (exp): Call script_data_segment_align and
11748 script_data_segment_relro_end.
11749 * testsuite/relro_script_test.t: New file.
11750 * testsuite/relro_test.cc (using_script): Declare.
11751 (t1, t2): Test using_script.
11752 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11753 (relro_script_test_SOURCES): Define.
11754 (relro_script_test_DEPENDENCIES): Define.
11755 (relro_script_test_LDFLAGS): Define.
11756 (relro_script_test_LDADD): Define.
11757 (relro_script_test.so): New target.
11758 * testsuite/Makefile.in: Rebuild.
11759
f827c9a9
CC
117602008-08-06 Cary Coutant <ccoutant@google.com>
11761
11762 * archive.cc (Archive::total_archives, Archive::total_members)
11763 (Archive::total_members_loaded): New variables.
11764 (Archive::setup): Add parameter. Add option to preread
11765 archive symbols.
11766 (Archive::read_armap): Add counter.
11767 (Archive::get_file_and_offset): New function.
11768 (Archive::get_elf_object_for_member): New function.
11769 (Archive::read_all_symbols): New function.
11770 (Archive::read_symbols): New function.
11771 (Archive::add_symbols): Add counters.
11772 (Archive::include_all_members): Use armap to find members if it's
11773 already built.
11774 (Archive::include_member): Skip reading symbols if already read.
11775 Factored code into Archive::get_file_and_offset and
11776 Archive::get_elf_object_for_member. Changed call to
11777 Mapfile::report_include_archive_member.
11778 (Archive::print_stats): New function.
11779 * archive.h: Declare Object and Read_symbols_data classes.
11780 (Archive::Archive): Add initializers for new members.
11781 (Archive::setup): Add parameter.
11782 (Archive::print_stats): New function.
11783 (Archive::total_archives, Archive::total_members)
11784 (Archive::total_members_loaded): New variables.
11785 (Archive::get_file_and_offset): New function.
11786 (Archive::get_elf_object_for_member): New function.
11787 (Archive::read_all_symbols): New function.
11788 (Archive::read_symbols): New function.
11789 (Archive::Archive_member): New class.
11790 (Archive::members_): New member.
11791 (Archive::num_members_): New member.
11792 * main.cc: Include archive.h.
11793 (main): Call Archive::print_stats.
11794 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11795 archive parameter; member_name is now the fully-decorated name.
11796 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11797 * options.h: (General_options): Add --preread-archive-symbols option.
11798 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11799 Archive::setup.
11800
de4c45bd
ILT
118012008-08-04 Ian Lance Taylor <iant@google.com>
11802
11803 * symtab.h (Symbol::use_plt_offset): New function.
11804 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11805 * powerpc.cc (Relocate::relocate): Likewise.
11806 * sparc.cc (Relocate::relocate): Likewise.
11807 * x86_64.cc (Relocate::relocate): Likewise.
11808 * testsuite/weak_plt.sh: New test.
11809 * testsuite/weak_plt_main.cc: New test.
11810 * testsuite/weak_plt_shared.cc: New test.
11811 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11812 (check_PROGRAMS): Add weak_plt.
11813 (check_DATA): Add weak_plt_shared.so.
11814 (weak_plt_main_pic.o, weak_plt): New targets.
11815 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11816 * testsuite/Makefile.in: Rebuild.
11817
11818 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11819 gcctestdir/ld.
11820 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11821 * testsuite/Makefile.in: Rebuild.
11822
323ee3f4
AM
118232008-08-04 Alan Modra <amodra@bigpond.net.au>
11824
11825 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11826 * Makefile.in: Regenerate.
11827 * po/POTFILES.in: Regenerate.
11828
7c07ecec
ILT
118292008-07-29 Ian Lance Taylor <iant@google.com>
11830
11831 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11832 symbols before other symbols.
11833 * testsuite/script_test_2.cc (test_addr): Declare.
11834 (test_addr_alias): Declare.
11835 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11836 values.
7c07ecec
ILT
11837 * testsuite/script_test_2.t: Define test_addr_alias and
11838 test_addr.
11839
5778530e
ILT
118402008-07-24 Ian Lance Taylor <iant@google.com>
11841
2a00e4fb
ILT
11842 PR 5990
11843 * descriptors.cc: New file.
11844 * descriptors.h: New file.
11845 * gold-threads.h (class Hold_optional_lock): New class.
11846 * fileread.cc: Include "descriptors.h".
11847 (File_read::~File_read): Release descriptor rather than closing
11848 it.
11849 (File_read::open) [file]: Call open_descriptor rather than open.
11850 Set is_descriptor_opened_.
11851 (File_read::open) [memory]: Assert that descriptor is not open.
11852 (File_read::reopen_descriptor): New function.
11853 (File_read::release): Release descriptor.
11854 (File_read::do_read): Make non-const. Reopen descriptor.
11855 (File_read::read): Make non-const.
11856 (File_read::make_view): Reopen descriptor.
11857 (File_read::do_readv): Likewise.
11858 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11859 Update declarations.
11860 * layout.cc: Include "descriptors.h".
11861 (Layout::create_build_id): Use open_descriptor rather than open.
11862 * output.cc: Include "descriptors.h".
11863 (Output_file::open): Use open_descriptor rather than open.
11864 * archive.cc (Archive::const_iterator): Change Archive to be
11865 non-const.
11866 (Archive::begin, Archive::end): Make non-const.
11867 (Archive::count_members): Likewise.
11868 * archive.h (class Archive): Update declarations.
11869 * object.h (Object::read): Make non-const.
11870 * Makefile.am (CCFILES): Add descriptors.cc.
11871 (HFILES): Add descriptors.h.
11872 * Makefile.in: Rebuild.
11873
801647d1
ILT
11874 PR 6716
11875 * gold.h: Always include <clocale>. Add Solaris workarounds
11876 following code in binutils/sysdep.h.
11877
5edd166e
ILT
11878 PR 6048
11879 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11880 this->eh_frame_hdr_ is NULL before using it.
11881
c89ad728
ILT
11882 * dynobj.cc (Versions::Versions): Update comment.
11883
aa86f06b
ILT
11884 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11885 the base version name.
11886
5778530e
ILT
11887 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11888 array size plus one.
11889 (Stringpool_template::set_string_offsets): Subtract one from key
11890 before using it as an array index.
11891 (Stringpool_template::get_offset_with_length): Likewise.
11892 (Stringpool_template::write_to_buffer): Likewise.
11893 * stringpool.h (Stringpool_template::get_offset_from_key):
11894 Likewise.
11895
057ead22
ILT
118962008-07-23 Ian Lance Taylor <iant@google.com>
11897
7f649c59
ILT
11898 PR 6658
11899 * object.h (Merged_symbol_value::value): Do our best to handle a
11900 negative addend.
11901
057ead22
ILT
11902 PR 6647
11903 * script.cc (Version_script_info::get_versions): Don't add empty
11904 version tag to return value.
11905 (Version_script_info::get_symbol_version_helper): Change return
11906 type to bool. Add pversion parameter. Change all callers.
11907 (script_register_vers_node): Don't require a non-NULL tag.
11908 * script.h (class Version_script_info): Update declarations.
11909 (Version_script_info::get_symbol_version): Change return type to
11910 bool. Add version parameter. Change all callers.
11911 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11912 handling. Handle an empty version from a version script.
11913 (Symbol_table::define_special_symbol): Likewise.
11914 * testsuite/ver_test_10.script: New file.
11915 * testsuite/ver_test_10.sh: New file.
11916 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11917 (check_DATA): Add ver_test_10.syms.
11918 (ver_test_10.syms, ver_test_10.so): New target.
11919 * testsuite/Makefile.in: Rebuild.
11920
58e54ac2
CD
119212008-07-23 Simon Baldwin <simonb@google.com>
11922
11923 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11924 to zero for undefined symbols from dynamic libraries.
11925
95d14cd3
ILT
119262008-07-23 Ian Lance Taylor <iant@google.com>
11927
11928 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11929 Change all callers.
11930 * symtab.h (class Symbol_table): Update declaration.
11931 * testsuite/ver_test_9.cc: New file.
11932 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11933 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11934 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11935 (ver_test_9.so, ver_test_9.o): New targets.
11936 * testsuite/Makefile.in: Rebuild.
11937
92de84a6
ILT
119382008-07-22 Ian Lance Taylor <iant@google.com>
11939
34810851
ILT
11940 * options.h (class General_options): Define --check-sections.
11941 * layout.cc (Layout::set_segment_offsets): Handle
11942 --check-sections.
11943
af6156ef
ILT
11944 * options.h (class General_options): Define -n/--nmagic and
11945 -N/--omagic.
11946 * options.cc (General_options::finalize): For -n/--nmagic or
11947 -N/--omagic, set -static.
11948 * layout.cc (Layout::attach_allocated_section_to_segment): If
11949 -N/--omagic, don't put read-only and read-write sections in
11950 different segments.
11951 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11952 finding a read-only segment.
11953 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11954 don't set the minimum segment alignment to the common page size,
11955 and don't set the file offset to the address modulo the page size.
11956 * script-sections.cc (Script_sections::create_segments): If
11957 -n/--omagic, don't put read-only and read-write sections in
11958 different segments.
11959
92de84a6
ILT
11960 * cref.cc: New file.
11961 * cref.h: New file.
11962 * options.h (class General_options): Add --print-symbol-counts.
11963 * main.cc (main): Issue defined symbol report if requested.
11964 * archive.cc (Archive::interpret_header): Make into a const member
11965 function.
11966 (Archive::add_symbols): Call Input_objects::archive_start and
11967 archive_stop.
11968 (Archive::const_iterator): Define new class.
11969 (Archive::begin, Archive::end): New functions.
11970 (Archive::include_all_members): Rewrite to use iterator.
11971 (Archive::count_members): New function.
11972 * archive.h (class Archive): Update declarations.
11973 (Archive::filename): New function.
11974 * object.cc: Include "cref.h".
11975 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11976 (Sized_relobj::do_get_global_symbol_counts): New function.
11977 (Input_objects::add_object): Add object to cross-referencer.
11978 (Input_objects::archive_start): New function.
11979 (Input_objects::archive_stop): New function.
11980 (Input_objects::print_symbol_counts): New function.
11981 * object.h: Declare Cref and Archive.
11982 (Object::get_global_symbol_counts): New function.
11983 (Object::do_get_global_symbol_counts): New pure virtual function.
11984 (class Sized_relobj): Add defined_count_ field. Update
11985 declarations.
11986 (class Input_objects): Add cref_ field. Update constructor.
11987 Update declarations.
11988 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11989 defined_count_.
11990 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11991 symbol counts.
11992 (Sized_dynobj::do_get_global_symbol_counts): New function.
11993 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11994 defined_count_. Update declarations. Define Symbols typedef.
11995 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11996 parameter. Change all callers.
11997 (Symbol_table::add_from_dynobj): Add sympointers and defined
11998 parameters. Change all callers.
11999 * symtab.h (class Symbol_table): Update declarations.
12000 * Makefile.am (CCFILES): Add cref.cc.
12001 (HFILES): Add cref.h.
12002 * Makefile.in: Rebuild.
12003
3f7c5e1d
CD
120042008-07-22 Simon Baldwin <simonb@google.com>
12005
12006 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
12007 to zero when writing undefined symbols.
12008
e0b64032
ILT
120092008-07-22 Ian Lance Taylor <iant@google.com>
12010
12011 * output.cc (Output_section::add_input_section): Don't try to
12012 merge empty merge sections.
12013
096b02cf
CS
120142008-07-21 Craig Silverstein <csilvers@google.com>
12015
12016 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
12017 Include symbol version in error message.
cd536b21 12018
1d1f116d
CD
120192008-07-20 Chris Demetriou <cgd@google.com>
12020
cd536b21 12021 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
12022 (RANDOM_SEED_CFLAGS): New substituted variable.
12023 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
12024 * configure: Rebuild.
12025 * Makefile.in: Likewise.
12026 * testsuite/Makefile.in: Likewise.
12027
a18f591e
ILT
120282008-07-18 Ian Lance Taylor <iant@google.com>
12029
12030 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
12031 where we see NAME/NULL and NAME/VERSION as separate symbols.
12032 * testsuite/ver_test_main.cc (main): Call t4.
12033 (t4, t4_2a): Define.
12034 * testsuite/ver_test_2.cc (t4_2): Define.
12035 * testsuite/ver_test_2.script: Put t4_2a in VER2.
12036 * testsuite/ver_test_4.cc (t4_2a): Define.
12037 * testsuite/ver_test_4.script: Put t4_2a in VER2.
12038 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
12039
c6e3f6ed
ILT
120402008-07-17 Ian Lance Taylor <iant@google.com>
12041
12042 * dynobj.cc (Versions::add_def): If we give an error about a
12043 missing version, go ahead and create the version anyhow.
12044
ef9beddf
ILT
120452008-07-10 Ian Lance Taylor <iant@google.com>
12046
12047 Handle output sections with more than 0x7fffffff bytes.
12048 * object.h (class Relobj): Change map_to_output_ to
12049 output_sections_, and just keep a section pointer. Change all
12050 uses. Move comdat group support to Sized_relobj.
12051 (Relobj::is_section_specially_mapped): Remove.
12052 (Relobj::output_section): Remove poff parameter. Change all
12053 callers.
12054 (Relobj::output_section_offset): New function.
12055 (Relobj::set_section_offset): Rewrite.
12056 (Relobj::map_to_output): Remove.
12057 (Relobj::output_sections): New function.
12058 (Relobj::do_output_section_offset): New pure virtual function.
12059 (Relobj::do_set_section_offset): Likewise.
12060 (class Sized_relobj): Add section_offsets_ field. Add comdat
12061 group support from Relobj. Update declarations.
12062 (Sized_relobj::get_output_section_offset): New function.
12063 (Sized_relobj::do_output_section_offset): New function.
12064 (Sized_relobj::do_set_section_offset): New function.
12065 * object.cc (Relobj::output_section_address): Remove.
12066 (Sized_relobj::Sized_relobj): Initialize new fields.
12067 (Sized_relobj::include_section_group): Cast find_kept_object to
12068 Sized_relobj.
12069 (Sized_relobj::include_linkonce_section): Likewise.
12070 (Sized_relobj::do_layout): Use separate arrays for output section
12071 and output offset.
12072 (Sized_relobj::do_count_local_symbols): Change map_to_output to
12073 output_sections.
12074 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
12075 output_sections and section_offsets.
12076 (Sized_relobj::write_local_symbols): Likewise.
12077 (map_to_kept_section): Compute output address directly.
12078 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
12079 output_sections and section_offsets.
12080 (Sized_relobj::write_sections): Likewise.
12081 (Sized_relobj::relocate_sections): Likewise.
12082 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
12083 * output.h (class Output_reloc): Update declarations. Change
12084 u2_.relobj to Sized_relobj*.
12085 (class Output_data_reloc): Change add functions to use
12086 Sized_relobj*.
12087 * output.cc (Output_reloc::Output_reloc): Change relobj to
12088 Sized_relobj*.
12089 (Output_reloc::local_section_offset): Change return type to
12090 Elf_Addr. Use get_output_section_offset.
12091 (Output_reloc::get_address): Likewise.
12092 (Output_section::is_input_address_mapped): Don't call
12093 is_section_specially_mapped.
12094 (Output_section::output_offset): Likewise.
12095 (Output_section::output_address): Likewise.
12096 (Output_section::starting_output_address): Likewise.
12097 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12098 parameter to Sized_relobj*.
12099 (Copy_relocs::need_copy_reloc): Likewise.
12100 (Copy_relocs::save): Likewise.
12101 * copy-relocs.h (class Copy_relocs): Update declarations.
12102 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12103 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12104 * target-reloc.h (relocate_for_relocatable): Change
12105 offset_in_output_section type to Elf_Addr. Change code that uses
12106 it as well.
12107 * layout.cc (Layout::layout): Always set *off.
12108 * mapfile.cc (Mapfile::print_input_section): Use
12109 output_section_offset.
12110 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12111 Sized_relobj*.
12112 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12113 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12114 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12115
5cb66f97
ILT
121162008-07-03 Ian Lance Taylor <iant@google.com>
12117
12118 * layout.cc (Layout::include_section): Do not discard unrecognized
12119 SHT_STRTAB sections.
12120
afe47622
CS
121212008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12122
12123 * script.cc (Lex::can_continue_name): Make '?' allowable in
12124 version-script names.
12125 * testsuite/version_script.map: Change glob pattern to use '?'
12126
5adf9721
ILT
121272008-06-30 Manish Singh <yosh@gimp.org>
12128
12129 PR 6585
12130 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12131 Correct typo.
12132
e6fde208
ILT
121332008-06-30 Ian Lance Taylor <iant@google.com>
12134
12135 PR 6660
12136 PR 6682
12137 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12138 versions]: Don't try to read the value in the contents, since we
12139 don't use it. Use the template endianness when writing.
12140
3f2e6a2d
CC
121412008-06-25 Cary Coutant <ccoutant@google.com>
12142
12143 * fileread.cc (File_read::make_view): Assert on zero-length view.
12144 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12145 symbol table when there are no symbols to read.
12146
c43d3a48
CS
121472008-06-23 Craig Silverstein <csilvers@google.com>
12148
12149 * version.cc (version_string): Bump to 1.7
12150
5f494ea0
CS
121512008-06-18 Craig Silverstein <csilvers@google.com>
12152
12153 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12154 constant 0xFFFF to type Valtype.
12155 (Powerpc_relocate_functions::rel16_ha): Likewise.
12156
c42e122e
ILT
121572008-06-17 Ian Lance Taylor <iant@google.com>
12158
f34787f8
ILT
12159 * output.h (Output_section::Input_section): Initialize p2align_ to
12160 zero for Output_section_data constructors.
12161 (Output_section::Input_section::addralign): If not an input
12162 section, return the alignment of the Output_section_data.
12163 * testsuite/copy_test.cc: New file.
12164 * testsuite/copy_test_1.cc: New file.
12165 * testsuite/copy_test_2.cc: New file.
12166 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12167 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12168 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12169 (copy_test_1_pic.o, copy_test_1.so): New targets.
12170 (copy_test_2_pic.o, copy_test_2.so): New targets.
12171 * testsuite/Makefile.in: Rebuild.
12172
c42e122e
ILT
12173 * script-sections.cc (Script_sections::place_orphan): Initialize
12174 local variable exact.
12175
ce3ac18a
DE
121762008-06-13 David Edelsohn <edelsohn@gnu.org>
12177
12178 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12179
42cacb20
DE
121802008-06-12 David Edelsohn <edelsohn@gnu.org>
12181 David S. Miller <davem@davemloft.net>
12182
12183 * powerpc.cc: New file.
12184 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12185 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12186 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12187 * Makefile.in: Rebuild.
12188
7b308235
ILT
121892008-06-09 Ian Lance Taylor <iant@google.com>
12190
12191 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12192 <exception>.
12193 (throwing, orig_terminate): New static variables.
12194 (terminate_handler): New static function.
12195 (t2): Set terminate handler.
12196
f0b886e3
ILT
121972008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12198
12199 PR 6584
cd536b21 12200 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12201 alignment.
12202
3e90f135
CC
122032008-05-30 Cary Coutant <ccoutant@google.com>
12204
12205 * archive.cc (Archive::include_all_members) Correct to step
12206 over symbol table and extended name table in thin archives.
12207
e09ad04a
ILT
122082008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12209
12210 PR 6407
12211 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12212 calculation.
12213
62b01cb5
ILT
122142008-05-28 Caleb Howe <cshowe@google.com>
12215
12216 * reduced_debug_output.cc: New file.
12217 * reduced_debug_output.h: New file.
92de84a6 12218 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12219 * options.cc (General_options::finalize): Add strip_debug_non_line
12220 to the strip heirarchy.
12221 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12222 fields.
12223 * layout.cc: Include "reduced_debug_output.h".
12224 (Layout::Layout): Initialize new fields.
12225 (line_only_debug_sections): New static array.
12226 (is_lines_only_debug_sections): New static inline function.
12227 (Layout::include_section): Handle --strip-debug-non-line.
12228 (Layout::make_output_section): If --strip-debug-non-line, build
12229 new output sections for .debug_abbrev and .debug_info.
12230 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12231 gold. Warn about possible overflow.
12232 (read_signed_LEB_128): Likewise.
12233 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12234 (read_signed_LEB_128): Declare.
12235 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12236 (HFILES): Add reduced_debug_output.h.
12237 * Makefile.in: Rebuild.
12238
7d9e3d98
ILT
122392008-05-21 Ian Lance Taylor <iant@google.com>
12240
12241 * mapfile.cc: New file.
12242 * mapfile.h: New file.
12243 * options.h (class General_options): Add -M/--print-map and -Map.
12244 * options.cc (General_options::finalize): Make -M equivalent to
12245 -Map -.
12246 * main.cc: Include <cstdio> and "mapfile.h".
12247 (main): Open mapfile if requested.
12248 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12249 constructor. Change caller.
12250 (queue_initial_tasks): Add mapfile parameter. Change caller.
12251 (queue_middle_tasks): Likewise.
12252 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12253 declarations.
12254 * archive.cc: Include "mapfile.h".
12255 (Archive::add_symbols): Add mapfile parameter. Change all
12256 callers. Pass mapfile, symbol, and reason to include_member.
12257 (Archive::include_all_members): Add mapfile parameter. Change all
12258 callers.
12259 (Archive::include_member): Add mapfile, sym, and why parameters.
12260 Change all callers. Report inclusion to map file.
12261 * archive.h: Include "fileread.h".
12262 (class Archive): Update declarations.
12263 (Archive::file): New const method.
12264 (class Add_archive_symbols): Add mapfile_ field. Update
12265 constructor. Change all callers.
12266 * readsyms.h (class Read_symbols): Likewise.
12267 (class Finish_group): Likewise.
12268 (class Read_script): Likewise.
12269 * common.cc: Include "mapfile.h".
12270 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12271 all callers.
12272 (Symbol_table::do_allocate_commons): Likewise.
12273 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12274 symbol allocation to mapfile.
12275 * common.h (class Allocate_commons_task): Add mapfile_ field.
12276 Update constructor. Change all callers.
12277 * symtab.h (class Symbol_table): Update declarations.
12278 * layout.cc: Include "mapfile.h".
12279 (Layout_task_runner::run): Print information to mapfile.
12280 (Layout::create_gold_note): Change Output_data_fixed_space to
12281 Output_data_zero_fill.
12282 (Layout::create_build_id): Likewise.
12283 (Layout::print_to_mapfile): New function.
12284 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12285 constructor. Change caller.
12286 (class Layout): Declare print_to_mapfile.
12287 * output.cc (Output_section::Input_section::print_to_mapfile): New
12288 function.
12289 (Output_section::add_input_section): If producing a map, always
12290 add to input_sections_ list.
12291 (Output_section::do_print_to_mapfile): New function.
12292 (Output_segment::print_sections_to_mapfile): New function.
12293 (Output_segment::print_section_list_to_mapfile): New function.
12294 * output.h: Include "mapfile.h".
12295 (Output_data::print_to_mapfile): New function.
12296 (Output_data::do_print_to_mapfile): New virtual function.
12297 (Output_segment_headers::do_print_to_mapfile): New function.
12298 (Output_file_header::do_print_to_mapfile): New function.
12299 (Output_data_const::do_print_to_mapfile): New function.
12300 (class Output_data_const_buffer): Add map_name_ field. Update
12301 constructor. Change all callers. Add do_print_to_mapfile
12302 function.
12303 (class Output_data_fixed_space): Likewise.
12304 (class Output_data_space): Likewise.
12305 (class Output_data_zero_fill): New class.
12306 (Output_data_strtab::do_print_to_mapfile): New function.
12307 (Output_data_reloc_base::do_print_to_mapfile): New function.
12308 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12309 (Output_data_group::do_print_to_mapfile): New function.
12310 (Output_data_got::do_print_to_mapfile): New function.
12311 (Output_data_dynamic::do_print_to_mapfile): New function.
12312 (Output_symtab_xindex::do_print_to_mapfile): New function.
12313 (class Output_section): Declare do_print_to_mapflie. Declare
12314 print_to_mapfile in Input_section.
12315 (class Output_segment): Declare new functions.
12316 * object.h (Sized_relobj::symbol_count): New function.
12317 * script-sections.cc
12318 (Output_section_element_dot_assignment::set_section_addresses):
12319 Change Output_data_fixed_space to Output_data_zero_fill.
12320 (Output_data_expression::do_print_to_mapfile): New function.
12321 * script.cc (read_input_script): Add mapfile parameter. Change
12322 all callers.
12323 * script.h (read_input_script): Update declaration.
12324 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12325 (Eh_frame::do_print_to_mapfile): New function.
12326 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12327 (Output_merge_string::do_print_to_mapfile): New function.
12328 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12329 function.
12330 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12331 function.
12332 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12333 function.
12334 * Makefile.am (CCFILES): Add mapfile.cc.
12335 (HFILES): Add mapfile.h.
12336 * Makefile.in: Rebuild.
12337
9f1d377b
ILT
123382008-05-19 Ian Lance Taylor <iant@google.com>
12339
12340 * options.h (class General_options): Add -z relro.
12341 * layout.cc (Layout::Layout): Initialize relro_segment_.
12342 (Layout::add_output_section_data): Return the output section.
12343 (Layout::make_output_section): Rcognize relro sections and mark
12344 them appropriately.
12345 (Layout::attach_allocated_section_to_segment): Put relro sections
12346 in a PT_GNU_RELRO segment.
12347 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12348 section as relro.
12349 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12350 PT_TLS segments.
12351 (Layout::linkonce_mapping): Map d.rel.ro.local to
12352 .data.rel.ro.local.
12353 (Layout::output_section_name): Us .data.rel.ro.local for any
12354 section which begins with that.
12355 * layout.h (class Layout): Update add_output_section_data
12356 declaration. Add relro_segment_ field.
12357 * output.cc (Output_section::Output_section): Initialize is_relro_
12358 and is_relro_local_ fields.
12359 (Output_segment::add_output_section): Group relro sections.
12360 (Output_segment::is_first_section_relro): New function.
12361 (Output_segment::maximum_alignment): If there is a relro section,
12362 align the segment to the common page size.
12363 (Output_segment::set_section_addresses): Track whether we are
12364 looking at relro sections. If the last section is a relro
12365 section, align to the common page size.
12366 (Output_segment::set_section_list_addresses): Add in_relro
12367 parameter. Change all callers. Align to the page size when
12368 moving from relro to non-relro section.
12369 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12370 segment.
12371 * output.h (class Output_section): Add is_relro_ and
12372 is_relro_local_ fields.
12373 (Output_section::is_relro): New function.
12374 (Output_section::set_is_relro): New function.
12375 (Output_section::is_relro_local): New function.
12376 (Output_section::set_is_relro_local): New function.
12377 (class Output_segment): Update declarations.
12378 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12379 * sparc.cc (Target_sparc::got_section): Likewise.
12380 * x86_64.cc (Target_x86_64::got_section): Likewise.
12381 * testsuite/relro_test_main.cc: New file.
12382 * testsuite/relro_test.cc: New file.
12383 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12384 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12385 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12386 (relro_test.so, relro_test_pic.o): New targets.
12387 * testsuite/Makefile.in: Rebuild.
12388
a984ee1d
ILT
123892008-05-16 Ian Lance Taylor <iant@google.com>
12390
01676dcd
ILT
12391 * output.cc (Output_segment::add_output_section): Remove front
12392 parameter.
12393 * output.h (class Output_segment): Remove
12394 add_initial_output_section and overloaded add_output_section.
12395 Update declaration of remaining add_output_section.
12396 * layout.cc (Layout::create_interp): Call add_output_section
12397 rather than add_initial_output_section.
12398 (Layout::finish_dynamic_section): Likewise.
12399
497897f9
ILT
12400 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12401 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12402 know the dynamic type.
12403 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12404 field. Initialize it in constructor.
12405 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12406 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12407 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12408 reloc.
12409
a984ee1d
ILT
12410 * output.cc (Output_reloc::get_address): Change return type to
12411 Elf_Addr.
12412 * output.h (class Output_reloc): Update get_address declaration.
12413 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12414 for section addresses.
12415
55ba0940
ILT
124162008-05-09 Ian Lance Taylor <iant@google.com>
12417
12418 PR 6493
12419 * gold.cc (gold_nomem): Use return value of write.
12420
75517b77
ILT
124212008-05-08 Ian Lance Taylor <iant@google.com>
12422
12423 * symtab.c (Symbol::init_base_output_data): Add version
12424 parameter. Change all callers.
12425 (Symbol::init_base_output_segment): Likewise.
12426 (Symbol::init_base_constant): Likewise.
12427 (Symbol::init_base_undefined): Likewise.
12428 (Sized_symbol::init_output_data): Likewise.
12429 (Sized_symbol::init_output_segment): Likewise.
12430 (Sized_symbol::init_constant): Likewise.
12431 (Sized_symbol::init_undefined): Likewise.
12432 (Symbol_table::do_define_in_output_data): If the new symbol has a
12433 version, mark it as the default.
12434 (Symbol_table::do_define_in_output_segment): Likewise.
12435 (Symbol_table::do_define_as_constant): Likewise.
12436 * symtab.h (class Symbol): Update declarations.
12437 (class Sized_symbol): Likewise.
12438 * resolve.cc (Symbol::override_version): New function.
c42e122e 12439 (Symbol::override_base): Call override_version.
75517b77
ILT
12440 (Symbol::override_base_with_special): Likewise.
12441 * testsuite/ver_script_8.script: New file.
12442 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12443 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12444 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12445 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12446
f1f70eae
ILT
124472008-05-06 Ian Lance Taylor <iant@google.com>
12448
f3e9c5c5
ILT
12449 PR 6049
12450 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12451 functions.
12452 (class General_options): Remove existing --undefined, and add
12453 --no-undefined instead. Add new --undefined as synonym for -u.
12454 * archive.cc (Archive::add_symbols): Check whether symbol was
12455 named with -u.
12456 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12457 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12458 all uses. Add IS_UNDEFINED. Update declarations to split
12459 different versions of init_base. Declare init_base_undefined.
12460 (Symbol::is_defined): Handle IS_UNDEFINED.
12461 (Symbol::is_undefined): Likewise.
12462 (Symbol::is_weak_undefined): Call is_undefined.
12463 (Symbol::is_absolute): Handle IS_CONSTANT.
12464 (class Sized_symbol): Update declarations to split different
12465 versions of init. Declare init_undefined.
12466 (class Symbol_table): Declare new functions.
12467 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12468 Change all callers.
12469 (Symbol::init_base_output_data): Likewise.
12470 (Symbol::init_base_output_segment): Likewise.
12471 (Symbol::init_base_constant): Likewise.
12472 (Symbol::init_base_undefined): New function.
12473 (Sized_symbol::init_object): Rename from init. Change all
12474 callers.
12475 (Sized_symbol::init_output_data): Likewise.
12476 (Sized_symbol::init_output_segment): Likewise.
12477 (Sized_symbol::init_constant): Likewise.
12478 (Sized_symbol::init_undefined): New function.
12479 (Symbol_table::add_undefined_symbols_from_command_line): New
12480 function.
12481 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12482 function.
12483 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12484 (Symbol::output_section): Likewise.
12485 (Symbol::set_output_section): Likewise.
12486 (Symbol_table::sized_finalize_symbol): Likewise.
12487 (Symbol_table::sized_write_globals): Likewise.
12488 * resolve.cc (Symbol_table::should_override): Likewise.
12489 (Symbol::override_base_with_special): Likewise.
12490
8bdcdf2c
ILT
12491 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12492 symbol, change it to have default visibility.
12493 * testsuite/protected_1.cc: New file.
12494 * testsuite/protected_2.cc: New file.
12495 * testsuite/protected_3.cc: New file.
12496 * testsuite/protected_main_1.cc: New file.
12497 * testsuite/protected_main_2.cc: New file.
12498 * testsuite/protected_main_3.cc: New file.
12499 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12500 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12501 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12502 (protected_1.so): New target.
12503 (protected_1_pic.o, protected_2_pic.o): New targets.
12504 (protected_3_pic.o): New target.
12505 (check_PROGRAMS): Add protected_2.
12506 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12507 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12508 * testsuite/Makefile.in: Rebuild.
12509
2b706932
ILT
12510 * options.h (DEFINE_var): Add set_user_set_##varname__.
12511 (DEFINE_bool_alias): New macro.
12512 (class General_options): Define -Bstatic using DEFINE_bool_alias
12513 rather than DEFINE_special. Add --undefined as an alias for -z
12514 defs.
12515 * options.cc (General_options::parse_Bstatic): Remove.
12516
d82a5bcc
ILT
12517 * options.h (class General_options): Add --fatal-warnings.
12518 * main.cc (main): Implement --fatal-warnings.
12519 * errors.h (Errors::warning_count): New function.
12520
f1f70eae
ILT
12521 * options.h (class General_options): Add -Bsymbolic-functions.
12522 * symtab.h (Symbol::is_preemptible): Check for
12523 -Bsymbolic-functions.
12524
8825ac63
ILT
125252008-05-05 Ian Lance Taylor <iant@google.com>
12526
d98bc257
ILT
12527 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12528 as noVARNAME rather than no-VARNAME.
12529 (class General_options): Add option -z combreloc.
12530 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12531 get_address.
12532 (Output_reloc::sort_before) [SHT_REL]: New function.
12533 (Output_reloc::sort_before) [SHT_RELA]: New function.
12534 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12535 Sort_relocs_comparison.
12536 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12537 parameter. Change all callers.
12538 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12539 sort_relocs parameter. Change all callers.
12540 * output.cc (Output_reloc::get_address): New function, broken out
12541 of write_rel.
12542 (Output_reloc::write_rel): Call it.
12543 (Output_reloc::compare): New function.
12544 (Output_data_reloc_base::do_write): Optionally sort relocs.
12545
60b2b4e7
ILT
12546 * configure.ac: If targ_extra_obj is set, link it in.
12547 * configure.tgt: Initialize all variables.
12548 (x86_64*): Set targ_extra_obj and targ_extra_size.
12549 * configure: Rebuild.
12550
8825ac63
ILT
12551 * object.cc (Sized_relobj::include_section_group): Adjust section
12552 indexes read from group data. Build vector to pass to
12553 layout_group.
12554 * layout.cc (Layout::layout_group): Add flags and shndxes
12555 parameters. Remove contents parameter. Change caller. Update
12556 explicit instantiations.
12557 * layout.h (class Layout): Update layout_group declaration.
12558 * output.cc (Output_data_group::Output_data_group): Add flags and
12559 input_shndxes parameters. Remove contents parameter. Change
12560 caller.
12561 (Output_data_group::do_write): Change input_sections_ to
12562 input_shndxes_.
12563 * output.h (class Output_data_group): Update constructor
12564 declaration. Rename input_sections_ to input_shndxes_.
12565 * testsuite/many_sections_test.cc: Add template.
12566
e94cf127
CC
125672008-04-30 Cary Coutant <ccoutant@google.com>
12568
4418b2d5
CC
12569 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12570
e94cf127
CC
12571 * layout.cc (Layout::include_section): Refactored check for debug
12572 info section.
12573 (Layout::add_comdat): Add new parameters. Change type
12574 of signature parameter. Add object and shndx to signatures table.
12575 (Layout::find_kept_object): New function.
12576 * layout.h: Include <cstring>.
12577 (Layout::is_debug_info_section): New function.
12578 (Layout::add_comdat): Add new parameters.
12579 (Layout::find_kept_object): New function.
12580 (Layout::Kept_section): New struct.
12581 (Layout::Signatures): Change type of map range.
12582 * object.cc (Relobj::output_section_address): New function.
12583 (Sized_relobj::include_section_group): Add new parameters. Change
12584 calls to Layout::add_comdat. Change to build table of kept comdat
12585 groups and table mapping discarded sections to kept sections.
12586 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12587 (Sized_relobj::do_layout): Change calls to include_section_group and
12588 include_linkonce_section.
12589 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12590 value to zero when section is discarded.
12591 (Sized_relobj::map_to_kept_section): New function.
12592 * object.h (Relobj::output_section_address): New function.
12593 (Relobj::Comdat_group): New type.
12594 (Relobj::find_comdat_group): New function.
12595 (Relobj::Comdat_group_table): New type.
12596 (Relobj::Kept_comdat_section): New type.
12597 (Relobj::Kept_comdat_section_table): New type.
12598 (Relobj::add_comdat_group): New function.
12599 (Relobj::set_kept_comdat_section): New function.
12600 (Relobj::get_kept_comdat_section): New function.
12601 (Relobj::comdat_groups_): New field.
12602 (Relobj::kept_comdat_sections_): New field.
12603 (Symbol_value::input_value): Update comment.
12604 (Sized_relobj::map_to_kept_section) New function.
12605 (Sized_relobj::include_linkonce_section): Add new parameter.
12606 * target-reloc.h (Comdat_behavior): New type.
12607 (get_comdat_behavior): New function.
12608 (relocate_section): Add code to map a discarded section to the
12609 corresponding kept section when applying a relocation.
12610
e4e5049b
CS
126112008-04-30 Craig Silverstein <csilvers@google.com>
12612
12613 * dwarf_reader.cc (next_generation_count): New static var.
12614 (Addr2line_cache_entry): New struct.
12615 (addr2line_cache): New static var.
12616 (Dwarf_line_info::one_addr2line): Added caching.
12617 (Dwarf_line_info::clear_addr2line_cache): New function.
12618 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12619 cache-size parameter.
12620 (Dwarf_line_info::one_addr2line_cache): New function.
12621 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12622 new cache-size argument to one_addr2line(), and clear cache.
12623
d09e9154
CC
126242008-04-28 Cary Coutant <ccoutant@google.com>
12625
12626 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12627 R_386_PC8 relocations.
12628
7ef73768
ILT
126292008-04-23 Ian Lance Taylor <iant@google.com>
12630
55438702
ILT
12631 * object.cc (Sized_relobj::include_section_group): Check for
12632 invalid section group.
12633
c165fb93
ILT
12634 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12635 header size.
12636
7ef73768
ILT
12637 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12638 than read for file header.
12639 * archive.cc (Archive::include_member): Likewise.
12640
6194aaab
L
126412008-04-23 Paolo Bonzini <bonzini@gnu.org>
12642
12643 * aclocal.m4: Regenerate.
12644 * configure: Regenerate.
12645
d491d34e
ILT
126462008-04-19 Ian Lance Taylor <iant@google.com>
12647
5ea2bac6
ILT
12648 * version.cc (version_string): Bump to 1.6.
12649
7bc3e21a
ILT
12650 * testsuite/Makefile.am (many_sections_r_test): New target.
12651 (many_sections_r_test_SOURCES): Remove.
12652 (many_sections_r_test_DEPENDENCIES): Remove.
12653 (many_sections_r_test_LDFLAGS): Remove.
12654 (many_sections_r_test_LDADD): Remove.
12655
7fcd3aa9
ILT
12656 * object.cc (Sized_relobj::do_add_symbols): Always pass
12657 local_symbol_count_ to add_from_relobj.
12658
4c94d6ae
ILT
12659 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12660 every thousand variables.
12661 * testsuite/Makefile.in: Rebuild.
12662
d491d34e
ILT
12663 * object.cc (Xindex::initialize_symtab_xindex): New function.
12664 (Xindex::read_symtab_xindex): New function.
12665 (Xindex::sym_xindex_to_shndx): New function.
12666 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12667 available.
12668 (Sized_relobj::do_initialize_xindex): New function.
12669 (Sized_relobj::do_read_symbols): Adjust section links.
12670 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12671 parameter. Change all callers.
12672 (Sized_relobj::include_section_group): Adjust section links and
12673 symbol section indexes.
12674 (Sized_relobj::do_layout): Adjust section links.
12675 (Sized_relobj::do_count_local_symbols): Adjust section links and
12676 symbol section indexes.
12677 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12678 ordinary and special symbols.
12679 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12680 dynsym_xindex parameters. Change all callers. Adjust section
12681 links. Use SHN_XINDEX when needed.
12682 (Sized_relobj::get_symbol_location_info): Adjust section links.
12683 Don't get fooled by special symbols.
12684 * object.h (class Xindex): Define.
12685 (class Object): Add xindex_ parameter. Declare virtual functoin
12686 do_initialize_xindex.
12687 (Object::adjust_sym_shndx): New function.
12688 (Object::set_xindex): New protected function.
12689 (class Symbol_value): Add is_ordinary_shndx_ field.
12690 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12691 (Symbol_value::value): Assert ordinary section.
12692 (Symbol_value::initialize_input_to_output_map): Likewise.
12693 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12694 Change all callers.
12695 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12696 all callers.
12697 (class Sized_relobj): Update declarations.
12698 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12699 parameter. Change all callers.
12700 (Sized_relobj::adjust_shndx): New function.
12701 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12702 field.
12703 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12704 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12705 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12706 (Sized_dynobj::read_dynsym_section): Adjust section links.
12707 (Sized_dynobj::read_dynamic): Likewise.
12708 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12709 section links.
12710 (Sized_dynobj::do_initialize_xindex): New function.
12711 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12712 do_initialize_xindex.
12713 (Sized_dynobj::adjust_shndx): New function.
12714 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12715 dynsym_xindex_ fields.
12716 (Layout::finalize): Add a call to set_section_indexes before
12717 creating the symtab sections.
12718 (Layout::set_section_indexes): Don't do anything if the section
12719 already has a section index.
12720 (Layout::create_symtab_sections): Add shnum parameter. Change
12721 caller. Create .symtab_shndx section if needed.
12722 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12723 caller.
12724 (Layout::allocated_output_section_count): New function.
12725 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12726 needed.
12727 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12728 fields. Update declarations.
12729 (Layout::symtab_xindex): New function.
12730 (Layout::dynsym_xindex): New function.
12731 (class Write_symbols_task): Add layout_ field.
12732 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12733 Change caller.
12734 * output.cc (Output_section_headers::Output_section_headers): Add
12735 shstrtab_section parameter. Change all callers.
12736 (Output_section_headers::do_sized_write): Store overflow values
12737 for section count and section string table section index in
12738 section header zero.
12739 (Output_file_header::do_sized_write): Check for overflow of
12740 section count and section string table section index.
12741 (Output_symtab_xindex::do_write): New function.
12742 (Output_symtab_xindex::endian_do_write): New function.
12743 * output.h (class Output_section_headers): Add shstrtab_section_.
12744 Update declarations.
12745 (class Output_symtab_xindex): Define.
12746 (Output_section::has_out_shndx): New function.
12747 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12748 field.
12749 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12750 Change all callers.
12751 (Sized_symbol::init): Likewise.
12752 (Symbol::output_section): Check for ordinary symbol.
12753 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12754 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12755 callers.
12756 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12757 Change all callers. Simplify handling of symbols from sections
12758 not included in the link.
12759 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12760 distinction.
12761 (Weak_alias_sorter::operator()): Assert that symbols are
12762 ordinary.
12763 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12764 distinction.
12765 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12766 parameters. Change all callers.
12767 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12768 symbol distinction. Use SHN_XINDEX when needed.
12769 (Symbol_table::write_section_symbol): Add symtab_xindex
12770 parameter. Change all callers.
12771 (Symbol_table::sized_write_section_symbol): Likewise. Use
12772 SHN_XINDEX when needed.
12773 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12774 declarations.
12775 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12776 (Symbol::is_defined): Check is_ordinary.
12777 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12778 (Symbol::is_absolute, Symbol::is_common): Likewise.
12779 (class Sized_symbol): Update declarations.
12780 (class Symbol_table): Update declarations.
12781 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12782 parameters. Change all callers.
12783 (Sized_symbol::override): Likewise.
12784 (Symbol_table::override): Likewise.
12785 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12786 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12787 is_ordinary, and orig_st_shndx parameters. Change all callers.
12788 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12789 to be in an ordinary section.
12790 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12791 object and is_ordinary parameters. Change all callers.
12792 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12793 Change all callers. Don't add undefined or non-ordinary symbols
12794 to reloc_map_.
12795 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12796 Change all callers.
12797 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12798 declarations.
12799 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12800 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12801 (Sized_relobj::relocate_sections): Likewise.
12802 * target-reloc.h (scan_relocs): Adjust section symbol index.
12803 (scan_relocatable_relocs): Likewise.
12804 * i386.cc (Scan::local): Check for ordinary symbols.
12805 * sparc.cc (Scan::local): Likewise.
12806 * x86_64.cc (Scan::local): Likewise.
12807 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12808 to symbol_section_and_value.
12809 * testsuite/many_sections_test.cc: New file.
12810 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12811 (check_PROGRAMS): Add many_sections_test.
12812 (many_sections_test_SOURCES): Define.
12813 (many_sections_test_DEPENDENCIES): Define.
12814 (many_sections_test_LDFLAGS): Define.
12815 (BUILT_SOURCES): Add many_sections_define.h.
12816 (many_sections_define.h): New target.
12817 (BUILT_SOURCES): Add many_sections_check.h.
12818 (many_sections_check.h): New target.
12819 (check_PROGRAMS): Add many_sections_r_test.
12820 (many_sections_r_test_SOURCES): Define.
12821 (many_sections_r_test_DEPENDENCIES): Define.
12822 (many_sections_r_test_LDFLAGS): Define.
12823 (many_sections_r_test_LDADD): Define.
12824 (many_sections_r_test.o): New target.
12825 * testsuite/Makefile.in: Rebuild.
12826
c5818ff1
CC
128272008-04-17 Cary Coutant <ccoutant@google.com>
12828
12829 * errors.cc (Errors::info): New function.
12830 (gold_info): New function.
12831 * errors.h (Errors::info): New function.
12832 * gold.h (gold_info): New function.
12833 * object.cc (Input_objects::add_object): Print trace output.
12834 * options.cc (options::parse_set): New function.
12835 (General_options::parse_wrap): Deleted.
12836 (General_options::General_options): Deleted initializer.
12837 * options.h (options::String_set): New typedef.
12838 (options::parse_set): New function.
12839 (DEFINE_set): New macro.
12840 (General_options::wrap): Changed to use DEFINE_set. Changed
12841 callers of any_wrap_symbols and is_wrap_symbol.
12842 (General_options::trace, General_options::trace_symbol):
12843 New options.
12844 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12845 (General_options::wrap_symbols_): Deleted.
12846 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12847
b5be4a7c
DM
128482008-04-17 David S. Miller <davem@davemloft.net>
12849
12850 * options.cc (General_options::parse_V): New function.
12851 * options.h: Add entries for -V and -Qy.
12852
155a0dd7
ILT
128532008-04-17 Ian Lance Taylor <iant@google.com>
12854
12855 * common.cc (Symbol_table::allocate_commons): Remove options
12856 parameter. Change caller.
12857 (Symbol_table::do_allocate_commons): Remove options parameter.
12858 Change caller. Just call do_allocate_commons_list twice.
12859 (Symbol_table::do_allocate_commons_list): New function, broken out
12860 of do_allocate_commons.
12861 * common.h (class Allocate_commons_task): Remove options_ field.
12862 Update constructor.
12863 * symtab.cc (Symbol_table::Symbol_table): Initialize
12864 tls_commons_.
12865 (Symbol_table::add_from_object): Put TLS common symbols on
12866 tls_commons_ list.
12867 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12868 which are IN_OUTPUT_DATA.
12869 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12870 allocate_commons and do_allocate_commons declarations. Declare
12871 do_allocate_commons_list.
12872 * gold.cc (queue_middle_tasks): Update creation of
12873 Allocate_commons_task to not pass options.
12874 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12875 (TLS_TEST_C_FLAGS): New variable.
12876 (tls_test_c_pic.o): New target.
12877 (tls_test_shared.so): Link in tls_test_c_pic.o.
12878 (tls_test_c_pic_ie.o): New target.
12879 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12880 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12881 (tls_test_c.o): New target.
12882 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12883 (tls_pic_test_LDADD): Likewise.
12884 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12885 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12886 (tls_test_c_gnu2.o): New target.
12887 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12888 tls_test_c_gnu2.o.
12889 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12890 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12891 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12892 * testsuite/tls_test.cc: Include "config.h".
12893 (t_last): Call t11_last.
12894 * testsuite/tls_test.h (t11, t11_last): Declare.
12895 * testsuite/tls_test_c.c: New file.
12896 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12897 * configure.ac: Check for OpenMP support.
12898 * configure, config.in, Makefile.in: Rebuild.
12899 * testsuite/Makefile.in: Rebuild.
12900
edfbb029
CC
129012008-04-16 Cary Coutant <ccoutant@google.com>
12902
12903 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12904 (Target_i386::tls_base_symbol_defined_): New field.
12905 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12906 (Target_i386::Scan::global): Likewise.
12907 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12908 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12909 (Target_x86_64::tls_base_symbol_defined_): New field.
12910 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12911 (Target_x86_64::Scan::global): Likewise.
12912
f3c69fca
CC
129132008-04-16 Cary Coutant <ccoutant@google.com>
12914
12915 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12916 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12917 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12918 building shared libraries.
12919 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12920 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12921 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12922 * testsuite/Makefile.in: Rebuild.
12923 * testsuite/weak_undef.h: New file.
12924 * testsuite/weak_undef_file1.cc: Add extra test cases.
12925 * testsuite/weak_undef_file2.cc: Likewise.
12926 * testsuite/weak_undef_test.cc: Likewise.
12927
7c414435
DM
129282008-04-16 David S. Miller <davem@davemloft.net>
12929
32b769e1
DM
12930 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12931 Add issued_non_pic_error_ field. Declare check_non_pic.
12932 (Target_sparc::Scan::check_non_pic): New function.
12933 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12934 (Target_sparc::Scan::global): Likewise.
12935
11936fb1
DM
12936 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12937 * configure: Rebuild.
12938
7c414435
DM
12939 * options.h (DEFINE_enable): New macro.
12940 (new_dtags): New enable option.
12941 (initfirst, interpose, loadfltr, nodefaultlib,
12942 nodelete, nodlopen, nodump): New -z options.
12943 * layout.cc (Layout:finish_dynamic_section): If new
12944 dtags enabled, emit DT_RUNPATH. Also, emit a
12945 DT_FLAGS_1 containing any specified -z flags.
12946
85c7bf8b
ILT
129472008-04-16 Ian Lance Taylor <iant@google.com>
12948
12c0daef
ILT
12949 * copy-relocs.cc: New file.
12950 * copy-relocs.h: New file.
12951 * reloc.cc: Remove Copy_relocs code.
12952 * reloc.h: Likewise.
12953 * reloc-types.h (struct Reloc_types) [both versions]: Add
12954 get_reloc_addend_noerror.
12955 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12956 variants of add_global which take an addend which must be zero.
12957 * i386.cc: Include "copy-relocs.h".
12958 (class Target_i386): Change type of copy_relocs_ to variable,
12959 update initializer.
12960 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12961 Change all callers.
12962 (Target_i386::do_finalize_sections): Change handling of
12963 copy_relocs_.
12964 * sparc.cc: Include "copy-relocs.h".
12965 (class Target_sparc): Change type of copy_relocs_ to variable,
12966 update initializer.
12967 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12968 Change all callers.
12969 (Target_sparc::do_finalize_sections): Change handling of
12970 copy_relocs_.
12971 * x86_64.cc: Include "copy-relocs.h".
12972 (class Target_x86_64): Change type of copy_relocs_ to variable,
12973 update initializer.
12974 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12975 class. Change all callers.
12976 (Target_x86_64::do_finalize_sections): Change handling of
12977 copy_relocs_.
12978 * Makefile.am (CCFILES): Add copy-relocs.cc.
12979 (HFILES): Add copy-relocs.h.
12980
4f4995b6
ILT
12981 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12982
85c7bf8b
ILT
12983 * testsuite/script_test_4.sh: Permit leading zeroes.
12984
4f2a9edd
ILT
129852008-04-15 Ian Lance Taylor <iant@google.com>
12986
e6188289
ILT
12987 * script-sections.cc (Script_sections::create_segments): Use
12988 header_size_adjustment even when there is enough room for the
12989 headers.
12990 * testsuite/script_test_4.sh: New file.
12991 * testsuite/script_test_4.t: New file.
12992 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12993 (check_DATA): Add script_test_4.stdout.
12994 (MOSTLYCLEANFILES): Likewise.
12995 (script_test_4): New target.
12996 (script_test_4.stdout): New target.
12997 * testsuite/Makefile.in: Rebuild.
12998
4f2a9edd
ILT
12999 * sparc.cc: Add definitions for Output_data_plt_sparc class
13000 constants.
13001
f5314dd5
DM
130022008-04-14 David S. Miller <davem@davemloft.net>
13003
13004 * sparc.cc: New file.
13005 * Makefile.am (TARGETSOURCES): Add sparc.cc
13006 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
13007 * configure.tgt: Document targ_extra_size and
13008 targ_extra_big_endian. Add entries for sparc-* and
13009 sparc64-*.
13010 * configure.ac: Handle targ_extra_size and
13011 targ_extra_big_endian.
13012 * Makefile.in: Rebuild.
13013 * configure: Likewise.
13014 * po/POTFILES.in: Likewise.
13015 * po/gold.pot: Likewise.
13016
154e0e9a
ILT
130172008-04-14 Ian Lance Taylor <iant@google.com>
13018
13019 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
13020 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
13021 in the name/type/flags to section mapping. Don't call
13022 allocate_output_section.
13023 (Layout::choose_output_section): Change parameter from adjust_name
13024 to is_input_section. Don't permit input sections after sections
13025 are attached to segments. Don't call allocate_output_section.
13026 (Layout::layout_eh_frame): Call update_flags_for_input_section,
13027 not write_enable_output_section.
13028 (Layout::make_output_section): Don't push to
13029 unattached_section_list_ nor call attach_to_segment. Call
13030 attach_section_to_segment if sections are attached.
13031 (Layout::attach_sections_to_segments): New function.
13032 (Layout::attach_section_to_segment): New function.
13033 (Layout::attach_allocated_section_to_segment): Rename from
13034 attach_to_segment. Remove flags parameter.
13035 (Layout::allocate_output_section): Remove function.
13036 (Layout::write_enable_output_section): Remove function.
13037 * layout.h (class Layout): Update for above changes. Add new
13038 field sections_are_attached_.
13039 * output.h (Output_section::update_flags_for_input_section): New
13040 function.
13041 * output.cc (Output_section::add_input_section): Call
13042 update_flags_for_input_section.
13043 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
13044
009a67a2
CC
130452008-04-11 Cary Coutant <ccoutant@google.com>
13046
13047 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
13048 thought unnecessary.
13049 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
13050
759b1a24
ILT
130512008-04-11 Ian Lance Taylor <iant@google.com>
13052
13053 * output.h (class Output_section_data): Remove inline definition
13054 of set_addralign.
13055 * output.cc (Output_section_data::set_addralign): New function.
13056
c2b45e22
CC
130572008-04-11 Cary Coutant <ccoutant@google.com>
13058
13059 Add support for TLS descriptors for i386 and x86_64.
13060 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
13061 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
13062 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
13063 GOT_TYPE_TLS_DESC.
13064 (Target_i386::got_mod_index_entry): Remove unnecessary code.
13065 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
13066 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
13067 relocations.
13068 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
13069 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
13070 Fix problem with initial-exec relocations.
13071 (Target_i386::Relocate::relocate_tls): Likewise.
13072 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
13073 relaxation.
13074 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
13075 support for section-plus-offset dynamic table entries.
13076 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
13077 (Output_data_dynamic::Dynamic_entry): Add support for
13078 section-plus-offset dynamic table entries.
13079 (Output_data_dynamic::Classification): Likewise.
13080 (Output_data_dynamic::classification_): Renamed offset_.
13081 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
13082 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
13083 (Target_x86_64::make_plt_section): New function.
13084 (Target_x86_64::reserve_tlsdesc_entries): New function.
13085 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
13086 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
13087 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
13088 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
13089 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
13090 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
13091 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
13092 add extra PLT entry for TLS descriptors.
13093 (Output_data_plt_x86_64::got_): New field.
13094 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13095 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13096 fields.
13097 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13098 descriptors.
13099 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13100 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13101 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13102 R_386_TLS_DESC_CALL relocations.
13103 (Target_x86_64::Scan::global): Likewise.
13104 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13105 for TLS descriptors.
13106 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13107 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13108 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13109 GD-to-IE relaxation.
13110 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13111 and TLS_DESCRIPTORS.
13112 * Makefile.in: Rebuild.
13113 * configure: Rebuild.
13114 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13115 (tls_test_shared2.so): New target.
13116 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13117 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13118 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13119 (tls_shared_gd_to_ie_test_LDADD): New variable.
13120 (tls_shared_gnu2_gd_to_ie_test): New target.
13121 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13122 New targets.
13123 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13124 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13125 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13126 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13127 (tls_shared_gnu2_test): New target.
13128 (tls_test_gnu2_shared.so): New target.
13129 (tls_shared_gnu2_test_SOURCES): New variable.
13130 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13131 (tls_shared_gnu2_test_LDFLAGS): New variable.
13132 (tls_shared_gnu2_test_LDADD): New variable.
13133 * testsuite/Makefile.in: Rebuild.
13134 * testsuite/Makefile.
13135
83bfb6b7
ILT
131362008-04-11 Ian Lance Taylor <iant@google.com>
13137
13138 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13139 justsyms.t.
13140 * testsuite/Makefile.in: Rebuild.
13141
13142 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13143 long.
13144 * testsuite/script_test_2.cc (main): Adjust test.
13145
706e1f5e
ILT
131462008-04-11 David S. Miller <davem@davemloft.net>
13147 Ian Lance Taylor <iant@google.com>
13148
13149 * options.h (General_options): Add entries for '-Y' and
13150 '-relax'.
13151 * options.cc (General_options:finalize): If -Y was used, add those
13152 entries to the library path instead of the default "/lib" and
13153 "/usr/lib".
13154
7c98e6bb
DM
131552008-04-11 David S. Miller <davem@davemloft.net>
13156
13157 * testsuite/justsyms.t: Start at 0x100.
13158 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13159 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13160 long.
13161 * testsuite/script_test_2.cc: Adjust string and section length
13162 checks.
7c98e6bb 13163
99a37bfd
ILT
131642008-04-09 Ian Lance Taylor <iant@google.com>
13165
2cefc357
ILT
13166 PR gold/5996
13167 * script-sections.cc (Sections_element::allocate_to_segment): Add
13168 orphan parameter.
13169 (Output_section_definition::allocate_to_segment): Likewise.
13170 (Orphan_output_section::allocate_to_segment): Likewise.
13171 (Script_sections::attach_sections_using_phdrs_clause): Don't
13172 propagate non-PT_LOAD segments to orphan sections.
13173 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13174 readelf rather than objdump.
13175 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13176 .interp section and PT_INTERP segment are the same size.
13177 * testsuite/Makefile.in: Rebuild.
13178
99a37bfd
ILT
13179 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13180 aliases for symbols defined in the same object.
13181 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13182 (weak_alias_test_SOURCES): New variable.
13183 (weak_alias_test_DEPENDENCIES): New variable.
13184 (weak_alias_test_LDFLAGS): New variable.
13185 (weak_alias_test_LDADD): New variable.
13186 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13187 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13188 (weak_alias_test_3.o): New target.
13189 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13190 * testsuite/weak_alias_test_main.cc: New file.
13191 * testsuite/weak_alias_test_1.cc: New file.
13192 * testsuite/weak_alias_test_2.cc: New file.
13193 * testsuite/weak_alias_test_3.cc: New file.
13194
780e49c5
ILT
131952008-04-08 Ian Lance Taylor <iant@google.com>
13196
cdb0b8f5
ILT
13197 * options.h (class General_options): Add --noinhibit-exec option.
13198 * main.cc (main): Check --noinhibit-exec.
13199
0864d551
ILT
13200 * options.h (class General_options): Define --wrap as a special
13201 option. Add wrap_symbols_ field.
13202 (General_options::any_wrap_symbols): New function.
13203 (General_options::is_wrap_symbol): New function.
13204 * options.cc (General_options::parse_wrap): New function.
13205 (General_options::General_options): Initialize wrap_symbols_.
13206 * symtab.cc (Symbol_table::wrap_symbol): New function.
13207 (Symbol_table::add_from_object): Handle --wrap.
13208 * symtab.h (class Symbol_table): Declare wrap_symbol.
13209 * target.h (Target::wrap_char): New function.
13210 (Target::Target_info): Add wrap_char field.
13211 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13212 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13213 * testsuite/testfile.cc (Target_test::test_target_info):
13214 Likewise.
13215
789aa6de
ILT
13216 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13217 there is one.
13218
2c38906f
ILT
13219 * layout.h (class Layout): Add added_eh_frame_data_ field.
13220 * layout.cc (Layout::Layout): Initialize new field.
13221 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13222 output section until we find a section we merged successfully.
13223 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13224 that the size be non-zero.
13225
780e49c5
ILT
13226 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13227 qualifier.
13228
7fcd0256
ILT
132292008-04-08 Craig Silverstein <csilvers@google.com>
13230
13231 * configure.ac: Export new conditional variable HAVE_ZLIB.
13232 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13233 on HAVE_ZLIB.
13234 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13235 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13236
6835af53
ILT
132372008-04-07 Ian Lance Taylor <iant@google.com>
13238
e24f324c
ILT
13239 * version.cc (version_string): Set to "1.5".
13240
a036edd8
ILT
13241 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13242 Add issued_non_pic_error_ field. Declare check_non_pic.
13243 (Target_x86_64::Scan::check_non_pic): New function.
13244 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13245 (Target_x86_64::Scan::global): Likewise.
13246
624f8810
ILT
13247 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13248 addend parameter. Change caller. Handle merge sections.
13249 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13250 Address to Addend. Don't add in the result of
13251 local_section_offset, pass down the addend and use the returned
13252 value.
13253 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13254 Update declarations of local_section_offset and symbol_value.
13255 * testsuite/two_file_test_1.cc (t18): New function.
13256 * testsuite/two_file_test_2.cc (f18): New function.
13257 * testsuite/two_file_test_main.cc (main): Call t18.
13258 * testsuite/two_file_test.h (t18, f18): Declare.
13259
6835af53
ILT
13260 * configure.ac: Don't test for objdump, c++filt, or readelf.
13261 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13262 conditionals.
13263 (TEST_READELF): New variable.
13264 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13265 (check_PROGRAMS): Add two_file_strip_test.
13266 (two_file_strip_test): New target.
13267 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13268 (two_file_same_shared_strip_test_SOURCES): New variable.
13269 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13270 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13271 (two_file_same_shared_strip_test_LDADD): New variable.
13272 (two_file_shared_strip.so): New target.
13273 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13274 (ver_test_5.syms, ver_test_7.syms): Likewise.
13275 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13276 (strip_test_3.stdout): Use TEST_OBJDUMP.
13277 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13278
86925eef
CC
132792008-04-04 Cary Coutant <ccoutant@google.com>
13280
13281 * symtab.h (Symbol::is_weak_undefined): New function.
13282 (Symbol::is_strong_undefined): New function.
13283 (Symbol::is_absolute): New function.
13284 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13285 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13286 absolute symbols.
13287 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13288 (weak_undef_test): New target.
13289 * testsuite/Makefile.in: Rebuild.
13290 * testsuite/weak_undef_file1.cc: New file.
13291 * testsuite/weak_undef_file2.cc: New file.
13292 * testsuite/weak_undef_test.cc: New file.
13293
126f3ece
ILT
132942008-04-03 Craig Silverstein <csilvers@google.com>
13295
13296 * compressed_output.h (class Output_compressed_section): Use
13297 unsigned buffer.
13298 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13299 add zlib header.
13300 (zlib_compressed_suffix): Removed.
13301 (Output_compressed_section::set_final_data_size): Use unsigned
13302 buffers.
13303 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13304 Fix linker invocation.
13305 (flagstest_o_specialfile_and_compress_debug_sections):
13306 Likewise.
13307 * testsuite/Makefile.in: Regenerated.
13308
deae2a14
DM
133092008-04-02 David S. Miller <davem@davemloft.net>
13310
13311 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13312 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13313
70752818
ILT
133142008-04-02 Craig Silverstein <csilvers@google.com>
13315
13316 * TODO: New file.
13317
39d0cb0e
ILT
133182008-04-02 Ian Lance Taylor <iant@google.com>
13319
13320 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13321 parameters. Update for new key type to views_. Change all
13322 callers.
13323 (File_read::read): Adjust for byteshift in returned view.
13324 (File_read::add_view): New function, broken out of
13325 find_and_make_view.
13326 (File_read::make_view): New function, broken out of
13327 find_and_make_view.
13328 (File_read::find_or_make_view): Add offset and aligned
13329 parameters. Rewrite accordingly. Change all callers.
13330 (File_read::get_view): Add offset and aligned parameters. Adjust
13331 for byteshift in return value.
13332 (File_read::get_lasting_view): Likewise.
13333 * fileread.h (class File_read): Update declarations.
13334 (class File_read::View): Add byteshift_ field. Add byteshift to
13335 constructor. Add byteshift method.
13336 * archive.h (Archive::clear_uncached_views): New function.
13337 (Archive::get_view): Add aligned parameter. Change all callers.
13338 * object.h (Object::get_view): Add aligned parameter. Change all
13339 callers.
13340 (Object::get_lasting_view): Likewise.
13341
13342 * fileread.cc (File_read::release): Don't call clear_views if
13343 there are multiple objects.
13344 * fileread.h (File_read::clear_uncached_views): New function.
13345 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13346 on the archive.
13347
a1207466
CC
133482008-03-31 Cary Coutant <ccoutant@google.com>
13349
13350 Add thin archive support.
13351 * archive.cc (Archive::armagt): New const.
13352 (Archive::setup): Remove task parameter and calls to unlock.
13353 (Archive::unlock_nested_archives): New function.
13354 (Archive::read_header): Add nested_off parameter. Change
13355 all callers.
13356 (Archive::interpret_header): Likewise.
13357 (Archive::include_all_members): Change to handle thin
13358 archives.
13359 (Archive::include_member): Likewise.
13360 * archive.h (Archive::Archive): Add new parameters and
13361 initializers.
13362 (Archive::armagt): New const.
13363 (Archive::setup): Remove task parameter.
13364 (Archive::unlock_nested_archives): New function.
13365 (Archive::read_header): Add nested_off parameter.
13366 (Archive::interpret_header): Likewise.
13367 (Archive::Nested_archive_table): New typedef.
13368 (Archive::is_thin_archive_): New field.
13369 (Archive::nested_archives_): New field.
13370 (Archive::options_): New field.
13371 (Archive::dirpath_): New field.
13372 (Archive::task_): New field.
13373 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13374 for thin archives. Pass additional parameters to
13375 Archive::Archive. Unlock the archive file after calling
13376 Archive::setup.
cd536b21 13377
479f6503
ILT
133782008-03-29 Ian Lance Taylor <iant@google.com>
13379
686c8caf
ILT
13380 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13381 version symbol to be local.
13382 * testsuite/ver_test_4.sh: New file.
13383 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13384 (check_DATA): Add ver_test_4.syms.
13385 (ver_test_4.syms): New target.
13386 * testsuite/Makefile.in: Rebuild.
13387
ab794b6b
ILT
13388 * output.cc
13389 (Output_section::Input_section_sort_entry::has_priority): New
13390 function.
13391 (Output_section::Input_section_sort_entry::match_file_name): New
13392 function.
13393 (Output_section::Input_section_sort_entry::match_section_name):
13394 Remove.
13395 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13396 Remove.
13397 (Output_section::Input_section_sort_entry::match_section_file):
13398 Remove.
13399 (Output_section::Input_section_sort_compare::operator()): Rewrite
13400 using new Input_section_sort_entry functions. Sort crtbegin and
13401 crtend first. Sort sections with no priority before sections with
13402 a priority.
13403 * testsuite/initpri1.c (d3): Check j != 4.
13404 (cd5): New constructor/destructor function.
13405 (main): Check j != 2.
13406
479f6503
ILT
13407 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13408 new symbol when resolving, don't call set_is_default.
13409 * testsuite/ver_test_7.cc: New file.
13410 * testsuite/ver_test_7.sh: New file.
13411 * testsuite/Makefile.am (ver_test_7.so): New target.
13412 (ver_test_7.o): New target.
13413 (check_SCRIPTS): Add ver_test_7.sh.
13414 (check_DATA): Add ver_test_7.syms.
13415 (ver_test_7.syms): New target.
13416
2fd32231
ILT
134172008-03-28 Ian Lance Taylor <iant@google.com>
13418
13419 * layout.cc (Layout::layout): If we see an input section with a
13420 name that needs sorting, set the must_sort flag for the output
13421 section.
13422 (Layout::make_output_section): If the name of the output section
13423 indicates that it might require sorting, set the may_sort flag.
13424 * output.h (Output_section::may_sort_attached_input_sections): New
13425 function.
13426 (Output_section::set_may_sort_attached_input_sections): New
13427 function.
13428 (Output_section::must_sort_attached_input_sections): New
13429 function.
13430 (Output_section::set_must_sort_attached_input_sections): New
13431 function.
13432 (class Output_section): Declare Input_section_sort_entry. Define
13433 Input_section_sort_compare. Declare
13434 sort_attached_input_sections. Add new fields:
13435 may_sort_attached_input_sections_,
13436 must_sort_attached_input_sections_,
13437 attached_input_sections_are_sorted_.
13438 * output.cc (Output_section::Output_section): Initialize new
13439 fields.
13440 (Output_section::add_input_section): Add an entry to
13441 input_sections_ if may_sort or must_sort are true.
13442 (Output_section::set_final_data_size): Call
13443 sort_attached_input_sections if necessary.
13444 (Output_section::Input_section_sort_entry): Define new class.
13445 (Output_section::Input_section_sort_compare::operator()): New
13446 function.
13447 (Output_section::sort_attached_input_sections): New function.
13448 * configure.ac: Check whether the compiler supports constructor
13449 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13450 * testsuite/initpri1.c: New file.
13451 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13452 CONSTRUCTOR_PRIORITY.
13453 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13454 (initpri1_LDFLAGS): New variable.
13455 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13456
18e6b24e
ILT
134572008-03-27 Ian Lance Taylor <iant@google.com>
13458
49bdd526
ILT
13459 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13460 * testsuite/common_test_1.c: New file.
13461 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13462 (common_test_1_SOURCES): New variable.
13463 (common_test_1_DEPENDENCIES): New variable.
13464 (common_test_1_LDFLAGS): New variable.
13465
18e6b24e
ILT
13466 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13467 and commons_ correctly when NAME/VERSION does not override
13468 NAME/NULL.
13469 * testsuite/ver_test_6.c: New file.
13470 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13471 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13472 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13473
04bf7072
ILT
134742008-03-26 Ian Lance Taylor <iant@google.com>
13475
5871526f
ILT
13476 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13477 of an undefined symbol from a version script.
13478 * testsuite/Makefile.am (ver_test_5.so): New target.
13479 (ver_test_5.o): New target.
13480 (check_SCRIPTS): Add ver_test_5.sh.
13481 (check_DATA): Add ver_test_5.syms.
13482 (ver_test_5.syms): New target.
13483 * testsuite/ver_test_5.cc: New file.
13484 * testsuite/ver_test_5.script: New file.
13485 * testsuite/ver_test_5.sh: New file.
13486 * Makefile.in, testsuite/Makefile.in: Rebuild.
13487
04bf7072
ILT
13488 PR gold/5986
13489 Fix problems building gold with gcc 4.3.0.
13490 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13491 (gold_error_at_location, gold_warning_at_location): Use it.
13492 * configure.ac: Check whether we can compile and use a template
13493 function with a printf attribute.
13494 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13495 when jumping over bytes.
13496 * object.cc: Instantiate Object::read_section_data.
13497 * debug.h: Include <cstring>
13498 * dwarf_reader.cc: Include <algorithm>
13499 * main.cc: Include <cstring>.
13500 * options.cc: Include <cstring>.
13501 * output.cc: Include <cstring>.
13502 * script.cc: Include <cstring>.
13503 * script.h: Include <string>.
13504 * symtab.cc: Include <cstring> and <algorithm>.
13505 * target-select.cc: Include <cstring>.
13506 * version.cc: Include <string>.
13507 * testsuite/testmain.cc: Include <cstdlib>.
13508 * configure, config.in: Rebuild.
13509
874c5b28
ILT
135102008-03-25 Ian Lance Taylor <iant@google.com>
13511
819d6c3a
ILT
13512 * options.cc: Include "../bfd/bfdver.h".
13513 (options::help): Print bug reporting address.
13514
f4b2c6f5
ILT
13515 * version.cc (print_version): Adjust output for current value of
13516 BFD_VERSION_STRING.
13517
13518 * NEWS: New file.
13519
e96caa79
ILT
13520 * options.cc (options::help): Print list of supported targets.
13521 * target-select.h: Include <vector>.
13522 (class Target_selector): Make machine_, size_, and is_big_endian_
13523 fields const. Add bfd_name_ and instantiated_target_ fields.
13524 (Target_selector::Target_selector): Add bfd_name parameter.
13525 (Target_selector::recognize): Make non-virtual, call
13526 do_recognize.
13527 (Target_selector::recognize_by_name): Make non-virtual, call
13528 do_recognize_by_name.
13529 (Target_selector::supported_names): New function.
13530 (Target_selector::bfd_name): New function.
13531 (Target_selector::do_instantiate_target): New pure virtual
13532 function.
13533 (Target_selector::do_recognize): New virtual function.
13534 (Target_selector::do_recognize_by_name): New virtual function.
13535 (Target_selector::instantiate_target): New private function.
13536 (supported_target_names): Declare.
13537 * target-select.cc (Target_selector::Target_selector): Update for
13538 new parameter and fields.
13539 (select_target_by_name): Check that the name matches before
13540 calling recognize_by_name.
13541 (supported_target_names): New function.
13542 * i386.cc (class Target_selector_i386): Update Target_selector
13543 constructor call. Remove recognize and recognize_by_name. Add
13544 do_instantiate_target.
13545 * x86_64.cc (class Target_selector_x86_64): Likewise.
13546 * testsuite/testfile.cc (class Target_selector_test): Update for
13547 changes to Target_selector.
13548
874c5b28
ILT
13549 * README: Rewrite, with some notes on unsupported features.
13550
0a65a3a7
CC
135512008-03-24 Cary Coutant <ccoutant@google.com>
13552
13553 * i386.cc (Target_i386::Got_type): New enum declaration.
13554 (Target_i386::Scan::local): Updated callers of Output_data_got
13555 member functions.
13556 (Target_i386::Scan::global): Likewise.
13557 (Target_i386::Relocate::relocate): Likewise.
13558 (Target_i386::Relocate::relocate_tls): Likewise.
13559 * object.h (Got_offset_list): New class.
13560 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13561 (Sized_relobj::local_got_offset): Likewise.
13562 (Sized_relobj::set_local_got_offset): Likewise.
13563 (Sized_relobj::local_has_tls_got_offset): Removed.
13564 (Sized_relobj::local_tls_got_offset): Removed.
13565 (Sized_relobj::set_local_tls_got_offset): Removed.
13566 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13567 * output.cc (Output_data_got::add_global): Added got_type parameter.
13568 (Output_data_got::add_global_with_rel): Likewise.
13569 (Output_data_got::add_global_with_rela): Likewise.
13570 (Output_data_got::add_global_pair_with_rel): New function.
13571 (Output_data_got::add_global_pair_with_rela): New function.
13572 (Output_data_got::add_local): Added got_type parameter.
13573 (Output_data_got::add_local_with_rel): Likewise.
13574 (Output_data_got::add_local_with_rela): Likewise.
13575 (Output_data_got::add_local_pair_with_rel): New function.
13576 (Output_data_got::add_local_pair_with_rela): New function.
13577 (Output_data_got::add_global_tls): Removed.
13578 (Output_data_got::add_global_tls_with_rel): Removed.
13579 (Output_data_got::add_global_tls_with_rela): Removed.
13580 (Output_data_got::add_local_tls): Removed.
13581 (Output_data_got::add_local_tls_with_rel): Removed.
13582 (Output_data_got::add_local_tls_with_rela): Removed.
13583 * output.h (Output_data_got::add_global): Added got_type parameter.
13584 (Output_data_got::add_global_with_rel): Likewise.
13585 (Output_data_got::add_global_with_rela): Likewise.
13586 (Output_data_got::add_global_pair_with_rel): New function.
13587 (Output_data_got::add_global_pair_with_rela): New function.
13588 (Output_data_got::add_local): Added got_type parameter.
13589 (Output_data_got::add_local_with_rel): Likewise.
13590 (Output_data_got::add_local_with_rela): Likewise.
13591 (Output_data_got::add_local_pair_with_rel): New function.
13592 (Output_data_got::add_local_pair_with_rela): New function.
13593 (Output_data_got::add_global_tls): Removed.
13594 (Output_data_got::add_global_tls_with_rel): Removed.
13595 (Output_data_got::add_global_tls_with_rela): Removed.
13596 (Output_data_got::add_local_tls): Removed.
13597 (Output_data_got::add_local_tls_with_rel): Removed.
13598 (Output_data_got::add_local_tls_with_rela): Removed.
13599 * resolve.cc (Symbol::override_base_with_special): Removed
13600 reference to has_got_offset_ field.
13601 * symtab.cc (Symbol::init_fields): Replaced initialization
13602 of got_offset_ with got_offsets_. Removed initialization
13603 of has_got_offset_
53fcba31 13604 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13605 (Symbol::got_offset): Likewise.
13606 (Symbol::set_got_offset): Likewise.
13607 (Symbol::has_tls_got_offset): Removed.
13608 (Symbol::tls_got_offset): Removed.
13609 (Symbol::set_tls_got_offset): Removed.
13610 (Symbol::got_offset_): Removed.
13611 (Symbol::tls_mod_got_offset_): Removed.
13612 (Symbol::tls_pair_got_offset_): Removed.
13613 (Symbol::got_offsets_): New field.
13614 (Symbol::has_got_offset): Removed.
13615 (Symbol::has_tls_mod_got_offset): Removed.
13616 (Symbol::has_tls_pair_got_offset): Removed.
13617 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13618 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13619 member functions.
13620 (Target_x86_64::Scan::global): Likewise.
13621 (Target_x86_64::Relocate::relocate): Likewise.
13622 (Target_x86_64::Relocate::relocate_tls): Likewise.
13623
bd52eafb
BE
136242008-03-25 Ben Elliston <bje@au.ibm.com>
13625
13626 * yyscript.y: Fix spelling error in comment.
13627
8b105e34
ILT
136282008-03-24 Ian Lance Taylor <iant@google.com>
13629
8ed814a9
ILT
13630 * options.h (class General_options): Define build_id option.
13631 * layout.h (class Layout): Declare write_build_id, create_note,
13632 create_build_id. Add build_id_note_ member.
13633 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13634 "libiberty.h", "md5.h", "sha1.h".
13635 (Layout::Layout): Initialize eh_frame_data_,
13636 eh_frame_hdr_section_, and build_id_note_.
13637 (Layout::finalize): Call create_build_id.
13638 (Layout::create_note): New function, broken out of
13639 Layout::create_gold_note.
13640 (Layout::create_gold_note): Call create_note.
13641 (Layout::create_build_id): New function.
13642 (Layout::write_build_id): New function.
13643 (Close_task_runner::run): Call write_build_id.
13644
8b105e34
ILT
13645 * x86_64.cc: Correct license to GPLv3.
13646
086a1841
ILT
136472008-03-23 Ian Lance Taylor <iant@google.com>
13648
13649 * options.cc: Include "demangle.h".
13650 (parse_optional_string): New function.
13651 (parse_long_option): Handle takes_optional_argument.
13652 (parse_short_option): Update dash_z initializer. Handle
13653 takes_optional_argument.
13654 (General_options::General_options): Initialize do_demangle_.
13655 (General_options::finalize): Set do_demangle_. Handle demangling
13656 style.
13657 * options.h (parse_optional_string): Declare.
13658 (struct One_option): Add optional_arg field. Update constructor.
13659 Update call constructor calls. Add takes_optional_argument
13660 function.
13661 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13662 (DEFINE_optional_string): Define.
13663 (General_options::demangle): Change from DEFINE_bool to
13664 DEFINE_optional_string.
13665 (General_options::no_demangle): New function.
13666 (General_options::do_demangle): New function.
13667 (General_options::set_do_demangle): New function.
13668 (General_options::execstack_status_): Move definition to end of
13669 class definition.
13670 (General_options::static_): Likewise.
13671 (General_options::do_demangle_): New field.
13672 * object.cc (big_endian>::get_symbol_location_info): Call
13673 Options::do_demangle, not Options::demangle.
13674 * symtab.cc (demangle): Likewise.
13675
cbb93e63
ILT
136762008-03-22 Ian Lance Taylor <iant@google.com>
13677
13678 * gold.h: Include <cstddef> and <sys/types.h>
13679 * options.h: Include <cstring>.
13680
ec531623
ILT
136812008-03-21 Ian Lance Taylor <iant@google.com>
13682
13683 * Added source code to GNU binutils.
This page took 0.875768 seconds and 4 git commands to generate.