* configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
864a1b56
AM
12012-09-05 Alan Modra <amodra@gmail.com>
2
3 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4 * configure: Regenerate.
5 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
6 (plugin_final_layout.stdout): Likewise.
7 (memory_test): Set page sizes to 0x1000.
8 * testsuite/Makefile.in: Regenerate.
9 * testsuite/discard_locals_test.sh: Add FIXME comment.
10 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
11 * testsuite/pr14265.t: Add .got output section statement.
12 * testsuite/script_test_2.t: Likewise.
13 * testsuite/script_test_3.t: Likewise.
14 * testsuite/script_test_4.t: Likewise.
15 * testsuite/script_test_5.t: Likewise.
16 * testsuite/script_test_6.t: Likewise.
17 * testsuite/script_test_7.t: Likewise.
18 * testsuite/script_test_9.t: Likewise.
19
3ea0a085
AM
202012-09-05 Alan Modra <amodra@gmail.com>
21
22 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
23 (Powerpc_relocate_functions::Status): New typedef.
24 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
25 (Target_powerpc::Scan::local): Handle REL64.
26 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
27 for REL32 and REL64.
28 (Target_powerpc::symval_for_branch): New function, extracted from..
29 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
30 checks. Report overflow errors.
31
7404fe1b
AM
322012-09-05 Alan Modra <amodra@gmail.com>
33
34 * object.h (Sized_relobj_file::emit_relocs): Delete.
35 (Sized_relobj_file::emit_relocs_reltype): Delete.
36 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
37 relocate_relocs for --emit-relocs.
38 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
39 * output.h: Update comment.
40 (Output_segment::first_section): New function.
41 (Output_segment::first_section_load_address): Use first_section.
42 * output.cc (Output_segment::first_section): New function extracted..
43 (Output_segment::first_section_load_address): ..from here. Delete.
44 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
45 * target.h (Sized_target::relocate_for_relocatable): Likewise.
46 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
47 adjust call to target.h function.
48 * i386.cc (Target_i386): Likewise.
49 * sparc.cc (Target_sparc): Likewise.
50 * x86_64.cc (Target_x86_64): Likewise.
51 * powerpc.cc (Target_powerpc): Likewise.
52 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
53 first tls section has section symbol for optimised local dynamic
54 output relocs.
55 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
56 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
57 optimised tls code.
58 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
59 Rename to relocate_relocs. Update error message.
60
957564c9
AS
612012-09-04 Andreas Schwab <schwab@linux-m68k.org>
62
63 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
64 --just-symbols.
65
dd93cd0a
AM
662012-08-31 Alan Modra <amodra@gmail.com>
67
68 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
69 (Powerpc_relobj::toc_base_offset): New stub function.
70 (Target_powerpc): Add tp_offset, dtp_offset. Rename
71 got_mod_index_offset to tlsld_got_offset. Update all refs.
72 (Target_powerpc::Relocate::enum skip_tls): New.
73 (Target_powerpc::call_tls_get_addr_): New var.
74 (Target_powerpc::is_branch_reloc): Move to file scope.
75 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
76 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
77 New functions.
78 (Target_powerpc::enum Got_type): Delete old values, add new ones.
79 (powerpc_info): Correct common_pagesize for ppc64.
80 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
81 (Powerpc_relocate_functions): Add overflow check enums and functions.
82 Add non-shift version of rela, rela_ua. Delete all rel public
83 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
84 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
85 addr16_ha3, addr14 functions.
86 (Output_data_got_powerpc::add_constant_pair): New function.
87 (Output_data_got_powerpc::got_base_offset): Likewise.
88 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
89 (instruction constants): Sort, add some more.
90 (Output_data_glink::do_write): Add and use Address typedef. Use
91 object->toc_base_offset() stub for 64-bit.
92 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
93 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
94 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
95 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
96 Always treat .opd relocs as against locally defined symbol.
97 Correct condition for RELATIVE relocs.
98 (Target_powerpc::do_finalize_sections): Test for NULL sections.
99 (Target_powerpc::Relocate::relocate): Use plt call stub as value
100 for 32-bit syms with a plt entry. Correct ppc64 toc base
101 calculations. Handle TLS relocs, and more. Add overflow
102 checking and adjust for Powerpc_relocate_functions changes.
103 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
104 Reinstate --emit-relocs code with FIXME.
105
a1373b60
AM
1062012-08-30 Alan Modra <amodra@gmail.com>
107
108 * layout.cc (Layout::set_segment_offsets): Set p_align to
109 abi_pagesize, not common_pagesize.
110 (Layout::relaxation_loop_body): Similarly use abi_pagesize
111 to determine whether file header can go in segment.
112
703d02da
AM
1132012-08-30 Alan Modra <amodra@gmail.com>
114
115 * output.h (Output_reloc::Output_reloc <output section>): Add
116 is_relative param. Adjust calls.
117 (Output_reloc::add_output_section_relative): New functions.
118 * output.cc (Output_reloc::Output_reloc <output section>): Handle
119 is_relative.
120 (Output_reloc::symbol_value): Handle SECTION_CODE.
121
16164a6b
ST
1222012-08-24 Sriraman Tallam <tmsriram@google.com>
123
124 * gold.cc (queue_middle_tasks): Call layout again when unique
125 segments for sections is desired.
126 * layout.cc (Layout::Layout): Initialize new members.
127 (Layout::get_output_section_flags): New function.
128 (Layout::choose_output_section): Call get_output_section_flags.
129 (Layout::layout): Make output section for mapping to a unique segment.
130 (Layout::insert_section_segment_map): New function.
131 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 132 output sections marked so.
16164a6b
ST
133 (Layout::segment_precedes): Check for unique segments when sorting.
134 * layout.h (Layout::Unique_segment_info): New struct.
135 (Layout::Section_segment_map): New typedef.
136 (Layout::insert_section_segment_map): New function.
137 (Layout::get_output_section_flags): New function.
138 (Layout::is_unique_segment_for_sections_specified): New function.
139 (Layout::set_unique_segment_for_sections_specified): New function.
140 (Layout::unique_segment_for_sections_specified_): New member.
141 (Layout::section_segment_map_): New member.
142 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
143 Rename is_gc_pass_one to is_pass_one.
144 Rename is_gc_pass_two to is_pass_two.
145 Rename is_gc_or_icf to is_two_pass.
146 Check for which pass based on whether symbols data is present.
147 Make it two pass when unique segments for sections is desired.
148 * output.cc (Output_section::Output_section): Initialize new
149 members.
150 * output.h (Output_section::is_unique_segment): New function.
151 (Output_section::set_is_unique_segment): New function.
152 (Output_section::is_unique_segment_): New member.
153 (Output_section::extra_segment_flags): New function.
154 (Output_section::set_extra_segment_flags): New function.
155 (Output_section::extra_segment_flags_): New member.
156 (Output_section::segment_alignment): New function.
157 (Output_section::set_segment_alignment): New function.
158 (Output_section::segment_alignment_): New member.
159 (Output_segment::Output_segment): Initialize is_unique_segment_.
160 (Output_segment::is_unique_segment): New function.
161 (Output_segment::set_is_unique_segment): New function.
162 (Output_segment::is_unique_segment_): New member.
163 * plugin.cc (allow_unique_segment_for_sections): New function.
164 (unique_segment_for_sections): New function.
165 (Plugin::load): Add new functions to transfer vector.
166 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
167 * Makefile.in: Regenerate.
168 * testsuite/plugin_final_layout.sh: Check if unique segment
169 functionality works.
170 * testsuite/plugin_section_order.c (onload): Check if new interfaces
171 are available.
172 (allow_unique_segment_for_sections): New global.
173 (unique_segment_for_sections): New global.
174 (claim_file_hook): Call allow_unique_segment_for_sections.
175 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 176
1e2bee4f
CC
1772012-08-22 Cary Coutant <ccoutant@google.com>
178
179 * layout.cc (Layout::include_section): Don't assert on GROUP
180 sections with --emit-relocs.
181
1d5dfe78
CC
1822012-08-21 Cary Coutant <ccoutant@google.com>
183
184 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
185 if --export-dynamic-symbol names an undef symbol.
186
c9269dff
AM
1872012-08-18 Alan Modra <amodra@gmail.com>
188
189 * powerpc.cc: Formatting and white space.
190 (Powerpc_relobj): Rename got2_section_ to special_.
191 Add opd_ent_shndx_ and opd_ent_off_ vectors.
192 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
193 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
194 (Target_powerpc): Add Address typedef and invalid_address. Use
195 throughout.
196 (Target_powerpc::is_branch_reloc): New function.
197 (Powerpc_relocate_functions): Add Address typedef, use throughout.
198 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
199 for dst_mask, value and addend.
200 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
201 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
202 (Output_data_glink::do_write): Correct toc base. Don't try to use
203 uint16_t for 24-bit offset. Use get_output_section_offset and
204 check return.
205 (Target_powerpc::Scan::local): Handle more relocs.
206 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
207 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
208 Plug in toc restoring insn after plt calls. Translate branches
209 to function descriptor symbols to corresponding entry point.
210 (Target_powerpc::relocate_for_relocatable): Check return from
211 get_output_section_offset.
212 * symtab.h: Comment typo.
213
b1759dce
ILT
2142012-08-14 Ian Lance Taylor <iant@google.com>
215
216 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
217 unsupported_relocal_local to call unsupported_reloc_global.
218
b9b2ae8b
NC
2192012-08-14 Nick Clifton <nickc@redhat.com>
220
221 PR ld/14265
222 * script-sections.cc (Sections_element::output_section_name): Add
223 keep return parameter.
224 (Output_section_element::match_name): Add keep return parameter.
225 Return the value of the keep_ member.
226 * script-sections.h (class Output_section): Update
227 output_section_name prototype.
228 * layout.cc (Layout::keep_input_section): New public member
229 function.
230 (Layout::choose_output_section): Pass keep parameter to
231 output_section_name.
232 * layout.h (class Layout): Add keep_input_section.
233 * object.cc (Sized_relobj_file::do_layout): Check for kept input
234 sections.
235 * testsuite/Makefile.am: Add a test.
236 * testsuite/Makefile.in: Regenerate.
237 * testsuite/pr14265.c: Source file for the test.
238 * testsuite/pr14265.t: Linker script for the test.
239 * testsuite/pr14265.sh: Shell script for the test.
240
921b5322
AM
2412012-08-14 Alan Modra <amodra@gmail.com>
242
243 * target.h (Target::output_section_name): New function.
244 (Target::do_output_section_name): New function.
245 * layout.cc (Layout::choose_output_section): Call the above.
246 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
247
6ce78956
AM
2482012-08-14 Alan Modra <amodra@gmail.com>
249
250 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
251 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
252 for replace_constant call.
253 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
254 (Output_data_glink::do_print_to_mapfile): New function.
255 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
256 (Target_powerpc::Relocate::relocate): Likewise.
257
d1a8cabd
AM
2582012-08-14 Alan Modra <amodra@gmail.com>
259
260 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
261 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
262 (Output_data_glink::add_entry,find_entry): Remove shndx param.
263 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
264 all references to shndx_. Handle special case for R_PPC_PLTREL24
265 here.
266 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
267 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
268 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
269 here.
270 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
271 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
272
d83ce4e3
AM
2732012-08-12 Alan Modra <amodra@gmail.com>
274
275 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
276 (glink insn constants): Use uint32_t.
277 (Output_data_glink::add_entry): Use insert, not [] operator.
278
cf43a2fe
AM
2792012-08-11 Alan Modra <amodra@gmail.com>
280
281 * object.h (Sized_relobj_file::find_shdr): New function.
282 (Sized_relobj_file::find_special_sections): New function.
283 * object.cc (Sized_relobj_file::find_shdr): New function.
284 (Sized_relobj_file::find_eh_frame): Use find_shdr.
285 (Sized_relobj_file::find_special_sections): New function, split out..
286 (Sized_relobj_file::do_read_symbols): ..from here.
287 * output.h (Output_data_got::replace_constant): New function.
288 (Output_data_got::num_entries): New function.
289 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
290 (Output_data_got::got_offset): Protected rather than private.
291 (Output_data_got::replace_got_entry): New function.
292 * output.cc (Output_data_got::replace_got_entry): New function.
293 * powerpc.cc (class Powerpc_relobj): New.
294 (class Powerpc_relocate_functions): Delete all psymval variants or
295 convert to value,addend type. Delete pcrela, pcrela_unaligned.
296 Implement _ha functions using corresponding _hi function.
297 (Powerpc_relobj::find_special_sections): New function.
298 (Target_powerpc::do_make_elf_object): New function.
299 (class Output_data_got_powerpc): New.
300 (class Output_data_glink): New.
301 (class Powerpc_scan_relocatable_reloc): New.
302 Many more changes througout file.
303
3c892704
NC
3042012-08-09 Nick Clifton <nickc@redhat.com>
305
306 * po/vi.po: Updated Vietnamese translation.
307
82435b3b
ILT
3082012-08-07 Ian Lance Taylor <iant@google.com>
309
310 * layout.cc (Layout::add_target_dynamic_tags): If
311 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
312 plt_rel.
313
a6dc81d2
NC
3142012-07-30 Nick Clifton <nickc@redhat.com>
315
316 * po/gold.pot: Updated template.
317 * po/es.po: Updated Spanish translation.
318
f1415016
CC
3192012-07-18 Cary Coutant <ccoutant@google.com>
320
321 PR gold/14344
322 * configure.ac: Add check for -gpubnames support.
323 * configure: Regenerate.
324 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
325 support; force -gno-pubnames.
326 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
327 support.
328 (gdb_index_test_4): New test.
329 * testsuite/Makefile.in: Regenerate.
330 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
331 * testsuite/gdb_index_test_2.sh: Likewise.
332 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
333 * testsuite/gdb_index_test_4.sh: New script.
334 * testsuite/gdb_index_test_comm.sh: New script with common code;
335 don't look for space after colon.
336
b7fd7c37
ST
3372012-07-16 Sriraman Tallam <tmsriram@google.com>
338
339 * gold.cc (queue_middle_tasks): Update function order only after
340 deferred objects due to plugins are processed.
341
1f3212db
ILT
3422012-07-11 Ian Lance Taylor <iant@google.com>
343
344 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
345 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
346 (Target_arm::scan_reloc_for_stub): Likewise.
347 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
348 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
349 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
350 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
351 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
352
81c82a68
ILT
3532012-07-10 Dodji Seketeli <dodji@redhat.com>
354 Ian Lance Taylor <iant@google.com>
355
356 PR gold/14309
357 * configure.ac: Test whether std::tr1::hash<off_t> works.
358 * gold.h: Add a specialization for std::tr1::hash<off_t> if
359 needed.
360 * output.h (class Output_fill): Add virtual destructor.
361 * configure, config.in: Rebuild.
362
eabc84f4
RM
3632012-06-22 Roland McGrath <mcgrathr@google.com>
364
365 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
366
370e30b6
RÁE
3672012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
368
369 * plugin.cc (Plugin::load): Handle position independent executables.
370
fb1b895d
CC
3712012-06-06 Cary Coutant <ccoutant@google.com>
372
373 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
374 add .debug_macro.
375 (lines_only_debug_sections): Likewise.
376 (gdb_fast_lookup_sections): New static array.
377 (is_gdb_debug_section): Rename formal parameter.
378 (is_lines_only_debug_section): Likewise.
379 (is_gdb_fast_lookup_section): New function.
380 (Layout::include_section): Check for ".zdebug_" prefix; pass
381 section name suffix to is_gdb_debug_section, et al.; check for
382 fast-lookup sections when building .gdb_index.
383 * options.h (--strip-debug-gdb): Update GDB version number.
384
7c0640fa
CC
3852012-06-06 Cary Coutant <ccoutant@google.com>
386
387 * configure.ac: Add check for fallocate.
388 * configure: Regenerate.
389 * config.in: Regenerate.
390
391 * options.h (class General_options): Add --mmap-output-file and
392 --posix-fallocate options.
393 * output.cc: (posix_fallocate): Remove; replace with...
394 (gold_fallocate): New function.
395 (Output_file::map_no_anonymous): Call gold_fallocate.
396 (Output_file::map): Check --mmap-output-file option.
397
2a49eb69
DK
3982012-06-05 Jing Yu <jingyu@google.com>
399
400 * gold.h (textdomain): Add do {} to empty while(0).
401 (bindtextdomain): Likewise.
402
fad072ac
CC
4032012-06-04 Cary Coutant <ccoutant@google.com>
404
405 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
406 has_dynsym_index.
407
8cc69fb6
ST
4082012-05-25 Sriraman Tallam <tmsriram@google.com>
409
410 * symtab.cc (Symbol_table::define_special_symbol):
411 Initialize *poldsym to prevent uninitialized variable errors.
412
1be75daa
CC
4132012-05-23 Cary Coutant <ccoutant@google.com>
414
415 * layout.cc (Layout::section_name_mapping): Add rules to handle
416 exact match on .data.rel.ro.local or .data.rel.ro.
417 (Layout::output_section_name): Check for exact matches.
418
9b689de0
CC
4192012-05-23 Cary Coutant <ccoutant@google.com>
420
421 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
422 more carefully.
423
b24fdbf5
CC
4242012-05-22 Cary Coutant <ccoutant@google.com>
425
426 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
427 object before exporting symbol.
428
e550e1a2
L
4292012-05-21 H.J. Lu <hongjiu.lu@intel.com>
430
431 * testsuite/tls_test.cc: Include "config.h" first.
432 * testsuite/tls_test_c.c: Likewise.
433
df7b86aa
NC
4342012-05-17 Daniel Richard G. <skunk@iskunk.org>
435 Nick Clifton <nickc@redhat.com>
436
437 PR 14072
438 * configure.in: Add check that sysdep.h has been included before
439 any system header files.
440 * configure: Regenerate.
441 * config.in: Regenerate.
442
1007b503
CC
4432012-05-14 Cary Coutant <ccoutant@google.com>
444
445 * layout.cc (Layout::make_output_section): Mark .tdata section
446 as RELRO.
447 * testsuite/relro_test.cc: Add a TLS variable.
448
fd885f3a
L
4492012-05-10 H.J. Lu <hongjiu.lu@intel.com>
450
451 PR gold/14091
452 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
453 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
454 R_X86_64_64.
455
80f5885c
CC
4562012-05-08 Cary Coutant <ccoutant@google.com>
457
458 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
459 (lines_only_debug_sections): Likewise.
460
2e702c99
RM
4612012-05-02 Roland McGrath <mcgrathr@google.com>
462
463 * nacl.cc: New file.
464 * nacl.h: New file.
465 * Makefile.am (CCFILES, HFILES): Add them.
466 * Makefile.in: Regenerate.
467 * i386.cc (Output_data_plt_i386_nacl): New class.
468 (Output_data_plt_i386_nacl_exec): New class.
469 (Output_data_plt_i386_nacl_dyn): New class.
470 (Target_i386_nacl): New class.
471 (Target_selector_i386_nacl): New class.
472 (target_selector_i386): Use it instead of Target_selector_i386.
473 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
474 (Target_x86_64_nacl): New class.
475 (Target_selector_x86_64_nacl): New class.
476 (target_selector_x86_64, target_selector_x32): Use it instead of
477 Target_selector_x86_64.
478 * arm.cc (Output_data_plt_arm_nacl): New class.
479 (Target_arm_nacl): New class.
480 (Target_selector_arm_nacl): New class.
481 (target_selector_arm, target_selector_armbe): Use it instead of
482 Target_selector_arm.
483
484 * target-select.cc (select_target): Take new Input_file* and off_t
485 arguments, pass them on to recognize method of selector.
486 * object.cc (make_elf_sized_object): Update caller.
487 * parameters.cc (parameters_force_valid_target): Likewise.
488 * incremental.cc (make_sized_incremental_binary): Likewise.
489 * target-select.h: Update decl.
490 (Target_selector::recognize): Take new Input_file* argument,
491 pass it on to do_recognize.
492 (Target_selector::do_recognize): Take new Input_file* argument.
493 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
494 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
495 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
496 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
497
498 * target.h (Target::Target_info): New members isolate_execinstr
499 and rosegment_gap.
500 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
501 * arm.cc (Target_arm::arm_info): Update initializer.
502 * i386.cc (Target_i386::i386_info): Likewise.
503 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
504 * sparc.cc (Target_sparc::sparc_info): Likewise.
505 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
506 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
507 * layout.cc (Layout::attach_allocated_section_to_segment):
508 Take new const Target* argument. If target->isolate_execinstr(), act
509 like --rosegment.
510 (Layout::find_first_load_seg): Take new const Target* argument;
511 if target->isolate_execinstr(), reject PF_X segments.
512 (Layout::relaxation_loop_body): Update caller.
513 (Layout::set_segment_offsets): If target->isolate_execinstr(),
514 reset file offset to zero when we hit LOAD_SEG, and then do a second
515 loop over the segments before LOAD_SEG to reassign offsets after
516 addresses have been determined. Handle target->rosegment_gap().
517 (Layout::attach_section_to_segment): Take new const Target* argument;
518 pass it to attach_allocated_section_to_segment.
519 (Layout::make_output_section): Update caller.
520 (Layout::attach_sections_to_segments): Take new const Target* argument;
521 pass it to attach_section_to_segment.
522 * gold.cc (queue_middle_tasks): Update caller.
523 * layout.h (Layout): Update method decls with new arguments.
524
525 * arm.cc (Target_arm::Target_arm): Take optional argument for the
526 Target_info pointer to use.
527 (Target_arm::do_make_data_plt): New virtual method.
528 (Target_arm::make_data_plt): New method that calls it.
529 (Target_arm::make_plt_entry): Use it.
530 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
531 for the section alignment.
532 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
533 method.
534 (Output_data_plt_arm::first_plt_entry_offset): Call it.
535 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
536 method.
537 (Output_data_plt_arm::get_plt_entry_size): Call it.
538 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
539 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
540 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
541 method.
542 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
543 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
544 method instead of sizeof(plt_entry).
545 (Output_data_plt_arm::add_entry): Likewise.
546 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
547 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
548 than static method.
549 (Target_arm::plt_entry_size): Likewise.
550 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
551 Move to ...
552 (Output_data_plt_arm_standard): ... here, new class.
553 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
554 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
555 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
556
557 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
558 Take additional argument for the PLT entry size.
559 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
560 Use get_plt_entry_size method rather than plt_entry_size variable.
561 (Output_data_plt_x86_64::reserve_slot): Likewise.
562 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
563 (Output_data_plt_x86_64::add_entry): Likewise.
564 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
565 (Output_data_plt_x86_64::address_for_global): Likewise.
566 (Output_data_plt_x86_64::address_for_local): Likewise.
567 (Output_data_plt_x86_64::set_final_data_size): Likewise.
568 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
569 Make method non-static.
570 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
571 method.
572 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
573 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
574 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
575 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
576 virtual method.
577 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
578 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
579 virtual method.
580 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
581 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
582 virtual method.
583 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
584 (Output_data_plt_x86_64::plt_entry_size)
585 (Output_data_plt_x86_64::first_plt_entry)
586 (Output_data_plt_x86_64::plt_entry)
587 (Output_data_plt_x86_64::tlsdesc_plt_entry)
588 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
589 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
590 (Output_data_plt_x86_64_standard): ... here, new class.
591 (Target_x86_64::Target_x86_64): Take optional argument for the
592 Target_info pointer to use.
593 (Target_x86_64::do_make_data_plt): New virtual method.
594 (Target_x86_64::make_data_plt): New method to call it.
595 (Target_x86_64::init_got_plt_for_update): Use that.
596 Call this->plt_->add_eh_frame method here.
597 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
598 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
599 rather than static method.
600 (Target_x86_64::plt_entry_size): Likewise.
601 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
602 rather than plt_entry_size variable. Move guts of PLT filling to...
603 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
604 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
605 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
606
607 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
608 additional argument for the section alignment.
609 Don't do add_eh_frame_for_plt here.
610 (Output_data_plt_i386::first_plt_entry_offset): Make the method
611 non-static. Use get_plt_entry_size method rather than plt_entry_size
612 variable.
613 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
614 method.
615 (Output_data_plt_i386::get_plt_entry_size): Call it.
616 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
617 (Output_data_plt_i386::add_eh_frame): New method to call it.
618 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
619 method.
620 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
621 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
622 method.
623 (Output_data_plt_i386::fill_plt_entry): New method to call it.
624 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
625 method instead of plt_entry_size.
626 (Output_data_plt_i386::plt_entry_size)
627 (Output_data_plt_i386::plt_eh_frame_fde_size)
628 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
629 (Output_data_plt_i386_standard): ... here, new class.
630 (Output_data_plt_i386_exec): New class.
631 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
632 (Output_data_plt_i386_exec::first_plt_entry): ... here.
633 (Output_data_plt_i386::exec_plt_entry): Move to ...
634 (Output_data_plt_i386_exec::plt_entry): ... here.
635 (Output_data_plt_i386_dyn): New class.
636 (Output_data_plt_i386::first_plt_entry): Move to ...
637 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
638 (Output_data_plt_i386::dyn_plt_entry): Move to ...
639 (Output_data_plt_i386_dyn::plt_entry): ... here.
640 (Target_i386::Target_i386): Take optional argument for the Target_info
641 pointer to use.
642 (Target_i386::do_make_data_plt): New virtual method.
643 (Target_i386::make_data_plt): New method to call it.
644 (Target_i386::make_plt_section): Use that.
645 Call this->plt_->add_eh_frame method here.
646 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
647 rather than plt_entry_size variable.
648 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
649 (Output_data_plt_i386::address_for_local): Likewise.
650 (Output_data_plt_i386::do_write): Likewise.
651 Move guts of PLT filling to...
652 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
653 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
654 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
655 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
656
b9b9f2ee
CC
6572012-05-01 Cary Coutant <ccoutant@google.com>
658
659 * dwarf_reader.cc (Dwarf_die::read_attributes)
660 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
661 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
662 * reduced_debug_output.cc
663 (Output_reduced_debug_info_section::get_die_end): Remove
664 DW_FORM_GNU_ref_index. Add default case.
665
57923f48
MW
6662012-04-26 Mark Wielaard <mjw@redhat.com>
667
668 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
669 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
670 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
671 DW_AT_high_pc as offset from DW_AT_low_pc.
672
673 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
674 * testsuite/Makefile.in: Regenerate.
675 * testsuite/gdb_index_test_3.c: New test source file.
676 * testsuite/gdb_index_test_3.sh: New test source file.
677
2c54b4f4
ILT
6782012-04-25 Ian Lance Taylor <iant@google.com>
679
680 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
681 pointer.
682 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
683 as a class, not a struct.
684 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
685 (Target_arm::apply_cortex_a8_workaround): Likewise.
686 * gc.h: Declare Reloc_types as a struct, not a class.
687 * object.h: Declare Symbols_data as a struct.
688 * reloc.h: Declare Read_relocs_data as a struct.
689 * target.h: Declare Relocate_info as a struct.
690
a5a5f7a3
DM
6912012-04-24 David S. Miller <davem@davemloft.net>
692
693 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
694 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
695 and R_SPARC_WPLT30.
696
f038d496
CC
6972012-04-24 Cary Coutant <ccoutant@google.com>
698
699 * incremental-dump.cc (find_input_containing_global): Replace
700 magic number with symbolic constant.
701 (dump_incremental_inputs): Update version number.
702 * incremental.cc (Output_section_incremental_inputs): Update version
703 number; import symbolic constants from Incremental_inputs_reader.
704 (Incremental_inputs::create_data_sections): Align relocations
705 section correctly for 64-bit targets.
706 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
707 constants; add padding.
708 (Output_section_incremental_inputs::write_header): Add assert for
709 header_size.
710 (Output_section_incremental_inputs::write_input_files): Add assert
711 for input_entry_size.
712 (Output_section_incremental_inputs::write_info_blocks): Add padding;
713 add assert for object_info_size, input_section_entry_size,
714 global_sym_entry_size.
715 * incremental.h (Incremental_inputs_reader): Add symbolic constants
716 for data structure sizes; use them.
717 (Incremental_input_entry_reader): Import symbolic constants from
718 Incremental_inputs_reader; use them.
719
a4d85145
DM
7202012-04-23 David S. Miller <davem@davemloft.net>
721
722 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
723 and elf_flags_set_.
724 (Target_sparc::Target_sparc): Initialize new fields.
725 (Target_sparc::do_make_elf_object): New function.
726 (Target_sparc::do_adjust_elf_header): New function.
727
1d509098
CC
7282012-04-23 Cary Coutant <ccoutant@google.com>
729
730 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
731 CU range table of gdb index.
732
7ebeff7f
DM
7332012-04-20 David S. Miller <davem@davemloft.net>
734
735 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
736 instead of false.
737
13cf9988
DM
7382012-04-16 David S. Miller <davem@davemloft.net>
739
2a1079e8
DM
740 * sparc.cc (Target_sparc::got_address): New function.
741 (Sparc_relocate_functions::gdop_hix22): New function.
742 (Sparc_relocate_functions::gdop_lox10): New function.
743 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
744 relocs.
745 (Target_sparc::Scan::local): Likewise if the global symbol is not
746 preemptible and is not IFUNC.
747 (Target_sparc::Relocate::relocate): Perform GOTDATA code
748 transformations for local and non-preemptible non-IFUNC global
749 symbols.
750
0bc964fc
DM
751 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
752 writing out 64-bit part of ranges.
753
661d7a80
DM
754 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
755 -fpic and -fpie respectively.
756 * Makefile.in: Regenerate.
757
8c2bf391
DM
758 * sparc.cc (class Target_sparc): Add rela_ifunc_.
759 (Target_sparc::Target_sparc): Initialize new field.
760 (Target_sparc::do_plt_section_for_global): New function.
761 (Target_sparc::do_plt_section_for_local): New function.
762 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
763 (Target_sparc::make_plt_section): New function, broken out of
764 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
765 (Target_sparc::make_plt_entry): Call make_plt_section.
766 (Target_sparc::make_local_ifunc_plt_entry): New function.
767 (Target_sparc::rela_ifunc_section): New function.
768 (Target_sparc::plt_section): Remove const.
769 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
770 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
771 and ifunc_count_ fields.
772 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
773 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
774 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
775 (Output_data_plt_sparc::rela_ifunc): New function.
776 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
777 (Output_data_plt_sparc::has_ifunc_section): New function.
778 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
779 (Output_data_plt_sparc::address_for_global): New function.
780 (Output_data_plt_sparc::address_for_local): New function.
781 (Output_data_plt_sparc::plt_index_to_offset): New function.
782 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
783 and entry_count.
784 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
785 entry_count.
786 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
787 R_SPARC_JMP_IREL to switch.
788 (Target_sparc::Scan::check_non_pic): Likewise.
789 (Target_sparc::Scan::local): Handle IFUNC symbols.
790 (Target_sparc::Scan::local): Likewise.
791 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
792 and plt_address_for_local.
793 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
794 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
795
13cf9988
DM
796 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
797 (class Output_data_reloc): Adjust calls to Output_reloc_type.
798 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
799 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
800 global relocs too.
801 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
802 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
803 calls.
804 * sparc.cc (Target_sparc::Scan::global): Likewise.
805 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
806
31821be0
CC
8072012-04-16 Cary Coutant <ccoutant@google.com>
808
809 * archive.cc (Library_base::should_include_member): Check for
810 --export-dynamic-symbol.
811 * options.h (class General_options): Add --export-dynamic-symbol.
812 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
813 --export-dynamic-symbol.
814 (Symbol_table::gc_mark_undef_symbols): Likewise.
815 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
816
2615994e
DM
8172012-04-12 David S. Miller <davem@davemloft.net>
818
819 * sparc.cc (Reloc::wdisp10): New relocation method.
820 (Reloc::h34): Likewise.
821 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
822 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
823 R_SPARC_WDISP10.
824 (Target_sparc::Scan::local): Likewise.
825 (Target_sparc::Scan::global): Likewise.
826 (Target_sparc::Relocate::relocate): Likewise.
827
6782735d
CC
8282012-04-09 Cary Coutant <ccoutant@google.com>
829
830 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
831 low_pc == 0.
832
8c7a0b00
ILT
8332012-04-06 Ian Lance Taylor <iant@google.com>
834
835 * timer.cc: #include <unistd.h>.
836
58797674
RM
8372012-04-06 Roland McGrath <mcgrathr@google.com>
838
839 * configure.in (AC_CHECK_HEADERS): Add locale.h.
840 * config.in: Regenerate.
841 * configure: Regenerate.
842
44350750
NC
8432012-04-05 Nick Clifton <nickc@redhat.com>
844
845 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
846 (AM_LC_MESSAGES): Add.
847 * aclocal.m4: Regenerate.
848 * config.in: Regenerate.
849 * configure: Regenerate.
850
c1027032
CC
8512012-03-21 Cary Coutant <ccoutant@google.com>
852
853 * Makefile.am: Add gdb-index.cc, gdb-index.h.
854 * Makefile.in: Regenerate.
855 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
856 (Sized_elf_reloc_mapper::symbol_section): New function.
857 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
858 (make_elf_reloc_mapper): New function.
859 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
860 (Dwarf_abbrev_table::do_read_abbrevs): New function.
861 (Dwarf_abbrev_table::do_get_abbrev): New function.
862 (Dwarf_ranges_table::read_ranges_table): New function.
863 (Dwarf_ranges_table::read_range_list): New function.
864 (Dwarf_pubnames_table::read_section): New function.
865 (Dwarf_pubnames_table::read_header): New function.
866 (Dwarf_pubnames_table::next_name): New function.
867 (Dwarf_die::Dwarf_die): New function.
868 (Dwarf_die::read_attributes): New function.
869 (Dwarf_die::skip_attributes): New function.
870 (Dwarf_die::set_name): New function.
871 (Dwarf_die::set_linkage_name): New function.
872 (Dwarf_die::attribute): New function.
873 (Dwarf_die::string_attribute): New function.
874 (Dwarf_die::int_attribute): New function.
875 (Dwarf_die::uint_attribute): New function.
876 (Dwarf_die::ref_attribute): New function.
877 (Dwarf_die::child_offset): New function.
878 (Dwarf_die::sibling_offset): New function.
879 (Dwarf_info_reader::check_buffer): New function.
880 (Dwarf_info_reader::parse): New function.
881 (Dwarf_info_reader::do_parse): New function.
882 (Dwarf_info_reader::do_read_string_table): New function.
883 (Dwarf_info_reader::lookup_reloc): New function.
884 (Dwarf_info_reader::get_string): New function.
885 (Dwarf_info_reader::visit_compilation_unit): New function.
886 (Dwarf_info_reader::visit_type_unit): New function.
887 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
888 Sized_elf_reloc_mapper.
889 (Sized_dwarf_line_info::symbol_section): Remove function.
890 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
891 (Sized_dwarf_line_info::read_line_mappings): Remove object
892 parameter, adjust callers.
893 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
894 * dwarf_reader.h: Include <sys/types.h>.
895 (class Track_relocs): Remove forward declaration.
896 (class Elf_reloc_mapper): New class.
897 (class Sized_elf_reloc_mapper): New class.
898 (class Dwarf_abbrev_table): New class.
899 (class Dwarf_range_list): New class.
900 (class Dwarf_ranges_table): New class.
901 (class Dwarf_pubnames_table): New class.
902 (class Dwarf_die): New class.
903 (class Dwarf_info_reader): New class.
904 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
905 (Sized_dwarf_line_info::symbol_section): Remove member function.
906 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
907 base class.
908 * gdb-index.cc: New source file.
909 * gdb-index.h: New source file.
910 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
911 and .debug_types sections, call Layout::add_to_gdb_index.
912 (Sized_relobj_incr::do_section_name): Implement.
913 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
914 return type; Implement.
915 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
916 return type.
917 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
918 parameter list and return type.
919 (Sized_incr_dynobj::do_section_contents): Likewise.
920 * layout.cc: Include gdb-index.h.
921 (Layout::Layout): Initialize gdb_index_data_.
922 (Layout::init_fixed_output_section): Check for .gdb_index section.
923 (Layout::add_to_gdb_index): New function. Instantiate.
924 * layout.h: Add forward declaration for class Gdb_index.
925 (Layout::add_to_gdb_index): New member function.
926 (Layout::gdb_index_data_): New data member.
927 * main.cc: Include gdb-index.h.
928 (main): Print statistics for gdb index.
929 * object.cc (Object::section_contents): Move code into
930 do_section_contents.
931 (need_decompressed_section): Check for sections needed when building
932 gdb index.
933 (build_compressed_section_map): Likewise.
934 (Sized_relobj_file::do_read_symbols): Need local symbols when building
935 gdb index.
936 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
937 sections; call Layout::add_to_gdb_index.
938 (Sized_relobj_file::do_decompressed_section_contents): Call
939 do_section_contents directly.
940 * object.h (Object::do_section_contents): Adjust parameter list and
941 return type.
942 (Object::do_decompressed_section_contents): Call do_section_contents
943 directly.
944 (Sized_relobj_file::do_section_contents): Adjust parameter list and
945 return type.
946 * options.h (class General_options): Add --gdb-index option.
947 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
948 list and return type.
949 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
950 * reloc.h (Track_relocs::checkpoint): New function.
951 (Track_relocs::reset): New function.
952
953 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
954 New test cases.
955 * testsuite/Makefile.in: Regenerate.
956 * testsuite/gdb_index_test.cc: New test source file.
957 * testsuite/gdb_index_test_1.sh: New test source file.
958 * testsuite/gdb_index_test_2.sh: New test source file.
959
647f1574
DK
9602012-03-19 Doug Kwan <dougkwan@google.com>
961
962 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 963 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
964 __exidx_start and __exidx_end. Make symbol table parameter
965 anonymous as it is not used.
966 * gold.cc (queue_middle_tasks): Call target hook to define any
967 target-specific symbols.
968 * target.h (Target::define_standard_symbols): New method.
969 (Target::do_define_standard_symbols): Same.
970 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
971 * testsuite/Makefile.in: Regenerate.
972 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
973 and __exidx_end.
974 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
975 relocations are generated for __exidx_start and __exidx_end.
976
7c6109da
DK
9772012-03-16 Doug Kwan <dougkwan@google.com>
978
979 * testsuite/Makefile.am: Disable test initpri3b.
980 * testsuite/Makefile.in: Regenerate.
981
7b8957f8
DK
9822012-03-15 Doug Kwan <dougkwan@google.com>
983
984 * arm.cc (Target_arm::got_section): Make .got section read-only
985 if -z now is given.
986
14dc9ef7
ILT
9872012-03-15 Ian Lance Taylor <iant@google.com>
988
989 PR gold/13850
990 * layout.cc (Layout::make_output_section): Correctly mark
991 SHT_INIT_ARRAY, et. al., as relro.
992
fa40b62a
DK
9932012-03-14 Doug Kwan <dougkwan@google.com>
994
995 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
996 dynamic relocations for protected symbols in shared objects.
997
fd325007
ILT
9982012-03-13 Ian Lance Taylor <iant@google.com>
999
1000 * resolve.cc (Symbol_table::resolve): When merging common symbols,
1001 keep the larger alignment.
1002
e8dd54e1
CC
10032012-03-12 Cary Coutant <ccoutant@google.com>
1004
1005 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
1006 handling of DW_LNE_define_file.
1007
feb5f3b0
CC
10082012-03-12 Cary Coutant <ccoutant@google.com>
1009
1010 * reduced_debug_output.cc
1011 (Output_reduced_debug_info_section::get_die_end): Add new FORM
1012 codes to switch.
1013
a1fb4256
CC
10142012-02-29 Cary Coutant <ccoutant@google.com>
1015
1016 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
1017
5dd8762a
CC
10182012-02-29 Cary Coutant <ccoutant@google.com>
1019
1020 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1021 Call Object::decompressed_section_contents.
1022 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
1023 New dtor.
1024 (Sized_dwarf_line_info::buffer_start_): New data member.
1025 * merge.cc (Output_merge_data::do_add_input_section): Call
1026 Object::decompressed_section_contents.
1027 (Output_merge_string::do_add_input_section): Likewise.
1028 * object.cc (need_decompressed_section): New function.
1029 (build_compressed_section_map): Decompress sections needed later.
1030 (Sized_relobj_file::do_decompressed_section_contents): New function.
1031 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1032 * object.h (Object::decompressed_section_contents): New function.
1033 (Object::discard_decompressed_sections): New function.
1034 (Object::do_decompressed_section_contents): New function.
1035 (Object::do_discard_decompressed_sections): New function.
1036 (Compressed_section_info): New type.
1037 (Compressed_section_map): Include decompressed section contents.
1038 (Sized_relobj_file::do_decompressed_section_contents): New function.
1039 (Sized_relobj_file::do_discard_decompressed_sections): New function.
1040
7b5de7ee
CC
10412012-02-16 Cary Coutant <ccoutant@google.com>
1042
1043 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
1044 * testsuite/Makefile.in: Regenerate.
1045
f9fa4a63
CC
10462012-02-14 Cary Coutant <ccoutant@google.com>
1047
1048 * options.cc (General_options::finalize): Disallow -pie and -static.
1049
2c175ebc
DK
10502012-02-03 Doug Kwan <dougkwan@google.com>
1051
1052 * arm.cc (Arm_relocate_functions::abs8,
1053 Arm_relocate_functions::abs16): Use
1054 Bits::has_signed_unsigned_overflow32.
1055 (Arm_relocate_functions::thm_abs8): Correct range of
1056 overflow check.
1057 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
1058 in assertions.
1059
90cff06f
DK
10602012-02-02 Doug Kwan <dougkwan@google.com>
1061
1062 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
1063 position independent outputs, not just shared objects.
1064
63887f3d
L
10652012-01-30 H.J. Lu <hongjiu.lu@intel.com>
1066
1067 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
1068 * configure: Regenerated.
1069
bef2b434
ILT
10702012-01-27 Ian Lance Taylor <iant@google.com>
1071
1072 * reloc.h (Bits): New class with static functions, copied from
1073 namespace utils in arm.cc.
1074 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
1075 instead.
1076
c335b55d
L
10772012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1078
1079 * incremental.cc (write_info_blocks): Correct relocation offset.
1080
41194d9f
L
10812012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1082
1083 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
1084 (Relocate::tls_gd_to_le): Likewise.
1085
1bae613c
L
10862012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1087
1088 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
1089
24482ca0
L
10902012-01-27 H.J. Lu <hongjiu.lu@intel.com>
1091
1092 * configure.ac: Check if -mcmodel=medium works.
1093 * configure: Regenerated.
1094
c2c7840a
CC
10952012-01-24 Cary Coutant <ccoutant@google.com>
1096
1097 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
1098 definition and ...
1099 (read_unsigned_LEB_128_x): ... this new function.
1100 (read_signed_LEB_128): Replaced with inline definition and ...
1101 (read_signed_LEB_128_x): ... this new function.
1102 * int_encoding.h (read_unsigned_LEB_128_x): New function.
1103 (read_unsigned_LEB_128): Add inline definition.
1104 (read_signed_LEB_128_x): New function.
1105 (read_signed_LEB_128): Add inline definition.
1106 * testsuite/Makefile.am (leb128_unittest): New unit test.
1107 * testsuite/Makefile.in: Regenerate.
1108 * testsuite/leb128_unittest.cc: New unit test.
1109
833de760 11102012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
1111
1112 PR gold/13617
1113 * i386.cc (Target_i386::do_code_fill): When using a jmp
1114 instruction, pad with nop instructions.
1115 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1116
618d6666
L
11172012-01-22 H.J. Lu <hongjiu.lu@intel.com>
1118
1119 * x86_64.cc (gc_process_relocs): Add typename on types used in
1120 template.
1121 (scan_relocs): Likewise.
1122 (relocate_section): Likewise.
1123 (apply_relocation): Likewise.
1124
3660ff06
L
11252012-01-10 H.J. Lu <hongjiu.lu@intel.com>
1126
1127 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
1128 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
1129 under x32.
1130
fc51264f
L
11312012-01-09 H.J. Lu <hongjiu.lu@intel.com>
1132
1133 * x86_64.cc: Initial support for x32.
1134
dd74ae06
CC
11352012-01-03 Cary Coutant <ccoutant@google.com>
1136
1137 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
1138 Use abstract base class for GOT.
1139 * gold/output.h (class Output_data_got_base): New abstract base class.
1140 (class Output_data_got): Derive from new base class, adjust ctors.
1141 (Output_data_got::reserve_slot): Make virtual; rename to
1142 do_reserve_slot; Adjust callers.
1143 * gold/target.h (Sized_target::init_got_plt_for_update): Return
1144 pointer to abstract base class.
1145 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
1146
83896202
ILT
11472011-12-18 Ian Lance Taylor <iant@google.com>
1148
1149 * object.h (Relobj::local_symbol_value): New function.
1150 (Relobj::local_plt_offset): New function.
1151 (Relobj::local_has_got_offset): New function.
1152 (Relobj::local_got_offset): New function.
1153 (Relobj::set_local_got_offset): New function.
1154 (Relobj::do_local_symbol_value): New pure virtual function.
1155 (Relobj::do_local_plt_offset): Likewise.
1156 (Relobj::do_local_has_got_offset): Likewise.
1157 (Relobj::do_local_got_offset): Likewise.
1158 (Relobj::do_set_local_got_offset): Likewise.
1159 (Sized_relobj::do_local_has_got_offset): Rename from
1160 local_has_got_offset.
1161 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
1162 (Sized_relobj::do_set_local_got_offset): Rename from
1163 set_local_got_offset.
1164 (Sized_relobj_file::do_local_plt_offset): Rename from
1165 local_plt_offset.
1166 (Sized_relobj_file::do_local_symbol_value): New function.
1167 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
1168 local_plt_offset.
1169 * output.cc (Output_data_got::Got_entry::write): Change object to
1170 Relobj. Use local_symbol_value.
1171 (Output_data_got::add_global_with_rel): Change rel_dyn to
1172 Output_data_reloc_generic*. Use add_global_generic.
1173 (Output_data_got::add_global_with_rela): Remove. Change all
1174 callers to use add_global_with_rel.
1175 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
1176 Output_data_reloc_generic*. Use add_global_generic.
1177 (Output_data_got::add_global_pair_with_rela): Remove. Change all
1178 callers to use add_global_pair_with_rel.
1179 (Output_data_got::add_local): Change object to Relobj*.
1180 (Output_data_got::add_local_plt): Likewise.
1181 (Output_data_got::add_local_with_rel): Change object to Relobj*,
1182 change rel_dyn to Output_data_reloc_generic*. Use
1183 add_local_generic.
1184 (Output_data_got::add_local_with_rela): Remove. Change all
1185 callers to use all_local_with_rel.
1186 (Output_data_got::add_local_pair_with_rel): Change object to
1187 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
1188 add_output_section_generic.
1189 (Output_data_got::add_local_pair_with_rela): Remove. Change all
1190 callers to use add_local_pair_with_rel.
1191 (Output_data_got::reserve_local): Change object to Relobj*.
1192 * output.h: (class Output_data_reloc_generic): Add pure virtual
1193 declarations for add_global_generic, add_local_generic,
1194 add_output_section_generic.
1195 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
1196 functions for Output_data_reloc_generic. Update declarations for
1197 changes listed in output.cc.
1198 (class Output_data_got): Change template parameter to got_size.
1199 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
1200 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
1201 function.
1202 (Sized_relobj_incr::do_local_plt_offset): New function.
1203 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
1204 add_global_generic.
1205
76677ad0
CC
12062011-12-17 Cary Coutant <ccoutant@google.com>
1207
1208 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
1209 * resolve.cc (Symbol_table::resolve): Likewise.
1210 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
1211 arrays.
1212 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
1213
8b8dd8d5
ILT
12142011-12-16 Ian Lance Taylor <iant@google.com>
1215
1216 * output.h (Output_data_reloc_generic::add): Only call
1217 add_dynamic_reloc if this is a dynamic reloc section.
1218
d55525b9
L
12192011-12-15 H.J. Lu <hongjiu.lu@intel.com>
1220
1221 PR gold/13505
1222 * target-reloc.h (apply_relocation): Replace <64, false> with
1223 <size, big_endian>.
1224
ff81c7c1
NC
12252011-11-25 Nick Clifton <nickc@redhat.com>
1226
1227 * po/it.po: New Italian translation.
1228
628f39be
SA
12292011-11-17 Sterling Augustine <saugustine@google.com>
1230
1231 * script.cc (script_include_directive): Implement.
1232 (read_script_file): New local variables name and search_path. Update
1233 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
1234 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
1235 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
1236
98ef3ea4
SA
12372011-11-11 Sterling Augustine <saugustine@google.com>
1238
1239 * yyscript.y (section_cmd): Add support for INCLUDE directive.
1240 (file_or_sections_cmd): Likewise.
1241
f4a8b6d7
DK
12422011-11-11 Doug Kwan <dougkwan@google.com>
1243
1244 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
1245 if --just-symbols is given.
1246
29ab395d
DK
12472011-11-10 Doug Kwan <dougkwan@google.com>
1248
1249 PR gold/13362
1250 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
1251 when processing data relocs.
1252 * reloc.h (Relocate_functions::rel_unaligned): New method.
1253 (Relocate_functions::pcrel_unaligned): Ditto.
1254 (Relocate_functions::rel32_unaligned): Ditto.
1255 (Relocate_functions::pcrel32_unaligned): Ditto.
1256
2c339f71
DK
12572011-11-09 Doug Kwan <dougkwan@google.com>
1258
1259 PR gold/13362
1260 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
1261 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
1262 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
1263 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1264 (Relocate_functions::rel_unaligned): New.
1265 (Relocate_functions::rel32_unaligned): New.
1266 * target-reloc.h (relocate_for_relocatable): Add code to handle
1267 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
1268 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
1269 arm_unaligned_reloc_r): New targets.
1270 * testsuite/Makefile.in: Regenerate.
1271 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
1272 linking.
1273
3f3cddf1
ILT
12742011-11-02 Ian Lance Taylor <iant@google.com>
1275
1276 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
1277 NATIVE_LINKER.
1278 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
1279 * options.cc (General_options::finalize): Use library search path
1280 from configure script if specified. If not native and no sysroot,
1281 only search TOOLLIBDIR.
1282 * options.h (Search_directory::Search_directory): Change name to
1283 const std::string&.
1284 (General_options::add_to_library_path_with_sysroot): Change arg to
1285 const std::string&.
1286 * configure, Makefile.in, config.in: Rebuild.
1287
a8e2273b
ILT
12882011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1289
1290 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
1291 we are working around the ARM1176 Erratum.
1292 * options.h (General_options::fix_arm1176): Add option.
1293 * testsuite/Makefile.am: Add testcases, and keep current ones
1294 working.
1295 * testsuite/Makefile.in: Regenerate.
1296 * testsuite/arm_fix_1176.s: New file.
1297 * testsuite/arm_fix_1176.sh: Likewise.
1298
cd6eab1c
ILT
12992011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
1300
1301 * arm.cc (Target_arm::Target_arm): Remove initialisation of
1302 may_use_blx_.
1303 (Target_arm::may_use_blx): Remove method.
1304 (Target_arm::set_may_use_blx): Likewise.
1305 (Target_arm::may_use_v4t_interworking): New method.
1306 (Target_arm::may_use_v5t_interworking): Likewise.
1307 (Target_arm::may_use_blx_): Remove member variable.
1308 (Arm_relocate_functions::arm_branch_common): Check for v5T
1309 interworking.
1310 (Arm_relocate_functions::thumb_branch_common): Likewise.
1311 (Reloc_stub::stub_type_for_reloc): Likewise.
1312 (Target_arm::do_finalize_sections): Correct interworking checks.
1313 * testsuite/Makefile.am: Add new tests.
1314 * testsuite/Makefile.in: Regenerate.
1315 * testsuite/arm_farcall_arm_arm.s: New test.
1316 * testsuite/arm_farcall_arm_arm.sh: Likewise.
1317 * testsuite/arm_farcall_arm_thumb.s: Likewise.
1318 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
1319 * testsuite/arm_farcall_thumb_arm.s: Likewise.
1320 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
1321 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
1322 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
1323
286adcf4
CC
13242011-10-31 Cary Coutant <ccoutant@google.com>
1325
1326 PR gold/13023
1327 * expression.cc (Expression::eval_with_dot): Add
1328 is_section_dot_assignment parameter.
1329 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
1330 absolute and assigning to dot within a section.
1331 * script-sections.cc
1332 (Output_section_element_assignment::set_section_addresses): Pass
1333 dot_section to set_if_absolute.
1334 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
1335 as is_section_dot_assignment flag to eval_with_dot.
1336 (Output_section_element_dot_assignment::set_section_addresses):
1337 Likewise.
1338 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
1339 parameter. Also set value if relative to dot_section; set the
1340 symbol's output_section.
1341 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
1342 parameter. Adjust all callers.
1343 (Expression::eval_maybe_dot): Likewise.
1344 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
1345 Adjust all callers.
1346 * testsuite/script_test_2.t: Test assignment of an absolute value
1347 to dot within an output section element.
1348
9634ed06
CC
13492011-10-31 Cary Coutant <ccoutant@google.com>
1350
1351 * options.h (class General_options): Add --[no-]gnu-unique options.
1352 * symtab.cc (Symbol_table::sized_write_globals): Convert
1353 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1354
de4101c7
CC
13552011-10-31 Cary Coutant <ccoutant@google.com>
1356
1357 PR gold/13359
1358 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1359 unnecessary assertion.
1360 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1361
7257cc92
ST
13622011-10-31 Sriraman Tallam <tmsriram@google.com>
1363
1364 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1365 gc_mark_symbol.
1366 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1367 gc_mark_symbol.
1368 Change to just keep the section associated with symbol.
1369 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1370 they are externally visible and --export-dynamic is turned on.
1371 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1372
bfc34b3f
ILT
13732011-10-19 Ian Lance Taylor <iant@google.com>
1374
1375 PR gold/13163
1376 * script-sections.cc
1377 (Output_section_element_dot_assignment::needs_output_section): New
1378 function.
1379
ea0d8c47
ILT
13802011-10-19 Ian Lance Taylor <iant@google.com>
1381
1382 PR gold/13204
1383 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1384 --section-start option was seen.
1385 * options.h (General_options::any_section_start): New function.
1386
abd242a9
DM
13872011-10-18 David S. Miller <davem@davemloft.net>
1388
1389 PR binutils/13301
1390 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1391 member to track relocation locations that have moved during TLS
1392 reloc optimizations.
1393 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1394 (Target_sparc::Relocate::relocate): Adjust view down by 4
1395 bytes if it matches reloc_adjust_addr_.
1396 (Target_sparc::Relocate::relocate_tls): Always move the
1397 __tls_get_addr call delay slot instruction forward 4 bytes when
1398 performing relaxation.
1399
bab9090f
CC
14002011-10-18 Cary Coutant <ccoutant@google.com>
1401
1402 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1403 (Output_file::map_no_anonymous): Check for non-zero
1404 return code from posix_fallocate.
1405
f7c5b166
CC
14062011-10-17 Cary Coutant <ccoutant@google.com>
1407
1408 PR gold/13245
1409 * plugin.cc (is_visible_from_outside): Check for symbols
1410 referenced from dynamic objects.
1411 * resolve.cc (Symbol_table::resolve): Don't count references
1412 from dynamic objects as references from real ELF files.
1413 * testsuite/plugin_test_2.sh: Adjust expected result.
1414
b490c0bb
CC
14152011-10-17 Cary Coutant <ccoutant@google.com>
1416
1417 * gold.cc: Include timer.h.
1418 (queue_middle_tasks): Stamp time.
1419 (queue_final_tasks): Likewise.
1420 * main.cc (main): Store timer in parameters. Print timers
1421 for each pass.
1422 * parameters.cc (Parameters::Parameters): Initialize timer_.
1423 (Parameters::set_timer): New function.
1424 (set_parameters_timer): New function.
1425 * parameters.h (Parameters::set_timer): New function.
1426 (Parameters::timer): New function.
1427 (Parameters::timer_): New data member.
1428 (set_parameters_timer): New function.
1429 * timer.cc (Timer::stamp): New function.
1430 (Timer::get_pass_time): New function.
1431 * timer.h (Timer::stamp): New function.
1432 (Timer::get_pass_time): New function.
1433 (Timer::pass_times_): New data member.
1434
f475cf7b
CC
14352011-10-17 Cary Coutant <ccoutant@google.com>
1436
1437 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1438 task for members of lib groups.
1439
cdd7e244
CC
14402011-10-17 Cary Coutant <ccoutant@google.com>
1441
1442 PR gold/13288
4f95c8b4 1443 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1444 (File_read::make_view): Move bounds check (replace with assert)...
1445 (File_read::find_or_make_view): ... to here.
1446
dfb45471
CC
14472011-10-12 Cary Coutant <ccoutant@google.com>
1448
4f95c8b4 1449 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1450 ::read returns less than requested size.
1451
53bbcc1b
CC
14522011-10-10 Cary Coutant <ccoutant@google.com>
1453
4f95c8b4 1454 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1455 Initialize defined_count_.
1456 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1457 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1458 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1459 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1460 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1461 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1462 member.
1463 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1464 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1465 Return zeroes instead of internal error.
1466
397b129b
CC
14672011-10-10 Cary Coutant <ccoutant@google.com>
1468
1469 PR gold/13249
4f95c8b4 1470 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1471 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1472 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1473 (Output_reloc::type_): Adjust size of bit field.
1474 (Output_reloc::use_plt_offset_): New bit field.
1475 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1476 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1477 flag. Adjust all callers.
4f95c8b4 1478 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1479 creating RELATIVE relocations.
1480
d5698657
NC
14812011-10-10 Nick Clifton <nickc@redhat.com>
1482
1483 * po/es.po: Updated Spanish translation.
1484 * po/fi.po: Updated Finnish translation.
1485
6a59a5c2
DN
14862011-10-03 Diego Novillo <dnovillo@google.com>
1487
1488 * options.cc (parse_uint): Fix dereference of RETVAL.
1489
f0558624
ST
14902011-09-29 Sriraman Tallam <tmsriram@google.com>
1491
1492 * layout.h (section_order_map_): New member.
1493 (get_section_order_map): New member function.
1494 * output.cc (Output_section::add_input_section): Check for patterns
1495 only when --section-ordering-file is specified.
1496 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1497 output_sections have been formed.
1498 * layout.cc (Layout_Layout): Initialize section_order_map_.
1499 * plugin.cc (update_section_order): Store order in order_map. Do not
1500 update the order.
1501 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1502 * testsuite/Makefile.in: Regenerate.
1503 * testsuite/plugin_section_order.c: New file.
1504 * testsuite/plugin_final_layout.cc: New file.
1505 * testsuite/plugin_final_layout.sh: New file.
1506
a7dac153
CC
15072011-09-29 Cary Coutant <ccoutant@google.com>
1508
4f95c8b4 1509 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1510 Check for NULL.
4f95c8b4 1511 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1512 symbols during incremental update.
1513 (Symbol_table::add_from_dynobj): Likewise.
1514
eebd87a5
ILT
15152011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1516 Ian Lance Taylor <iant@google.com>
1517
1518 * symtab.cc (Symbol_table::define_special_symbol): Always
1519 canonicalize version string.
1520
403a3331
CC
15212011-09-26 Cary Coutant <ccoutant@google.com>
1522
4f95c8b4
CC
1523 * gold.cc (queue_initial_tasks): Move option checks ...
1524 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1525 some options; make others fatal.
1526
235061c2
CC
15272011-09-26 Cary Coutant <ccoutant@google.com>
1528
1529 gcc PR lto/47247
1530 * plugin.cc (get_symbols_v2): New function.
1531 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1532 (is_referenced_from_outside): New function.
1533 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1534 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1535 (get_symbols): Pass version parameter.
1536 (get_symbols_v2): New function.
1537 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1538 parameter.
1539 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1540 (onload): Add LDPT_GET_SYMBOLS_V2.
1541 (all_symbols_read_hook): Use get_symbols_v2; check for
1542 LDPR_PREVAILING_DEF_IRONLY_EXP.
1543 * testsuite/plugin_test_3.sh: Update expected results.
1544
dc87f620
ILT
15452011-09-23 Simon Baldwin <simonb@google.com>
1546
1547 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1548 configuration options.
1549 * configure: Regenerate.
1550 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1551 * Makefile.in: Regenerate.
1552 * testsuite/Makefile.in: Regenerate.
1553
a8279f82
ST
15542011-09-19 Sriraman Tallam <tmsriram@google.com>
1555
1556 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1557
0c9350c8
CC
15582011-09-19 Cary Coutant <ccoutant@google.com>
1559
1560 * incremental.cc (can_incremental_update): Fix typo in comment.
1561 * incremental.h (can_incremental_update): Likewise.
1562
aa06ae28
CC
15632011-09-18 Cary Coutant <ccoutant@google.com>
1564
1565 * incremental.cc (can_incremental_update): New function.
1566 * incremental.h (can_incremental_update): New function.
1567 * layout.cc (Layout::init_fixed_output_section): Call it.
1568 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1569 * object.cc (Sized_relobj_file::do_layout): Call
1570 can_incremental_update.
1571
ebb300b2
CC
15722011-09-13 Cary Coutant <ccoutant@google.com>
1573
1574 * configure.ac: Check for glibc support for gnu_indirect_function
1575 support with static linking, setting automake conditional
1576 IFUNC_STATIC.
1577 * Makefile.in: Regenerate.
1578 * configure: Regenerate.
1579
1580 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1581 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1582 for IFUNC_STATIC.
1583 * testsuite/Makefile.in: Regenerate.
1584
1206d0d5
CC
15852011-09-13 Cary Coutant <ccoutant@google.com>
1586
1587 * incremental.cc (Sized_relobj_incr::do_layout): Call
1588 report_comdat_group for kept comdat sections.
1589 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1590 * testsuite/Makefile.in: Regenerate.
1591 * testsuite/incr_comdat_test_1.cc: New source file.
1592 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1593 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1594 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1595
40b29874
ILT
15962011-09-13 Ian Lance Taylor <iant@google.com>
1597
1598 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1599 variable external_symbols_offset.
1600
1b045aac
ILT
16012011-09-12 Ian Lance Taylor <iant@google.com>
1602
1603 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1604 triggered if object has no symbols.
1605
24c6c55a
DM
16062011-09-09 David S. Miller <davem@davemloft.net>
1607
1608 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1609 (Output_fill_debug_line::do_write): Likewise.
1610
66570254
CC
16112011-08-29 Cary Coutant <ccoutant@google.com>
1612
1613 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1614 casts to match formatting specs.
1615 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1616
8ea8cd50
CC
16172011-08-26 Cary Coutant <ccoutant@google.com>
1618
1619 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1620 remaining hole size when allocating.
1621 (Layout::make_output_section): Set fill methods for debug sections.
1622 * layout.h (Free_list::Free_list_node): Move from private to
1623 public.
1624 (Free_list::set_min_hole_size): New function.
1625 (Free_list::begin, Free_list::end): New functions.
1626 (Free_list::min_hole_): New data member.
1627 * output.cc: Include dwarf.h.
1628 (Output_fill_debug_info::do_minimum_hole_size): New function.
1629 (Output_fill_debug_info::do_write): New function.
1630 (Output_fill_debug_line::do_minimum_hole_size): New function.
1631 (Output_fill_debug_line::do_write): New function.
1632 (Output_section::Output_section): Initialize new data member.
1633 (Output_section::set_final_data_size): Ensure patch space is larger
1634 than minimum hole size.
1635 (Output_section::do_write): Fill holes in debug sections.
1636 * output.h (Output_fill): New class.
1637 (Output_fill_debug_info): New class.
1638 (Output_fill_debug_line): New class.
1639 (Output_section::set_free_space_fill): New function.
1640 (Output_section::free_space_fill_): New data member.
1641 * testsuite/Makefile.am (incremental_test_3): Add
1642 --incremental-patch option.
1643 (incremental_test_4): Likewise.
1644 (incremental_test_5): Likewise.
1645 (incremental_test_6): Likewise.
1646 (incremental_copy_test): Likewise.
1647 (incremental_common_test_1): Likewise.
1648 * testsuite/Makefile.in: Regenerate.
1649
7cf80422
NC
16502011-08-26 Nick Clifton <nickc@redhat.com>
1651
1652 * po/es.po: Updated Spanish translation.
1653
c3f7b0e5
CC
16542011-08-01 Cary Coutant <ccoutant@google.com>
1655
1656 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1657 * gold/testsuite/Makefile.in: Regenerate.
1658 * gold/testsuite/justsyms_exec.c: New source file.
1659 * gold/testsuite/justsyms_lib.c: New source file.
1660
9590bf25
CC
16612011-08-01 Cary Coutant <ccoutant@google.com>
1662
1663 * layout.cc (Layout::set_segment_offsets): Don't realign text
1664 segment if -Ttext was specified.
1665 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1666 file type.
1667 * object.h (Sized_relobj_file::e_type): New function.
1668 (Sized_relobj_file::e_type_): New data member.
1669 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1670 base address for ET_EXEC files.
1671 * target.cc (Target::do_make_elf_object_implementation): Allow
1672 ET_EXEC files with --just-symbols option.
1673
dcd8d12e
CC
16742011-07-28 Cary Coutant <ccoutant@google.com>
1675
1676 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1677 Add thread_number parameter.
1678 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1679 * workqueue-threads.cc
1680 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1681 current thread if its thread number is greater than desired thread
1682 count.
1683 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1684 Add thread_number parameter.
1685 (Workqueue::should_cancel_thread): Likewise.
1686 (Workqueue::find_runnable_or_wait): Pass thread_number to
1687 should_cancel_thread.
1688 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1689 parameter.
1690
804eb480
ST
16912011-07-22 Sriraman Tallam <tmsriram@google.com>
1692
1693 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1694 only after checking if it cannot be forced local.
1695 * symtab.h (is_externally_visible): Check if the symbol is not forced
1696 local.
1697
f1ddb600
ILT
16982011-07-15 Ian Lance Taylor <iant@google.com>
1699
1700 * options.h (class General_options): Add --print-output-format.
1701 Move -EL next to -EB, for better --help output.
1702 * target-select.cc: Include <cstdio>, "options.h", and
1703 "parameters.h".
1704 (Target_selector::do_target_bfd_name): New function.
1705 (print_output_format): New function.
1706 * target-select.h (class Target_selector): Update declarations.
1707 (Target_selector::target_bfd_name): New function.
1708 (print_output_format): Declare.
1709 * main.cc: Include "target-select.h".
1710 (main): Handle --print-output-format.
1711 * gold.cc: Include "target-select.h".
1712 (queue_initial_tasks): Handle --print-output-format when there are
1713 no input files.
1714 * parameters.cc (parameters_force_valid_target): Give a better
1715 error message if -EB/-EL does not match target.
1716 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1717 function.
1718
7d172687
ILT
17192011-07-15 Ian Lance Taylor <iant@google.com>
1720
1721 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1722 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1723 (Output_data_plt_i386::do_write): Write address of .dynamic
1724 section to first entry in .got.plt section.
1725 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1726 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1727 Initialize layout_.
1728 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1729 section to first entry in .got.plt section.
1730 * layout.h (Layout::dynamic_section): New function.
1731
e9552f7e
ST
17322011-07-13 Sriraman Tallam <tmsriram@google.com>
1733
1734 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1735 to claim_file call.
1736 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1737 input_section_position_, and input_section_glob_.
1738 (read_layout_from_file): Call function section_ordering_specified.
1739 * layout.h (is_section_ordering_specified): New function.
1740 (section_ordering_specified): New function.
1741 (section_ordering_specified_): New boolean member.
1742 * main.cc(main): Call load_plugins after layout object is defined.
1743 * output.cc (Output_section::add_input_section): Use
1744 function section_ordering_specified to check if section ordering is
1745 needed.
1746 * output.cc (Output_section::add_relaxed_input_section): Use
1747 function section_ordering_specified to check if section ordering is
1748 needed.
1749 (Output_section::update_section_layout): New function.
1750 (Output_section::sort_attached_input_sections): Check if input section
1751 must be reordered.
1752 * output.h (Output_section::update_section_layout): New function.
1753 * plugin.cc (get_section_count): New function.
1754 (get_section_type): New function.
1755 (get_section_name): New function.
1756 (get_section_contents): New function.
1757 (update_section_order): New function.
58797674 1758 (allow_section_ordering): New function.
e9552f7e
ST
1759 (Plugin::load): Add the new interfaces to the transfer vector.
1760 (Plugin_manager::load_plugins): New parameter.
1761 (Plugin_manager::all_symbols_read): New parameter.
1762 (Plugin_manager::claim_file): New parameter. Save the elf object for
1763 unclaimed objects.
1764 (Plugin_manager::get_elf_object): New function.
1765 (Plugin_manager::get_view): Change to directly use the bool to check
1766 if get_view is called from claim_file_hook.
1767 * plugin.h (input_objects): New function
1768 (Plugin__manager::load_plugins): New parameter.
1769 (Plugin_manager::claim_file): New parameter.
1770 (Plugin_manager::get_elf_object): New function.
1771 (Plugin_manager::in_claim_file_handler): New function.
1772 (Plugin_manager::in_claim_file_handler_): New member.
1773 (layout): New function.
1774 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1775 handler with an extra parameter. Make the elf object before calling
1776 claim_file handler.
1777 * testsuite/plugin_test.c (get_section_count): New function pointer.
1778 (get_section_type): New function pointer.
1779 (get_section_name): New function pointer.
1780 (get_section_contents): New function pointer.
1781 (update_section_order): New function pointer.
1782 (allow_section_ordering): New function pointer.
1783 (onload): Check if the new interfaces exist.
1784
9446efde
ILT
17852011-07-13 Ian Lance Taylor <iant@google.com>
1786
1787 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1788 relro section.
1789 * x86_64.cc (Target_x86_64::got_section): Likewise.
1790 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1791 (relro_now_test_SOURCES): New variable.
1792 (relro_now_test_DEPENDENCIES): New variable.
1793 (relro_now_test_LDFLAGS): New variable.
1794 (relro_now_test_LDADD): New variable.
1795 (relro_now_test.so): New target.
1796 * testsuite/Makefile.in: Rebuild.
1797
07aa62f2
ILT
17982011-07-12 Ian Lance Taylor <iant@google.com>
1799
1800 PR gold/12980
1801 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1802 GLOB_DAT relocation rather than a RELATIVE relocation for a
1803 protected symbol when creating a shared library.
1804 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1805 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1806 * testsuite/protected_main_1.cc (main): Test that protected
1807 function has same address.
1808
e2153196
ILT
18092011-07-11 Ian Lance Taylor <iant@google.com>
1810
1811 PR gold/12979
1812 * options.h (class General_options): Add -Bgroup.
1813 * options.cc (General_options::finalize): If -Bgroup is set,
1814 default to --unresolved-symbols=report-all.
1815 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1816 * target-reloc.h (issue_undefined_symbol_error): Handle
1817 --unresolved-symbols=report-all.
1818
6daf5215
ILT
18192011-07-08 Ian Lance Taylor <iant@google.com>
1820
1821 PR gold/11985
1822 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1823 if linker script discards key sections.
1824 (Layout::create_dynamic_symtab): Likewise.
1825 (Layout::assign_local_dynsym_offsets): Likewise.
1826 (Layout::sized_create_version_sections): Likewise.
1827 (Layout::create_interp): Likewise.
1828 (Layout::finish_dynamic_section): Likewise.
1829 (Layout::set_dynamic_symbol_size): Likewise.
1830
beabb2c6
ILT
18312011-07-08 Ian Lance Taylor <iant@google.com>
1832
1833 PR gold/12386
1834 * options.h (class General_options): Add --unresolved-symbols.
1835 * target-reloc.h (issue_undefined_symbol_error): Check
1836 --unresolved-symbols. Add comments.
1837
9c16daf1
ILT
18382011-07-08 Ian Lance Taylor <iant@google.com>
1839
1840 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1841 expression more complex.
1842
191f1a2d
ILT
18432011-07-08 Ian Lance Taylor <iant@google.com>
1844
1845 PR gold/11317
1846 * target-reloc.h (issue_undefined_symbol_error): New inline
1847 function, broken out of relocate_section.
1848 (relocate_section): Call issue_undefined_symbol_error.
1849 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1850 there is no TLS segment if we are about to issue an undefined
1851 symbol error.
1852 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1853
62855347
ILT
18542011-07-08 Ian Lance Taylor <iant@google.com>
1855
1856 PR gold/12279
1857 * resolve.cc (Symbol_table::should_override): Add fromtype
1858 parameter. Change all callers. Give error when linking together
1859 TLS and non-TLS symbol.
1860 (Symbol_table::should_override_with_special): Add fromtype
1861 parameter. Change all callers.
1862 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1863 there is no TLS segment if we have reported some errors.
1864 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1865
67181c72
ILT
18662011-07-08 Ian Lance Taylor <iant@google.com>
1867
1868 PR gold/12372
1869 * target.h (Target::plt_address_for_global): New function.
1870 (Target::plt_address_for_local): New function.
1871 (Target::plt_section_for_global): Remove.
1872 (Target::plt_section_for_local): Remove.
1873 (Target::do_plt_address_for_global): New virtual function.
1874 (Target::do_plt_address_for_local): New virtual function.
1875 (Target::do_plt_section_for_global): Remove.
1876 (Target::do_plt_section_for_local): Remove.
1877 (Target::register_global_plt_entry): Add Symbol_table and Layout
1878 parameters.
1879 * output.cc (Output_data_got::Got_entry::write): Use
1880 plt_address_for_global and plt_address_for_local.
1881 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1882 address of output section.
1883 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1884 got_irelative_, and irelative_count_ fields. Update
1885 declarations.
1886 (Output_data_plt_i386::has_irelative_section): New function.
1887 (Output_data_plt_i386::entry_count): Add irelative_count_.
1888 (Output_data_plt_i386::set_final_data_size): Likewise.
1889 (class Target_i386): Add got_irelative_ and rel_irelative_
1890 fields. Update declarations.
1891 (Target_i386::Target_i386): Initialize new fields.
1892 (Target_i386::do_plt_address_for_global): New function replacing
1893 do_plt_section_for_global.
1894 (Target_i386::do_plt_address_for_local): New function replacing
1895 do_plt_section_for_local.
1896 (Target_i386::got_section): Create got_irelative_.
1897 (Target_i386::rel_irelative_section): New function.
1898 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1899 fields. Don't define __rel_iplt_{start,end}.
1900 (Output_data_plt_i386::add_entry): Add symtab and layout
1901 parameters. Change all callers. Use different PLT and GOT for
1902 IFUNC symbols.
1903 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1904 layout parameters. Change all callers. Use different PLT and
1905 GOT.
1906 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1907 (Output_data_plt_i386::rel_irelative): New function.
1908 (Output_data_plt_i386::address_for_global): New function.
1909 (Output_data_plt_i386::address_for_local): New function.
1910 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1911 IRELATIVE GOT when changing IFUNC GOT entries.
1912 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1913 reloc.
1914 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1915 if we didn't create an IRELATIVE GOT.
1916 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1917 plt_address_for_local.
1918 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1919 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1920 got_irelative_, and irelative_count_ fields. Update
1921 declarations.
1922 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1923 Initialize new fields. Remove symtab parameter. Change all
1924 callers.
1925 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1926 irelative_count_.
1927 (Output_data_plt_x86_64::has_irelative_section): New function.
1928 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1929 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1930 fields. Update declarations.
1931 (Target_x86_64::Target_x86_64): Initialize new fields.
1932 (Target_x86_64::do_plt_address_for_global): New function replacing
1933 do_plt_section_for_global.
1934 (Target_x86_64::do_plt_address_for_local): New function replacing
1935 do_plt_section_for_local.
1936 (Target_x86_64::got_section): Create got_irelative_.
1937 (Target_x86_64::rela_irelative_section): New function.
1938 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1939 all callers. Don't create __rel_iplt_{start,end}.
1940 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1941 parameters. Change all callers. Use different PLT and GOT for
1942 IFUNC symbols.
1943 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1944 layout parameters. Change all callers. Use different PLT and
1945 GOT.
1946 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1947 parameters. Change all callers. Use different PLT and GOT for
1948 IFUNC symbols.
1949 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1950 (Output_data_plt_x86_64::rela_irelative): New function.
1951 (Output_data_plt_x86_64::address_for_global): New function.
1952 (Output_data_plt_x86_64::address_for_local): New function.
1953 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1954 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1955 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1956 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1957 parameters.
1958 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1959 reloc.
1960 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1961 symbols if we didn't create an IRELATIVE GOT.
1962 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1963 plt_address_for_local.
1964 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1965 * testsuite/ifuncvar1.c: New test file.
1966 * testsuite/ifuncvar2.c: New test file.
1967 * testsuite/ifuncvar3.c: New test file.
1968 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1969 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1970 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1971 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1972 * testsuite/Makefile.in: Rebuild.
1973
33c15b45
CC
19742011-07-07 Cary Coutant <ccoutant@google.com>
1975
1976 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1977 (two_file_test_1_ndebug.o): Likewise.
1978 (two_file_test_1b_ndebug.o): Likewise.
1979 (two_file_test_2_ndebug.o): Likewise.
1980 (two_file_test_main_ndebug.o): Likewise.
1981 (incremental_test_2): Link with no-debug versions.
1982
f48b5fb7
CC
19832011-07-06 Cary Coutant <ccoutant@google.com>
1984
1985 * gold/incremental.cc
1986 (Output_section_incremental_inputs::write_info_blocks): Check for
1987 hidden and internal symbols.
1988
221597a5
CC
19892011-07-06 Cary Coutant <ccoutant@google.com>
1990
1991 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1992 Check disposition for startup file.
1993 (Incremental_inputs::report_command_line): Ignore
1994 --incremental-startup-unchanged option.
1995 * options.cc (General_options::parse_incremental_startup_unchanged):
1996 New function.
1997 (General_options::General_options): Initialize new data member.
1998 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1999 (General_options): Add --incremental-startup-unchanged option.
2000 (General_options::incremental_startup_disposition): New function.
2001 (General_options::incremental_startup_disposition_): New data member.
2002
e24719f6
CC
20032011-07-06 Cary Coutant <ccoutant@google.com>
2004
2005 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
2006 input file index to Script_info ctor.
2007 (Sized_incremental_binary::do_file_has_changed): Find the
2008 command-line argument for files named in scripts.
2009 * incremental.h (Script_info::Script_info): New ctor
2010 with input file index.
2011 (Script_info::input_file_index): New function.
2012 (Script_info::input_file_index_): New data member.
2013 (Incremental_binary::get_library): Add const.
2014 (Incremental_binary::get_script_info): Add const.
2015 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
2016 * testsuite/Makefile.am (incremental_test_5): New test case.
2017 (incremental_test_6): New test case.
2018 * testsuite/Makefile.in: Regenerate.
2019
8f7c81e8
CC
20202011-07-06 Cary Coutant <ccoutant@google.com>
2021
2022 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
2023 debug output when command lines differ.
2024
9fbd3822
CC
20252011-07-06 Cary Coutant <ccoutant@google.com>
2026
2027 * incremental.cc (Incremental_inputs::report_command_line): Ignore
2028 --incremental-patch option.
2029 * layout.cc (Free_list::allocate): Extend allocation beyond original
2030 end if enabled.
2031 (Layout::make_output_section): Mark sections that should get
2032 patch space.
2033 * options.cc (parse_percent): New function.
2034 * options.h (parse_percent): New function.
2035 (DEFINE_percent): New macro.
2036 (General_options): Add --incremental-patch option.
2037 * output.cc (Output_section::Output_section): Initialize new data
2038 members.
2039 (Output_section::add_input_section): Print section name when out
2040 of patch space.
2041 (Output_section::add_output_section_data): Likewise.
2042 (Output_section::set_final_data_size): Add patch space when
2043 doing --incremental-full.
2044 (Output_section::do_reset_address_and_file_offset): Remove patch
2045 space.
2046 (Output_segment::set_section_list_addresses): Print debug output
2047 only if --incremental-update.
2048 * output.h (Output_section::set_is_patch_space_allowed): New function.
2049 (Output_section::is_patch_space_allowed_): New data member.
2050 (Output_section::patch_space_): New data member.
2051 * parameters.cc (Parameters::incremental_full): New function.
2052 * parameters.h (Parameters::incremental_full): New function
2053 * testsuite/Makefile.am (incremental_test_2): Add test for
2054 --incremental-patch option.
2055 * testsuite/Makefile.in: Regenerate.
2056 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
2057 (t18): Remove function body.
2058
f6cccc2c
DK
20592011-07-05 Doug Kwan <dougkwan@google.com>
2060
2061 PR gold/12771
2062 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
2063 Arm_Address type for relocation result.
2064 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
2065 overflow check.
2066 (Arm_relocate_functions::abs32): Use unaligned access.
2067 (Arm_relocate_functions::rel32): Ditto.
2068 (Arm_relocate_functions::prel31): Ditto.
2069 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
2070 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
2071 static data relocations.
2072 * testsuite/Makefile.in: Regnerate.
2073 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
2074
28a13fec
ILT
20752011-07-05 Ian Lance Taylor <iant@google.com>
2076
2077 PR gold/12392
2078 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
2079 symbols if necessary.
2080 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2081
24d47b34
ILT
20822011-07-05 Ian Lance Taylor <iant@google.com>
2083
2084 PR gold/12952
2085 * resolve.cc (Symbol::override_base_with_special): Simply override
2086 version with special symbol version, ignoring previous version.
2087
41f9cbbe
ILT
20882011-07-05 Ian Lance Taylor <iant@google.com>
2089
2090 * object.cc (Sized_relobj_file::include_section_group): Add
2091 information to comment about signature location.
2092
886288f1
ILT
20932011-07-02 Ian Lance Taylor <iant@google.com>
2094
2095 PR gold/12957
2096 * options.h (class General_options): Add -f and -F.
2097 * options.cc (General_options::finalize): Fatal error if -f/-F
2098 are used without -shared.
2099 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
2100
ae3a6d4f
ILT
21012011-07-02 Ian Lance Taylor <iant@google.com>
2102
2103 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
2104
21131061
ILT
21052011-07-01 Ian Lance Taylor <iant@google.com>
2106
2107 PR gold/12525
2108 PR gold/12952
2109 * resolve.cc (Symbol::override_base_with_special): Don't override
2110 the version if the overriding symbol has a different name.
2111 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
2112 all callers. If we give an error about an undefined version,
2113 define the base version if necessary.
2114 * dynobj.h (class Versions): Update declaration.
2115 * testsuite/weak_alias_test_5.cc: New file.
2116 * testsuite/weak_alias_test.script: New file.
2117 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
2118 and versioned_alias have the right value, and call t2.
2119 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
2120 weak_alias_test_5.so.
2121 (weak_alias_test_LDADD): Likewise.
2122 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
2123 * testsuite/Makefile.in: Rebuild.
2124
611062c0
ILT
21252011-07-01 Ian Lance Taylor <iant@google.com>
2126
2127 PR gold/12525
2128 * options.h (class General_options): Support -z notext.
2129 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
2130 -Wl,-z,notext.
2131 (two_file_shared_nonpic.so): Likewise.
2132 (two_file_shared_mixed.so): Likewise.
2133 (two_file_shared_mixed_1.so): Likewise.
2134 (weak_undef_lib_nonpic.so): Likewise.
2135 (alt/weak_undef_lib_nonpic.so): Likewise.
2136 (tls_test_shared_nonpic.so): Likewise.
2137 * testsuite/Makefile.in: Rebuild.
2138
328c7c2f
ILT
21392011-07-01 Ian Lance Taylor <iant@google.com>
2140
2141 PR gold/12525
2142 * configure.ac: Test whether static linking works, setting
2143 the automake conditional HAVE_STATIC.
2144 * testsuite/Makefile.am: Disable tests using -static if
2145 HAVE_STATIC is not true.
2146 * configure, testsuite/Makefile.in: Rebuild.
2147
02d7cd44
ILT
21482011-07-01 Ian Lance Taylor <iant@google.com>
2149
2150 PR gold/12525
2151 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
2152 Assert if we see DW_EH_PE_indirect.
2153 * target.h (Target::ehframe_datarel_base): New function.
2154 (Target::do_ehframe_datarel_base): New target function.
2155 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
2156 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
2157 function.
2158
07a60597
ILT
21592011-07-01 Ian Lance Taylor <iant@google.com>
2160
2161 PR gold/12571
2162 * options.h (class General_options): Add
2163 --ld-generated-unwind-info.
2164 * ehframe.cc (Fde::write): Add address parameter. Change all
2165 callers. If associated with PLT, fill in address and size.
2166 (Cie::set_output_offset): Only add merge mapping if there is an
2167 object.
2168 (Cie::write): Add address parameter. Change all callers.
2169 (Eh_frame::add_ehframe_for_plt): New function.
2170 * ehframe.h (class Fde): Update declarations. Move shndx_ and
2171 input_offset_ fields into union u_, with new plt field.
2172 (Fde::Fde): Adjust for new union field.
2173 (Fde::Fde) [Output_data version]: New constructor.
2174 (Fde::add_mapping): Only add merge mapping if there is an object.
2175 (class Cie): Update declarations.
2176 (class Eh_frame): Declare add_ehframe_for_plt.
2177 * layout.cc (Layout::layout_eh_frame): Break out code into
2178 make_eh_frame_section, and call it.
2179 (Layout::make_eh_frame_section): New function.
2180 (Layout::add_eh_frame_for_plt): New function.
2181 * layout.h (class Layout): Update declarations.
2182 * merge.cc (Merge_map::add_mapping): Add assertion.
2183 * i386.cc: Include "dwarf.h".
2184 (class Output_data_plt_i386): Make first_plt_entry,
2185 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
2186 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2187 and plt_eh_frame_fde.
2188 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
2189 boundary. Call add_eh_frame_for_plt if appropriate.
2190 * x86_64.cc: Include "dwarf.h".
2191 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
2192 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
2193 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
2194 and plt_eh_frame_fde.
2195 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
2196 appropriate.
2197
14788a3f
ILT
21982011-06-29 Ian Lance Taylor <iant@google.com>
2199
2200 PR gold/12629
2201 * object.cc (Sized_relobj_file::layout_section): Change shdr
2202 parameter to be const.
2203 (Sized_relobj_file::layout_eh_frame_section): New function, broken
2204 out of do_layout.
2205 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
2206 appropriate. Call layout_eh_frame_section.
2207 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
2208 sections.
2209 * object.h (class Sized_relobj_file): Update declarations.
2210
6c21fce1
ILT
22112011-06-29 Ian Lance Taylor <iant@google.com>
2212
37e41b03 2213 PR gold/12652
6c21fce1
ILT
2214 * script.cc (Token::integer_value): Accept trailing M/m/K/k
2215 modifier.
2216 (Lex::gather_token): Accept trailing M/m/K/k for integers.
2217
4d5e4e62
ILT
22182011-06-29 Ian Lance Taylor <iant@google.com>
2219
2220 PR gold/12675
2221 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
2222 SHT_X86_64_UNWIND.
2223 * layout.cc (Layout::layout_eh_frame): Likewise.
2224
886f533a
ILT
22252011-06-29 Ian Lance Taylor <iant@google.com>
2226
2227 PR gold/12695
2228 * layout.cc (Layout::symtab_section_shndx): New function.
2229 * layout.h (class Layout): Declare symtab_section_shndx.
2230 * output.cc (Output_section::write_header): Call it.
2231
f3ae1b28
ILT
22322011-06-29 Ian Lance Taylor <iant@google.com>
2233
2234 PR gold/12818
2235 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
2236 symbols which are not used in a relocation.
2237
aecf301f
ILT
22382011-06-28 Ian Lance Taylor <iant@google.com>
2239
2240 PR gold/12898
2241 * layout.cc (Layout::segment_precedes): Don't crash if a linker
2242 script create indistinguishable segments.
2243 (Layout::set_segment_offsets): Use stable_sort when sorting
2244 segments. Pass this to Compare_segments constructor.
2245 * layout.h (class Layout): Make segment_precedes non-static.
2246 (class Compare_segments): Change from struct to class. Add
2247 layout_ field. Add constructor.
2248 * script-sections.cc
2249 (Script_sections::attach_sections_using_phdrs_clause): Rename
2250 local orphan to is_orphan. Don't report failure to put empty
2251 section in segment. On attachment failure, report name of
2252 section, and attach to first PT_LOAD segment.
2253
03ef7571
ILT
22542011-06-28 Ian Lance Taylor <iant@google.com>
2255
2256 PR gold/12934
2257 * target-select.cc (Target_selector::Target_selector): Add
2258 emulation parameter. Change all callers.
2259 (select_target_by_bfd_name): Rename from select_target_by_name.
2260 Change all callers.
2261 (select_target_by_emulation): New function.
2262 (supported_emulation_names): New function.
2263 * target-select.h (class Target_selector): Add emulation_ field.
2264 Update declarations.
2265 (Target_selector::recognize_by_bfd_name): Rename from
2266 recognize_by_name. Change all callers.
2267 (Target_selector::supported_bfd_names): Rename from
2268 supported_names. Change all callers.
2269 (Target_selector::recognize_by_emulation): New function.
2270 (Target_selector::supported_emulations): New function.
2271 (Target_selector::emulation): New function.
2272 (Target_selector::do_recognize_by_bfd_name): Rename from
2273 do_recognize_by_name. Change all callers.
2274 (Target_selector::do_supported_bfd_names): Rename from
2275 do_supported_names. Change all callers.
2276 (Target_selector::do_recognize_by_emulation): New function.
2277 (Target_selector::do_supported_emulations): New function.
2278 (select_target_by_bfd_name): Change name in declaration.
2279 (select_target_by_emulation): Declare.
2280 (supported_emulation_names): Declare.
2281 * parameters.cc (parameters_force_valid_target): Try to find
2282 target based on emulation from -m option.
2283 * options.h (class General_options): Change doc string for -m.
2284 * options.cc (help): Print emulations.
2285 (General_options::parse_V): Likewise.
2286 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
2287 Add emulation parameter. Change all callers.
2288
200b2bb9
ILT
22892011-06-28 Ian Lance Taylor <iant@google.com>
2290
2291 * target.h (class Target): Add osabi_ field.
2292 (Target::osabi): New function.
2293 (Target::set_osabi): New function.
2294 (Target::Target): Initialize osabi_.
2295 (Target::do_adjust_elf_header): Make pure virtual.
2296 (Sized_target::do_adjust_elf_header): Declare.
2297 * target.cc (Sized_target::do_adjust_elf_header): New function.
2298 (class Sized_target): Instantiate all versions.
2299 * freebsd.h (class Target_freebsd): Remove.
2300 (Target_selector_freebsd::do_recognize): Call set_osabi on
2301 Target.
2302 (Target_selector_freebsd::do_recognize_by_name): Likewise.
2303 (Target_selector_freebsd::set_osabi): Remove.
2304 * i386.cc (class Target_i386): Inherit from Sized_target rather
2305 than Target_freebsd.
2306 * x86_64.cc (class Target_x86_64): Likewise.
2307
b3ce541e
ILT
23082011-06-28 Ian Lance Taylor <iant@google.com>
2309
2310 * target.h (Target::can_check_for_function_pointers): Rewrite.
2311 Make non-virtual.
2312 (Target::can_icf_inline_merge_sections): Likewise.
2313 (Target::section_may_have_icf_unsafe_poineters): Likewise.
2314 (Target::Target_info): Add can_icf_inline_merge_sections field.
2315 (Target::do_can_check_for_function_pointers): New virtual
2316 function.
2317 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
2318 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
2319 from can_check_for_function_pointers, move in file.
2320 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
2321 section_may_have_icf_unsafe_poineters, move in file.
2322 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
2323 * i386.cc (Target_i386::do_can_check_for_function_pointers):
2324 Rename from can_check_for_function_pointers, move in file.
2325 (Target_i386::can_icf_inline_merge_sections): Remove.
2326 (Target_i386::i386_info): Initialize
2327 can_icf_inline_merge_sections.
2328 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
2329 Initialize can_icf_inline_merge_sections.
2330 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
2331 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
2332 Rename from can_check_for_function_pointers, move in file.
2333 (Target_x86_64::can_icf_inline_merge_sections): Remove.
2334 (Target_x86_64::x86_64_info): Initialize
2335 can_icf_inline_merge_sections.
2336 * testsuite/testfile.cc (Target_test::test_target_info):
2337 Likewise.
2338 * icf.cc (get_section_contents): Correct formatting.
2339
6d1c4efb
ILT
23402011-06-27 Ian Lance Taylor <iant@google.com>
2341
2342 * symtab.cc (Symbol::versioned_name): New function.
2343 (Symbol_table::add_to_final_symtab): Use versioned_name when
2344 appropriate.
2345 (Symbol_table::sized_write_symbol): Likewise.
2346 * symtab.h (class Symbol): Declare versioned_name.
2347 * stringpool.h (class Stringpool_template): Add variant of add
2348 which takes a std::basic_string.
2349 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
2350 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
2351 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2352 (ver_test_12.o): New target.
2353 * testsuite/Makefile.in: Rebuild.
2354
57eb9b50
DK
23552011-06-27 Doug Kwan <dougkwan@google.com>
2356
2357 * arm.cc (Arm_relocate_functions::thm_jump8,
2358 Arm_relocate_functions::thm_jump11): Use a wider signed
2359 type to compute offset.
2360 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2361 arm_thm_jump8.
2362 * testsuite/Makefile.in: Regenerate.
2363 * testsuite/arm_branch_in_range.sh: Check test results of
2364 arm_thm_jump11 and arm_thm_jump8.
2365 * testsuite/arm_thm_jump11.s: New test source file.
2366 * testsuite/arm_thm_jump11.t: New linker script.
2367 * testsuite/arm_thm_jump8.s: New test source file.
2368 * testsuite/arm_thm_jump8.t: New linker script.
2369
487b39df
ILT
23702011-06-24 Ian Lance Taylor <iant@google.com>
2371
2372 * layout.cc: Include "object.h".
2373 (ctors_sections_in_init_array): New static variable.
2374 (Layout::is_ctors_in_init_array): New function.
2375 (Layout::layout): Add entry to ctors_sections_in_init_array if
2376 appropriate.
2377 * layout.h (class Layout): Declare is_ctors_in_init_array.
2378 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2379 is_ctors_reverse_view is set.
2380 (Sized_relobj_file::write_sections): Add layout parameter. Change
2381 all callers. Set is_ctors_reverse_view field of View_size.
2382 (Sized_relobj_file::reverse_words): New function.
2383 * object.h (Sized_relobj_file::View_size): Add
2384 is_ctors_reverse_view field.
2385 (class Sized_relobj_file): Update declarations.
2386 * testsuite/initpri3.c: New test.
2387 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2388 initpri3b.
2389 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2390 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2391 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2392 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2393 * testsuite/Makefile.in: Rebuild.
2394
472076e4
CC
23952011-06-24 Cary Coutant <ccoutant@google.com>
2396
2397 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2398 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2399 (debug_msg_cdebug.err): New targets.
2400 * testsuite/Makefile.in: Regenerate.
2401 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2402 Fix checks for link with shared library.
2403
a60af0db
DK
24042011-06-24 Doug Kwan <dougkwan@google.com>
2405
2406 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2407 skip empty text sections.
2408 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2409
5393d741
ILT
24102011-06-22 Ian Lance Taylor <iant@google.com>
2411
2412 PR gold/12910
2413 * options.h (class General_options): Add --ctors-in-init-array.
2414 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2415 friends as SHT_PROGBITS for merging sections.
2416 (Layout::layout): Remove special handling of .init_array and
2417 friends. Don't sort if doing relocatable link. Sort for .ctors
2418 and .dtors if ctors_in_init_array.
2419 (Layout::make_output_section): Force correct section types for
2420 .init_array and friends. Don't sort if doing relocatable link,
2421 Don't sort .ctors and .dtors if ctors_in_init_array.
2422 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2423 (Layout::output_section_name): Add relobj parameter. Change all
2424 callers. Handle .ctors. and .dtors. in code rather than table.
2425 Handle .ctors and .dtors if ctors_in_init_array.
2426 (Layout::match_file_name): New function, moved from output.cc.
2427 * layout.h (class Layout): Update declarations.
2428 * output.cc: Include "layout.h".
2429 (Input_section_sort_entry::get_priority): New function.
2430 (Input_section_sort_entry::match_file_name): Just call
2431 Layout::match_file_name.
2432 (Output_section::Input_section_sort_init_fini_compare::operator()):
2433 Handle .ctors and .dtors. Sort by explicit priority rather than
2434 by name.
2435 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2436 * testsuite/initpri2.c: New test.
2437 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2438 (check_PROGRAMS): Add initpri2.
2439 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2440 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2441 * configure, testsuite/Makefile.in: Rebuild.
2442
e1f74f98
ILT
24432011-06-19 Ian Lance Taylor <iant@google.com>
2444
2445 PR gold/12880
2446 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2447 .interp section to a PT_INTERP segment even if we have seen a
2448 --dynamic-linker option. Don't do it if we have seen a PHDRS
2449 clause in a linker script.
2450 (Layout::finalize): Don't create a .interp section if we've
2451 already create a PT_INTERP segment.
2452 (Layout::create_interp): Always call choose_output_section (revert
2453 patch of 2011-06-17). Don't create PT_INTERP segment.
2454 * script-sections.cc
2455 (Script_sections::create_note_and_tls_segments): Add a .interp
2456 section to a PT_INTERP segment even if we have seen a
2457 --dynamic-linker option.
2458
766f91bb
ILT
24592011-06-18 Ian Lance Taylor <iant@google.com>
2460
2461 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2462 merely because a non-PT_LOAD segment has a dynamic reloc.
2463
0d212c3a
ILT
24642011-06-18 Ian Lance Taylor <iant@google.com>
2465
2466 * layout.cc (Layout::finish_dynamic_section): Don't create
2467 DT_FLAGS entry if not needed.
2468
911a5072
ILT
24692011-06-18 Ian Lance Taylor <iant@google.com>
2470
2471 PR gold/12745
2472 * layout.cc (Layout::layout_eh_frame): Correct handling of
2473 writable .eh_frame section.
2474
534b4e5f
ILT
24752011-06-17 Ian Lance Taylor <iant@google.com>
2476
2477 PR gold/12893
2478 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2479 symbol is redefined with the exact same object and value.
2480
10b4f102
ILT
24812011-06-17 Ian Lance Taylor <iant@google.com>
2482
2483 PR gold/12880
2484 * layout.h (class Layout): Add interp_segment_ field.
2485 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2486 (Layout::attach_allocated_section_to_segment): If making shared
2487 library, put .interp section in PT_INTERP segment.
2488 (Layout::finalize): Also call create_interp if -dynamic-linker
2489 option was used.
2490 (Layout::create_interp): Assert that there is no PT_INTERP
2491 segment. If not using a SECTIONS clause, use make_output_section.
2492 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2493 * script-sections.cc
2494 (Script_sections::create_note_and_tls_segments): If making shared
2495 library, put .interp section in PT_INTERP segment.
2496
a29b0dad
ILT
24972011-06-17 Ian Lance Taylor <iant@google.com>
2498
e588ea8d
ILT
2499 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2500 when making a shared library.
2501
25022011-06-17 Ian Lance Taylor <iant@google.com>
2503
2504 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2505 parameter. Change all callers. Don't issue warning about PC32
2506 against locally defined symbol.
a29b0dad 2507
9d3b0698
ILT
25082011-06-16 Ian Lance Taylor <iant@google.com>
2509
2510 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2511 occurs in same object.
2512
85b0f90c
AM
25132011-06-14 Alan Modra <amodra@gmail.com>
2514
2515 * po/POTFILES.in: Regenerate.
2516
a94907d9
ILT
25172011-06-09 Ian Lance Taylor <iant@google.com>
2518
2519 * script-sections.cc
2520 (Orphan_output_section::set_section_addresses): For a relocatable
2521 link set address to 0.
2522
4fb3a1c3
CC
25232011-06-09 Cary Coutant <ccoutant@google.com>
2524
2525 PR gold/12804
2526 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2527 used with --compress-debug-sections.
2528 * gold/object.cc (Sized_relobj_file::do_layout): Report
2529 uncompressed size of compressed input sections.
2530
61220854
CC
25312011-06-08 Cary Coutant <ccoutant@google.com>
2532
2533 PR gold/12804
2534 * testsuite/two_file_test_2_v1.cc: Change initialization of
2535 v2 to keep it in .data.
2536
e6455dfb
CC
25372011-06-07 Cary Coutant <ccoutant@google.com>
2538
2539 * common.cc (Symbol_table::do_allocate_commons_list): Call
2540 gold_fallback.
2541 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2542 (Errors::fallback): New function.
2543 (gold_fallback): New function.
2544 * errors.h (Errors::fallback): New function.
2545 * gold.cc (gold_exit): Change status parameter to enum; adjust
2546 all callers.
2547 (queue_initial_tasks): Call gold_fallback.
2548 * gold.h: Include cstdlib.
2549 (Exit_status): New enum type.
2550 (gold_exit): Change status parameter to enum.
2551 (gold_fallback): New function.
2552 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2553 (Layout::create_symtab_sections): Likewise.
2554 (Layout::create_shdrs): Likewise.
2555 * main.cc (main): Adjust call to gold_exit.
2556 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2557 (Output_data_got::add_got_entry_pair): Likewise.
2558 (Output_section::add_input_section): Likewise.
2559 (Output_section::add_output_section_data): Likewise.
2560 (Output_segment::set_section_list_addresses): Likewise.
2561 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2562
fb0e076f
CC
25632011-06-07 Cary Coutant <ccoutant@google.com>
2564
2565 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2566 for incremental links.
2567 * output.cc (Output_segment::set_section_list_addresses): Remove
2568 FIXME and test for TLS or BSS.
2569
a5ee4d5d
CC
25702011-06-07 Cary Coutant <ccoutant@google.com>
2571
2572 * testsuite/Makefile.am: Add incremental_copy_test,
2573 incremental_common_test_1.
2574 * testsuite/Makefile.in: Regenerate.
2575 * testsuite/common_test_1_v1.c: New source file.
2576 * testsuite/common_test_1_v2.c: New source file.
2577 * testsuite/copy_test_v1.cc: New source file.
2578
5146f448
CC
25792011-06-07 Cary Coutant <ccoutant@google.com>
2580
2581 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2582 update, allocate common from bss section's free list.
2583 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2584 linker-defined symbols.
2585 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2586 Skip GOT and PLT entries that are no longer referenced.
2587 (Output_section_incremental_inputs::write_info_blocks): Mark
2588 linker-defined symbols.
2589 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2590 * output.cc (Output_section::allocate): New function.
2591 * output.h (Output_section::allocate): New function.
2592 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2593 linker-defined symbols.
2594 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2595 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2596 (Symbol::init_base_output_data): Likewise.
2597 (Symbol::init_base_output_segment): Likewise.
2598 (Symbol::init_base_constant): Likewise.
2599 (Sized_symbol::init_output_data): Likewise.
2600 (Sized_symbol::init_output_segment): Likewise.
2601 (Sized_symbol::init_constant): Likewise.
2602 (Symbol_table::do_define_in_output_data): Likewise.
2603 (Symbol_table::do_define_in_output_segment): Likewise.
2604 (Symbol_table::do_define_as_constant): Likewise.
2605 * symtab.h (Symbol::is_predefined): New function.
2606 (Symbol::init_base_output_data): Add is_predefined parameter.
2607 (Symbol::init_base_output_segment): Likewise.
2608 (Symbol::init_base_constant): Likewise.
2609 (Symbol::is_predefined_): New data member.
2610 (Sized_symbol::init_output_data): Add is_predefined parameter.
2611 (Sized_symbol::init_output_segment): Likewise.
2612 (Sized_symbol::init_constant): Likewise.
2613 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2614
26d3c67d
CC
26152011-06-07 Cary Coutant <ccoutant@google.com>
2616
2617 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2618 instead of emit_copy_reloc.
2619 (Copy_relocs::emit_copy_reloc): Refactor.
2620 (Copy_relocs::make_copy_reloc): New function.
2621 (Copy_relocs::add_copy_reloc): Remove.
2622 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2623 section.
2624 (Copy_relocs::make_copy_reloc): New function.
2625 (Copy_relocs::add_copy_reloc): Remove.
2626 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2627 unchanged input files.
2628 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2629 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2630 Reserve BSS space for COPY relocations.
2631 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2632 (Output_section_incremental_inputs::write_info_blocks): Record
2633 whether a symbol is copied from a shared object.
2634 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2635 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2636 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2637 (Incremental_input_entry_reader::get_output_symbol_index): Add
2638 is_copy parameter.
2639 (Incremental_binary::emit_copy_relocs): New function.
2640 (Incremental_binary::do_emit_copy_relocs): New function.
2641 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2642 new data member.
2643 (Sized_incremental_binary::add_copy_reloc): New function.
2644 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2645 (Sized_incremental_binary::Copy_reloc): New struct.
2646 (Sized_incremental_binary::Copy_relocs): New typedef.
2647 (Sized_incremental_binary::copy_relocs_): New data member.
2648 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2649 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2650 * target.h (Sized_target::emit_copy_reloc): New function.
2651 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2652
7cdb37d9
CC
26532011-06-02 Cary Coutant <ccoutant@google.com>
2654
2655 PR gold/12163
2656 * gold/archive.cc (Archive::Archive): Initialize new data member.
2657 (Archive::include_all_members): Return if archive has already been
2658 included.
2659 * gold/archive.h (Archive::include_all_members_): New data member.
2660
cc643b88
NC
26612011-06-02 Nick Clifton <nickc@redhat.com>
2662
2663 * dynobj.h: Fix spelling mistake in comment.
2664 * output.cc: Likewise.
2665
f62a3ca7 26662011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2667 Asier Llano
f62a3ca7
DK
2668
2669 PR gold/12826
cc643b88 2670 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2671 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2672 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2673 redundant arm_exidx_test.so.
2674 * testsuite/Makefile.in: Regenerate.
2675 (check_SCRIPTS): Add pr12826.sh
2676 (check_DATA): Add pr12826.stdout
2677 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2678 * testsuite/pr12826.sh: New file.
2679 * testsuite/pr12826_1.s: Ditto.
2680 * testsuite/pr12826_1.s: Ditto.
2681
8dbe1edc
ILT
26822011-05-30 Ian Lance Taylor <iant@google.com>
2683
2684 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2685 sections.
2686
c49875be
ILT
26872011-05-29 Ian Lance Taylor <iant@google.com>
2688
2689 PR gold/12804
2690 * testsuite/Makefile.am: Use different file name for two_file_test
2691 temporary file for each incremental test.
2692 * testsuite/Makefile.in: Rebuild.
2693
69d53f7a
ILT
26942011-05-29 Ian Lance Taylor <iant@google.com>
2695
2696 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2697 binary input file is empty.
2698
41d0ab5f
ILT
26992011-05-27 Ian Lance Taylor <iant@google.com>
2700
2701 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2702 (ver_test_9.so): Likewise.
2703 * testsuite/Makefile.in: Rebuild.
2704
89d8a36b
CC
27052011-05-26 Cary Coutant <ccoutant@google.com>
2706
2707 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2708 * incremental.cc (Incremental_inputs::report_input_section): Fix
2709 comment, indentation.
2710 (Incremental_inputs::report_comdat_group): New function.
2711 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2712 of data for incremental input file entry.
2713 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2714 group count, COMDAT group signatures.
2715 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2716 an unchanged input file.
2717 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2718 Initialize new data member.
2719 (Incremental_object_entry::add_comdat_group): New function.
2720 (Incremental_object_entry::get_comdat_group_count): New function.
2721 (Incremental_object_entry::get_comdat_signature_key): New function.
2722 (Incremental_object_entry::groups_): New data member.
2723 (Incremental_inputs::report_comdat_group): New function.
2724 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2725 data for incremental input file entry.
2726 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2727 (Incremental_input_entry_reader::get_input_section): Adjust size of
2728 data for incremental input file entry.
2729 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2730 (Incremental_input_entry_reader::get_comdat_group_signature): New
2731 function.
2732 * object.cc (Sized_relobj::include_section_group): Report kept
2733 COMDAT groups for incremental links.
2734
1706a06f
ILT
27352011-05-24 David Meyer <pdox@google.com>
2736
2737 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2738 with name parameter. Add found_name parameter.
2739 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2740 * dirsearch.h (class Dirsearch): Update declaration.
2741
a10ae760
ILT
27422011-05-24 Ian Lance Taylor <iant@google.com>
2743
2744 * archive.cc (Library_base::should_include_member): Pull in object
2745 from archive if it defines the entry symbol.
2746 * parameters.cc (Parameters::entry): New function.
2747 * parameters.h (class Parameters): Declare entry.
2748 * output.h (class Output_file_header): Remove entry_ field.
2749 * output.cc (Output_file_header::Output_file_header): Remove entry
2750 parameter. Change all callers.
2751 (Output_file_header::entry): Use parameters->entry.
2752 * gold.cc (queue_middle_tasks): Likewise.
2753 * plugin.cc (Plugin_hook::run): Likewise.
2754
aa92d6ed
CC
27552011-05-24 Cary Coutant <ccoutant@google.com>
2756
2757 * gold.cc (queue_initial_tasks): Pass incremental base filename
2758 to Output_file::open_base_file; don't print error message.
2759 * incremental-dump.cc (main): Adjust call to
2760 Output_file::open_for_modification.
2761 * incremental-dump.cc (main): Likewise.
2762 * incremental.cc (Incremental_inputs::report_command_line):
2763 Ignore --incremental-base option when comparing command lines.
2764 Ignore parameter when given as separate argument.
2765 * options.h (class General_options): Add --incremental-base.
2766 * output.cc (Output_file::Output_file):
2767 (Output_file::open_base_file): Add base_name and writable parameters;
2768 read base file into new file; print error message here.
2769 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2770 callers.
2771 * output.h (Output_file::open_for_modification): Rename to...
2772 (Output_file::open_base_file): ...this; add base_name and
2773 writable parameters; adjust all callers.
2774 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2775 callers.
2776 * testsuite/Makefile.am (incremental_test_4): Test
2777 --incremental-base.
2778 * testsuite/Makefile.in: Regenerate.
2779
2eedd706
CC
27802011-05-24 Cary Coutant <ccoutant@google.com>
2781
2782 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2783 incremental_test_4.
2784 * testsuite/Makefile.in: Regenerate.
2785 * testsuite/two_file_test_1_v1.cc: New test source file.
2786 * testsuite/two_file_test_1b_v1.cc: New test source file.
2787 * testsuite/two_file_test_2_v1.cc: New test source file.
2788
0f1c85a6
CC
27892011-05-24 Cary Coutant <ccoutant@google.com>
2790
2791 * dynobj.h (Dynobj::do_dynobj): New function.
2792 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2793 flag and soname for shared objects.
2794 * incremental.cc (Incremental_inputs::report_object): Make
2795 either Incremental_object_entry or Incremental_dynobj_entry; add
2796 soname to string table.
2797 (Incremental_inputs::report_input_section): Add assertion.
2798 (Output_section_incremental_inputs::set_final_data_size): Adjust
2799 type of input file entry for shared libraries; adjust size of
2800 shared library info entry.
2801 (Output_section_incremental_inputs::write_input_files): Write
2802 as_needed flag for shared libraries.
2803 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2804 of input file entry for shared libraries; write soname.
2805 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2806 soname from incremental info.
2807 * incremental.h (enum Incremental_input_flags): Add
2808 INCREMENTAL_INPUT_AS_NEEDED.
2809 (Incremental_input_entry::Incremental_input_entry): Initialize new
2810 data member.
2811 (Incremental_input_entry::set_as_needed): New function.
2812 (Incremental_input_entry::as_needed): New function.
2813 (Incremental_input_entry::do_dynobj_entry): New function.
2814 (Incremental_input_entry::as_needed_): New data member.
2815 (Incremental_object_entry::Incremental_object_entry): Don't check
2816 for shared library.
2817 (Incremental_object_entry::do_type): Likewise.
2818 (class Incremental_dynobj_entry): New class.
2819 (Incremental_input_entry_reader::as_needed): New function.
2820 (Incremental_input_entry_reader::get_soname): New function.
2821 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2822 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2823 size of shared library info entry.
58797674 2824 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2825 incremental link when adding DT_NEEDED entries.
2826 * object.h (Object::Object): Initialize new data member.
2827 (Object::dynobj): New function.
2828 (Object::set_as_needed): New function.
2829 (Object::as_needed): New function.
2830 (Object::do_dynobj): New function.
2831 (Object::as_needed_): New data member.
2832
6fa2a40b
CC
28332011-05-24 Cary Coutant <ccoutant@google.com>
2834
2835 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2836 info; adjust display of GOT entries.
2837 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2838 vector of input objects; remove file_status_.
2839 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2840 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2841 got_plt reader; call target hooks to reserve GOT entries.
2842 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2843 of input file info header and GOT info entry.
2844 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2845 relocation info.
2846 (Got_plt_view_info::got_descriptor): Remove.
2847 (Got_plt_view_info::sym_index): New data member.
2848 (Got_plt_view_info::input_index): New data member.
2849 (Local_got_offset_visitor::visit): Write input file index.
2850 (Global_got_offset_visitor::visit): Write 0 for input file index.
2851 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2852 with sym_index and input_index.
2853 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2854 incremental info GOT entry; replace got_descriptor with input_index.
2855 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2856 map from input file index to object.
2857 (Sized_relobj_incr::do_layout): Replace direct data member reference
2858 with accessor function.
2859 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2860 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2861 Adjust size of input file info header.
2862 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2863 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2864 (Incremental_input_entry_reader::get_input_section): Adjust size of
2865 input file info header.
2866 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2867 of incremental info GOT entry.
2868 (Incremental_got_plt_reader::get_got_desc): Remove.
2869 (Incremental_got_plt_reader::get_got_symndx): New function.
2870 (Incremental_got_plt_reader::get_got_input_index): New function.
2871 (Sized_incremental_binary::Sized_incremental_binary): Remove
2872 file_status_; add input_objects_.
2873 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2874 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2875 (Sized_incremental_binary::file_is_unchanged): Remove.
2876 (Sized_incremental_binary::set_input_object): New function.
2877 (Sized_incremental_binary::input_object): New function.
2878 (Sized_incremental_binary::file_status_): Remove.
2879 (Sized_incremental_binary::input_objects_): New data member.
2880 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2881 references.
2882 (Sized_relobj_incr::invalid_address): Move to base class.
2883 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2884 class.
2885 (Sized_relobj_incr::do_output_section_offset): Likewise.
2886 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2887 (Sized_relobj_incr::section_offsets_): Likewise.
2888 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2889 function.
2890 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2891 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2892 with accessor function.
2893 (Sized_relobj_file::do_layout): Likewise.
2894 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2895 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2896 (Sized_relobj_file::compute_final_local_value): Replace refs to
2897 section_offsets_ with accessor function.
2898 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2899 * object.h (Relobj::Relobj): Initialize new data members.
2900 (Relobj::add_dyn_reloc): New function.
2901 (Relobj::first_dyn_reloc): New function.
2902 (Relobj::dyn_reloc_count): New function.
2903 (Relobj::first_dyn_reloc_): New data member.
2904 (Relobj::dyn_reloc_count_): New data member.
2905 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2906 references.
2907 (Sized_relobj::Address): New typedef.
2908 (Sized_relobj::invalid_address): Move here from child class.
2909 (Sized_relobj::Sized_relobj): Initialize new data members.
2910 (Sized_relobj::sized_relobj): New function.
2911 (Sized_relobj::is_output_section_offset_invalid): Move here from
2912 child class.
2913 (Sized_relobj::get_output_section_offset): Likewise.
2914 (Sized_relobj::local_has_got_offset): Likewise.
2915 (Sized_relobj::local_got_offset): Likewise.
2916 (Sized_relobj::set_local_got_offset): Likewise.
2917 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2918 (Sized_relobj::clear_got_offsets): New function.
2919 (Sized_relobj::section_offsets): Move here from child class.
2920 (Sized_relobj::do_output_section_offset): Likewise.
2921 (Sized_relobj::do_set_section_offset): Likewise.
2922 (Sized_relobj::Local_got_offsets): Likewise.
2923 (Sized_relobj::local_got_offsets_): Likewise.
2924 (Sized_relobj::section_offsets_): Likewise.
2925 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2926 references.
2927 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2928 class.
2929 (Sized_relobj_file::sized_relobj): New function
2930 (Sized_relobj_file::local_has_got_offset): Move to base class.
2931 (Sized_relobj_file::local_got_offset): Likewise.
2932 (Sized_relobj_file::set_local_got_offset): Likewise.
2933 (Sized_relobj_file::get_output_section_offset): Likewise.
2934 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2935 (Sized_relobj_file::do_output_section_offset): Likewise.
2936 (Sized_relobj_file::do_set_section_offset): Likewise.
2937 (Sized_relobj_file::Local_got_offsets): Likewise.
2938 (Sized_relobj_file::local_got_offsets_): Likewise.
2939 (Sized_relobj_file::section_offsets_): Likewise.
2940 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2941 (all constructors).
2942 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2943 (Output_reloc::get_symbol_index): Likewise.
2944 (Output_reloc::local_section_offset): Likewise.
2945 (Output_reloc::get_address): Likewise.
2946 (Output_reloc::symbol_value): Likewise.
2947 (Output_data_got::reserve_slot): Move to class definition.
2948 (Output_data_got::reserve_local): New function.
2949 (Output_data_got::reserve_slot_for_global): Remove.
2950 (Output_data_got::reserve_global): New function.
2951 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2952 (all constructors, two instantiations).
2953 (Output_reloc::get_relobj): New function (two instantiations).
2954 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2955 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2956 (Output_data_reloc::add_global): Adjust type of relobj.
2957 (Output_data_reloc::add_global_relative): Likewise.
2958 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2959 (Output_data_reloc::add_local): Likewise.
2960 (Output_data_reloc::add_local_relative): Likewise.
2961 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2962 (Output_data_reloc::add_local_section): Likewise.
2963 (Output_data_reloc::add_output_section): Likewise.
2964 (Output_data_reloc::add_absolute): Likewise.
2965 (Output_data_reloc::add_target_specific): Likewise.
2966 (Output_data_got::reserve_slot): Move definition here.
2967 (Output_data_got::reserve_local): New function.
2968 (Output_data_got::reserve_global): New function.
2969 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2970 section_offsets_ with accessor function.
2971 (Sized_relobj_file::write_sections): Likewise.
2972 (Sized_relobj_file::do_relocate_sections): Likewise.
2973 * target.h (Sized_target::reserve_local_got_entry): New function.
2974 (Sized_target::reserve_global_got_entry): New function.
2975 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2976 (Target_x86_64::reserve_global_got_entry): New function.
2977 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2978
4829d394
CC
29792011-05-23 Cary Coutant <ccoutant@google.com>
2980
2981 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2982 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2983 bit when checking got_type.
2984 * incremental.cc (Sized_incremental_binary::setup_readers):
2985 Store symbol table and string table locations; initialize bit vector
2986 of file status flags.
2987 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2988 unchanged files.
2989 (Sized_incremental_binary::do_process_got_plt): New function.
2990 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2991 (Output_section_incremental_inputs::set_final_data_size): Record
2992 file index for each input file.
2993 (Output_section_incremental_inputs::write_got_plt): Store file index
2994 instead of input entry offset for each GOT entry.
2995 * incremental.h
2996 (Incremental_input_entry::Incremental_input_entry): Initialize new
2997 data member.
2998 (Incremental_input_entry::set_offset): Store file index.
2999 (Incremental_input_entry::get_file_index): New function.
3000 (Incremental_input_entry::file_index_): New data member.
3001 (Incremental_binary::process_got_plt): New function.
3002 (Incremental_binary::do_process_got_plt): New function.
3003 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3004 data members.
3005 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
3006 (Sized_incremental_binary::set_file_is_unchanged): New function.
3007 (Sized_incremental_binary::file_is_unchanged): New function.
3008 (Sized_incremental_binary::do_process_got_plt): New function.
3009 (Sized_incremental_binary::file_status_): New data member.
3010 (Sized_incremental_binary::main_symtab_loc_): New data member.
3011 (Sized_incremental_binary::main_strtab_loc_): New data member.
3012 * output.cc (Output_data_got::Got_entry::write): Add case
3013 RESERVED_CODE.
3014 (Output_data_got::add_global): Call add_got_entry.
3015 (Output_data_got::add_global_plt): Likewise.
3016 (Output_data_got::add_global_with_rel): Likewise.
3017 (Output_data_got::add_global_with_rela): Likewise.
3018 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
3019 (Output_data_got::add_global_pair_with_rela): Likewise.
3020 (Output_data_got::add_local): Call add_got_entry.
3021 (Output_data_got::add_local_plt): Likewise.
3022 (Output_data_got::add_local_with_rel): Likewise.
3023 (Output_data_got::add_local_with_rela): Likewise.
3024 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
3025 (Output_data_got::add_local_pair_with_rela): Likewise.
3026 (Output_data_got::reserve_slot): New function.
3027 (Output_data_got::reserve_slot_for_global): New function.
3028 (Output_data_got::add_got_entry): New function.
3029 (Output_data_got::add_got_entry_pair): New function.
3030 (Output_section::add_output_section_data): Edit FIXME.
3031 * output.h
3032 (Output_section_data_build::Output_section_data_build): New
3033 constructor with size parameter.
3034 (Output_data_space::Output_data_space): Likewise.
3035 (Output_data_got::Output_data_got): Initialize new data member; new
3036 constructor with size parameter.
3037 (Output_data_got::add_constant): Call add_got_entry.
3038 (Output_data_got::reserve_slot): New function.
3039 (Output_data_got::reserve_slot_for_global): New function.
3040 (class Output_data_got::Got_entry): Add RESERVED_CODE.
3041 (Output_data_got::add_got_entry): New function.
3042 (Output_data_got::add_got_entry_pair): New function.
3043 (Output_data_got::free_list_): New data member.
3044 * target.h (Sized_target::init_got_plt_for_update): New function.
3045 (Sized_target::register_global_plt_entry): New function.
3046 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
3047 Initialize new data member; call init; add constructor with PLT count.
3048 (Output_data_plt_x86_64::init): New function.
3049 (Output_data_plt_x86_64::add_relocation): New function.
3050 (Output_data_plt_x86_64::reserve_slot): New function.
3051 (Output_data_plt_x86_64::free_list_): New data member.
3052 (Target_x86_64::init_got_plt_for_update): New function.
3053 (Target_x86_64::register_global_plt_entry): New function.
3054 (Output_data_plt_x86_64::add_entry): Allocate from free list for
3055 incremental updates.
3056 (Output_data_plt_x86_64::add_relocation): New function.
3057 * testsuite/object_unittest.cc (Object_test): Set default options.
3058
ec69d6da
ILT
30592011-05-16 Ian Lance Taylor <iant@google.com>
3060
3061 * options.h (class General_options): Make -i a synonym for -r.
3062
732e31de
ILT
30632011-05-16 Ian Lance Taylor <iant@google.com>
3064
3065 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
3066
403676b5
CC
30672011-05-10 Cary Coutant <ccoutant@google.com>
3068
3069 * object.cc (Sized_relobj::do_count_local_symbols): Check for
3070 strip_all (-s).
3071
5b7b7d6e
ILT
30722011-05-06 Ian Lance Taylor <iant@google.com>
3073
3074 * layout.cc (Layout::layout): If the output section flags change,
3075 update the ordering.
3076
f0f9babf
CC
30772011-04-25 Cary Coutant <ccoutant@google.com>
3078
3079 * incremental-dump.cc (dump_incremental_inputs): Print local
3080 symbol info for each input file.
3081 * incremental.cc
3082 (Output_section_incremental_inputs::set_final_data_size): Add local
3083 symbol info to input file entries in incremental info.
3084 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3085 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
3086 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
3087 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
3088 implementation.
3089 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
3090 (Sized_incr_relobj::do_relocate): Write the local symbols.
3091 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
3092 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
3093 Adjust size of input file header.
3094 (Incremental_inputs_reader::get_local_symbol_offset): New function.
3095 (Incremental_inputs_reader::get_local_symbol_count): New function.
3096 (Incremental_inputs_reader::get_input_section): Adjust size of input
3097 file header.
3098 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
3099 (Sized_incr_relobj::This): New typedef.
3100 (Sized_incr_relobj::sym_size): New const data member.
3101 (Sized_incr_relobj::Local_symbol): New struct.
3102 (Sized_incr_relobj::do_output_local_symbol_count): New function.
3103 (Sized_incr_relobj::do_local_symbol_offset): New function.
3104 (Sized_incr_relobj::local_symbol_count_): New data member.
3105 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
3106 (Sized_incr_relobj::local_symbol_index_): New data member.
3107 (Sized_incr_relobj::local_symbol_offset_): New data member.
3108 (Sized_incr_relobj::local_dynsym_offset_): New data member.
3109 (Sized_incr_relobj::local_symbols_): New data member.
3110 * object.h (Relobj::output_local_symbol_count): New function.
3111 (Relobj::local_symbol_offset): New function.
3112 (Relobj::do_output_local_symbol_count): New function.
3113 (Relobj::do_local_symbol_offset): New function.
3114 (Sized_relobj::do_output_local_symbol_count): New function.
3115 (Sized_relobj::do_local_symbol_offset): New function.
3116
d0a9ace3
ILT
31172011-04-22 Vladimir Simonov <sv@sw.ru>
3118
3119 * descriptors.cc (set_close_on_exec): New function.
3120 (Descriptors::open): Use set_close_on_exec.
3121 * output.cc (S_ISLNK): Define if not defined.
3122
94a3fc8b
CC
31232011-04-22 Cary Coutant <ccoutant@google.com>
3124
3125 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
3126 global symbol map.
3127 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3128 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
3129 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
3130 relocations.
3131 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
3132 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
3133 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
3134 * incremental.h
3135 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
3136 function.
3137 (Incremental_binary::apply_incremental_relocs): New function.
3138 (Incremental_binary::do_apply_incremental_relocs): New function.
3139 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
3140 data member.
3141 (Sized_incremental_binary::add_global_symbol): New function.
3142 (Sized_incremental_binary::global_symbol): New function.
3143 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
3144 (Sized_incremental_binary::symbol_map_): New data member.
3145 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
3146 * target.h (Sized_target::apply_relocation): New function.
3147 * target-reloc.h (apply_relocation): New function.
3148 * x86_64.cc (Target_x86_64::apply_relocation): New function.
3149
c87e4302
DK
31502011-04-22 Doug Kwan <dougkwan@google.com>
3151
3152 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
3153 flag of a SHT_ARM_EXIDX section.
2e702c99 3154 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
3155 * testsuite/Makefile.in: Regenerate.
3156 * testsuite/arm_exidx_test.s: New file.
3157 * testsuite/arm_exidx_test.sh: Same.
3158
e7782cf6
CC
31592011-04-20 Cary Coutant <ccoutant@google.com>
3160
3161 PR gold/12689
3162 * archive.h (Incremental_archive_entry::Archive_member):
3163 Initialize arg_serial_ (second constructor).
3164
308ecdc7
ILT
31652011-04-17 Ian Lance Taylor <iant@google.com>
3166
3167 * object.cc (Relocate_info::location): Simplify location string.
3168 * errors.cc (Errors::error_at_location): Don't print program
3169 name.
3170 (Errors::warning_at_location): Likewise.
3171 (Errors::undefined_symbol): Likewise.
3172 * testsuite/debug_msg.sh: Update accordingly.
3173
bec5b579
CC
31742011-04-14 Cary Coutant <ccoutant@google.com>
3175
3176 * gold/layout.cc (Layout::symtab_section_offset): New function.
3177 * gold/layout.h (Layout::symtab_section_offset): New function.
3178 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
3179
88597d34
ILT
31802011-04-12 Ian Lance Taylor <iant@google.com>
3181
3182 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
3183 with MREMAP_MAYMOVE.
3184 * output.h (class Output_file): Add map_is_allocated_ field.
3185 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
3186 not available, provide stubs. If mremap is not available, #define
3187 it to gold_mremap.
3188 (MREMAP_MAYMOVE): Define if not defined.
3189 (Output_file::Output_file): Initialize map_is_allocated_.
3190 (Output_file::resize): Check map_is_allocated_.
3191 (Output_file::map_anonymous): If mmap fails, use malloc.
3192 (Output_file::unmap): Don't do anything for an anonymous map.
3193 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
3194 is not available, provide stubs.
3195 (File_read::View::~View): Use free rather than delete[].
3196 (File_read::make_view): Use malloc rather than new[]. If mmap
3197 fails, use malloc.
3198 (File_read::find_or_make_view): Use malloc rather than new[].
3199 * gold.h: Remove HAVE_REMAP code.
3200 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
3201 exists. Rename mremap to gold_mremap. If mmap is not available
3202 don't do anything.
3203 * configure, config.in: Rebuild.
3204
11e361bc
ILT
32052011-04-11 Ian Lance Taylor <iant@google.com>
3206
3207 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
3208 initialize local variable v.
3209
cdc29364
CC
32102011-04-11 Cary Coutant <ccoutant@google.com>
3211
3212 * archive.cc (Archive::include_member): Adjust call to
3213 report_object.
3214 (Add_archive_symbols::run): Track argument serial numbers.
3215 (Lib_group::include_member): Likewise.
3216 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
3217 * archive.h (Incremental_archive_entry::Archive_member):
3218 Initialize arg_serial_.
3219 (Archive_member::arg_serial_): New data member.
3220 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
3221 (Sized_dynobj::do_add_symbols): Track symbols when doing an
3222 incremental link.
3223 (Sized_dynobj::do_for_all_local_got_entries): New function.
3224 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
3225 function.
3226 * fileread.cc (get_mtime): New function.
3227 * fileread.h (get_mtime): New function.
3228 * gold.cc (queue_initial_tasks): Check for incremental update.
3229 (process_incremental_input): New function.
3230 (queue_middle_tasks): Don't force valid target for incremental
3231 update.
3232 * incremental-dump.cc (find_input_containing_global): Adjust
3233 size of symbol info entry.
3234 (dump_incremental_inputs): Dump argument serial number and
3235 in_system_directory flag; bias shndx by 1; print symbol names
3236 when dumping per-file symbol lists; use new symbol info readers.
3237 * incremental.cc
3238 (Output_section_incremental_inputs:update_data_size): New function.
3239 (Sized_incremental_binary::setup_readers): Setup input readers
3240 for each input file; build maps for files added from libraries
3241 and scripts.
3242 (Sized_incremental_binary::check_input_args): New function.
3243 (Sized_incremental_binary::do_check_inputs): Build map of argument
3244 serial numbers to input arguments.
3245 (Sized_incremental_binary::do_file_has_changed): Rename
3246 do_file_is_unchanged to this; compare file modification times.
3247 (Sized_incremental_binary::do_init_layout): New function.
3248 (Sized_incremental_binary::do_reserve_layout): New function.
3249 (Sized_incremental_binary::do_get_input_reader): Remove.
3250 (Sized_incremental_binary::get_symtab_view): New function.
3251 (Incremental_checker::can_incrementally_link_output_file): Remove.
3252 (Incremental_inputs::report_command_line): Exclude --debug options.
3253 (Incremental_inputs::report_archive_begin): Add parameter; track
3254 argument serial numbers; don't put input file entry for archive
3255 before archive members.
3256 (Incremental_inputs::report_archive_end): Put input file entry
3257 for archive after archive members.
3258 (Incremental_inputs::report_object): Add parameter; track argument
3259 serial numbers and in_system_directory flag.
3260 (Incremental_inputs::report_script): Add parameter; track argument
3261 serial numbers.
3262 (Output_section_incremental_inputs::set_final_data_size): Adjust
3263 size of symbol info entry; check for forwarding symbols.
3264 (Output_section_incremental_inputs::write_input_files): Write
3265 in_system_directory flag and argument serial number.
3266 (Output_section_incremental_inputs::write_info_blocks): Map section
3267 indices between incremental info and original input file; store
3268 input section index for each symbol.
3269 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
3270 change operator() to visit().
3271 (class Global_got_offset_visitor): Likewise.
3272 (class Global_symbol_visitor_got_plt):
3273 (Output_section_incremental_inputs::write_got_plt): Use new visitor
3274 classes.
3275 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
3276 (Sized_incr_relobj::do_read_symbols): New function.
3277 (Sized_incr_relobj::do_layout): New function.
3278 (Sized_incr_relobj::do_layout_deferred_sections): New function.
3279 (Sized_incr_relobj::do_add_symbols): New function.
3280 (Sized_incr_relobj::do_should_include_member): New function.
3281 (Sized_incr_relobj::do_for_all_global_symbols): New function.
3282 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
3283 (Sized_incr_relobj::do_section_size): New function.
3284 (Sized_incr_relobj::do_section_name): New function.
3285 (Sized_incr_relobj::do_section_contents): New function.
3286 (Sized_incr_relobj::do_section_flags): New function.
3287 (Sized_incr_relobj::do_section_entsize): New function.
3288 (Sized_incr_relobj::do_section_address): New function.
3289 (Sized_incr_relobj::do_section_type): New function.
3290 (Sized_incr_relobj::do_section_link): New function.
3291 (Sized_incr_relobj::do_section_info): New function.
3292 (Sized_incr_relobj::do_section_addralign): New function.
3293 (Sized_incr_relobj::do_initialize_xindex): New function.
3294 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
3295 (Sized_incr_relobj::do_read_relocs): New function.
3296 (Sized_incr_relobj::do_gc_process_relocs): New function.
3297 (Sized_incr_relobj::do_scan_relocs): New function.
3298 (Sized_incr_relobj::do_count_local_symbols): New function.
3299 (Sized_incr_relobj::do_finalize_local_symbols): New function.
3300 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
3301 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
3302 (Sized_incr_relobj::do_relocate): New function.
3303 (Sized_incr_relobj::do_set_section_offset): New function.
3304 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
3305 (Sized_incr_dynobj::do_read_symbols): New function.
3306 (Sized_incr_dynobj::do_layout): New function.
3307 (Sized_incr_dynobj::do_add_symbols): New function.
3308 (Sized_incr_dynobj::do_should_include_member): New function.
3309 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
3310 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
3311 (Sized_incr_dynobj::do_section_size): New function.
3312 (Sized_incr_dynobj::do_section_name): New function.
3313 (Sized_incr_dynobj::do_section_contents): New function.
3314 (Sized_incr_dynobj::do_section_flags): New function.
3315 (Sized_incr_dynobj::do_section_entsize): New function.
3316 (Sized_incr_dynobj::do_section_address): New function.
3317 (Sized_incr_dynobj::do_section_type): New function.
3318 (Sized_incr_dynobj::do_section_link): New function.
3319 (Sized_incr_dynobj::do_section_info): New function.
3320 (Sized_incr_dynobj::do_section_addralign): New function.
3321 (Sized_incr_dynobj::do_initialize_xindex): New function.
3322 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
3323 (make_sized_incremental_object): New function.
3324 (Incremental_library::copy_unused_symbols): New function.
3325 (Incremental_library::do_for_all_unused_symbols): New function.
3326 * incremental.h (enum Incremental_input_flags): New type.
3327 (class Incremental_checker): Remove.
3328 (Incremental_input_entry::Incremental_input_entry): Add argument
3329 serial number.
3330 (Incremental_input_entry::arg_serial): New function.
3331 (Incremental_input_entry::set_is_in_system_directory): New function.
3332 (Incremental_input_entry::is_in_system_directory): New function.
3333 (Incremental_input_entry::arg_serial_): New data member.
3334 (Incremental_input_entry::is_in_system_directory_): New data member.
3335 (class Script_info): Move here from script.h.
3336 (Script_info::Script_info): Add filename parameter.
3337 (Script_info::filename): New function.
3338 (Script_info::filename_): New data member.
3339 (Incremental_script_entry::Incremental_script_entry): Add argument
3340 serial number.
3341 (Incremental_object_entry::Incremental_object_entry): Likewise.
3342 (Incremental_object_entry::add_input_section): Build list of input
3343 sections with map to original shndx.
3344 (Incremental_object_entry::get_input_section_index): New function.
3345 (Incremental_object_entry::shndx_): New data member.
3346 (Incremental_object_entry::name_key_): Rename; adjust all refs.
3347 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
3348 (Incremental_archive_entry::Incremental_archive_entry): Add argument
3349 serial number.
3350 (Incremental_inputs::report_archive_begin): Likewise.
3351 (Incremental_inputs::report_object): Likewise.
3352 (Incremental_inputs::report_script): Likewise.
3353 (class Incremental_global_symbol_reader): New class.
3354 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3355 and store flags and input file type.
3356 (Incremental_input_entry_reader::arg_serial): New function.
3357 (Incremental_input_entry_reader::type): Extract type from flags.
3358 (Incremental_input_entry_reader::is_in_system_directory): New function.
3359 (Incremental_input_entry_reader::get_input_section_count): Call
3360 accessor function for type.
3361 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3362 function for type; adjust size of global symbol entry.
3363 (Incremental_input_entry_reader::get_global_symbol_count): Call
3364 accessor function for type.
3365 (Incremental_input_entry_reader::get_object_count): Likewise.
3366 (Incremental_input_entry_reader::get_object_offset): Likewise.
3367 (Incremental_input_entry_reader::get_member_count): Likewise.
3368 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3369 (Incremental_input_entry_reader::get_member_offset): Likewise.
3370 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3371 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3372 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3373 (Incremental_input_entry_reader::get_global_symbol_reader): New
3374 function.
3375 (Incremental_input_entry_reader::get_output_symbol_index): New
3376 function.
3377 (Incremental_input_entry_reader::type_): Remove.
3378 (Incremental_input_entry_reader::flags_): New data member.
3379 (Incremental_inputs_reader::input_file_offset): New function.
3380 (Incremental_inputs_reader::input_file_index): New function.
3381 (Incremental_inputs_reader::input_file): Call input_file_offset.
3382 (Incremental_inputs_reader::input_file_at_offset): New function.
3383 (Incremental_relocs_reader::get_r_type): Reformat.
3384 (Incremental_relocs_reader::get_r_shndx): Reformat.
3385 (Incremental_relocs_reader::get_r_offset): Reformat.
3386 (Incremental_relocs_reader::data): New function.
3387 (Incremental_binary::Incremental_binary): Initialize new data members.
3388 (Incremental_binary::check_inputs): Add cmdline parameter.
3389 (Incremental_binary::file_is_unchanged): Remove.
3390 (Input_reader::arg_serial): New function.
3391 (Input_reader::get_unused_symbol_count): New function.
3392 (Input_reader::get_unused_symbol): New function.
3393 (Input_reader::do_arg_serial): New function.
3394 (Input_reader::do_get_unused_symbol_count): New function.
3395 (Input_reader::do_get_unused_symbol): New function.
3396 (Incremental_binary::input_file_count): New function.
3397 (Incremental_binary::get_input_reader): Change signature to use
3398 index instead of filename.
3399 (Incremental_binary::file_has_changed): New function.
3400 (Incremental_binary::get_input_argument): New function.
3401 (Incremental_binary::get_library): New function.
3402 (Incremental_binary::get_script_info): New function.
3403 (Incremental_binary::init_layout): New function.
3404 (Incremental_binary::reserve_layout): New function.
3405 (Incremental_binary::output_file): New function.
3406 (Incremental_binary::do_check_inputs): New function.
3407 (Incremental_binary::do_file_is_unchanged): Remove.
3408 (Incremental_binary::do_file_has_changed): New function.
3409 (Incremental_binary::do_init_layout): New function.
3410 (Incremental_binary::do_reserve_layout): New function.
3411 (Incremental_binary::do_input_file_count): New function.
3412 (Incremental_binary::do_get_input_reader): Change signature.
3413 (Incremental_binary::input_args_map_): New data member.
3414 (Incremental_binary::library_map_): New data member.
3415 (Incremental_binary::script_map_): New data member.
3416 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3417 new data members.
3418 (Sized_incremental_binary::output_section): New function.
3419 (Sized_incremental_binary::inputs_reader): Add const.
3420 (Sized_incremental_binary::symtab_reader): Add const.
3421 (Sized_incremental_binary::relocs_reader): Add const.
3422 (Sized_incremental_binary::got_plt_reader): Add const.
3423 (Sized_incremental_binary::get_symtab_view): New function.
3424 (Sized_incremental_binary::Inputs_reader): New typedef.
3425 (Sized_incremental_binary::Input_entry_reader): New typedef.
3426 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3427 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3428 (Sized_incremental_binary::do_file_has_changed): New function.
3429 (Sized_incremental_binary::do_init_layout): New function.
3430 (Sized_incremental_binary::do_reserve_layout): New function.
3431 (Sized_input_reader::Inputs_reader): Remove.
3432 (Sized_input_reader::Input_entry_reader): Remove.
3433 (Sized_input_reader::do_arg_serial): New function.
3434 (Sized_input_reader::do_get_unused_symbol_count): New function.
3435 (Sized_input_reader::do_get_unused_symbol): New function.
3436 (Sized_incremental_binary::do_input_file_count): New function.
3437 (Sized_incremental_binary::do_get_input_reader): Change signature;
3438 use index instead of filename.
3439 (Sized_incremental_binary::section_map_): New data member.
3440 (Sized_incremental_binary::input_entry_readers_): New data member.
3441 (class Sized_incr_relobj): New class.
3442 (class Sized_incr_dynobj): New class.
3443 (make_sized_incremental_object): New function.
3444 (class Incremental_library): New class.
3445 * layout.cc (Free_list::num_lists): New static data member.
3446 (Free_list::num_nodes): New static data member.
3447 (Free_list::num_removes): New static data member.
3448 (Free_list::num_remove_visits): New static data member.
3449 (Free_list::num_allocates): New static data member.
3450 (Free_list::num_allocate_visits): New static data member.
3451 (Free_list::init): New function.
3452 (Free_list::remove): New function.
3453 (Free_list::allocate): New function.
3454 (Free_list::dump): New function.
3455 (Free_list::print_stats): New function.
3456 (Layout_task_runner::run): Resize output file for incremental updates.
3457 (Layout::Layout): Initialize new data members.
3458 (Layout::set_incremental_base): New function.
3459 (Layout::init_fixed_output_section): New function.
3460 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3461 incremental updates.
3462 (Layout::create_gold_note): Do not create gold note section for
3463 incremental updates.
3464 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3465 for incremental updates.
3466 (Layout::set_section_offsets): For incremental updates, allocate space
3467 from free list.
3468 (Layout::create_symtab_sections): Layout with offsets relative to
3469 start of section; for incremental updates, allocate space from free
3470 list.
3471 (Layout::create_shdrs): For incremental updates, allocate space from
3472 free list.
3473 (Layout::finish_dynamic_section): For incremental updates, do not
3474 check --as-needed (fixed in subsequent patch).
3475 * layout.h (class Free_list): New class.
3476 (Layout::set_incremental_base): New function.
3477 (Layout::incremental_base): New function.
3478 (Layout::init_fixed_output_section): New function.
3479 (Layout::allocate): New function.
3480 (Layout::incremental_base_): New data member.
3481 (Layout::free_list_): New data member.
3482 * main.cc (main): Print Free_list statistics.
3483 * object.cc (Relobj::finalize_incremental_relocs): Add
3484 clear_counts parameter; clear counts only when clear_counts is set.
3485 (Sized_relobj::Sized_relobj): Initialize new base class.
3486 (Sized_relobj::do_layout): Don't report special sections.
3487 (Sized_relobj::do_for_all_local_got_entries): New function.
3488 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3489 symtab_off to all symbol table offsets.
3490 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3491 * object.h (class Got_offset_list): Move to top of file.
3492 (Object::Object): Allow case where input_file == NULL.
3493 (Object::~Object): Likewise.
3494 (Object::input_file): Assert that input_file != NULL.
3495 (Object::lock): Allow case where input_file == NULL.
3496 (Object::unlock): Likewise.
3497 (Object::is_locked): Likewise.
3498 (Object::token): Likewise.
3499 (Object::release): Likewise.
3500 (Object::is_incremental): New function.
3501 (Object::get_mtime): New function.
3502 (Object::for_all_local_got_entries): New function.
3503 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3504 (Object::set_is_in_system_directory): New function.
3505 (Object::is_in_system_directory): New function.
3506 (Object::do_is_incremental): New function.
3507 (Object::do_get_mtime): New function.
3508 (Object::do_for_all_local_got_entries): New function.
3509 (Object::is_in_system_directory_): New data member.
3510 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3511 (class Sized_relobj_base): New class.
3512 (class Sized_relobj): Derive from Sized_relobj_base.
3513 (class Sized_relobj::Symbols): Redeclare from base class.
3514 (class Sized_relobj::local_got_offset_list): Remove.
3515 (class Sized_relobj::Output_sections): Redeclare from base class.
3516 (class Sized_relobj::do_for_all_local_got_entries): New function.
3517 (class Sized_relobj::write_local_symbols): Add offset parameter.
3518 (class Sized_relobj::local_symbol_offset_): Update comment.
3519 (class Sized_relobj::local_dynsym_offset_): Update comment.
3520 * options.cc (Input_arguments::add_file): Remove const.
3521 * options.h (Input_file_argument::Input_file_argument):
3522 Initialize arg_serial_ (all constructors).
3523 (Input_file_argument::set_arg_serial): New function.
3524 (Input_file_argument::arg_serial): New function.
3525 (Input_file_argument::arg_serial_): New data member.
3526 (Input_arguments::Input_arguments): Initialize file_count_.
3527 (Input_arguments::add_file): Remove const.
3528 (Input_arguments::number_of_input_files): New function.
3529 (Input_arguments::file_count_): New data member.
3530 (Command_line::number_of_input_files): Call
3531 Input_arguments::number_of_input_files.
3532 * output.cc (Output_segment_headers::Output_segment_headers):
3533 Set current size.
3534 (Output_section::Input_section::current_data_size): New function.
3535 (Output_section::Output_section): Initialize new data members.
3536 (Output_section::add_input_section): Don't do merge sections for
3537 an incremental link; allocate space from free list for an
3538 incremental update.
3539 (Output_section::add_output_section_data): Allocate space from
3540 free list for an incremental update.
3541 (Output_section::update_data_size): New function.
3542 (Output_section::set_fixed_layout): New function.
3543 (Output_section::reserve): New function.
3544 (Output_segment::set_section_addresses): Remove const.
3545 (Output_segment::set_section_list_addresses): Remove const; allocate
3546 space from free list for an incremental update.
3547 (Output_segment::set_offset): Adjust size of RELRO segment for an
3548 incremental update.
3549 * output.h (Output_data::current_data_size): Move here from
3550 child classes.
3551 (Output_data::pre_finalize_data_size): New function.
3552 (Output_data::update_data_size): New function.
3553 (Output_section_headers::update_data_size): new function.
3554 (Output_section_data_build::current_data_size): Move to Output_data.
3555 (Output_data_strtab::update_data_size): New function.
3556 (Output_section::current_data_size): Move to Output_data.
3557 (Output_section::set_fixed_layout): New function.
3558 (Output_section::has_fixed_layout): New function.
3559 (Output_section::reserve): New function.
3560 (Output_section::update_data_size): New function.
3561 (Output_section::has_fixed_layout_): New data member.
3562 (Output_section::free_list_): New data member.
3563 (Output_segment::set_section_addresses): Remove const.
3564 (Output_segment::set_section_list_addresses): Remove const.
3565 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3566 New function.
3567 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3568 New function.
3569 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3570 parameter when calling Add_symbols constructor; store argument
3571 serial number for members of a lib group.
3572 (Add_symbols::locks): Allow case where token == NULL.
3573 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3574 (Read_member::~Read_member): New function.
3575 (Read_member::is_runnable): New function.
3576 (Read_member::locks): New function.
3577 (Read_member::run): New function.
3578 (Check_script::~Check_script): New function.
3579 (Check_script::is_runnable): New function.
3580 (Check_script::locks): New function.
3581 (Check_script::run): New function.
3582 (Check_library::~Check_library): New function.
3583 (Check_library::is_runnable): New function.
3584 (Check_library::locks): New function.
3585 (Check_library::run): New function.
3586 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3587 (Add_symbols::library_): New data member.
3588 (class Read_member): New class.
3589 (class Check_script): New class.
3590 (class Check_library): New class.
3591 * reloc.cc (Read_relocs::is_runnable): Allow case where
3592 token == NULL.
3593 (Read_relocs::locks): Likewise.
3594 (Scan_relocs::locks): Likewise.
3595 (Relocate_task::locks): Likewise.
3596 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3597 to clear counters.
3598 (Sized_relobj::incremental_relocs_scan): Fix comment.
3599 (Sized_relobj::do_relocate): Pass output file offset to
3600 write_local_symbols.
3601 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3602 from class declaration.
3603 * script.cc (read_input_script): Allocate Script_info; pass
3604 argument serial number to report_script.
3605 * script.h (class Script_info): Move to incremental.h.
3606 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3607 * symtab.h (Symbol_table::add_from_incrobj): New function.
3608 (Symbol_table::set_file_offset): New function.
3609
b961d0d7
CC
36102011-04-05 Cary Coutant <ccoutant@google.com>
3611
3612 * incremental-dump.cc (dump_incremental_inputs): Change signature
3613 to take a Sized_incremental_binary; change caller. Use readers
3614 in Sized_incremental_binary.
3615 * incremental.cc
3616 (Sized_incremental_binary::find_incremental_inputs_sections):
3617 Rename do_find_incremental_inputs_sections to this.
3618 (Sized_incremental_binary::setup_readers): New function.
3619 (Sized_incremental_binary::do_check_inputs): Check
3620 has_incremental_info_ flag; move setup code to setup_readers;
3621 use input readers.
3622 (Sized_incremental_binary::do_file_is_unchanged): New function.
3623 (Sized_incremental_binary::do_get_input_reader): New function.
3624 * incremental.h (class Incremental_binary): Move to end of file.
3625 (Incremental_binary::file_is_unchanged): New function.
3626 (Incremental_binary::do_file_is_unchanged): New function.
3627 (Incremental_binary::Input_reader): New class.
3628 (Incremental_binary::get_input_reader): New function.
3629 (class Sized_incremental_binary): Move to end of file.
3630 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3631 input section reader classes.
3632 (Sized_incremental_binary::has_incremental_info): New function.
3633 (Sized_incremental_binary::inputs_reader): New function.
3634 (Sized_incremental_binary::symtab_reader): New function.
3635 (Sized_incremental_binary::relocs_reader): New function.
3636 (Sized_incremental_binary::got_plt_reader): New function.
3637 (Sized_incremental_binary::do_file_is_unchanged): New function.
3638 (Sized_incremental_binary::Sized_input_reader): New class.
3639 (Sized_incremental_binary::get_input_reader): New function.
3640 (Sized_incremental_binary::find_incremental_inputs_sections):
3641 Rename do_find_incremental_inputs_sections to this.
3642 (Sized_incremental_binary::setup_readers): New function.
3643 (Sized_incremental_binary::has_incremental_info_): New data member.
3644 (Sized_incremental_binary::inputs_reader_): New data member.
3645 (Sized_incremental_binary::symtab_reader_): New data member.
3646 (Sized_incremental_binary::relocs_reader_): New data member.
3647 (Sized_incremental_binary::got_plt_reader_): New data member.
3648 (Sized_incremental_binary::current_input_file_): New data member.
3649
a869183f
PP
36502011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3651
3652 PR gold/12640
3653 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3654 violation.
3655
36562011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3657
3658 * archive.cc (Archive::include_member): Adjust call to report_object.
3659 (Add_archive_symbols::run): Add script_info to call to
3660 report_archive_begin.
3661 (Lib_group::include_member): Adjust call to report_object.
3662 (Add_lib_group_symbols::run): Adjust call to report_object.
3663 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3664 blocks. Add object count for script input files.
3665 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3666 script_info parameter; change all callers.
3667 (Incremental_inputs::report_object): Add script_info parameter;
3668 change all callers.
3669 (Incremental_inputs::report_script): Store backpointer to
3670 incremental info entry.
3671 (Output_section_incremental_inputs::set_final_data_size): Record
3672 additional information for scripts.
3673 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3674 * incremental.h (Incremental_script_entry::add_object): New function.
3675 (Incremental_script_entry::get_object_count): New function.
3676 (Incremental_script_entry::get_object): New function.
3677 (Incremental_script_entry::objects_): New data member; adjust
3678 constructor.
3679 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3680 (Incremental_inputs::report_object): Add script_info parameter.
3681 (Incremental_inputs_reader::get_object_count): New function.
3682 (Incremental_inputs_reader::get_object_offset): New function.
3683 * options.cc (Input_arguments::add_file): Return reference to
3684 new input argument.
3685 * options.h (Input_argument::set_script_info): New function.
3686 (Input_argument::script_info): New function.
3687 (Input_argument::script_info_): New data member; adjust all
3688 constructors.
3689 (Input_file_group::add_file): Return reference to new input argument.
3690 (Input_file_lib::add_file): Likewise.
3691 (Input_arguments::add_file): Likewise.
3692 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3693 * script.cc (Parser_closure::Parser_closure): Add script_info
3694 parameter; adjust all callers.
3695 (Parser_closure::script_info): New function.
3696 (Parser_closure::script_info_): New data member.
3697 (read_input_script): Report scripts earlier to incremental info.
3698 (script_add_file): Set script_info in Input_argument.
3699 (script_add_library): Likewise.
3700 * script.h (Script_options::Script_info): Rewrite class.
3701
a869183f 37022011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3703
3704 * archive.cc (Library_base::should_include_member): Move
3705 method here from class Archive.
3706 (Archive::Archive): Initialize base class.
3707 (Archive::should_include_member): Move to base class.
3708 (Archive::do_for_all_unused_symbols): New function.
3709 (Add_archive_symbols::run): Remove redundant access to
3710 incremental_inputs.
3711 (Lib_group::Lib_group): Initialize base class.
3712 (Lib_group::do_filename): New function.
3713 (Lib_group::include_member): Pass pointer to Lib_group to
3714 report_object.
3715 (Lib_group::do_for_all_unused_symbols): New function.
3716 (Add_lib_group_symbols::run): Report archive information for
3717 incremental links.
3718 * archive.h (class Library_base): New base class.
3719 (class Archive): Derive from Library_base.
3720 (Archive::filename): Move to base class.
3721 (Archive::set_incremental_info): Likewise.
3722 (Archive::incremental_info): Likewise.
3723 (Archive::Should_include): Likewise.
3724 (Archive::should_include_member): Likewise.
3725 (Archive::Armap_entry): Remove.
3726 (Archive::Unused_symbol_iterator): Remove.
3727 (Archive::unused_symbols_begin): Remove.
3728 (Archive::unused_symbols_end): Remove.
3729 (Archive::do_filename): New function.
3730 (Archive::do_get_mtime): New function.
3731 (Archive::do_for_all_unused_symbols): New function.
3732 (Archive::task_): Move to base class.
3733 (Archive::incremental_info_): Likewise.
3734 (class Lib_group): Derive from Library_base.
3735 (Lib_group::do_filename): New function.
3736 (Lib_group::do_get_mtime): New function.
3737 (Lib_group::do_for_all_unused_symbols): New function.
3738 (Lib_group::task_): Move to base class.
3739 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3740 function.
3741 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3742 function.
3743 * incremental.cc (Incremental_inputs::report_archive_begin):
3744 Use Library_base; call library's get_mtime; add incremental inputs
3745 entry before members.
3746 (class Unused_symbol_visitor): New class.
3747 (Incremental_inputs::report_archive_end): Use Library_base; use
3748 visitor class to record unused symbols; don't add incremental inputs
3749 entry after members.
3750 (Incremental_inputs::report_object): Use Library_base.
3751 * incremental.h
3752 (Incremental_archive_entry::Incremental_archive_entry): Remove
3753 unused Archive parameter.
3754 (Incremental_inputs::report_archive_begin): Use Library_base.
3755 (Incremental_inputs::report_archive_end): Likewise.
3756 (Incremental_inputs::report_object): Likewise.
3757 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3758 function.
3759 * object.h (Object::for_all_global_symbols): New function.
3760 (Object::do_for_all_global_symbols): New function.
3761 (Sized_relobj::do_for_all_global_symbols): New function.
3762 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3763 function.
3764 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3765 function.
3766
61ab3e40
ILT
37672011-03-27 Ian Lance Taylor <iant@google.com>
3768
3769 * archive.cc (Archive::interpret_header): Return -1 if something
3770 goes wrong. Change callers accordingly.
3771
30e1f9e6
CC
37722011-03-25 Cary Coutant <ccoutant@google.com>
3773
3774 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3775 * testsuite/Makefile.in: Regenerate.
3776
9370ce59 37772011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3778
3779 * plugin.cc (get_view): New.
3780 (Plugin::load): Pass get_view to the plugin.
3781 (Plugin_manager::get_view): New.
3782
9312bb0a
ILT
37832011-03-21 Ian Lance Taylor <iant@google.com>
3784
3785 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3786 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3787
7e12ba9e
ST
37882011-03-21 Sriraman Tallam <tmsriram@google.com>
3789
3790 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3791 Change == to -eq.
3792 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3793 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3794 Change == to -eq.
3795 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3796 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3797
fd7a005d
ILT
37982011-03-14 Ian Lance Taylor <iant@google.com>
3799
3800 * script-sections.cc (Sort_output_sections::script_compare):
3801 Rename from is_before, change return type.
3802 (Sort_output_sections::operator()): Adjust accordingly.
3803
ed16fd1b
ILT
38042011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3805
3806 PR gold/12572
3807 * testsuite/odr_violation2.cc: Add comment to make all error line
3808 numbers double digits.
3809 * testsuite/debug_msg.sh: Adjust expected errors.
3810
71ff8986
ILT
38112011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3812
3813 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3814 but mark earlier ones as non-canonical
3815 (offset_to_iterator): Update search target and example
3816 (do_addr2line): Return extra lines in a vector*
3817 (format_file_lineno): Extract from do_addr2line
3818 (one_addr2line): Add vector* out-param
3819 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3820 when a lineno entry appeared last for its instruction
3821 (Dwarf_line_info): Add vector* out-param
3822 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3823 * symtab.cc (Odr_violation_compare): Include the lineno in the
3824 comparison again.
3825 (linenos_from_loc): New. Combine the canonical line for an
3826 address with its other lines.
3827 (True_if_intersect): New. Helper functor to make
3828 std::set_intersection a query.
3829 (detect_odr_violations): Compare sets of lines instead of just
3830 one line for each function. This became less deterministic, but
3831 has fewer false positives.
3832 * symtab.h: Declarations.
3833 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3834 mix an optimized and non-optimized object in the same binary
3835 (odr_violation2.so): Same.
3836 * testsuite/Makefile.in: Regenerate from Makefile.am.
3837 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3838 * testsuite/debug_msg.sh: Update line numbers and add
3839 assertions.
3840 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3841 non-optimized context.
3842 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3843 isn't inlined, and use OdrDerived in an optimized context.
3844 * testsuite/odr_header1.h: Defines OdrDerived, where
3845 optimization will change the
3846 first-instruction-in-the-destructor's file and line number.
3847 * testsuite/odr_header2.h: Defines OdrBase.
3848
a19fefdc
ILT
38492011-03-09 Ian Lance Taylor <iant@google.com>
3850
3851 * fileread.cc (File_read::clear_views): Don't delete the whole
3852 file view.
3853
ecb351e9
ILT
38542011-03-08 Ian Lance Taylor <iant@google.com>
3855
3856 PR gold/12525
3857 * fileread.cc: #include <climits>.
3858 (GOLD_IOV_MAX): Define.
3859 (File_read::read_multiple): Limit number of entries by iov_max.
3860 * fileread.h (class File_read): Always set max_readv_entries to
3861 128.
3862
b821d13c
ILT
38632011-03-07 Ian Lance Taylor <iant@google.com>
3864
3865 PR gold/12525
3866 * options.h (class General_options): Add -dy and -dn.
3867
89243142
CC
38682011-03-02 Cary Coutant <ccoutant@google.com>
3869
3870 * testsuite/script_test_9.t: Add TLS segment.
3871
d0773f31
ILT
38722011-03-02 Simon Baldwin <simonb@google.com>
3873
3874 * configure.ac: Add check for gnu_indirect_function support in
3875 the toolchain building binutils.
3876 * configure: Rebuild.
3877
9370ce59 38782011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3879
3880 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3881 plugin only symbols.
3882 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3883 in plugin files as not needed in the symbol table.
3884
4cf7a849
ST
38852011-02-11 Sriraman Tallam <tmsriram@google.com>
3886
3887 * output.cc (Output_section::add_input_section): Delay fill
3888 generation for section ordering.
3889
b578bd7d
ILT
38902011-02-09 Ian Lance Taylor <iant@google.com>
3891
3892 PR gold/12316
3893 * object.h (class Sized_relobj): Remove clear_local_symbols.
3894 * reloc.cc (Sized_relobj::do_relocate): Don't call
3895 clear_local_symbols.
3896
9370ce59 38972011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3898
3899 * plugin.cc (is_visible_from_outside): Return true for symbols
3900 in the -u option.
3901
55382fb7
ILT
39022011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3903
3904 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3905 filename.
3906
4e271fff
ST
39072011-02-02 Sriraman Tallam <tmsriram@google.com>
3908
3909 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3910 to std::string.
4e271fff 3911 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3912 section_name to be std::string.
4e271fff
ST
3913 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3914
d433c3ac
ILT
39152011-01-25 Ian Lance Taylor <iant@google.com>
3916
3917 * script.cc (script_add_extern): Rewrite to use
3918 add_symbol_reference.
3919
880473a6
DK
39202011-01-25 Doug Kwan <dougkwan@google.com>
3921
d433c3ac 3922 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3923
f30f86fa
ILT
39242011-01-24 Ian Lance Taylor <iant@google.com>
3925
3926 * options.h (class General_options): Accept
3927 --no-detect-odr-violations.
3928
8e51a0b9
ILT
39292011-01-24 Ian Lance Taylor <iant@google.com>
3930
3931 * version.cc (version_string): Bump to 1.11.
3932
0f3b89d8
ILT
39332011-01-24 Ian Lance Taylor <iant@google.com>
3934
3935 * plugin.cc (class Plugin_rescan): Define new class.
3936 (Plugin_manager::claim_file): Set any_claimed_.
3937 (Plugin_manager::save_archive): New function.
3938 (Plugin_manager::save_input_group): New function.
3939 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3940 necessary.
3941 (Plugin_manager::new_undefined_symbol): New function.
3942 (Plugin_manager::rescan): New function.
3943 (Plugin_manager::rescannable_defines): New function.
3944 (Plugin_manager::add_input_file): Set any_added_.
3945 * plugin.h (class Plugin_manager): define new fields rescannable_,
3946 undefined_symbols_, any_claimed_, and any_added_. Declare
3947 Plugin_rescan as friend. Declare new functions.
3948 (Plugin_manager::Rescannable): Define type.
3949 (Plugin_manager::Rescannable_list): Define type.
3950 (Plugin_manager::Undefined_symbol_list): Define type.
3951 (Plugin_manager::Plugin_manager): Initialize new fields.
3952 * archive.cc (Archive::defines_symbol): New function.
3953 (Add_archive_symbols::run): Pass archive to plugins if any.
3954 * archive.h (class Archive): Declare defines_symbol.
3955 * readsyms.cc (Input_group::~Input_group): New function.
3956 (Finish_group::run): Pass input_group to plugins if any.
3957 * readsyms.h (class Input_group): Declare destructor.
3958 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3959 any.
3960
3bb951e5
ILT
39612011-01-10 Ian Lance Taylor <iant@google.com>
3962
3963 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3964 section as relro.
3965 (Layout::set_segment_offsets): Reset increase_relro before calling
3966 set_section_addresses a second time.
3967
0aa45fac
CC
39682011-01-04 Cary Coutant <ccoutant@google.com>
3969
3970 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3971 sections before NOBITS sections.
3972
0db46eb4
L
39732011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3974
3975 * version.cc (print_version): Update copyright to 2011.
3976
829c9745
CC
39772010-12-23 Cary Coutant <ccoutant@google.com>
3978
3979 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3980 of OS to this->add. Add OD parameter to second form of the function.
3981
7500420b
ILT
39822010-12-20 Ian Lance Taylor <iant@google.com>
3983
3984 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3985 second of two consecutive entries with same offset.
3986
f8e9a930
RW
39872010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3988
3989 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3990 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3991 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3992 to avoid unneeded links against $(LDADD).
3993 * testsuite/Makefile.in: Regenerate.
3994
2fbb4320
ILT
39952010-12-15 Ian Lance Taylor <iant@google.com>
3996
3997 PR gold/12324
3998 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3999 for R_X86_64_32 and R_X86_64_PC32.
4000 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
4001 ver_matching_def_pic.o.
4002 (ver_matching_def_pic.o): New target.
4003
fedb228d
RW
40042010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4005
4006 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
4007 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
4008 Move definition before File_read::View member definitions.
4009 (File_read::View::~View): Initialize and hold lock before
4010 updating current_mapped_bytes.
4011
9b547ce6
RW
40122010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4013
4014 * dwarf_reader.cc: Remove outdated comment.
4015 * gold-threads.cc: Fix typo in error message.
4016 * archive.cc: Fix typos in comments.
4017 * archive.h: Likewise.
4018 * arm-reloc-property.cc: Likewise.
4019 * arm-reloc-property.h: Likewise.
4020 * arm-reloc.def: Likewise.
4021 * arm.cc: Likewise.
4022 * attributes.h: Likewise.
4023 * cref.cc: Likewise.
4024 * ehframe.cc: Likewise.
4025 * fileread.h: Likewise.
4026 * gold.h: Likewise.
4027 * i386.cc: Likewise.
4028 * icf.cc: Likewise.
4029 * incremental.h: Likewise.
4030 * int_encoding.cc: Likewise.
4031 * layout.h: Likewise.
4032 * main.cc: Likewise.
4033 * merge.h: Likewise.
4034 * object.cc: Likewise.
4035 * object.h: Likewise.
4036 * options.cc: Likewise.
4037 * readsyms.cc: Likewise.
4038 * reduced_debug_output.cc: Likewise.
4039 * reloc.cc: Likewise.
4040 * script-sections.cc: Likewise.
4041 * sparc.cc: Likewise.
4042 * symtab.h: Likewise.
4043 * target-reloc.h: Likewise.
4044 * target.cc: Likewise.
4045 * target.h: Likewise.
4046 * timer.cc: Likewise.
4047 * timer.h: Likewise.
4048 * x86_64.cc: Likewise.
4049
83e17bd5
CC
40502010-12-09 Cary Coutant <ccoutant@google.com>
4051
4052 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
4053 stack.
4054 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
4055 parameter; change all callers.
4056 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
4057 * options.h (warn_execstack): New option.
4058
017257f8
DK
40592010-12-07 Doug Kwan <dougkwan@google.com>
4060
4061 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
4062 like function call relocations.
4063
c20cbc06
ILT
40642010-12-07 Ian Lance Taylor <iant@google.com>
4065
4066 * archive.cc (Archive::get_elf_object_for_member): Permit
4067 punconfigured to be NULL.
4068 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
4069 (Archive::include_member): Pass NULL to get_elf_object_for_member
4070 if we searched for the archive and this is the first included
4071 object.
4072
4dbfafcc
ILT
40732010-12-01 Ian Lance Taylor <iant@google.com>
4074
4075 * dwarf_reader.h (class Sized_dwarf_line_info): Add
4076 track_relocs_type_ field.
4077 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4078 Set track_relocs_type_.
4079 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
4080 contents when using RELA relocs.
4081 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
4082 reloc_map_.
4083 * reloc.cc (Track_relocs::next_addend): New function.
4084 * reloc.h (class Track_relocs): Declare next_addend.
4085
e5e19edd
ILT
40862010-12-01 Ian Lance Taylor <iant@google.com>
4087
4088 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
4089 virtual destructor.
4090
9a5ce24c
ILT
40912010-12-01 Ian Lance Taylor <iant@google.com>
4092
4093 * README: Update compilers known to work and fail.
4094
c7791212
NC
40952010-11-23 Matthias Klose <doko@ubuntu.com>
4096
4097 * configure.in: For --enable-gold, handle value `default' instead of
4098 `both*'. Always install ld as ld.bfd, install as ld if gold is
4099 not the default.
4100 * configure: Regenerate.
4101
0ad220c9
DK
41022010-11-18 Doug Kwan <dougkwan@google.com>
4103
4104 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
4105 and right_alignment to be zero. Store result alignment only if it is
4106 greater than existing alignment.
4107
ab8056e0
CC
41082010-11-16 Cary Coutant <ccoutant@google.com>
4109
4110 PR gold/12220
4111 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
4112 Check for ".zdebug_line".
4113
fd064a5b
CC
41142010-11-16 Doug Kwan <dougkwan@google.com>
4115 Cary Coutant <ccoutant@google.com>
4116
4117 * output.h (Output_segment::set_section_addresses): Pass increase_relro
4118 by reference; adjust all callers.
4119 * output.cc (Output_segment::set_section_addresses): Adjust references
4120 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
4121 list is empty.
4122 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
4123 end at page boundary.
4124
6fc6ea19
CC
41252010-11-16 Cary Coutant <ccoutant@google.com>
4126
4127 PR gold/12220
4128 * layout.cc (Layout::choose_output_section): Transform names of
4129 compressed sections even when using a script with a SECTIONS clause.
4130 (Layout::output_section_name): Remove code to transform
4131 compressed debug section names.
4132 * output.cc (Output_section::add_input_section): Use uncompressed
4133 section size when tracking input sections.
4134
95a2c8d6
RS
41352010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
4136
4137 * symtab.h (Symbol::NON_PIC_REF): Remove.
4138 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
4139 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
4140 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
4141 (Symbol::use_plt_offset): Take a flags argument and pass it
4142 directly to needs_dynamic_reloc. Restrict check for undefined
4143 weak symbols to function calls.
4144 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
4145 (Target_arm::Scan::global): Use it.
4146 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
4147 (Target_arm::Relocate::relocate): Likewise.
4148 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
4149 parameter with an r_type parameter. Use get_reference_flags
4150 to get the flags.
4151 (Target_arm::Relocate::relocate): Update accordingly.
4152 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
4153 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
4154 (Target_i386::Scan::global): Likewise.
4155 (Target_i386::Relocate::relocate): Likewise.
4156 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
4157 parameter with an r_type parameter. Use get_reference_flags
4158 to get the flags.
4159 (Target_i386::Relocate::relocate): Update accordingly.
4160 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
4161 (Target_powerpc::Scan::global): Use it.
4162 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
4163 (Target_powerpc::Relocate::relocate): Likewise.
4164 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
4165 (Target_sparc::Scan::global): Use it.
4166 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
4167 (Target_sparc::Relocate::relocate): Likewise.
4168 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
4169 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
4170 (Target_x86_64::Scan::global): Likewise.
4171 (Target_x86_64::Relocate::relocate): Likewise.
4172
f625ae50
DK
41732010-11-08 Doug Kwan <dougkwan@google.com>
4174 Cary Coutant <ccoutant@google.com>
4175
4176 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
4177 (Arm_exidx_merge_section::section_contents_): New data member.
4178 (Arm_input_section::Arm_input_section): Initialize original_contents_.
4179 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 4180 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
4181 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
4182 in parameters instead of calling Object::section_contents without
4183 locking.
4184 (Arm_output_section::group_section): New parameter TASK. Pass it
4185 to callees that need locking objects.
4186 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
4187 to lock EXIDX input sections. Fix a formatting issue. Call
4188 Arm_exidx_merged_section::build_contents to create merged section
4189 contents.
4190 (Arm_output_section::create_stub_group): New parameter TASK. Use it
4191 to lock object of stub table owner.
4192 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
4193 TEXT_SIZE to initialize data member TEXT_SIZE_.
4194 (Arm_exidx_input_section::addralign): Fix typo in comment.
4195 (Arm_exidx_input_section::text_size): New method.
4196 (Target_arm::do_relax): New parameter TASK. Pass it to callees
4197 that require locking objects. Lock objects before scanning for stubs
4198 and updating local symbols.
4199 (Arm_input_section<big_endian>::init): Copy contents of original
4200 input section.
2e702c99 4201 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
4202 original input section instead of calling Object::section_contents
4203 without locking.
4204 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
4205 size without calling Object::section_size().
4206 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
4207 for size. Allocate a buffer for merged EXIDX entries.
4208 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 4209 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
4210 building code to Arm_exidx_merged_section::build_contetns. Write
4211 out contetns in buffer instead of building it on the fly.
4212 (Arm_relobj::make_exidx_input_section): Also pass text section size
4213 to Arm_exidx_input_section constructor.
4214 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
4215 (Arm_dynobj::do_read_symbols): Fix memory leak.
4216 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
4217 * target.h: (class Task): Add forward declaration.
4218 (Target::relax): Add new parameter TASK and pass it to
4219 Target::do_relax().
4220 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
4221
5f9bcf58
CC
42222010-11-05 Cary Coutant <ccoutant@google.com>
4223
4224 PR gold/10708
4225 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
4226 object when reading from the file.
4227 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
4228 second layout pass.
4229 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
4230 when reading section contents.
4231 (get_section_contents): Likewise.
4232 (icf::find_identical_sections): Likewise.
4233 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
4234 object when reading from the file.
4235 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
4236 the object when doing deferred section layout.
4237
e597fa08
NC
42382010-11-03 Nick Clifton <nickc@redhat.com>
4239
4240 PR gold/12001
4241 * script.h (class Symbol_assignment: name): New member. Returns
4242 the name of the symbol.
4243 * scrfipt.cc (Script_options::is_pending_assignment): New member.
4244 Returns true if the given symbol name is on the list of
4245 assignments wating to be processed.
4246 * archive.cc (should_incldue_member): If the symbol is undefined,
4247 check to see if it is on the list of symbols pending assignment.
4248
3f9a3278
ILT
42492010-11-03 Ryan Mansfield <rmansfield@qnx.com>
4250
4251 * script-sections.cc (Script_sections::find_memory_region): Check
4252 for a NULL output section pointer.
4253
d06fb4d1
DK
42542010-10-29 Doug Kwan <dougkwan@google.com>
4255
4256 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
4257 Output_section::add_relaxed_input_section.
4258 * output.cc (Output_section::add_relaxed_input_section): Add new
4259 arguments LAYOUT and NAME. Set section order index.
4260 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4261 Copy section order index.
4262 * output.h (Output_section::add_relaxed_input_section): Add new
4263 arguments LAYOUT and NAME.
4264
90e24de5
ILT
42652010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4266
4267 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 4268 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
4269 * testsuite/Makefile.in: Regenerate.
4270
c9484ea5
DK
42712010-10-20 Doug Kwan <dougkwan@google.com>
4272
4273 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
4274 without SHF_LINK_ORDER flags.
4275 * layout.cc (Layout::choose_output_section): Do not filter
4276 SHF_LINK_ORDER flag in a relocatable link.
4277
5bc2f5be
CC
42782010-10-17 Cary Coutant <ccoutant@google.com>
4279
4280 * output.h (Output_segment::set_section_addresses): Change function
4281 signature. Update all callers.
4282 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
4283 sections.
4284 (Output_segment::set_section_addresses): Align after last TLS
4285 section. Add padding before last relro section instead of after.
4286
0c91cf04
DK
42872010-10-17 Doug Kwan <dougkwan@google.com>
4288
4289 * gold/arm.cc (Target_arm::got_section): Use correct order and set
4290 GOT output section to be writable.
4291
8c21d9d3
CC
42922010-10-14 Cary Coutant <ccoutant@google.com>
4293
4294 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
4295 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
4296 * gold.cc (queue_initial_tasks): Check parameters for incremental link
4297 mode.
4298 * incremental.cc (report_command_line): Ignore all forms of
4299 --incremental.
4300 * layout.cc (Layout::Layout): Check parameters for incremental link
4301 mode.
4302 * options.cc (General_options::parse_incremental): New function.
4303 (General_options::parse_no_incremental): New function.
4304 (General_options::parse_incremental_full): New function.
4305 (General_options::parse_incremental_update): New function.
4306 (General_options::incremental_mode_): New data member.
4307 (General_options::finalize): Check incremental_mode_.
4308 * options.h (General_options): Update help text for --incremental.
4309 Add --no-incremental, --incremental-full, --incremental-update.
4310 (General_options::Incremental_mode): New enum type.
4311 (General_options::incremental_mode): New function.
4312 (General_options::incremental_mode_): New data member.
4313 * parameters.cc (Parameters::incremental_mode_): New data member.
4314 (Parameters::set_options): Set incremental_mode_.
4315 (Parameters::set_incremental_full): New function.
4316 (Parameters::incremental): New function.
4317 (Parameters::incremental_update): New function.
4318 (set_parameters_incremental_full): New function.
4319 * parameters.h (Parameters::set_incremental_full): New function.
4320 (Parameters::incremental): New function.
4321 (Parameters::incremental_update): New function.
4322 (Parameters::incremental_mode_): New data member.
4323 (set_parameters_incremental_full): New function.
4324 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
4325 incremental link mode.
4326 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
4327 (Sized_relobj::do_relocate_sections): Likewise.
4328 * testsuite/Makefile.am (incremental_test): Use --incremental-full
4329 option.
4330 * testsuite/Makefile.in: Regenerate.
4331 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 4332
bb32aa18 43332010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
4334
4335 * script-sections.h (class Script_sections): Make
4336 Sections_elements typedef public.
4337 * script-sections.cc (class Sort_output_sections): Add elements_
4338 field. Add constructor which sets it; change all callers.
4339 (Sort_output_sections::is_before): New function.
4340 (Sort_output_sections::operator()): Call is_before.
4341 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
4342 conditional.
4343 * testsuite/script_test_10.sh: New test. Test script section
4344 order.
4345 * testsuite/script_test_10.t: Likewise.
4346 * testsuite/script_test_10.s: Likewise.
4347 * testsuite/Makefile.am: Wrap the cross linker tests and the
4348 common tests into NATIVE_OR_CROSS_LINKER.
4349 (check_SCRIPTS): Add script_test_10.sh.
4350 (check_DATA): Add script_test_10.stdout.
4351 (script_test_10.o, script_test_10): New targets.
4352 (script_test_10.stdout): New target.
4353 * configure, testsuite/Makefile.in: Regenerate.
4354
3cef7179
ILT
43552010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4356
4357 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4358 error for the deprecated relocations.
4359 (Target_arm::Scan::global): Likewise.
4360 (Target_arm::Relocate::relocate): Likewise.
4361
7411e9a8
RS
43622010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4363
4364 * fileread.cc (Input_file::find_file): Initialize *found_name
4365 and *namep when using the fallback search for case 4.
4366
6a9da32a
CC
43672010-10-11 Cary Coutant <ccoutant@google.com>
4368
4369 * options.h (class General_options): Redefine -z lazy as an alias for
4370 the negation of -z now.
4371
ac897c20
ILT
43722010-10-11 Ian Lance Taylor <iant@google.com>
4373
4374 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4375 binding.
4376
ea5cae92
NC
43772010-10-06 Nick Clifton <nickc@redhat.com>
4378
4379 * script-sections.cc(class Memory_region): Remove
4380 current_lma_offset_ field. Rename current_vma_offset_ to
4381 current_offset_. Add last_section_ field.
4382 (Memory_region::get_current_vma_address): Rename to
4383 get_current_address.
4384 (Memory_region::get_current_lma_address): Delete.
4385 (Memory_region::increment_vma_offset): Rename to
4386 increment_offset.
4387 (Memory_region::increment_lma_offset): Delete.
4388 (Memory_region::attributes_compatible): New method. Returns
4389 true if the provided section is compatible with the region.
4390 (Memory_region::get_last_section): New method. Returns the last
4391 section to use the region.
4392 (Memory_region::set_last_section): New method. Stores the last
4393 section to use the region.
4394 (Script_sections::block_in_region): New method. Returns true if
4395 a block of memory is contained within a region.
4396 (Script_sections::find_memory_region): New method. Locates a
4397 memory region to be used to set a VMA or LMA address.
4398 (Output_section_definition::set_section_addresses): Add code to
4399 check for addresses set by memory regions.
4400 (Output_segment::set_section_addresses): Remove memory region
4401 walking code.
4402 (Script_sections::create_segment): Add a warning if a header
4403 segment is created outside of any region.
4404 * script-sections.h (class Script_sections): Add prototypes for
4405 find_memory_region and block_in_region methods.
4406 * testsuite/memory_test.s: Use .long instead of .word.
4407 * testsuite/memory_test.t: Add some more output sections.
4408 * testsuite/memory_test.sh: Update expected output.
4409
a9bfd952
DK
44102010-10-02 Doug Kwan <dougkwan@google.com>
4411
4412 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4413 defintion to symtab.h
4414 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4415 declaration to defintion.
4416
bacff3ab
NC
44172010-10-01 Nick Clifton <nickc@redhat.com>
4418
4419 * expression.cc (eval): Replace dummy argument with NULL.
4420 (eval_maybe_dot): Check for a NULL result section pointer.
4421 (Symbol_expression::value): Likewise.
4422 (Dot_expression::value): Likewise.
4423 (BINARY_EXPRESSION): Likewise.
4424 (Max_expression::value): Likewise.
4425 (Min_expression::value): Likewise.
4426 (Absolute_expression::value): Likewise.
4427 (Addr_expression::value_from_output_section): Likewise.
4428 (Loaddddr_expression::value_from_output_section): Likewise.
4429 (Segment_start_expression::value): Likewise.
4430 * script-sections.cc
4431 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4432 argument with NULL.
4433 (Sections_elememt_dot_assignment::set_section_addresses):
4434 Likewise.
4435 (Output_data_expression::do_write_to_buffer): Likewise.
4436 (Output_section_definition::finalize_symbols): Likewise.
4437 (Output_section_definition::set_section_addresses): Likewise.
4438
f81bc8b5
DK
44392010-09-30 Doug Kwan <dougkwan@google.com>
4440
4441 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4442
c95e9f27
ST
44432010-09-28 Sriraman Tallam <tmsriram@google.com>
4444
4445 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4446 function.
c95e9f27
ST
4447 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4448 virtual function.
4449 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4450 virtual function.
4451 * icf.cc (get_section_contents): Inline merge sections only when
4452 target allows it.
4453
3cac54d2
RW
44542010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4455
4456 * configure: Regenerate.
4457
2904037a
ILT
44582010-09-17 Ian Lance Taylor <iant@google.com>
4459
4460 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4461 * testsuite/Makefile.am (memory_test.o): New target.
4462 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4463 memory_test.t.
4464 * testsuite/Makefile.in: Rebuild.
2904037a 4465
bca7fb63
DK
44662010-09-17 Doug Kwan <dougkwan@google.com>
4467
4468 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4469 defintion if relocation uses GOT entries of the symbol.
4470 * testsuite/icf_safe_test.sh: Fix test.
4471 * testsuite/icf_safe_so_test.sh: Fix test.
4472
4ef28648
CC
44732010-09-16 Cary Coutant <ccoutant@google.com>
4474
4475 * script_sections.cc (class Memory_region): Remove "NULL" from
4476 vector initializations.
4477
793990de
CC
44782010-09-15 Cary Coutant <ccoutant@google.com>
4479
4480 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4481 Resolve forwarding symbols.
4482
81e015e2
DK
44832010-09-15 Doug Kwan <dougkwan@google.com>
4484
4485 * gold/testsuite/script_test_3.t: Add ARM special sections.
4486 * gold/testsuite/script_test_4.t: Same.
4487 * gold/testsuite/script_test_5.t: Same.
4488 * gold/testsuite/script_test_6.t: Same.
4489 * gold/testsuite/script_test_7.t: Same.
4490 * gold/testsuite/script_test_7.t: Same.
4491 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4492
36171d64
CC
44932010-09-14 Cary Coutant <ccoutant@google.com>
4494
4495 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4496 (Target_x86_64::Relocate::relocate_tls): Replace check for
4497 saw_tls_block_reloc_ with test for executable section.
4498
d89051bd
CC
44992010-09-12 Cary Coutant <ccoutant@google.com>
4500
4501 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4502 position-independent executables to shared libraries need dynamic
4503 relocations.
4504 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4505 position-independent executables.
4506 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4507 * testsuite/Makefile.in: Regenerate.
4508
fca41f0f
NC
45092010-09-10 Nick Clifton <nickc@redhat.com>
4510
4511 PR gold/11997
4512 * testsuite/memory_test.t: Discard any sections that are not
4513 needed.
4514
6695e4b3
L
45152010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4516
4517 PR gold/11996
4518 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4519 "This::" to work around a bug in gcc 4.2.
4520
4521 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4522
0f72bf6f
RÁE
45232010-09-09 Rafael Espindola <espindola@google.com>
4524
4525 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4526 sections with different PF_X flags in the same segment.
4527 (Layout::find_first_load_seg): Search all segments to find the first
4528 one.
4529 * options.h (rosegment): New.
4530
45312010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4532
05a79166 4533 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4534
aa98ff75
DK
45352010-09-08 Doug Kwan <dougkwan@google.com>
4536
4537 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4538 (Arm_relobj::do_relocate_sections): Add new parameter for output
4539 file to match the parent.
4540 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4541 of local symbols instead of input values. Update code to track
4542 changes in gold::relocate_section.
4543 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4544 (Sized_relobj::compute_final_local_value_internal): New methods.
4545 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4546 body into private version of Sized_relobj::compute_final_local_value.
4547 Call the inline method.
4548 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4549 merged symbol value if there is one.
4550 (Symbol_value::has_output_value): New method defintiion.
4551 (Sized_relobj::Compute_final_local_value_status): New enum type.
4552 (Sized_relobj::compute_final_local_value): New methods.
4553 (Sized_relobj::compute_final_local_value_internal): New methods.
4554 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4555 and arm_cortex_a8.sh.
4556 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4557 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4558 New tests.
4559 * Makefile.in: Regenerate.
4560 * testsuite/arm_bl_out_of_range.s: Update test.
4561 * testsuite/thumb_bl_out_of_range.s: Ditto.
4562 * testsuite/thumb_blx_out_of_range.s: Ditto.
4563 * testsuite/arm_branch_out_of_range.sh: New file.
4564 * testsuite/arm_cortex_a8.sh: Ditto.
4565 * testsuite/arm_cortex_a8_b.s: Ditto.
4566 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4567 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4568 * testsuite/arm_cortex_a8_bl.s: Ditto.
4569 * testsuite/arm_cortex_a8_blx.s: Ditto.
4570 * testsuite/arm_cortex_a8_local.s: Ditto.
4571 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4572 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4573
05a79166
L
45742010-09-08 Rafael Espindola <espindola@google.com>
4575
4576 * Makefile.am (memory_test.stdout): Run readelf with -W.
4577 * Makefile.in: Regenerate.
4578 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4579 64 bit output.
4580
33dbc701
RÁE
45812010-09-08 Rafael Espindola <espindola@google.com>
4582
4583 * script-sections.cc (Script_sections::add_memory_region): Convert
4584 field precision to int.
4585 * script.cc (script_set_section_region, script_set_section_region):
4586 Convert field precision to int.
4587
731ca54a
RÁE
45882010-09-08 Rafael Espindola <espindola@google.com>
4589
4590 * arm.cc (do_finalize_sections): Create the __exidx_start and
4591 __exdix_end symbols even when the section is missing.
4592
7f8cd844
NC
45932010-09-08 Nick Clifton <nickc@redhat.com>
4594
4595 * README: Remove claim that MEMORY is not supported.
4596 * expression.cc (script_exp_function_origin)
4597 (script_exp_function_length): Move from here to ...
4598 * script.cc: ... here.
4599 (script_set_section_region, script_add_memory)
4600 (script_parse_memory_attr, script_include_directive): New
4601 functions.
4602 * script-sections.cc
4603 (class Memory_region): New class.
4604 (class Output_section_definition): Add set_memory_region,
4605 set_section_vma, set_section_lma and get_section_name methods.
4606 (class Script_Sections): Add add_memory_region,
4607 find_memory_region, find_memory_region_origin,
4608 find_memory_region_length and set_memory_region methods.
4609 Have set_section_addresses method walk the list of set memory
4610 regions.
4611 Extend the print methos to display memory regions.
4612 * script-sections.h: Add prototypes for new methods.
4613 Add enum for MEMORY region attributes.
4614 * yyscript.y: Add support for parsing MEMORY regions.
4615 * script-c.h: Add prototypes for new functions.
4616 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4617 * testsuite/Makefile.in: Regenerate.
4618 * testsuite/memory_test.sh: New script.
4619 * testsuite/memory_test.s: New assembler source file.
4620 * testsuite/memory_test.t: New linker script.
4621
a4649286
DK
46222010-08-27 Doug Kwan <dougkwan@google.com>
4623
4624 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4625 reference override an existing dynamic weak reference.
4626 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4627 * testsuite/Makefile.in: Regenerate.
4628 * testsuite/dyn_weak_ref.sh: New file.
4629 * testsuite/dyn_weak_ref_1.c: Ditto.
4630 * testsuite/dyn_weak_ref_2.c: Ditto.
4631
b56648ad
ILT
46322010-08-27 Ian Lance Taylor <iant@google.com>
4633
4634 * incremental.h (class Incremental_input_entry): Add virtual
4635 destructor.
4636
809313cb
ILT
46372010-08-27 Ian Lance Taylor <iant@google.com>
4638
4639 * testsuite/start_lib_test_3.c: Mark t3 as used.
4640
11e32464
NC
46412010-08-27 Nick Clifton <nickc@redhat.com>
4642
4643 * options.cc (version_script): Fix small typo in previous
4644 whitespace tidyup.
4645
ca09d69a
NC
46462010-08-25 Nick Clifton <nickc@redhat.com>
4647
4648 * archive.cc: Formatting fixes: Remove whitespace between
4649 typename and following asterisk. Remove whitespace between
4650 function name and opening parenthesis.
4651 * archive.h: Likewise.
4652 * arm.cc: Likewise.
4653 * attributes.cc: Likewise.
4654 * attributes.h: Likewise.
4655 * common.cc: Likewise.
4656 * copy-relocs.cc: Likewise.
4657 * dirsearch.h: Likewise.
4658 * dynobj.cc: Likewise.
4659 * ehframe.cc: Likewise.
4660 * ehframe.h: Likewise.
4661 * expression.cc: Likewise.
4662 * fileread.cc: Likewise.
4663 * fileread.h: Likewise.
4664 * gc.h: Likewise.
4665 * gold-threads.cc: Likewise.
4666 * gold.cc: Likewise.
4667 * i386.cc: Likewise.
4668 * icf.h: Likewise.
4669 * incremental-dump.cc: Likewise.
4670 * incremental.cc: Likewise.
4671 * layout.cc: Likewise.
4672 * layout.h: Likewise.
4673 * main.cc: Likewise.
4674 * merge.cc: Likewise.
4675 * merge.h: Likewise.
4676 * object.cc: Likewise.
4677 * object.h: Likewise.
4678 * options.cc: Likewise.
4679 * options.h: Likewise.
4680 * output.cc: Likewise.
4681 * output.h: Likewise.
4682 * plugin.cc: Likewise.
4683 * plugin.h: Likewise.
4684 * powerpc.cc: Likewise.
4685 * reloc.cc: Likewise.
4686 * script-c.h: Likewise.
4687 * script-sections.cc: Likewise.
4688 * script.cc: Likewise.
4689 * stringpool.cc: Likewise.
4690 * symtab.cc: Likewise.
4691 * symtab.h: Likewise.
4692 * target.cc: Likewise.
4693 * timer.cc: Likewise.
4694 * timer.h: Likewise.
4695 * version.cc: Likewise.
4696 * x86_64.cc: Likewise.
4697
b8fa8750
NC
46982010-08-24 Nick Clifton <nickc@redhat.com>
4699
4700 PR 11899
4701 * layout.cc (segment_precedes): Sort segments by their physical
4702 addresses, if they have been set.
4703
9919d93b
CC
47042010-08-23 Cary Coutant <ccoutant@google.com>
4705
4706 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4707 symbols data.
4708 (Lib_group::include_member): Unlock object after deleting its
4709 symbols data.
4710 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4711 the bug fixed here.
4712
97b4be1c
CC
47132010-08-19 Neil Vachharajani <nvachhar@google.com>
4714 Cary Coutant <ccoutant@google.com>
4715
4716 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4717 constructor, and set_blocker.
4718 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4719 readsyms_blocker_.
4720 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4721 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4722 * testsuite/Makefile.am (start_lib_test): New test case.
4723 * testsuite/Makefile.in: Regenerate.
4724 * testsuite/start_lib_test_main.c: New file.
4725 * testsuite/start_lib_test_1.c: New file.
4726 * testsuite/start_lib_test_2.c: New file.
4727 * testsuite/start_lib_test_3.c: New file.
4728
dd0b1884
ILT
47292010-08-19 Ian Lance Taylor <iant@google.com>
4730
4731 * Makefile.in: Rebuild with automake 1.11.1.
4732 * aclocal.m4: Likewise.
4733 * testsuite/Makefile.in: Likewise.
4734
7223e9ca
ILT
47352010-08-19 Ian Lance Taylor <iant@google.com>
4736
4737 PR 10893
4738 * i386.cc (class Output_data_plt_i386): Update declarations.
4739 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4740 local_ifuncs_ fields.
4741 (Target_i386::do_plt_section_for_global): New function.
4742 (Target_i386::do_plt_section_for_local): New function.
4743 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4744 parameter; change all callers. Initialize global_ifuncs_ and
4745 local_ifuncs_. If doing a static link define __rel_iplt_start and
4746 __rel_iplt_end.
4747 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4748 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4749 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4750 symbols.
4751 (Target_i386::make_plt_section): New function, broken out of
4752 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4753 (Target_i386::make_plt_entry): Call make_plt_section.
4754 (Target_i386::make_local_ifunc_plt_entry): New function.
4755 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4756 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4757 R_386_IRELATIVE to switch.
4758 (Target_i386::Scan::global): Likewise.
4759 (Target_i386::Relocate::relocate): Likewise.
4760 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4761 switch.
4762 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4763 (Target_x86_64::do_plt_section_for_global): New function.
4764 (Target_x86_64::do_plt_section_for_local): New function.
4765 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4766 parameter; change all callers. If doing a static link define
4767 __rela_iplt_start and __rela_iplt_end.
4768 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4769 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4770 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4771 to point to .plt.
4772 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4773 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4774 switch.
4775 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4776 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4777 R_X86_64_IRELATIVE to switch.
4778 (Target_x86_64::Scan::global): Likewise.
4779 (Target_x86_64::Relocate::relocate): Likewise.
4780 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4781 switch.
4782 * target.h (class Target): Add plt_section_for_global and
4783 plt_section_for_local functions. Add do_plt_section_for_global
4784 and do_plt_section_for_local virtual functions.
4785 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4786 clarifying comments.
4787 (Symbol::use_plt_offset): Handle IFUNC symbol.
4788 * object.cc (Sized_relobj::Sized_relobj): Initialize
4789 local_plt_offsets_.
4790 (Sized_relobj::local_has_plt_offset): New function.
4791 (Sized_relobj::local_plt_offset): New function.
4792 (Sized_relobj::set_local_plt_offset): New function.
4793 (Sized_relobj::do_count): Handle IFUNC symbol.
4794 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4795 a bit away from input_shndx_ field. Add set_is_func_symbol and
4796 is_ifunc_symbol functions.
4797 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4798 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4799 local_plt_offsets_ field.
4800 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4801 * output.h (class Output_section_data): Add non-const
4802 output_section function.
4803 (class Output_data_got): Update declarations.
4804 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4805 Add use_plt_offset parameter to global and local constructors.
4806 Change all callers. Change local_sym_index_ field to 31 bits.
4807 Change GSYM_CODE and CONSTANT_CODE accordingly.
4808 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4809 doing a static link don't set sh_link field.
4810 (Output_data_got::Got_entry::write): Use PLT offset if
4811 appropriate.
4812 (Output_data_got::add_global_plt): New function.
4813 (Output_data_got::add_local_plt): New function.
4814 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4815 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4816 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4817 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4818 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4819 IFUNC conditional.
4820 * testsuite/ifunc-sel.h: New file.
4821 * testsuite/ifuncmain1.c: New file.
4822 * testsuite/ifuncmain1vis.c: New file.
4823 * testsuite/ifuncmod1.c: New file.
4824 * testsuite/ifuncdep2.c: New file.
4825 * testsuite/ifuncmain2.c: New file.
4826 * testsuite/ifuncmain3.c: New file.
4827 * testsuite/ifuncmod3.c: New file.
4828 * testsuite/ifuncmain4.c: New file.
4829 * testsuite/ifuncmain5.c: New file.
4830 * testsuite/ifuncmod5.c: New file.
4831 * testsuite/ifuncmain6pie.c: New file.
4832 * testsuite/ifuncmod6.c: New file.
4833 * testsuite/ifuncmain7.c: New file.
4834 * configure, testsuite/Makefile.in: Rebuild.
4835
56f75c03
ILT
48362010-08-18 Ian Lance Taylor <iant@google.com>
4837
4838 * incremental.cc
4839 (Output_section_incremental_inputs::write_input_files): Add cast
4840 to avoid signed/unsigned comparison warning.
4841 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4842
55455f89
CC
48432010-08-12 Cary Coutant <ccoutant@google.com>
4844
4845 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4846
e2054bcb
ILT
48472010-08-13 Ian Lance Taylor <iant@google.com>
4848
4849 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4850
74f67560
DK
48512010-08-12 Cary Coutant <ccoutant@google.com>
4852 Doug Kwan <dougkwan@google.com>
4853
4854 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4855 defintion overrides non-weak undef, remember that the original undef
4856 is not weak.
4857 * symtab.cc (Symbol_table::sized_write_global): For undef without
4858 an original weak binding, set binding to global in output.
4859 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4860 * testsuite/Makefile.in: Regenerate.
4861 * testsuite/strong_ref_weak_def.sh: New file.
4862 * testsuite/strong_ref_weak_def_1.c: Ditto.
4863 * testsuite/strong_ref_weak_def_2.c: Ditto.
4864
d1238d12
CC
48652010-08-12 Cary Coutant <ccoutant@google.com>
4866
4867 * testsuite/incremental_test.sh: Rewrite.
4868 * testsuite/incremental_test_1.c: Rewrite.
4869 * testsuite/incremental_test_2.c: Rewrite.
4870
0e70b911
CC
48712010-08-12 Cary Coutant <ccoutant@google.com>
4872
4873 * arm.cc (Target_arm::got_size): Add const.
4874 (Target_arm::got_entry_count): New function.
4875 (Target_arm::plt_entry_count): New function.
4876 (Target_arm::first_plt_entry_offset): New function.
4877 (Target_arm::plt_entry_size): New function.
4878 (Output_data_plt_arm::entry_count): New function.
4879 (Output_data_plt_arm::first_plt_entry_offset): New function.
4880 (Output_data_plt_arm::get_plt_entry_size): New function.
4881 * i386.cc (Target_i386::got_size): Add const.
4882 (Target_i386::got_entry_count): New function.
4883 (Target_i386::plt_entry_count): New function.
4884 (Target_i386::first_plt_entry_offset): New function.
4885 (Target_i386::plt_entry_size): New function.
4886 (Output_data_plt_i386::entry_count): New function.
4887 (Output_data_plt_i386::first_plt_entry_offset): New function.
4888 (Output_data_plt_i386::get_plt_entry_size): New function.
4889 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4890 find_incremental_inputs_sections. Dump incremental_got_plt section.
4891 * incremental.cc: Include target.h.
4892 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4893 parameter. Adjust all callers. Find incremental_got_plt section.
4894 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4895 section.
4896 (Output_section_incremental_inputs::set_final_data_size): Calculate
4897 size of incremental_got_plt section.
4898 (Output_section_incremental_inputs::do_write): Write the
4899 incremental_got_plt section.
4900 (Got_plt_view_info): New struct.
4901 (Local_got_offset_visitor): New class.
4902 (Global_got_offset_visitor): New class.
4903 (Global_symbol_visitor_got_plt): New class.
4904 (Output_section_incremental_inputs::write_got_plt): New function.
4905 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4906 Add parameter. Adjust all callers.
4907 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4908 (Incremental_inputs::got_plt_section): New function.
4909 (Incremental_inputs::got_plt_section_): New data member.
4910 (Incremental_got_plt_reader): New class.
4911 * layout.cc (Layout::create_incremental_info_sections): Add the
4912 incremental_got_plt section.
4913 * object.h (Got_offset_list::get_list): New function.
4914 (Got offset_list::for_all_got_offsets): New function.
4915 (Sized_relobj::local_got_offset_list): New function.
4916 * powerpc.cc (Target_powerpc::got_size): Add const.
4917 (Target_powerpc::got_entry_count): New function.
4918 (Target_powerpc::plt_entry_count): New function.
4919 (Target_powerpc::first_plt_entry_offset): New function.
4920 (Target_powerpc::plt_entry_size): New function.
4921 (Output_data_plt_powerpc::entry_count): New function.
4922 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4923 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4924 * sparc.cc (Target_sparc::got_size): Add const.
4925 (Target_sparc::got_entry_count): New function.
4926 (Target_sparc::plt_entry_count): New function.
4927 (Target_sparc::first_plt_entry_offset): New function.
4928 (Target_sparc::plt_entry_size): New function.
4929 (Output_data_plt_sparc::entry_count): New function.
4930 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4931 (Output_data_plt_sparc::get_plt_entry_size): New function.
4932 * symtab.h (Symbol::got_offset_list): New function.
4933 (Symbol_table::for_all_symbols): New function.
4934 * target.h (Sized_target::got_entry_count): New function.
4935 (Sized_target::plt_entry_count): New function.
4936 (Sized_target::plt_entry_size): New function.
4937 * x86_64.cc (Target_x86_64::got_size): Add const.
4938 (Target_x86_64::got_entry_count): New function.
4939 (Target_x86_64::plt_entry_count): New function.
4940 (Target_x86_64::first_plt_entry_offset): New function.
4941 (Target_x86_64::plt_entry_size): New function.
4942 (Output_data_plt_x86_64::entry_count): New function.
4943 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4944 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4945
09ec0418
CC
49462010-08-12 Cary Coutant <ccoutant@google.com>
4947
4948 * archive.cc: Include incremental.h.
4949 (Archive::Archive): Initialize incremental_info_.
4950 (Archive::include_member): Record archive members in incremental info.
4951 (Add_archive_symbols::run): Record begin and end of an archive in
4952 incremental info.
4953 (Lib_group::include_member): Record objects in incremental info.
4954 * archive.h (Incremental_archive_entry): Forward declaration.
4955 (Archive::set_incremental_info): New member function.
4956 (Archive::incremental_info): New member function.
4957 (Archive::Unused_symbol_iterator): New class.
4958 (Archive::unused_symbols_begin): New member function.
4959 (Archive::unused_symbols_end): New member function.
4960 (Archive::incremental_info_): New data member.
4961 * incremental-dump.cc (find_input_containing_global): New function.
4962 (dump_incremental_inputs): Dump new incremental info sections.
4963 * incremental.cc: Include symtab.h.
4964 (Output_section_incremental_inputs): New class.
4965 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4966 new incremental info sections.
4967 (Sized_incremental_binary::do_check_inputs): Likewise.
4968 (Incremental_inputs::report_archive): Remove.
4969 (Incremental_inputs::report_archive_begin): New function.
4970 (Incremental_inputs::report_archive_end): New function.
4971 (Incremental_inputs::report_object): New function.
4972 (Incremental_inputs::finalize_inputs): Remove.
4973 (Incremental_inputs::report_input_section): New function.
4974 (Incremental_inputs::report_script): Rewrite.
4975 (Incremental_inputs::finalize): Do nothing but finalize string table.
4976 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4977 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4978 (Incremental_inputs::create_data_sections): New function.
4979 (Incremental_inputs::relocs_entsize): New function.
4980 (Output_section_incremental_inputs::set_final_data_size): New function.
4981 (Output_section_incremental_inputs::do_write): New function.
4982 (Output_section_incremental_inputs::write_header): New function.
4983 (Output_section_incremental_inputs::write_input_files): New function.
4984 (Output_section_incremental_inputs::write_info_blocks): New function.
4985 (Output_section_incremental_inputs::write_symtab): New function.
4986 * incremental.h (Incremental_script_entry): Forward declaration.
4987 (Incremental_object_entry): Forward declaration.
4988 (Incremental_archive_entry): Forward declaration.
4989 (Incremental_inputs): Forward declaration.
4990 (Incremental_inputs_header_data): Remove.
4991 (Incremental_inputs_header): Remove.
4992 (Incremental_inputs_header_write): Remove.
4993 (Incremental_inputs_entry_data): Remove.
4994 (Incremental_inputs_entry): Remove.
4995 (Incremental_inputs_entry_write): Remove.
4996 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4997 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4998 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4999 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
5000 Likewise.
5001 (Incremental_input_entry): New class.
5002 (Incremental_script_entry): New class.
5003 (Incremental_object_entry): New class.
5004 (Incremental_archive_entry): New class.
5005 (Incremental_inputs::Incremental_inputs): Initialize new data members.
5006 (Incremental_inputs::report_inputs): Remove.
5007 (Incremental_inputs::report_archive): Remove.
5008 (Incremental_inputs::report_archive_begin): New function.
5009 (Incremental_inputs::report_archive_end): New function.
5010 (Incremental_inputs::report_object): Change prototype.
5011 (Incremental_inputs::report_input_section): New function.
5012 (Incremental_inputs::report_script): Change prototype.
5013 (Incremental_inputs::get_reloc_count): New function.
5014 (Incremental_inputs::set_reloc_count): New function.
5015 (Incremental_inputs::create_data_sections): New function.
5016 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
5017 (Incremental_inputs::inputs_section): New function.
5018 (Incremental_inputs::symtab_section): New function.
5019 (Incremental_inputs::relocs_section): New function.
5020 (Incremental_inputs::get_stringpool): Add const.
5021 (Incremental_inputs::command_line): Add const.
5022 (Incremental_inputs::inputs): Remove.
5023 (Incremental_inputs::command_line_key): New function.
5024 (Incremental_inputs::input_file_count): New function.
5025 (Incremental_inputs::input_files): New function.
5026 (Incremental_inputs::relocs_entsize): New function.
5027 (Incremental_inputs::sized_create_inputs_section_data): Remove.
5028 (Incremental_inputs::finalize_inputs): Remove.
5029 (Incremental_inputs::Input_info): Remove.
5030 (Incremental_inputs::lock_): Remove.
5031 (Incremental_inputs::inputs_): Change type.
5032 (Incremental_inputs::inputs_map_): Remove.
5033 (Incremental_inputs::current_object_entry_): New data member.
5034 (Incremental_inputs::inputs_section_): New data member.
5035 (Incremental_inputs::symtab_section_): New data member.
5036 (Incremental_inputs::relocs_section_): New data member.
5037 (Incremental_inputs::reloc_count_): New data member.
5038 (Incremental_inputs_reader): New class.
5039 (Incremental_symtab_reader): New class.
5040 (Incremental_relocs_reader): New class.
5041 * layout.cc (Layout::finalize): Move finalization of incremental info
5042 and creation of incremental info sections to follow finalization of
5043 symbol table. Set offsets for postprocessing sections.
5044 (Layout::create_incremental_info_sections): Call
5045 Incremental_inputs::create_data_sections. Add incremental symtab
5046 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
5047 sections to layout after input sections.
5048 * layout.h (struct Timespec): Forward declaration.
5049 (Layout::incremental_inputs): Add const.
5050 (Layout::create_incremental_info_sections): Add parameter.
5051 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
5052 * object.cc: Include incremental.h.
5053 (Relobj::finalize_incremental_relocs): New function.
5054 (Sized_relobj::do_layout): Record input sections in incremental info.
5055 * object.h (Object::output_section): New function.
5056 (Object::output_section_offset): Moved from Relobj.
5057 (Object::get_incremental_reloc_base): New function.
5058 (Object::get_incremental_reloc_count): New function.
5059 (Object::do_output_section): New function.
5060 (Object::do_output_section_offset): Moved from Relobj.
5061 (Object::do_get_incremental_reloc_base): New function.
5062 (Object::do_get_incremental_reloc_count): New function.
5063 (Object::Object): Initialize new data members.
5064 (Relobj::output_section): Renamed do_output_section and moved to
5065 protected.
5066 (Relobj::output_section_offset): Moved to Object.
5067 (Relobj::do_get_incremental_reloc_base): New function.
5068 (Relobj::do_get_incremental_reloc_count): New function.
5069 (Relobj::allocate_incremental_reloc_counts): New function.
5070 (Relobj::count_incremental_reloc): New function.
5071 (Relobj::finalize_incremental_relocs): New function.
5072 (Relobj::next_incremental_reloc_index): New function.
5073 (Relobj::reloc_counts_): New data member.
5074 (Relobj::reloc_bases_): New data member.
5075 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
5076 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
5077 (Sized_relobj::incremental_relocs_scan): New function.
5078 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5079 (Sized_relobj::incremental_relocs_write): New function.
5080 (Sized_relobj::incremental_relocs_write_reltype): New function.
5081 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
5082 incremental link.
5083 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
5084 archives and object files elsewhere.
5085 (Add_symbols::run): Report object files here.
5086 (Finish_group::run): Report end of archive at end of group.
5087 * reloc.cc: Include layout.h, incremental.h.
5088 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
5089 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
5090 (Sized_relobj::incremental_relocs_scan): New function.
5091 (Sized_relobj::incremental_relocs_scan_reltype): New function.
5092 (Sized_relobj::do_relocate_sections): Write incremental relocations.
5093 (Sized_relobj::incremental_relocs_write): New function.
5094 (Sized_relobj::incremental_relocs_write_reltype): New function.
5095 * script.cc (read_input_script): Rewrite test for incremental link.
5096 Change call to Incremental_inputs::report_script.
5097 * symtab.h (Symbol_table::first_global_index): New function.
5098 (Symbol_table::output_count): New function.
5099
ce0d1972
DK
51002010-08-12 Doug Kwan <dougkwan@google.com>
5101
5102 * arm.cc (Target_arm::merge_object_attributes): Check command line
5103 options --no-wchar-size-warning and --no-enum-size-warning.
5104 * options.h (General_options): Add ld-compatible options
5105 --no-enum-size-warning and --no-wchar-size-warning.
5106
6e5710ce
ILT
51072010-08-04 Ian Lance Taylor <iant@google.com>
5108
5109 * x86_64.cc (Target_x86_64::Scan::local): Use
5110 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
5111 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
5112 (Target_x86_64::Scan::global): Likewise.
5113 (Target_x86_64::Relocate::relocate): Likewise.
5114 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
5115 Likewise.
5116
fef830db
CC
51172010-08-03 Cary Coutant <ccoutant@google.com>
5118
5119 * merge.cc (Output_merge_string::do_add_input_section): Count strings
5120 to reserve space in merged_strings vector. Keep total input size
5121 for stats.
5122 (Output_merge_string::do_print_merge_stats): Print total input size.
5123 * merge.h (Output_merge_string): Add input_size_ field.
5124 * stringpool.cc (Stringpool_template::string_length): Move
5125 implementations out of Stringpool_template class and place in
5126 stringpool.h.
5127 * stringpool.h (string_length): Move out of Stringpool_template.
5128
1e3811b0
ILT
51292010-08-03 Ian Lance Taylor <iant@google.com>
5130
5131 PR 11712
5132 * layout.cc (relaxation_loop_body): If address of load segment is
5133 set, adjust address to include headers if possible.
5134
7af0c620
ILT
51352010-08-03 Ian Lance Taylor <iant@google.com>
5136
5137 * version.cc (version_string): Bump to 1.10.
5138
22f0da72
ILT
51392010-08-03 Ian Lance Taylor <iant@google.com>
5140
5141 PR 11805
5142 * layout.h (enum Output_section_order): Define.
5143 (class Layout): Update declarations.
5144 * layout.cc (Layout::get_output_section): Add order parameter.
5145 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
5146 is_first_non_relro parameters. Change all callers.
5147 (Layout::choose_output_section): Likewise.
5148 (Layout::add_output_section_data): Likewise.
5149 (Layout::make_output_section): Likewise. Set order.
5150 (Layout::default_section_order): New function.
5151 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
5152 * output.cc (Output_section::Output_section): Initialize order_.
5153 Don't initialize deleted fields.
5154 (Output_segment::Output_segment): Don't initialize deleted
5155 fields.
5156 (Output_segment::add_output_section_to_load): New function
5157 replacing add_output_section. Change all callers to call this or
5158 add_output_section_to_nonload.
5159 (Output_segment::add_output_section_to_nonload): New function.
5160 (Output_segment::remove_output_section): Rewrite.
5161 (Output_segment::add_initial_output_data): Likewise.
5162 (Output_segment::has_any_data_sections): Likewise.
5163 (Output_segment::is_first_section_relro): Likewise.
5164 (Output_segment::maximum_alignment): Likewise.
5165 (Output_segment::has_dynamic_reloc): New function replacing
5166 dynamic_reloc_count. Change all callers.
5167 (Output_segment::has_dynamic_reloc_list): New function replacing
5168 dynamic_reloc_count_list. Change all callers.
5169 (Output_segment::set_section_addresses): Rewrite.
5170 (Output_segment::set_offset): Rewrite.
5171 (Output_segment::find_first_and_last_list): Remove.
5172 (Output_segment::set_tls_offsets): Rewrite.
5173 (Output_segment::first_section_load_address): Likewise.
5174 (Output_segment::output_section_count): Likewise.
5175 (Output_segment::section_with_lowest_load_address): Likewise.
5176 (Output_segment::write_section_headers): Likewise.
5177 (Output_segment::print_sections_to_map): Likewise.
5178 * output.h (class Output_data): Remove dynamic_reloc_count_
5179 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
5180 (Output_data::add_dynamic_reloc): Rewrite.
5181 (Output_data::has_dynamic_reloc): New function.
5182 (Output_data::dynamic_reloc_count): Remove.
5183 (class Output_section): Add order_ field. Remvoe is_relro_local_,
5184 is_last_relro_, is_first_non_relro_, is_interp_,
5185 is_dynamic_linker_section_ fields. Add order and set_order
5186 functions. Remove is_relro_local, set_is_relro_local,
5187 is_last_relro, set_is_last_relro, is_first_non_relro,
5188 set_is_first_non_relro functions, is_interp, set_is_interp,
5189 is_dynamic_linker_section, and set_is_dynamic_linker_section
5190 functions.
5191 (class Output_segment): Change Output_data_list from std::list to
5192 std:;vector. Add output_lists_ field. Remove output_data_ and
5193 output_bss_ fields. Update declarations.
5194
3ff2ccb0
ILT
51952010-08-02 Ian Lance Taylor <iant@google.com>
5196
5197 * arm.cc (Target_arm::gc_process_relocs): Use typename.
5198 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
5199 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
5200
88a4108b
ILT
52012010-08-02 Ian Lance Taylor <iant@google.com>
5202
5203 PR 11855
5204 * script.cc (Script_options::Script_options): Initialize
5205 symbol_definitions_ and symbol_references_.
5206 (Script_options::add_symbol_assignment): Update
5207 symbol_definitions_ and symbol_references_.
5208 (Script_options::add_symbol_reference): New function.
5209 (script_symbol): New function.
5210 * script.h (class Script_options): Add symbol_definitions_ and
5211 symbol_references_ fields.
5212 (Script_options::referenced_const_iterator): New type.
5213 (Script_options::referenced_begin): New function.
5214 (Script_options::referenced_end): New function.
5215 (Script_options::is_referenced): New function.
5216 (Script_options::any_unreferenced): New function.
5217 * script-c.h (script_symbol): Declare.
5218 * yyscript.y (exp): Call script_symbol.
5219 * symtab.cc: Include "script.h".
5220 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
5221 Change all callers. Check symbols referenced by scripts.
5222 (Symbol_table::add_undefined_symbols_from_command_line): Add
5223 layout parameter. Change all callers.
5224 (Symbol_table::do_add_undefined_symbols_from_command_line):
5225 Likewise. Break out loop body. Check symbols referenced by
5226 scripts.
5227 (Symbol_table::add_undefined_symbol_from_command_line): New
5228 function broken out of
5229 do_add_undefined_symbols_from_command_line.
5230 * symtab.h (class Symbol_table): Update declarations.
5231 * archive.cc: Include "layout.h".
5232 (Archive::should_include_member): Add layout parameter. Change
5233 all callers. Check for symbol mentioned in expression.
5234 * archive.h (class Archive): Update declaration.
5235 * object.cc (Sized_relobj::do_should_include_member): Add layout
5236 parameter.
5237 * object.h (Object::should_include_member): Add layout parameter.
5238 Change all callers.
5239 (Object::do_should_include_member): Add layout parameter.
5240 (class Sized_relobj): Update declaration.
5241 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
5242 parameter.
5243 * dynobj.h (class Sized_dynobj): Update declaration.
5244 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
5245 layout parameter.
5246 * plugin.h (class Sized_pluginobj): Update declaration.
5247
5f1ab67a
ILT
52482010-08-02 Ian Lance Taylor <iant@google.com>
5249
5250 PR 11866
5251 * output.cc (Output_segment::set_offset): Search for the first and
5252 last sections rather than assuming that the list is in order.
5253 (Output_segment::find_first_and_last_list): New function.
5254 * output.h (class Output_segment): Update declarations.
5255 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
5256 (relro_strip_test_SOURCES): New variable.
5257 (relro_strip_test_DEPENDENCIES): New variable.
5258 (relro_strip_test_LDFLAGS): New variable.
5259 (relro_strip_test_LDADD): New variable.
5260 (relro_strip_test.so): New target.
5261
a8df5856
ILT
52622010-08-02 Ian Lance Taylor <iant@google.com>
5263
5264 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
5265 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
5266 (Target_i386::got_tlsdesc_section): New function.
5267 (Target_i386::got_section): Create space for GOT entries for
5268 TLSDESC relocations.
5269 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
5270 R_386_TLS_GOTDESC.
5271 (Target_i386::Scan::global): Likewise.
5272 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
5273 using TLSDESC GOT.
5274 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
5275 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
5276 (Target_x86_64::got_tlsdesc_section): New function.
5277 (Target_x86_64::got_section): Create space for GOT entries for
5278 TLSDESC relocations.
5279 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
5280 R_386_TLS_GOTDESC.
5281 (Target_x86_64::Scan::global): Likewise.
5282 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
5283 using TLSDESC GOT.
5284
0c10a0a6
ILT
52852010-08-02 Ian Lance Taylor <iant@google.com>
5286
5287 * testsuite/final_layout.sh: Use dc to convert from hex to
5288 decimal.
5289
41cbeecc
ST
52902010-07-29 Sriraman Tallam <tmsriram@google.com>
5291
5292 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
5293 paramter to the call to gold::gc_process_relocs.
5294 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
5295 paramter to the call to gold::gc_process_relocs.
5296 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
5297 parameter to the call to gold::gc_process_relocs.
5298 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
5299 template parameter to the call to gold::gc_process_relocs.
5300 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
5301 paramter to the call to gold::gc_process_relocs.
5302 * gc.h (get_embedded_addend_size): New function.
5303 (gc_process_relocs): Save the size of the reloc for use by ICF.
5304 * icf.cc (get_section_contents): Get the addend from the text section
5305 for SHT_REL relocation sections.
5306 * icf.h (Icf::Reloc_addend_size_info): New typedef.
5307 (Icf::Reloc_info): Add new member reloc_addend_size_info.
5308 * int_encoding.h (read_from_pointer): New overloaded function.
5309 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
5310 * testsuite/icf_sht_rel_addend_test.sh: New file.
5311 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
5312 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
5313
6ea55b82
RW
53142010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5315
5316 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
5317 * Makefile.in: Regenerate.
5318 * testsuite/Makefile.in: Regenerate.
5319
9691462b
ILT
53202010-07-27 Jeffrey Yasskin <jyasskin@google.com>
5321
5322 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
5323 * gold/testsuite/debug_msg.cc: Likewise.
5324 * gold/testsuite/odr_violation1.cc
5325 * gold/testsuite/odr_violation2.cc
5326
76897331
CC
53272010-07-21 Cary Coutant <ccoutant@google.com>
5328
5329 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
5330 string, and length fields.
5331 (Output_merge_string::Merged_strings_list): New type.
5332 (Output_merge_string::Merged_strings_lists): New typedef.
5333 (Output_merge_string): Replace merged_strings_ with
5334 merged_strings_lists_.
5335 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
5336 Merged_strings_list per input object and section. Don't store pointer
5337 to the string. Don't store length with each merged string entry.
5338 (Output_merge_string::finalize_merged_data): Loop over list of merged
5339 strings lists. Recompute length of each merged string.
5340
78384e8f
CC
53412010-07-15 Cary Coutant <ccoutant@google.com>
5342
5343 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
5344 here.
5345
783659f9
ILT
53462010-07-14 Ian Lance Taylor <iant@google.com>
5347
5348 * descriptors.cc (Descriptors::open): Report correct name in error
5349 message.
5350
131687b4
DK
53512010-07-13 Doug Kwan <dougkwan@google.com>
5352
5353 * arm.cc (Arm_input_section::Arm_input_section): For a
5354 SHT_ARM_EXIDX section, always keeps the input sections.
5355 (Arm_input_section::set_exidx_section_link): New method.
5356 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5357 has_errors_ to false.
5358 (Arm_exidx_input_section::has_errors,
5359 Arm_exidx_input_section::set_has_errors): New methods.
5360 (Arm_exidx_input_section::has_errors_): New data member.
5361 (Arm_relobj::get_exidx_shndx_list): New method.
5362 (Arm_output_section::append_text_sections_to_list): Do not skip
5363 section without SHF_EXECINSTR.
5364 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5365 errors.
2e702c99 5366 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5367 section header. Make error messages more verbose. Check for
5368 a non-executable section linked to an EXIDX section.
5369 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5370 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5371 check that there is no deferred EXIDX section if we exit early.
5372 Instead of not making an EXIDX section in case of an error, make one
5373 and set the has_errors flag of it.
5374 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5375 in a relocatable link.
5376 (Target_arm::do_relax): Look for the EXIDX output section instead of
5377 assuming that it is called .ARM.exidx.
2e702c99 5378 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5379 section list. Do not check for SHF_EXECINSTR section flags but
5380 skip any input section with errors.
5381 * output.cc (Output_section::Output_section): Initialize
5382 always_keeps_input_sections_ to false.
5383 (Output_section::add_input_section): Check for
5384 always_keeps_input_sections_.
5385 * output.h (Output_section::always_keeps_input_sections,
5386 Output_section::set_always_keeps_input_sections): New methods.
5387 (Output_section::always_keeps_input_sections): New data member.
5388
69517287
RÁE
53892010-07-13 Rafael Espindola <espindola@google.com>
5390
5391 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5392 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5393
82742395
ILT
53942010-07-13 Philip Herron <herron.philip@googlemail.com>
5395 Ian Lance Taylor <iant@google.com>
5396
5397 * output.h (Output_section_lookup_maps::add_merge_section):
5398 Correct check of whether value was inserted.
5399 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5400 (Output_section_lookup_maps::add_relaxed_input_section):
5401 Likewise.
5402 * arm.cc (Target_arm::got_section): Remove used local os.
5403 * i386.cc (Target_i386::got_section): Likewise.
5404 * x86_64.cc (Target_x86_64::got_section): Likewise.
5405 * sparc.cc (Target_sparc::got_section): Likewise.
5406 (Target_sparc::relocate): Remove unused local have_got_offset.
5407 * powerpc.cc (Target_powerpc::relocate): Likewise.
5408
f2d707b5
ILT
54092010-07-13 Ian Lance Taylor <iant@google.com>
5410
241531d6
ILT
5411 * compressed_output.cc (zlib_decompress): Fix signature in
5412 !HAVE_ZLIB_H case.
5413
f2d707b5
ILT
5414 * archive.cc (Archive::include_member): Unlock an external member
5415 of a thin archive. Don't bother to delete an object we know is
5416 NULL.
5417
a2e47362
CC
54182010-07-12 Cary Coutant <ccoutant@google.com>
5419
5420 * compressed_output.cc (zlib_decompress): New function.
5421 (get_uncompressed_size): New function.
5422 (decompress_input_section): New function.
5423 * compressed_output.h (get_uncompressed_size): New function.
5424 (decompress_input_section): New function.
5425 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5426 Handle compressed debug sections.
5427 * layout.cc (is_compressed_debug_section): New function.
5428 (Layout::output_section_name): Map compressed section names to
5429 canonical names.
5430 * layout.h (is_compressed_debug_section): New function.
5431 (is_debug_info_section): Recognize compressed debug sections.
5432 * merge.cc: Include compressed_output.h.
5433 (Output_merge_data::do_add_input_section): Handle compressed
5434 debug sections.
5435 (Output_merge_string::do_add_input_section): Handle compressed
5436 debug sections.
5437 * object.cc: Include compressed_output.h.
5438 (Sized_relobj::Sized_relobj): Initialize new data members.
5439 (build_compressed_section_map): New function.
5440 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5441 * object.h (Object::section_is_compressed): New method.
5442 (Object::do_section_is_compressed): New method.
5443 (Sized_relobj::Compressed_section_map): New type.
5444 (Sized_relobj::do_section_is_compressed): New method.
5445 (Sized_relobj::compressed_sections_): New data member.
5446 * output.cc (Output_section::add_input_section): Handle compressed
5447 debug sections.
5448 * reloc.cc: Include compressed_output.h.
5449 (Sized_relobj::write_sections): Handle compressed debug sections.
5450
ce279a62
CC
54512010-07-08 Cary Coutant <ccoutant@google.com>
5452
5453 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5454 weak when resolving to a dynamic def.
5455 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5456 for weak undef/dynamic def cases. Adjust callers.
5457 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5458 undef_binding_weak_.
5459 (Symbol_table::sized_write_globals): Adjust symbol binding.
5460 (Symbol_table::sized_write_symbol): Add binding parameter.
5461 * symtab.h (Symbol::set_undef_binding): New method.
5462 (Symbol::is_undef_binding_weak): New method.
5463 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5464 (Symbol_table::should_override): Add new parameter.
5465 (Symbol_table::sized_write_symbol): Add new parameter.
5466
5467 * testsuite/weak_undef_file1.cc: Add new test case.
5468 * testsuite/weak_undef_file2.cc: Fix header comment.
5469 * testsuite/weak_undef_test.cc: Add new test case.
5470
b2286c10
DK
54712010-06-29 Doug Kwan <dougkwan@google.com>
5472
5473 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5474 Initialize USE_SYMBOL_.
5475 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5476 definition.
5477 (Arm_reloc_property::uses_symbol_): New data member declaration.
5478 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5479 uses symbol value and symbol is undefined but not weakly undefined.
5480
4802450a
RÁE
54812010-06-28 Rafael Espindola <espindola@google.com>
5482
5483 * plugin.cc (Plugin::load): Use dlerror.
5484
e5ca47ba
ILT
54852010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5486
5487 * symtab.cc (detect_odr_violations): When reporting an ODR
5488 violation, report an object where the symbol is defined.
5489
8a75a161
DK
54902010-06-25 Doug Kwan <dougkwan@google.com>
5491
5492 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5493 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5494 definition.
5495 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5496 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5497 target hook to detect function points.
5498 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5499 * icf.h (Icf::check_section_for_function_pointers): Change type of
5500 parameter SECTION_NAME to const reference to std::string. Use
5501 target hook to determine if section may have unsafe pointers.
5502 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5503 method definition.
5504
42218b9f
RÁE
55052010-06-21 Rafael Espindola <espindola@google.com>
5506
5507 * fileread.cc (Input_file::find_fie): New
5508 (Input_file::open): Use Input_file::find_fie.
5509 * fileread.h (Input_file::find_fie): New
5510 * plugin.cc (set_extra_library_path): New.
5511 (Plugin::load): Add set_extra_library_path to the transfer vector.
5512 (Plugin_manager::set_extra_library_path): New.
5513 (Plugin_manager::add_input_file): Use the extra search path if set.
5514 (set_extra_library_path(): New.
5515 * plugin.h (Plugin_manager): Add set_extra_library_path and
5516 extra_search_path_.
5517
a0506cca
CC
55182010-06-19 Cary Coutant <ccoutant@google.com>
5519
5520 * layout.cc (gdb_sections): Add .debug_types.
5521 (lines_only_debug_sections): Likewise.
5522
6508b958
RÁE
55232010-06-18 Rafael Espindola <espindola@google.com>
5524
5525 * plugin.cc (add_input_file,add_input_library)
5526 (Plugin_manager::add_input_file): Make filename arguments const.
5527 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5528 const.
5529
3e235302
DK
55302010-06-16 Doug Kwan <dougkwan@google.com>
5531
5532 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5533 .ARM.attributes section if we have not merged any input
5534 attributes sections.
5535
106e8a6c
DK
55362010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5537
5538 * arm.cc: Allow combining objects with no EABI version
5539 information.
5540
91ff43fe
RÁE
55412010-06-15 Rafael Espindola <espindola@google.com>
5542
5543 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5544
68ed838c
ILT
55452010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5546
5547 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5548 (struct iovec): Correct !HAVE_READV definition.
5549
f3a2388f
CC
55502010-06-10 Cary Coutant <ccoutant@google.com>
5551
5552 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5553 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5554 reloc sections.
5555 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5556
5557 PR 11683
5558 * symtab.h (Symbol::is_placeholder): New member function.
5559 * target-reloc.h (relocate_section): Check for placeholder symbols.
5560
5561 * testsuite/Makefile.am (plugin_test_8): New test.
5562 (plugin_test_9): New test.
5563 * testsuite/Makefile.in: Regenerate.
5564
e1df38aa
NC
55652010-06-09 Nick Clifton <nickc@redhat.com>
5566
5567 * yyscript.y (input_list_element): Allow strings prefixed with
5568 the '-' character. Treat these as libraries.
5569 * script.cc (script_add_library): New function. Adds a library
5570 specified by "-l<name>" found in an input script.
5571 * script-c.h: Add prototype for script_add_library.
5572
25bbe950
DK
55732010-06-07 Doug Kwan <dougkwan@google.com>
5574
5575 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5576 Restrict stub-group size to be within long conditional branch
5577 range when working around cortex-A8 erratum.
5578
0f32ea4c
ILT
55792010-06-07 Damien Diederen <dd@crosstwine.com>
5580
5581 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5582 #ifdef typo.
5583
8fe2a369
ST
55842010-06-03 Sriraman Tallam <tmsriram@google.com>
5585
5586 PR gold/11658
5587 * output.cc
5588 (Output_section::Input_section_sort_entry::compare_section_ordering):
5589 Change to return non-zero correctly.
5590 (Output_section::Input_section_sort_section_order_index_compare
5591 ::operator()): Change to fix ambiguity in comparisons.
5592
6e9ba2ca
ST
55932010-06-01 Sriraman Tallam <tmsriram@google.com>
5594
5595 * gold.h (is_wildcard_string): New function.
5596 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5597 (Layout::layout_eh_frame): Ditto.
5598 (Layout::find_section_order_index): New method.
5599 (Layout::read_layout_from_file): New method.
5600 * layout.h (Layout::find_section_order_index): New method.
5601 (Layout::read_layout_from_file): New method.
5602 (Layout::input_section_position_): New private member.
5603 (Layout::input_section_glob_): New private member.
5604 * main.cc (main): Call read_layout_from_file here.
5605 * options.h (--section-ordering-file): New option.
5606 * output.cc (Output_section::input_section_order_specified_): New
5607 member.
5608 (Output_section::Output_section): Initialize new member.
5609 (Output_section::add_input_section): Add new parameter.
5610 Keep input sections when --section-ordering-file is used.
5611 (Output_section::set_final_data_size): Sort input sections when
5612 section ordering file is specified.
5613 (Output_section::Input_section_sort_entry): Add new parameter.
5614 Check sorting type.
5615 (Output_section::Input_section_sort_entry::compare_section_ordering):
5616 New method.
5617 (Output_section::Input_section_sort_compare::operator()): Change to
5618 consider section_order_index.
5619 (Output_section::Input_section_sort_init_fini_compare::operator()):
5620 Change to consider section_order_index.
5621 (Output_section::Input_section_sort_section_order_index_compare
5622 ::operator()): New method.
5623 (Output_section::sort_attached_input_sections): Change to sort
5624 according to section order when specified.
e1df38aa
NC
5625 (Output_section::add_input_section<32, true>): Add new parameter.
5626 (Output_section::add_input_section<64, true>): Add new parameter.
5627 (Output_section::add_input_section<32, false>): Add new parameter.
5628 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5629 * output.h (Output_section::add_input_section): Add new parameter.
5630 (Output_section::input_section_order_specified): New
5631 method.
5632 (Output_section::set_input_section_order_specified): New method.
5633 (Input_section::Input_section): Initialize section_order_index_.
5634 (Input_section::section_order_index): New method.
5635 (Input_section::set_section_order_index): New method.
5636 (Input_section::section_order_index_): New member.
5637 (Input_section::Input_section_sort_section_order_index_compare): New
5638 struct.
5639 (Output_section::input_section_order_specified_): New member.
5640 * script-sections.cc (is_wildcard_string): Delete and move modified
5641 method to gold.h.
5642 (Output_section_element_input::Output_section_element_input): Modify
5643 call to is_wildcard_string.
5644 (Output_section_element_input::Input_section_pattern
5645 ::Input_section_pattern): Ditto.
5646 (Output_section_element_input::Output_section_element_input): Ditto.
5647 * testsuite/Makefile.am (final_layout): New test case.
5648 * testsuite/Makefile.in: Regenerate.
5649 * testsuite/final_layout.cc: New file.
5650 * testsuite/final_layout.sh: New file.
5651
3537c84b
RÁE
56522010-06-01 Rafael Espindola <espindola@google.com>
5653
5654 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5655
105b6afd
RÁE
56562010-06-01 Rafael Espindola <espindola@google.com>
5657
5658 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5659 visibility of symbols.
5660
29e11421
DK
56612010-05-27 Doug Kwan <dougkwan@google.com>
5662
5663 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5664 from start of output section instead of address for a local symbol
5665 in a merged or relaxed section when doing a relocatable link.
5666
5e0f337e
RÁE
56672010-05-26 Rafael Espindola <espindola@google.com>
5668
703d02da 5669 PR 11604
5e0f337e
RÁE
5670 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5671 adding sections the garbage collector removed.
5672 * gold/testsuite/Makefile.am: Add test.
5673 * gold/testsuite/Makefile.in: Regenerate.
5674 * gold/testsuite/plugin_test_7.sh: New.
5675 * gold/testsuite/plugin_test_7_1.c: New.
5676 * gold/testsuite/plugin_test_7_2.c: New.
5677
f4187277
RÁE
56782010-05-26 Rafael Espindola <espindola@google.com>
5679
5680 * script-sections.cc (Output_section_definition::set_section_addresses):
5681 Check for --section-start.
5682
5c388529
DK
56832010-05-26 Doug Kwan <dougkwan@google.com>
5684
5685 * arm.cc (Arm_scan_relocatable_relocs): New class.
5686 (Target_arm::relocate_special_relocatable): New method.
5687 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5688 (Arm_relocate_functions::thumb_branch_common): Same.
5689 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5690 instead of Default_scan_relocatable_relocs.
5691 * target-reloc.h (relocate_for_relocatable): Let target handle
5692 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5693 * target.h (Sized_target::relocate_special_relocatable): New method.
5694
bca1c3ae
ILT
56952010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5696
5697 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5698
0439c796
DK
56992010-05-23 Doug Kwan <dougkwan@google.com>
5700
5701 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5702 instead of a cast.
5703 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5704 with a direct branch, not a conditional branch, to a stub.
5705 * merge.cc (Output_merge_base::record_input_section): New method
5706 defintion.
5707 (Output_merge_data::do_add_input_section): Record input section if
5708 keeps-input-sections flag is set.
5709 (Output_merge_string::do_add_input_section): Ditto.
5710 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5711 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5712 INPUT_SECTIONS_.
5713 (Output_merge_base::keeps_input_sections,
5714 Output_merge_base::set_keeps_input_sections,
5715 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5716 method definitions.
5717 (Output_merge_base::Input_sections): New type declaration.
5718 (Output_merge_base::input_sections_begin,
5719 Output_merge_base::input_sections_end,
5720 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5721 (Output_merge_base::bool keeps_input_sections_,
5722 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5723 Output_merge_base::input_sections_): New data members.
5724 (Output_merge_data::do_set_keeps_input_sections): New method
5725 defintion.
5726 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5727 * output.cc (Output_section::Input_section::relobj): Move method
5728 defintion from class declaration to here and handle merge sections.
5729 (Output_section::Input_section::shndx): Ditto.
5730 (Output_section::Output_section): Remove initializations of removed
5731 data members and initialize new data member LOOKUP_MAPS_.
5732 (Output_section::add_input_section): Set keeps-input-sections flag
5733 for a newly created merge output section as appropriate. Adjust code
5734 to use Output_section_lookup_maps class.
5735 (Output_section::add_relaxed_input_section): Adjst code for lookup
5736 maps code refactoring.
2e702c99 5737 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5738 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5739 class. If adding input section to a newly created merge output
5740 section fails, remove the new merge section.
5741 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5742 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5743 (Output_section::find_merge_section): Ditto.
0439c796 5744 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5745 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5746 Output_section_lookup_maps class.
5747 (Output_section::get_input_sections): Export merge sections. Adjust
5748 code to use Output_section_lookup_maps class.
5749 (Output_section:::add_script_input_section): Adjust code to use
5750 Output_section_lookup_maps class. Update lookup maps for merge
5751 sections also.
5752 (Output_section::discard_states): Use Output_section_lookup_maps.
5753 (Output_section::restore_states): Same.
5754 * output.h (Merge_section_properties): Move class defintion out of
5755 Output_section.
5756 (Output_section_lookup_maps): New class.
5757 (Output_section::Input_section::is_merge_section): New method
5758 defintion.
5759 (Output_section::Input_section::relobj): Move defintion out of class
5760 defintion. Declare method only.
5761 (Output_section::Input_section::shndx): Ditto.
5762 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5763 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5764 (Output_section::Merge_section_by_properties_map,
5765 Output_section::Output_section_data_by_input_section_map,
5766 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5767 Remove types.
2e702c99 5768 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5769 KEEPS_INPUT_SECTIONS.
5770 (Output_section::build_lookup_maps): New method declaration.
5771 (Output_section::merge_section_map_,
5772 Output_section::merge_section_by_properties_map_,
5773 Output_section::relaxed_input_section_map_,
5774 Output_section::is_relaxed_input_section_map_valid_): Remove data
5775 members.
5776 (Output_section::lookup_maps_): New data member.
5777
76295588
L
57782010-05-21 Doug Kwan <dougkwan@google.com>
5779
5780 PR gold/11619
5781 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5782 avoid a compilation error.
5783
d103a984
RÁE
57842010-05-19 Rafael Espindola <espindola@google.com>
5785
5786 * script-sections.cc (Output_section_definition::allocate_to_segment):
5787 Update the phdrs_list even when the output section is NULL.
5788 * testsuite/Makefile.am: Add test.
5789 * testsuite/Makefile.in: Regenerate.
5790 * testsuite/script_test_9.cc: New.
5791 * testsuite/script_test_9.sh: New.
5792 * testsuite/script_test_9.t: New.
5793
6625d24e
DK
57942010-05-19 Doug Kwan <dougkwan@google.com>
5795
5796 * arm.cc (Arm_input_section::original_size): New method.
5797 (Arm_input_section::do_addralign): Add a cast.
5798 (Arm_input_section::do_output_offset): Remove static cast.
5799 (Arm_input_section::original_addralign,
5800 Arm_input_section::original_size_): Change type to uint32_t.
5801 (Arm_input_section::init): Add safe casts for section alignment
5802 and size.
5803 (Arm_input_section::set_final_data_size): Do not set address and
5804 offset of stub table.
5805 (Arm_output_section::fix_exidx_coverage): Change use of of
5806 Output_section::Simple_input_section to that of
5807 Output_section::Input_section.
5808 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5809 except for the first pass.
5810 * output.cc (Output_section::get_input_sections): Change type of
5811 input_sections to std::list<Input_section>.
5812 (Output_section::add_script_input_section): Rename from
5813 Output_section::add_simple_input_section. Change type of SIS
5814 parameter from Simple_input_section to Input_section.
5815 * output.h (Output_section::Simple_input_section): Remove class.
5816 (Output_section::Input_section): Change class visibility to public.
5817 (Output_section::Input_section::addralign): Use stored alignments
5818 for special input sections if set.
5819 (Output_section::Input_section::set_addralign): New method.
5820 (Output_section::get_input_sections): Change parameter type from
5821 list of Simple_input_section to list of Input_section.
5822 (Output_section::add_script_input_section): Rename from
5823 Output_section::add_simple_input_section. Change first parameter's
5824 type from Simple_input_section to Input_section and remove the
5825 second and third parameters.
5826 * script-sections.cc (Input_section::Input_section_list): Change
5827 type to list of Output_section::Input_section/
5828 (Input_section_info::Input_section_info): Change parameter type of
5829 INPUT_SECTION to Output_section::Input_section.
5830 (Input_section_info::input_section): Change return type.
5831 (Input_section_info::input_section_): Change type to
5832 Output_section::Input_section.
5833 (Output_section_element_input::set_section_addresses): Adjust code
5834 to use Output_section::Input_section instead of
5835 Output_section::Simple_input_section. Adjust code for renaming
5836 of Output_section::add_simple_input_section.
5837 (Orphan_output_section::set_section_addresses): Ditto.
5838
e1e82ea4
RW
58392010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5840
5841 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5842 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5843
91e75c8a
RÁE
58442010-05-18 Rafael Espindola <espindola@google.com>
5845
5846 * options.cc (General_options::finalize): Handle -nostdlib.
5847 * options.h (nostdlib): New option.
5848 * script.cc (script_add_search_dir): Handle -nostdlib.
5849
da59ad79
DK
58502010-05-12 Doug Kwan <dougkwan@google.com>
5851
5852 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5853 attributes section only if there no attributes section after merging.
5854 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5855 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5856 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5857 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5858 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5859 and arm_attr_merge_7.stdout.
5860 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5861 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5862 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5863 arm_attr_merge_7b.o): New rules.
5864 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5865 arm_attr_merge_7
5866 * testsuite/Makefile.in: Regenerate.
5867 * testsuite/arm_attr_merge.sh: New file.
5868 * testsuite/arm_attr_merge_[67][ab].s: Same.
5869
3e01a7fd
NC
58702010-05-05 Nick Clifton <nickc@redhat.com>
5871
5872 * po/es.po: Updated Spanish translation.
5873
7ad2014a
L
58742010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5875
5876 * Makefile.am (install-exec-local): Properly install gold as
5877 default cross linker.
5878 * Makefile.in: Regenerated.
5879
4fda8867
NC
58802010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5881 Nick Clifton <nickc@redhat.com>
5882
5883 * configure.ac (install_as_default): Define and set to false
5884 unless --enable-gold or --enable-gold=both/gold has been
5885 specified.
5886 * configure: Regenerate.
5887
5888 * Makefile.am (install-exec-local): Install the executable as
5889 'ld.gold'. If install_as_default is true then also install it as
5890 'ld'.
5891 * Makefile.in: Regenerated.
5892
bd288ea2
ILT
58932010-04-24 Ian Lance Taylor <iant@google.com>
5894
5895 * layout.cc (Layout::layout_reloc): In relocatable link don't
5896 combine reloc sections for grouped sections.
5897
ef38fd8a
ST
58982010-04-23 Sriraman Tallam <tmsriram@google.com>
5899
5900 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5901 sections that are not ordinary to icf.
5902 * icf.cc (get_section_contents): Handle relocation pointing to section
5903 with no object or shndx information.
5904 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5905 * testsuite/Makefile.in: Regenerate.
5906 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5907 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5908
f6973bdc
ILT
59092010-04-22 Ian Lance Taylor <iant@google.com>
5910
5911 * expression.cc (Expression::Expression_eval_info): Add
5912 result_alignment_pointer field.
5913 (Expression::eval_with_dot): Add result_alignment_pointer
5914 parameter. Change all callers.
5915 (Expression::eval_maybe_dot): Likewise.
5916 (class Binary_expression): Add alignment_pointer parameter to
5917 left_value and right_value. Change all callers.
5918 (BINARY_EXPRESSION): Set result alignment.
5919 (class Trinary_expression): Add alignment_pointer parameter to
5920 arg2_value and arg3_value. Change all callers.
5921 (Trinary_cond::value): Set result alignment.
5922 (Max_expression::value, Min_expression::value): Likewise.
5923 (Align_expression::value): Likewise.
5924 * script-sections.cc (class Sections_element): Add dot_alignment
5925 parameter to set_section_addresses virtual function. Update
5926 instantiations.
5927 (class Output_section_element): Likewise.
5928 (Script_sections::create_segments): Add dot_alignment parameter.
5929 Change all callers.
5930 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5931 (Script_sections::set_phdrs_clause_addresses): Likewise.
5932 * script-sections.h: Update declarations.
5933 * script.h: Update declarations.
5934 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5935 min_p_align.
5936 * testsuite/script_test_3.t: Set large alignment.
5937 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5938 segment has expected alignment.
5939
9c9c98a5
NC
59402010-04-22 Nick Clifton <nickc@redhat.com>
5941
5942 * po/gold.pot: Updated by the Translation project.
5943 * po/vi.po: Updated Vietnamese translation.
5944
2253bfba
L
59452010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5946
5947 * testsuite/Makefile.am (check_PROGRAMS): Add
5948 icf_virtual_function_folding_test.
5949 * testsuite/Makefile.in: Regenerated.
5950
85fdf906
AH
59512010-04-15 Andrew Haley <aph@redhat.com>
5952
5953 * options.h (merge_exidx_entries): New option.
5954 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5955 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5956 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5957 (Target_arm::merge_exidx_entries): New function.
5958 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5959 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5960 to Arm_exidx_fixup constructor.
5961 Add new arg, merge_exidx_entries.
5962 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5963 Arm_output_section::fix_exidx_coverage.
5964
ce97fa81
ST
59652010-04-18 Sriraman Tallam <tmsriram@google.com>
5966
5967 * icf.cc (get_section_contents): Check for preemptible functions.
5968 Ignore addend when appropriate.
5969 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5970 section folded.
5971 (add_from_relobj): Check for section folded.
5972 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5973 * symtab.h (should_add_dynsym_entry): Add new parameter.
5974 * target-reloc.h (scan_relocs): Check for section folded.
5975 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5976 Check reloc types for function pointers in shared objects.
5977 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5978 case.
5979 (icf_preemptible_functions_test): New test case.
5980 (icf_string_merge_test): New test case.
5981 * testsuite.Makefile.in: Regenerate.
5982 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5983 bar_glob. Refactor code.
5984 * testsuite/icf_preemptible_functions_test.cc: New file.
5985 * testsuite/icf_preemptible_functions_test.sh: New file.
5986 * testsuite/icf_string_merge_test.cc: New file.
5987 * testsuite/icf_string_merge_test.sh: New file.
5988 * testsuite/icf_virtual_function_folding_test.cc: New file.
5989 * testsuite/icf_virtual_function_folding_test.sh: New file.
5990
04ceb17c
DK
59912010-04-14 Doug Kwan <dougkwan@google.com>
5992
5993 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5994 for local symbol recounting if we remove a section due to ICF.
5995 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5996 there are no regular objects in input.
5997
153e7da4
DK
59982010-04-13 Doug Kwan <dougkwan@google.com>
5999
6000 * arm.cc (Arm_input_section::set_final_data_size): Compute
6001 accurate final data size instead of using current data size.
6002
4dbd9faf
DK
60032010-04-09 Doug Kwan <dougkwan@google.com>
6004
6005 * layout.cc (Layout::choose_output_section): Handle script section
6006 types.
6007 (Layout::make_output_section_for_script): Add section type parameter.
6008 Handle script section types.
6009 * layout.h (Layout::make_output_section_for_script): Add section
6010 type parameter.
6011 * output.cc (Output_section::Output_section): Initialize data member
6012 is_noload_.
6013 (Output_section::do_reset_address_and_file_offset): Do not set address
6014 to 0 if section is a NOLOAD section.
6015 * output.h (Output_section::is_noload): New method.
6016 (Output_section::set_is_noload): Ditto.
6017 (Output_section::is_noload_): New data member.
6018 * script-c.h (Script_section_type): New enum type.
6019 (struct Parser_output_section_header): Add new file section_type.
6020 * script-sections.cc (Sections_element::output_section_name): Add
6021 parameter for returning script section type.
6022 (Output_section_definition::output_section_name): Ditto.
6023 (Output_section_definition::section_type)P; New method.
6024 (Output_section_definiton::script_section_type_name): Ditto.
6025 (Output_section_definition::script_section_type_): New data member.
6026 (Output_section_definition::Output_section_definition): Initialize
6027 data member Output_section_definition::script_section_type_.
6028 (Output_section_definition::create_sections): Pass script section type
6029 to Layout::make_output_section_for_script.
6030 (Output_section_definition::output_section_name): Return script
6031 section type to caller.
6032 (Output_section_definition::set_section_address): Do not advance
6033 dot value and load address if section type is NOLOAD. Set address
6034 of NOLOAD sections regardless of section flags.
6035 (Output_section_definition::print): Print section type if it is
6036 not SCRIPT_SECTION_TYPE_NONE.
6037 (Output_section_definition::section_type): New method.
6038 (Output_section_definition::script_section_type_name): Ditto.
6039 (Script_sections::output_section_name): Add new parameter
6040 PSECTION_TYPE for returning script section type. Pass it to
6041 section elements. Handle discard sections.
6042 (Sort_output_sections::operator()): Handle NOLOAD sections.
6043 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 6044 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
6045 returning script section type.
6046 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
6047 INFO and NOLOAD.
6048 * yyscript.y (union): Add new field SECTION_TYPE.
6049 (COPY, DSECT, INFO, NOLOAD): New tokens.
6050 (opt_address_and_section_type): Change type to output_section_header.
6051 (section_type): New non-terminal
6052 (section_header): Handle section type.
2253bfba 6053 (opt_address_and_section_type): Return section type value.
4dbd9faf 6054
721ea635
L
60552010-04-09 H.J. Lu <hongjiu.lu@intel.com>
6056
6057 * testsuite/plugin_common_test_1.c (foo): Add prototype.
6058 * testsuite/plugin_common_test_2.c (foo): Likewise.
6059
6bf924b0
DK
60602010-04-08 Doug Kwan <dougkwan@google.com>
6061
6062 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
6063 Output_merge_data.
6064 * output.cc (Output_section::add_merge_input_section): Simplify
6065 code and return status of Output_merge_base::add_input_section.
e1df38aa 6066 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
6067 returns true.
6068
24af6f92
DK
60692010-04-07 Doug Kwan <dougkwan@google.com>
6070
6071 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
6072 if section is marked as containing instructions but has no mapping
6073 symbols.
6074 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
6075 correct section index.
6076 (Arm_relobj::find_linked_text_section): Ditto.
6077
00698fc5
CC
60782010-04-07 Cary Coutant <ccoutant@google.com>
6079
6080 * archive.cc (include_member): Destroy Read_symbols_data object before
6081 releasing file.
6082 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
6083 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
6084 (Read_symbols_data::~Read_symbols_data) New destructor.
6085 (Section_relocs::Section_relocs) New constructor.
6086 (Section_relocs::~Section_relocs) New destructor.
6087 (Read_relocs_data::Read_relocs_data) New constructor.
6088 (Read_relocs_data::~Read_relocs_data) New destructor.
6089 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
6090 pointers to NULL after deleting.
6091
7296d933
DK
60922010-04-07 Doug Kwan <dougkwan@google.com>
6093
6094 * arm.cc: Replace "endianity" with "endianness" in comments.
6095 (Arm_exidx_cantunwind): Ditto.
6096 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
6097 (Arm_relobj::merge_flags_and_attributes): New method.
6098 (Arm_relobj::merge_flags_and_attributes_): New data member.
6099 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
6100 (Arm_relobj::scan_sections_for_stubs): Ditto.
6101 (Arm_relobj::do_read_symbols): Check to see if we really want to
6102 merge processor-specific flags and attributes. Exit early if
6103 an object is empty except for section names and the undefined symbol.
6104 (Target_arm::do_finalize_sections): Move check for ELF format to
6105 Arm_relobj::do_read_symbols. Merge processor specific flags and
6106 attributes from a regular object only when we have determined that
6107 it is aapropriate. Do not create an .ARM.attributes section in
6108 output if there is no regular input object.
6109 (Target_arm::merge_processor_specific_flags): Check
6110 --warn-mismatch before printing any error.
6111 (Target_arm::merge_object_attributes): Ditto.
6112 * gold.cc (queue_middle_tasks): Handle the case in which there is
6113 no regular object in input.
6114 * options.cc (General_options::parse_EB): New method.
6115 (General_options::parse_EL): Same.
6116 (General_options::General_options): Initialize endianness_.
6117 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
6118 New options.
6119 (General_options::Endianness): New enum.
6120 (General_options::endianness): New method.
6121 (General_options::endianness_): New data member.
6122 * parameters.cc (Parameters::set_options): Check target endianness.
6123 (Parameters::set_target_once): Ditto.
6124 (Parameters::check_target_endianness): New method.
6125 (parameters_force_valid_target): If either -EL or -EB is specified,
6126 use it to define endianness of default target.
6127 * parameters.h (Parameters::check_target_endianness): New method
6128 declaration.
6129 * target.h (class Target): Change "endianity" to "endianness"
6130 in comments.
6131
efc8d4f2
RW
61322010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6133
6134 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
6135 * configure: Regenerate.
6136 * Makefile.in: Regenerate.
6137 * testsuite/Makefile.in: Regenerate.
6138
be234d88
CC
61392010-04-06 Cary Coutant <ccoutant@google.com>
6140
6141 gcc PR lto/42757
6142 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
6143 prevailing definitions of common symbols.
6144 * testsuite/plugin_test_6.sh: New test case.
6145 * testsuite/plugin_common_test_1.c: New test case.
6146 * testsuite/plugin_common_test_2.c: New test case.
6147 * testsuite/Makefile.am (plugin_test_6): New test case.
6148 * testsuite/Makefile.in: Regenerate.
6149
bd32c6bd
NC
61502010-04-06 Nick Clifton <nickc@redhat.com>
6151
6152 * po/vi.po: New Vietnamese translation.
6153
323c532f
DK
61542010-03-30 Doug Kwan <dougkwan@google.com>
6155
6156 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
6157
4fcd97eb
DK
61582010-03-25 Doug Kwan <dougkwan@google.com>
6159
6160 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
6161 to avoid a conversion warning on a 32-bit host.
6162
4ebf39db
ILT
61632010-03-24 Ian Lance Taylor <iant@google.com>
6164
6165 * testsuite/script_test_3.t: Add a TLS segment.
6166 * testsuite/Makefile.am (check_PROGRAMS): Add
6167 tls_phdrs_script_test.
6168 (tls_phdrs_script_test_SOURCES): Define.
6169 (tls_phdrs_script_test_DEPENDENCIES): Define.
6170 (tls_phdrs_script_test_LDFLAGS): Define.
6171 (tls_phdrs_script_test_LDADD): Define.
6172 * testsuite/Makefile.in: Rebuild.
6173
4a599bdd
CC
61742010-03-23 Cary Coutant <ccoutant@google.com>
6175
6176 * fileread.cc (find_or_make_view): Fix comment.
6177
6c93b22c
ILT
61782010-03-23 Ian Lance Taylor <iant@google.com>
6179
6180 * script-sections.cc (class Orphan_section_placement): Define
6181 PLACE_TLS and PLACE_TLS_BSS.
6182 (Orphan_section_placement::Orphan_section_placement): Initialize
6183 new places.
6184 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
6185 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
6186 (tls_script_test_SOURCES): Define.
6187 (tls_script_test_DEPENDENCIES): Define.
6188 (tls_script_test_LDFLAGS): Define.
6189 (tls_script_test_LDADD): Define.
6190 * testsuite/Makefile.in: Rebuild.
6191
a2c7281b
DK
61922010-03-22 Doug Kwan <dougkwan@google.com>
6193
6194 * arm.cc (Arm_relocate_functions::abs8,
6195 Arm_relocate_functions::abs16): Use correct check for overflow
6196 specified in the ARM ELF specs.
6197 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
6198 target of a BLX instruction specially.
6199 (Reloc_stub::stub_type_for_reloc): Ditto.
6200 (Relocate::relocate): Use symbolic names instead of numeric relocation
6201 codes to report error.
6202 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
6203 workaround.
6204 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
6205 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
6206 thumb2_blx_out_of_range.stdout
6207 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
6208 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
6209 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
6210 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
6211 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
6212 thumb2_blx_in_range, thumb2_blx_in_range.o,
6213 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
6214 thumb2_blx_out_of_range.o): New rules.
2e702c99 6215 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
6216 thumb2_blx_in_range and thumb2_blx_out_of_range.
6217 * testsuite/Makefile.in: Regenerate.
6218 * arm_branch_in_range.sh: Add tests for THUMB BLX.
6219 * testsuite/thumb_blx_in_range.s: New file.
6220 * testsuite/thumb_blx_out_of_range.s: New file.
6221
b0193076
RÁE
62222010-03-22 Rafael Espindola <espindola@google.com>
6223
6224 * archive.cc (Should_include): Move to archive.h.
6225 (should_include_member): Make it a member of Archive.
6226 (Lib_group): New.
6227 (Add_lib_group_symbols): New.
6228 * archive.h: Include options.h.
6229 (Archive_member): Moved from Archive.
6230 (Should_include): Moved from archive.cc.
6231 (Lib_group): New.
6232 (Add_lib_group_symbols): New.
6233 * dynobj.cc (do_should_include_member): New.
6234 * dynobj.h (do_should_include_member): New.
6235 * gold.cc (queue_initial_tasks): Update call to queue.
6236 * main.cc (main): Print lib group stats.
6237 * object.cc (do_should_include_member): New.
6238 * object.h: Include archive.h.
6239 (Object::should_include_member): New.
6240 (Object::do_should_include_member): New.
6241 (Sized_relobj::do_should_include_member): New.
6242 * options.cc (General_options::parse_start_lib): New.
6243 (General_options::parse_end_lib): New.
6244 (Input_arguments::add_file): Handle lib groups.
6245 (Input_arguments::start_group): Check we are not in a lib.
6246 (Input_arguments::start_lib): New.
6247 (Input_arguments::end_lib): New.
6248 * options.h (General_options): Add start_lib and end_lib.
6249 (Input_argument::lib_): New.
6250 (Input_argument::lib): New.
6251 (Input_argument::is_lib): New.
6252 (Input_file_lib): New.
6253 (Input_arguments::in_lib_): New.
6254 (Input_arguments::in_lib): New.
6255 (Input_arguments::start_lib): New.
6256 (Input_arguments::end_lib_): New.
6257 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
6258 in unused members as preempted.
6259 (Sized_pluginobj::do_should_include_member): New.
6260 * plugin.h (Sized_pluginobj::do_should_include_member): New.
6261 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
6262 return the blocker.
6263 (Read_symbols::do_whole_lib_group): New.
6264 (Read_symbols::do_lib_group): New.
6265 (Read_symbols::do_read_symbols): Handle lib groups.
6266 (Read_symbols::get_name): Handle lib groups.
6267 * readsyms.h (Read_symbols): Add an archive member pointer.
6268 (Read_symbols::do_whole_lib_group): New.
6269 (Read_symbols::do_lib_group): New.
6270 (Read_symbols::member_): New.
6271 * script.cc (read_input_script): Update call to queue_soon.
6272
d099120c
DK
62732010-03-19 Doug Kwan <dougkwan@google.com>
6274
6275 * arm.cc (Stub_table::Stub_table): Initialize new data members
6276 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6277 (Stub_table::add_reloc_stub): Assign stub offset and update
6278 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
6279 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
6280 New data members.
2e702c99 6281 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
6282 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
6283 instead of going over all reloc stubs.
2e702c99 6284 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
6285 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6286 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 6287 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
6288 Stringpool_template::offset_.
6289 * stringpool.h (Stringpool_template::set_no_zero_null): Set
6290 Stringpool_template::offset_ to zero.
6291
1aa37384
DK
62922010-03-15 Doug Kwan <dougkwan@google.com>
6293
6294 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
6295 offset_.
6296 (Stringpool_template::new_key_offset): New method.
6297 (Stringpool_template::add_string): Assign offsets when adding new
6298 strings.
6299 (Stringpool_template::set_string_offsets): Do not set string offsets
6300 when not optimizing.
6301 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
6302 member size_.
2e702c99
RM
6303 (Chunked_vector::clear): Clear size_.
6304 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
6305 (Chunked_vector::size): Return size_.
6306 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 6307 (Chunked_vector::size_): New data member.
1aa37384
DK
6308 (Stringpool_template::set_no_zero_null): Assert string set is empty.
6309 (Stringpool_template::new_key_offset): New method declaration.
6310 (Stringpool_template::offset_): New data member.
6311
b672b057
RÁE
63122010-03-15 Rafael Espindola <espindola@google.com>
6313
6314 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
6315 Add_symbols' constructor.
6316 * readsyms.h (Add_symbols): Remove the input_group member.
6317
b6848d3c
ILT
63182010-03-10 Ian Lance Taylor <iant@google.com>
6319
6320 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
6321 target to ask whether a reference to a symbol requires a stack
6322 split.
6323 * target.h (Target::is_call_to_non_split): New function.
6324 (Target::do_is_call_to_non_split): Declare virtual function.
6325 * target.cc: Include "symtab.h".
6326 (Target::do_is_call_to_non_split): New function.
6327 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
6328
a2a5469e
CC
63292010-03-10 Cary Coutant <ccoutant@google.com>
6330
6331 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
6332 (File_read::open[1]): Remove initial mapping of whole_file_view_.
6333 (File_read::open[2]): Add whole_file_view_ to list of views.
6334 (File_read::make_view): Remove test of whole_file_view_.
6335 (File_read::find_or_make_view): Create whole_file_view_ if
6336 necessary.
6337 (File_read::clear_views): Replace bool parameter with enum;
6338 adjust all callers. Don't delete views with permanent data;
6339 do delete cached views and views from archives if
6340 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
6341 if clearing the corresponding view.
6342 * fileread.h (File_read::Clear_views_mode): New enum.
6343 (File_read::View::is_permanent_view): New method.
6344 (File_read::clear_views): Replace bool parameter
6345 with enum; adjust all callers.
6346 * options.h (General_options): Change keep_files_mapped option;
6347 add map_whole_files.
6348 * readsyms.cc (Add_symbols::run): Delete sd_ object before
6349 releasing the file.
6350 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
6351 the file.
6352
8861f32b
DM
63532010-03-10 David S. Miller <davem@davemloft.net>
6354
6355 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6356
d62d0f5f
ST
63572010-03-09 Sriraman Tallam <tmsriram@google.com>
6358
6359 * icf.cc (get_section_contents): Add '@' marker after processing the
6360 merge reloc.
6361
9177756d
DK
63622010-03-08 Doug Kwan <dougkwan@google.com>
6363
6364 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6365 due to a conversion warning.
6366 (Arm_relobj::update_output_local_symbol_count): Check for local
6367 symbol with unset output index.
6368
9e9e071b
ILT
63692010-03-05 Ian Lance Taylor <iant@google.com>
6370
6371 * options.h (class General_options): Add --spare-dynamic-tags.
6372 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6373 --spare-dynamic-tags.
6374
a81ee015
ILT
63752010-03-05 Ian Lance Taylor <iant@google.com>
6376
6377 * incremental.cc: Include "libiberty.h".
6378
44ec90b9
RO
63792010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6380
6381 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6382 function, is_info_ member.
6383 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6384 (Versions::Versions): Update caller.
6385 (Versions::define_base_version): Likewise.
6386 (Versions::add_def): Likewise.
6387
0897ed3b
ST
63882010-03-03 Sriraman Tallam <tmsriram@google.com>
6389
6390 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6391 (Scan::possible_function_pointer_reloc): New function.
6392 (Scan::local_reloc_may_be_function_pointer): Change to call
6393 possible_function_pointer_reloc.
6394 (Scan::global_reloc_may_be_function_pointer): Ditto.
6395 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6396 relocations in ".data.rel.ro._ZTV" section.
6397 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6398 * testsuite/icf_safe_so_test.cc: Ditto.
6399 * testsuite/icf_safe_test.cc: Ditto.
6400 * testsuite/icf_safe_test.sh: Ditto.
6401
d3bbad62
ILT
64022010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6403 Ian Lance Taylor <iant@google.com>
6404
6405 * target-reloc.h (relocate_section): Check the symbol table index
6406 for -1U before setting the local symbol index.
6407 (scan_relocatable_relocs): If copying the relocation, record that
6408 the local symbol is required.
6409 * object.h (Symbol_value::is_output_symtab_index_set): New
6410 function.
6411 (Symbol_value::may_be_discarded_from_output_symtab): New
6412 function.
6413 (Symbol_value::has_output_symtab_entry): New function.
6414 (Symbol_value::needs_output_symtab_entry): Remove.
6415 (Symbol_value::output_symtab_index): Make sure the symbol index is
6416 set.
6417 (Symbol_value::set_output_symtab_index): Make sure the symbol
6418 index is not set. Make sure the new index is valid.
6419 (Symbol_value::set_must_have_output_symtab_entry): New function.
6420 (Symbol_value::has_output_dynsym_entry): New function.
6421 (Symbol_value::set_output_dynsym_index): Make sure the new index
6422 is valid.
6423 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6424 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6425 local symbol if permitted.
6426 (Sized_relobj::do_finalize_local_symbols): Call
6427 is_output_symtab_index_set rather than needs_output_symtab_entry.
6428 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6429 rather than needs_output_symtab_entry. Call
6430 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6431 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6432 is_output_symtab_index_set rather than needs_output_symtab_entry.
6433 * testsuite/discard_locals_relocatable_test.c: New file.
6434 * testsuite/discard_locals_test.sh: Test -r.
6435 * testsuite/Makefile.am (check_DATA): Add
6436 discard_locals_relocatable_test1.syms,
6437 discard_local_relocatable_test2.syms.
6438 (MOSTLYCLEANFILES): Likewise. Also add
6439 discard_locals_relocatable_test1.lout and
6440 discard_locals_relocatable_test2.out.
6441 (discard_locals_relocatable_test1.syms): New target.
6442 (discard_locals_relocatable_test.o): New target.
6443 (discard_locals_relocatable_test1.out): New target.
6444 (discard_locals_relocatable_test2.syms): New target.
6445 (discard_locals_relocatable_test2.out): New target.
6446 (various): Add missing ../ld-new dependencies.
6447 * testsuite/Makefile.in: Rebuild.
6448
7e8ccf26
NC
64492010-03-03 Nick Clifton <nickc@redhat.com>
6450
6451 * po/fi.po: New Finnish translation.
6452
2a0ff005
DK
64532010-03-01 Doug Kwan <dougkwan@google.com>
6454
6455 * layout.cc (Layout::Layout): Force section types of .init_array*,
6456 .preinit_array* and .fini_array* sections.
6457 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6458 Fix check of return value of std::string::find.().
6459 (Output_section::Input_section_sort_compare::operator()): Remove
6460 comment about .init_array.
6461 (Output_section::Input_section_sort_init_fini_compare::operator()):
6462 New method.
6463 (Output_section::sort_attached_input_sections): Handle .init_array
6464 and .fini_array specially.
6465 * output.h (Output_section::Inut_section_sort_compare): Update
6466 comment.
6467 (Output_section::Input_section_sort_init_fini_compare): New struct.
6468
c3e4ae29
DK
64692010-02-26 Doug Kwan <dougkwan@google.com>
6470
6471 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6472 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6473 * testsuite/debug_msg.sh: Avoid matching source line number for
6474 use of global variable undef_int.
6475
2fd9ae7a
DK
64762010-02-26 Doug Kwan <dougkwan@google.com>
6477
6478 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6479 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6480 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6481 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6482 * options.cc (General_options::General_options): Initialize member
6483 fix_v4bx_.
6484 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6485 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6486 and rm_no_fix_v4bx.stdout
6487 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6488 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6489 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6490 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6491 and arm_no_fix_v4bx.
6492 * Makefile.in: Regenerate.
6493 * testsuite/arm_fix_v4bx.s: New file.
6494 * testsuite/arm_fix_v4bx.sh: Ditto.
6495
67ec7d0b
DK
64962010-02-24 Doug Kwan <dougkwan@google.com>
6497
6498 * arm.cc (Target_arm::got_section): Make the .got section the first
6499 non RELRO section in the data segment.
6500 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6501 suffixes of section names.
6502
10165461
DK
65032010-02-24 Doug Kwan <dougkwan@google.com>
6504
6505 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6506 flags and attributes merging if an input file is a binary file.
6507 * fileread.cc (Input_file::open): Record format of original file.
6508 * fileread.h (Input_file::Format): New enum type.
2e702c99 6509 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6510 (Input_file::format): New method definition.
6511 (Input_file::format_):: New data member.
6512
4a54abbb
DK
65132010-02-24 Doug Kwan <dougkwan@google.com>
6514
6515 * arm.cc (Arm_output_data_got): New class.
6516 (ARM_TCB_SIZE): New constant
6517 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6518 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6519 If user uses a script with a SECTIONS clause, issue only a warning
6520 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6521 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6522 garbage collection.
6523 (Target_arm::got_mode_index_entry): Handle static linking.
6524 (Target_arm::Scan::local): Ditto.
6525 (Target_arm::Scan::global): Ditto.
6526 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6527 all incorrectly implemented relocations.
e1df38aa 6528 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6529 Arm_output_section::fix_exidx_coverage.
6530 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6531 from ".ARM.exidx." and ".ARM.extab.".
6532
ca419a6f
ILT
65332010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6534
6535 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6536 section if it does not already exist.
6537 * attributes.cc (Attributes_section_data::Attributes_section_data):
6538 Don't crash if size is zero.
6539
135b9c78
ILT
65402010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6541 Ian Lance Taylor <iant@google.com>
6542
6543 * gold.cc (queue_middle_tasks): If no input files were opened,
6544 exit.
6545 * workqueue.h (Task_function::Task_function): Assert that there is
6546 a blocker.
6547
bb0bfe4f
DK
65482010-02-22 Doug Kwan <dougkwan@google.com>
6549
6550 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6551 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6552 types to avoid warnings due to different uint64_t implementations
6553 on different hosts.
6554
2a2b6d42
DK
65552010-02-21 Doug Kwan <dougkwan@google.com>
6556
6557 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6558 handling of the maximum backward branch offset.
2e702c99 6559 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6560 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6561 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6562 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6563 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6564 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6565 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6566 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6567 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6568 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6569 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6570 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6571 thumb2_bl_out_of_range.o): New rules.
6572 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6573 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6574 thumb2_bl_out_of_range
6575 * testsuite/Makefile.in: Regenerate.
6576 * testsuite/arm_bl_in_range.s: New file.
6577 * testsuite/arm_bl_out_of_range.s: Ditto.
6578 * testsuite/arm_branch_in_range.sh: Ditto.
6579 * testsuite/arm_branch_range.t: Ditto.
6580 * testsuite/thumb2_branch_range.t: Ditto.
6581 * testsuite/thumb_bl_in_range.s: Ditto.
6582 * testsuite/thumb_bl_out_of_range.s: Ditto.
6583 * testsuite/thumb_branch_range.t: Ditto.
6584
b487ad64
ST
65852010-02-20 Sriraman Tallam <tmsriram@google.com>
6586
6587 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6588 Add reloc offset information.
6589 * icf.cc (get_section_contents): Change iterators to point to the new
6590 vectors. Add reloc offset information to the contents.
6591 * icf.h (Icf::Sections_reachable_info): New typedef.
6592 (Icf::Sections_reachable_list): New typedef.
6593 (Icf::Offset_info): New typedef.
6594 (Icf::Reloc_info): New struct typedef.
6595 (Icf::Reloc_info_list): New typedef.
6596 (Icf::symbol_reloc_list): Delete method.
6597 (Icf::addend_reloc_list): Delete method.
6598 (Icf::section_reloc_list): Delete method.
6599 (Icf::reloc_info_list): New method.
6600 (Icf::reloc_info_list_): New member.
6601
f96accdf
DK
66022010-02-19 Doug Kwan <dougkwan@google.com>
6603
6604 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6605 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6606 * arm.cc (Arm_relocation_functions): New forward declaration.
6607 (Target_arm::Target_arm): Initialize new data members
6608 got_mod_index_offset_ and tls_base_symbol_defined_.
6609 (Target_arm::Relocate::relocate_tls): New method.
6610 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6611 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6612 New methods.
2e702c99 6613 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6614 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6615 (Target_arm::got_mod_index_offset_,
6616 Target_arm::tls_base_symbol_defined_): New data members.
6617 (Target_arm::Scan::local, Target::Scan::global,
6618 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6619 relocations.
6620
c8761b9a
DK
66212010-02-18 Doug Kwan <dougkwan@google.com>
6622
6623 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6624 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6625 text section as a parameter becuase some broken tools may not set
6626 the link in section header.
6627 (Target_arm::has_got_section): New method.
6628 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6629 without any mapping symbol as data only. Remove warning.
6630 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6631 link in its section header, try to discover the link by inspecting the
6632 REL31 relocation at the beginning of the section.
6633 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6634 in error message.
6635 (Target_arm::Scan::global): Treat any reference to the symbol
6636 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6637
21bb3914
ST
66382010-02-12 Sriraman Tallam <tmsriram@google.com>
6639
6640 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6641 (Scan::global_reloc_may_be_function_pointer): New function.
6642 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6643 (Scan::global_reloc_may_be_function_pointer): New function.
6644 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6645 (Scan::global_reloc_may_be_function_pointer): New function.
6646 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6647 (Scan::global_reloc_may_be_function_pointer): New function.
6648 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6649 (Scan::global_reloc_may_be_function_pointer): New function.
6650 (Scan::possible_function_pointer_reloc): New function.
6651 (Target_x86_64::can_check_for_function_pointers): New function.
6652 * gc.h (gc_process_relocs): Scan relocation types to determine if
6653 function pointers were taken for targets that support it.
6654 * icf.cc (Icf::find_identical_sections): Include functions for
6655 folding in safe ICF whose pointer is not taken.
6656 * icf.h (Secn_fptr_taken_set): New typedef.
6657 (fptr_section_id_): New member.
6658 (section_has_function_pointers): New function.
6659 (set_section_has_function_pointers): New function.
6660 (check_section_for_function_pointers): New function.
6661 * options.h: Fix comment for safe ICF option.
6662 * target.h (can_check_for_function_pointers): New function.
6663 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6664 Modify icf_safe_test for X86-64.
6665 * testsuite/Makefile.in: Regenerate.
6666 * testsuite/icf_safe_so_test.cc: New file.
6667 * testsuite/icf_safe_so_test.sh: New file.
6668 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6669 (main): Change to take pointer to function kept_func_3.
6670 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6671 folding is done correctly for X86-64.
6672
0da6fa6c
DM
66732010-02-12 David S. Miller <davem@davemloft.net>
6674
6675 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6676 is_symbolless parameter.
6677 (Output_reloc<SHT_REL>::is_symbolless): New.
6678 (Output_reloc<SHT_REL>::is_symbolless_): New.
6679 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6680 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6681 (Output_reloc<SHT_RELA>::is_symbolless): New.
6682 (Output_data_reloc::add_global): Handle is_symbolless.
6683 (Output_data_reloc::add_global_relative): Likewise.
6684 (Output_data_reloc::add_local): Likewise.
6685 (Output_data_reloc::add_local_relative): Likewise.
6686 (Output_data_reloc::add_symbolless_global_addend): New.
6687 (Output_data_reloc::add_symbolless_local_addend): New.
6688 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6689 is_symbolless.
6690 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6691 instead of ->is_relative_
6692 (Output_reloc::write): Likewise.
6693 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6694 (Output_reloc::write_rel): Simplify.
6695
6696 * sparc.cc (Target_sparc::Scan::local): Use
6697 ->add_symbolless_local_addend as needed.
6698 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6699 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6700 based upon relocation offset.
6701
e4782e83
DK
67022010-02-11 Doug Kwan <dougkwan@google.com>
6703
6704 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6705 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6706 beginning of function.
6707 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6708 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6709 parameter is_32bit in calls to should_apply_static_reloc.
6710 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6711 (check_DATA): Add arm_abs_global.stdout.
6712 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6713 arm_abs_global.stdout): New rules.
6714 (MOSTLLYCLEANFILES): Add arm_abs_global
6715 * Makefile.in: Regenerate.
6716 * testsuite/arm_abs_global.s: New file.
6717 * testsuite/arm_abs_global.sh: Ditto.
6718 * testsuite/arm_abs_lib.s: Ditto.
6719
93ceb764
ILT
67202010-02-11 Ian Lance Taylor <iant@google.com>
6721
6722 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6723 Read_relocs task.
6724 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6725 Allocate_commons_task first.
6726 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6727 task, rather than symtab_lock_.
6728 (Gc_process_relocs::~Gc_process_relocs): New function.
6729 (Gc_process_relocs::is_runnable): Check this_blocker_.
6730 (Gc_process_relocs::locks): Use next_blocker_ rather than
6731 blocker_.
6732 (Scan_relocs::~Scan_relocs): New function.
6733 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6734 symtab_lock_.
6735 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6736 next_blocker_.
6737 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6738 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6739 constructor accordingly.
6740 (class Gc_process_relocs): Likewise.
6741 (class Scan_relocs): Likewise.
6742 * common.h (class Allocate_commons_task): Remove symtab_lock_
6743 field, and corresponding constructor parameter.
6744 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6745 symtab_lock_.
6746 (Allocate_commons_task::locks): Likewise.
6747
114dfbe1
ILT
67482010-02-11 Ian Lance Taylor <iant@google.com>
6749
6750 * gold-threads.h (class Once): Define.
6751 (class Initialize_lock): Rewrite as child of Once.
6752 * gold-threads.cc (class Once_initialize): Define.
6753 (once_pointer_control): New static variable.
6754 (once_pointer, once_arg): New static variables.
6755 (c_run_once): New static function.
6756 (Once::Once, Once::run_once, Once::internal_run): New functions.
6757 (class Initialize_lock_once): Remove.
6758 (initialize_lock_control): Remove.
6759 (initialize_lock_pointer): Remove.
6760 (initialize_lock_once): Remove.
6761 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6762 (Initialize_lock::initialize): Rewrite.
6763 (Initialize_lock::do_run_once): New function.
6764 * archive.cc (Archive::interpret_header): Only clear name if it is
6765 not already empty.
6766 * fileread.cc: Include "gold-threads.h"
6767 (file_counts_lock): New static variable.
6768 (file_counts_initialize_lock): Likewise.
6769 (File_read::release): Only increment counts when using --stats.
6770 Use a lock around the increment.
6771 * parameters.cc (class Set_parameters_target_once): Define.
6772 (set_parameters_target_once): New static variable.
6773 (Parameters::Parameters): Move here from parameters.h.
6774 (Parameters::set_target): Rewrite.
6775 (Parameters::set_target_once): New function.
6776 (Parameters::clear_target): Move here and rewrite.
6777 * parameters.h (class Parameters): Update declarations. Add
6778 set_parameters_target_once_ field.
6779 (Parameters::Parameters): Move to parameters.cc.
6780 (Parameters::clear_target): Likewise.
6781 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6782 task.
6783 (Start_group::~Start_group): New function.
6784 (Start_group::is_runnable): New function.
6785 (Start_group::locks, Start_group::run): New functions.
6786 (Finish_group::run): Change saw_undefined to size_t.
6787 * readsyms.h (class Start_group): Define.
6788 (class Finish_group): Change saw_undefined_ field to size_t.
6789 (Finish_group::Finish_group): Remove saw_undefined and
6790 this_blocker parameters. Change all callers.
6791 (Finish_group::set_saw_undefined): New function.
6792 (Finish_group::set_blocker): New function.
6793 * symtab.h (class Symbol_table): Change saw_undefined to return
6794 size_t. Change saw_undefined_ field to size_t.
6795 * target-select.cc (Set_target_once::do_run_once): New function.
6796 (Target_selector::Target_selector): Initialize set_target_once_
6797 field. Don't initialize lock_ and initialize_lock_ fields.
6798 (Target_selector::instantiate_target): Rewrite.
6799 (Target_selector::set_target): New function.
6800 * target-select.h (class Set_target_once): Define.
6801 (class Target_selector): Update declarations. Make
6802 Set_target_once a friend. Remove lock_ and initialize_lock_
6803 fields. Add set_target_once_ field.
6804
fa17a3f4
ILT
68052010-02-10 Ian Lance Taylor <iant@google.com>
6806
6807 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6808 queueing any tasks.
6809 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6810 (queue_middle_tasks): Add all blockers before queueing any tasks.
6811 (queue_final_tasks): Likewise.
6812 * token.h (Task_token::add_blockers): New function.
6813 * object.h (Input_objects::number_of_relobjs): New function.
6814
c7177d31
ILT
68152010-02-10 Ian Lance Taylor <iant@google.com>
6816
5de0e392
ILT
6817 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6818 shared, not if not position independent.
6819 * x86_64.cc (Relocate::relocate_tls): Likewise.
6820 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6821 (tls_pie_pic_test): New target.
6822 * testsuite/Makefile.in: Rebuild.
6823
c7177d31
ILT
6824 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6825 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6826 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6827 * testsuite/Makefile.in: Rebuild.
6828
684b268a
DM
68292010-02-09 David S. Miller <davem@davemloft.net>
6830
6831 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6832 R_SPARC_RELATIVE using ->add_local_relative().
6833 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6834
612a8d3d
DM
6835 * output.h (Output_data_dynamic::add_section_size): New method
6836 that takes two Output_data objects.
6837 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6838 entry param. Handle it in initializers.
6839 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6840 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6841 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6842 arg.
6843 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6844 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6845 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6846 for dynrel_includes_plt.
6847 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6848 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6849 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6850 before .rela.plt
6851 (Target_sparc::do_finalize_sections): Update to pass true for
6852 dynrel_includes_plt.
6853 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6854 output before .rela.plt
6855 (Target_powerpc::do_finalize_sections): Update to pass true for
6856 dynrel_includes_plt when 32-bit.
6857
cb1be87e
DK
68582010-02-08 Doug Kwan <dougkwan@google.com>
6859
6860 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6861 method.
6862 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6863 Arm_relobj::scan_section_for_cortex_a8_stubs,
6864 Arm_relobj::do_relocation_section): Instead of calling
6865 Output_section::output_address, use faster
6866 Arm_relobj::simple_input_section_output_address.
6867
705b5121
DM
68682010-02-08 David S. Miller <davem@davemloft.net>
6869
6870 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6871 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6872 relocation helper function.
6873
024c4466
DM
6874 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6875 just like R_SPARC_GOT{10,13,22}.
6876 (Target_sparc::Scan::local): Likewise.
6877 (Target_sparc::Relocate:relocate): Likewise.
6878
9109c078
ILT
68792010-02-06 Ian Lance Taylor <iant@google.com>
6880
6881 * configure.ac: Rewrite targetobjs duplicate removal code to use
6882 only shell constructs.
6883 * configure: Rebuild.
6884
cf846138
DK
68852010-02-05 Doug Kwan <dougkwan@google.com>
6886
6887 PR 11247
6888 * arm.cc (Arm_relobj::section_is_scannable): New method.
6889 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6890 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6891
6cfaf60b
DK
68922010-02-04 Doug Kwan <dougkwan@google.com>
6893
6894 PR 11247
6895 * arm-reloc-property.cc (cstdio): Include.
6896 * configure.ac (targetobjs): Remove duplicates.
6897 * configure: Regenerate.
6898 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6899 big and little endian version for a given address size.
6900
5c57f1be
DK
69012010-02-03 Doug Kwan <dougkwan@google.com>
6902
6903 * arm-reloc-property.cc
6904 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6905 definition.
6906 * arm-reloc-property.h
6907 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6908 New method definition.
6909 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6910 declaration.
6911 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6912 overflow to N.
6913 (GOT_PREL): Change implemented to Y.
6914 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6915 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6916 (Arm_relocate_functions::movw_abs_nc): Remove method.
6917 (Arm_relocate_functions::movt_abs): Ditto.
6918 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6919 (Arm_relocate_functions::thm_movt_abs): Ditto.
6920 (Arm_relocate_functions::movw_rel_nc): Ditto.
6921 (Arm_relocate_functions::movw_rel): Ditto.
6922 (Arm_relocate_functions::movt_rel): Ditto.
6923 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6924 (Arm_relocate_functions:thm_movw_rel): Ditto.
6925 (Arm_relocate_functions:thm_movt_rel): Ditto.
6926 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6927 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6928 New method definitions.
6929 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6930 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6931 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6932 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6933 (Target_arm::Relocate::relocate): Check for non-static or
6934 unimplemented relocation code and exit early. Change calls to
6935 Target_arm::reloc_uses_thumb_bit and
6936 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6937 instead. Refactor code to handle similar relocations to increase
6938 code sharing. Remove check for unsupported relocation code in switch
6939 statement.
6940 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6941 relocation property table to find out size. Change error message to
6942 print out the name of a relocation code instead of the numeric value.
6943 (Target_arm::scan_reloc_for_stub): Use relocation property table
6944 instead of calling Target_arm::reloc_uses_thumb_bit().
6945
218c5831
DK
69462010-02-02 Doug Kwan <dougkwan@google.com>
6947
6948 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6949 types of relaxed input section.
6950
0d31c79d
DK
69512010-02-02 Doug Kwan <dougkwan@google.com>
6952
6953 * Makefile.am (HFILES): Add arm-reloc-property.h.
6954 (DEFFILES): New.
2e702c99
RM
6955 (TARGETSOURCES): Add arm-reloc-property.cc
6956 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6957 (libgold_a_SOURCES): $(DEFFILES)
6958 * Makefile.in: Regenerate.
6959 * arm-reloc-property.cc: New file.
6960 * arm-reloc-property.h: New file.
6961 * arm-reloc.def: New file.
6962 * arm.cc: Update comments.
6963 (arm-reloc-property.h): New included header.
6964 (arm_reloc_property_table): New global variable.
6965 (Target_arm::do_select_as_default_target): New method definition.
6966 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6967 arm-reloc-property to targ_extra_obj.
6968 * parameters.cc (set_parameters_target): Call
6969 Target::select_as_default_target().
6970 * target.h (Target::select_as_default_target): New method definition.
6971 (Target::do_select_as_default_target): Same.
6972
546c7457
DK
69732010-02-01 Doug Kwan <dougkwan@google.com>
6974
6975 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6976 first_output_text_section_.
6977 (Arm_exidx_fixup::first_output_text_section): New method definition.
6978 (Arm_exidx_fixup::first_output_text_section_): New data member.
6979 (Arm_exidx_fixup::process_exidx_section): Record the first text
6980 output section seen.
6981 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6982 and entsize in output section header.
6983
11b861d5
DK
69842010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6985
6986 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6987 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6988 (Arm_relocate_functions::thm_alu11): New Method.
6989 (Arm_relocate_functions::thm_pc8): New Method.
6990 (Arm_relocate_functions::thm_pc12): New Method.
6991 (Target_arm::Scan::local): Handle the relocations.
6992 (Target_arm::Scan::global): Likewise.
6993 (Target_arm::Relocate::relocate): Likewise.
6994 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6995
c9a2c125
DK
69962010-01-29 Doug Kwan <dougkwan@google.com>
6997
6998 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6999 of relocation types as ld.
7000
1521477a
DK
70012010-01-29 Doug Kwan <dougkwan@google.com>
7002
7003 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
7004 to public.
7005 (Arm_relocate_functions::thumb_branch_common): Ditto.
7006 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
7007 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
7008 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
7009 Arm_relocate_functions::jump24): Remove.
7010 (Target_arm::Relocate::relocate): Adjust code to call
7011 Arm_relocation_functions::arm_branch_common and
7012 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 7013 wrappers. Merge switch-cases together to reduce source code size.
1521477a 7014
e7eca48c
DK
70152010-01-29 Doug Kwan <dougkwan@google.com>
7016
7017 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
7018 output_local_symbol_count_needs_update_.
7019 (Arm_relobj::output_local_symbol_count_needs_update,
7020 Arm_relobj::set_output_local_symbol_count_needs_update,
7021 Arm_relobj::update_output_local_symbol_count): New methods.
7022 (Arm_relobj::output_local_symbol_count_needs_update_): New data
7023 member.
7024 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
7025 of pointed function as in a R_ARM_PREL31 relocation.
7026 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
7027 for output local symbol count updating.
7028 (Target_arm::do_relax): Update output local symbol counts in objects
7029 if necessary.
7030 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
7031
02961d7e
ILT
70322010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7033
7034 * arm.cc: Added support for the ARM relocations:
7035 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
7036 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
7037 (Arm_relocate_functions::movw_rel_nc): Renamed (was
7038 movw_prel_nc).
7039 (Arm_relocate_functions::movw_rel): New method.
7040 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
7041 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
7042 thm_movw_prel_nc).
7043 (Arm_relocate_functions::thm_movw_rel): New method.
7044 (Arm_relocate_functions::thm_movt_rel): Renamed (was
7045 thm_movt_prel).
7046 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
7047 relocations.
7048 (Target_arm::Scan::global): Likewise.
7049 (Target_arm::Relocate::relocate): Likewise.
7050 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7051 Likewise.
7052
b10d2873
ILT
70532010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7054
7055 * arm.cc: Added support for ARM group relocations.
7056 (Target_arm::reloc_needs_sym_origin): New method.
7057 (Arm_relocate_functions::calc_grp_kn): New method.
7058 (Arm_relocate_functions::calc_grp_residual): New method.
7059 (Arm_relocate_functions::calc_grp_gn): New method.
7060 (Arm_relocate_functions::arm_grp_alu): New Method.
7061 (Arm_relocate_functions::arm_grp_ldr): New Method.
7062 (Arm_relocate_functions::arm_grp_ldrs): New Method.
7063 (Arm_relocate_functions::arm_grp_ldc): New Method.
7064 (Target_arm::Scan::local): Handle the ARM group relocations.
7065 (Target_arm::Scan::global): Likewise.
7066 (Target_arm::Relocate::relocate): Likewise.
7067 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7068 Likewise.
7069
2b328d4e
DK
70702010-01-26 Doug Kwan <dougkwan@google.com>
7071
7072 * arm.cc (set): Include.
7073 (class Arm_exidx_fixup): Change type of last_input_section_ to const
7074 pointer type.
2e702c99 7075 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
7076 (Arm_output_section::append_text_sections_to_list): New method.
7077 (Arm_output_section::fix_exidx_coverage): Ditto.
7078 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 7079 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
7080 Relobj::set_section_offset() instead of
7081 Sized_relobj::invalidate_section_offset().
2e702c99 7082 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
7083 parameter for section headers. Ignore relocation sections for
7084 unallocated sections and EXIDX sections.
7085 (Target_arm::fix_exidx_coverage): New method.
7086 (Target_arm::output_section_address_less_than): New type.
7087 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
7088 linked text section instead of the EXIDX section.
7089 (Arm_output_section::create_stub_group): Add an assertion to check
7090 that this is not an EXIDX output section.
7091 (Arm_output_section::append_text_sections_to_list): New method.
7092 (Arm_output_section::fix_exidx_coverage): Ditto.
7093 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 7094 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
7095 (Target_arm::do_relax): Fix EXIDX output section coverage in the
7096 first pass.
7097 (Target_arm::fix_exidx_coverage): New method.
7098 * object.h (Relobj::set_output_section): New method.
7099 (Sized_relobj::invalidate_section_offset): Remove method.
7100 (Sized_relobj::do_invalidate_section_offset): Remove method.
7101 (Sized_relobj::do_set_section_offset): Handle offset value -1.
7102
c7f3c371
DK
71032010-01-25 Doug Kwan <dougkwan@google.com>
7104
7105 * arm.cc (Arm_exidx_merged_section::do_output_offset):
7106 Fix warning due to signed and unsigned comparison on a 32-bit host.
7107
8923b24c
DK
71082010-01-22 Doug Kwan <dougkwan@google.com>
7109
7110 * arm.cc (Target_arm::do_relax): Record an output section for section
7111 offset adjustment it contains any stub table that has changed.
7112 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
7113 offsets in an output section if necessary.
7114 * output.cc (Output_section::Output_section): Initialize
7115 section_offsets_need_adjustments_.
7116 (Output_section::add_input_section_for_script): Renamed to
7117 Output_section::add_simple_input_section.
7118 (Output_section::save_states): Add a comment.
7119 (Output_section::discard_states): New method defintion.
7120 (Output_section::adjust_section_offsets): Same.
7121 * output.h (Output_section::add_input_section_for_script): Renamed to
7122 Output_section::add_simple_input_section.
7123 (Output_section::discard_states): New method declaration.
7124 (Output_section::adjust_section_offsets): Same.
7125 (Output_section::section_offsets_need_adjustment,
7126 Output_section::set_section_offsets_need_adjustment): New method
7127 definitions.
7128 (Output_section::section_offsets_need_adjustment_): New data member.
7129 * script-sections.cc
7130 (Output_section_element_input::set_section_address): Adjust code for
7131 renaming of Output_section::add_input_section_for_script.
7132 (Orphan_output_section::set_section_address): Same.
7133
9b2fd367
DK
71342010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7135
7136 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
7137 Fix_v4bx enum values .
7138 * gold/options.h (General_options): New option definitions.
7139 (General_options::fix_v4bx): New method.
7140 (General_options::Fix_v4bx): New enum.
7141 * gold/options.cc (General_options::parse_fix_v4bx): New method.
7142 (General_options::parse_fix_v4bx_interworking): New method.
7143
80d0d023
DK
71442010-01-22 Doug Kwan <dougkwan@google.com>
7145
7146 * arm.cc (Arm_exidx_fixup): New class.
7147
af2cdeae
DK
71482010-01-21 Doug Kwan <dougkwan@google.com>
7149
7150 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
7151 classes.
7152 (Arm_exidx_section_offset_map): New type.
7153
993d07c1
DK
71542010-01-21 Doug Kwan <dougkwan@google.com>
7155
7156 * arm.cc (Arm_exidx_input_section): New class.
7157 (Arm_relobj::exidx_input_section_by_link,
7158 Arm_relobj::exidx_input_section_by_shndx,
7159 Arm_relobj::make_exidx_input_section): New methods.
7160 (read_arm_attributes_section): Remove.
7161 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
7162 information about them.
7163 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
7164 to here.
7165
5ac169d4
DK
71662010-01-20 Doug Kwan <dougkwan@google.com>
7167
7168 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
7169 Input_section_specifier to Section_id.
7170 (Target_arm::new_arm_input_section: Adjust code for change of key
7171 type.
7172 (Target_arm::find_arm_input_section): Ditto.
7173 * gc.h (object.h): Include for Section_id nand Section_id_hash.
7174 (Section_id): Remove.
7175 (Garbage_collection::Section_id_hash): Remove.
7176 * icf.h (object.h): Include for Section_id nand Section_id_hash.
7177 (Section_id): Remove.
7178 (Icf::Section_id_hash): Remove.
7179 * object.h (Section_id, Const_section_id, Section_id_hash,
7180 Const_section_id_hash): New type definitions.
7181 * output.cc (Output_section::add_relaxed_input_section): Change to
7182 use Const_section_id instead of Input_section_specifier as key type.
7183 (Output_section::add_merge_input_section): Ditto.
7184 (Output_section::build_relaxation_map): Change to use Section_id
7185 instead of Input_section_specifier as key type.
2e702c99 7186 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
7187 Ditto.
7188 (Output_section::convert_input_sections_to_relaxed_sections): Change
7189 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 7190 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
7191 (Output_section::find_relaxed_input_section): Ditto.
7192 * output.h (Input_section_specifier): Remove class.
7193 (Output_section::Output_section_data_by_input_section_map): Change
7194 key type to Const_section_id.
7195 (Output_section::Output_relaxed_input_section_by_input_section_map):
7196 Ditto.
7197 (Output_section::Relaxation_map): Change key type to Section_id.
7198
a2162063
ILT
71992010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7200
7201 * gold/arm.cc: Added support for R_ARM_V4BX relocation
7202 (class Arm_v4bx_stub): New class.
7203 (DEF_STUBS): Updated definition to support v4_veneer_bx.
7204 (Stub_factory::make_arm_v4bx_stub): New method.
7205 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
7206 (Stub_table::empty): Handle v4bx stubs.
7207 (Stub_table::add_arm_v4bx_stub): New method.
7208 (Stub_table::find_arm_v4bx_stub): New method.
7209 (Arm_relocate_functions::v4bx): New method.
7210 (Target_arm::fix_v4bx): New method.
7211 (Target_arm::Target_arm): Handle R_ARM_V4BX.
7212 (Stub_table::relocate_stubs): Likewise.
7213 (Stub_table::do_write): Likewise.
7214 (Stub_table::update_data_size_and_addralign): Likewise.
7215 (Stub_table::finalize_stubs): Likewise.
7216 (Target_arm::Scan::local): Likewise.
7217 (Target_arm::Scan::global): Likewise.
7218 (Target_arm::do_finalize_sections): Likewise.
7219 (Target_arm::Relocate::relocate): Likewise.
7220 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7221 Likewise.
7222 (Target_arm::scan_reloc_for_stub): Likewise.
7223 (Target_arm::scan_reloc_section_for_stubs): Likewise.
7224
5696ab0b
ILT
72252010-01-19 Ian Lance Taylor <iant@google.com>
7226
7227 * output.cc (Output_section_headers::do_sized_write): Write large
7228 segment count to sh_info field.
7229 (Output_file_header::do_sized_write): For large segment count,
7230 write PN_XNUM to e_phnum field.
7231
800d0f56
ILT
72322010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7233
7234 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
7235 (Arm_relocate_functions::thm_jump8): New function.
7236 (Arm_relocate_functions::thm_jump11): New function.
7237 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
7238 R_ARM_THM_JUMP11.
7239 (Target_arm::Scan::global): Likewise.
7240 (Target_arm::Relocate::relocate): Likewise.
7241 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7242 Likewise.
7243
41263c05
DK
72442010-01-14 Doug Kwan <dougkwan@google.com>
7245
7246 * arm.cc (map, utility): Include headers.
7247 (Target_arm::apply_cortex_a8_workaround): New method.
7248 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
7249 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
7250 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
7251 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
7252 the --[no-]fix-cortex-a8 command line options.
7253 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
7254 (Target_arm::relocate_stub): Use addend in instruction template.
7255 * options.h (DEFINE_bool): Set the user-set flag.
7256 (General_options): Add --[no-]-fix-cortex options.
7257 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 7258 : Update fast look-up map after conversion.
41263c05 7259
459e9b03
ST
72602010-01-14 Sriraman Tallam <tmsriram@google.com>
7261
7262 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
7263 in the first pass of do_layout.
7264
b521dfe4
DK
72652010-01-13 Doug Kwan <dougkwan@google.com>
7266
7267 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7268 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
7269 apparent compiler problem of not folding static constant integral
7270 data members of elfcpp::Elf_sizes<32>.
7271
44272192
DK
72722010-01-13 Doug Kwan <dougkwan@google.com>
7273
7274 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
7275 Arm_relobj::section_needs_cortex_a8_stub_scanning,
7276 Arm_relobj::scan_section_for_cortex_a8_erratum,
7277 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
7278 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
7279 sections to scan for relocation stubs into a new method
7280 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
7281 relocation and Cortex-A8 stub scanning.
7282 (Target_arm::do_relax): Force stubs to be after stubbed sections
7283 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 7284 the beginning of a new relaxation pass. Update a comment.
44272192
DK
7285 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
7286
44b71ece
ILT
72872010-01-12 Ian Lance Taylor <iant@google.com>
7288
7289 * target-reloc.h (visibility_error): New inline function.
7290 (relocate_section): Call visibility_error.
7291 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
7292 (MOSTLYCLEANFILES): Likewise.
7293 (protected_4_pic.o, protected_3.err): New targets.
7294 * testsuite/protected_4.cc: New file.
7295
a120bc7f
DK
72962010-01-12 Doug Kwan <dougkwan@google.com>
7297
7298 * arm.cc (Cortex_a8_reloc): New class.
7299 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
7300 and cortex_a8_relocs_info_.
7301 (Target_arm::fix_cortex_a8): New method definition.
7302 (Target_arm::Cortex_a8_relocs_info): New type.
7303 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
7304 New data member declarations.
7305 (Target_arm::scan_reloc_for_stub): Record information about
7306 relocations for THUMB branches that might be exempted from the
7307 Cortex-A8 workaround.
7308 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
7309 at the beginning of a relaxation pass.
7310
20138696
DK
73112010-01-12 Doug Kwan <dougkwan@google.com>
7312
7313 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
7314 (Arm_relobj::Mapping_symbol_position,
7315 Arm_reloj::Mapping_symbol_position_less,
7316 Arm_relobj::Mapping_symbols_info): New types.
7317 (Target_arm::is_mapping_symbol_name): New method definition.
7318 (Arm_relobj::do_count_local_symbols): Save information about mapping
7319 symbols.
7320
089d69dc
DK
73212010-01-11 Doug Kwan <dougkwan@google.com>
7322
7323 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
7324 Arm_relocate_functions::thumb32_branch_upper,
7325 Arm_relocate_functions::thumb32_branch_lower,
7326 Arm_relocate_functions::thumb32_cond_branch_offset,
7327 Arm_relocate_functions::thumb32_cond_branch_upper,
7328 Arm_relocate_functions::thumb32_cond_branch_lower,
7329 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
7330 branch offset encoding.
7331 (Arm_relocate_functions::thumb_branch_common): Use new branch
7332 offset encoding methods to avoid code duplication.
7333 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
7334 (Stub_addend_reader::operator()): Use new branch encoding method
7335 to avoid code duplication.
7336
99e5bff2
DK
73372010-01-11 Doug Kwan <dougkwan@google.com>
7338
7339 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
7340 (Target_arm::do_finalize_sections): Define special EXIDX section
7341 symbols only if referenced.
7342 * gc.h (Garbage_collection::add_reference): New method.
7343 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
7344 code duplication.
7345
98e090bd
ILT
73462010-01-11 Ian Lance Taylor <iant@google.com>
7347
d0a91bd8
ILT
7348 * script.cc (Version_script_info::build_expression_list_lookup):
7349 Change complaing about duplicate wildcard match from error to
7350 warning.
7351
98e090bd
ILT
7352 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7353 of 2009-12-30.
7354 (Version_script_info::Version_script_info): Initialize globs_,
7355 default_version_, default_is_global_, and exact_. Don't
7356 initialize globals_ or locals_.
7357 (Version_script_info::build_lookup_tables): Build local symbols
7358 first.
7359 (Version_script_info::unquote): New function.
7360 (Version_script_info::add_exact_match): New function.
7361 (Version_script_info::build_expression_list_lookup): Remove lookup
7362 parameter. Add is_global parameter. Change all callers. Handle
7363 wildcard pattern specially. Unquote pattern. Call
7364 add_exact_match.
7365 (Version_script_info::get_name_to_match): New function.
7366 (Version_script_info::get_symbol_version): New function.
7367 (Version_script_info::get_symbol_version_helper): Remove.
7368 (Version_script_info::check_unmatched_names): Call unquote.
7369 * script.h (class Version_script_info): Change get_symbol_version
7370 to be non-inline and add is_global parameter; change all callers.
7371 Rewrite symbol_is_local. Update declarations. Define struct
7372 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7373 Remove globals_ and locals_ members. Add exact_, globs_,
7374 default_version_, is_global_.
7375 (Version_script_info::Glob): Remove pattern, add expression and
7376 is_global. Update constructor. Change all callers.
7377 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7378 default version.
7379 (Versions::symbol_section_contents): If a symbol is undefined, or
7380 defined in a dynamic object, set the version index to
7381 VER_NDX_LOCAL.
7382 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7383 symbol_is_local.
7384 (Symbol_table::add_from_pluginobj): Likewise.
7385 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7386
d56962d3
DK
73872010-01-11 Doug Kwan <dougkwan@google.com>
7388
7389 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7390 (incremental_dump_LDADD): Add linking option for libintl.
7391 * Makefile.in: Regenerate.
7392
94e6ee91
L
73932010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7394
7395 PR gold/11144
7396 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7397 instead of -Ds.
7398 * testsuite/Makefile.in: Regenerated.
7399
e96c574b
DK
74002010-01-10 Doug Kwan <dougkwan@google.com>
7401
7402 * options.h (DEFINE_var): Use parentheses around argument varname__
7403 in macro body to avoid any unintended subsequent substitutions.
7404
7198066b
ILT
74052010-01-10 Ian Lance Taylor <iant@google.com>
7406
ba4d53bf
ILT
7407 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7408 candidates before doing symbol resolution.
7409
7198066b
ILT
7410 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7411 ODR candidates if only one is weak.
7412
a2beed37
ILT
74132010-01-08 Ian Lance Taylor <iant@google.com>
7414
7415 * script.cc (Version_script_info::build_expression_list_lookup):
7416 Don't warn about ambiguous version, just record the ambiguity.
7417 (Version_script_info::get_symbol_version_helper): Give error if
7418 version is ambiguous.
7419
2fb7225c
DK
74202010-01-08 Doug Kwan <dougkwan@google.com>
7421
7422 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
7423 prev_data_size_ and prev_addralign_. Remove initializer for
7424 deleted data member has_been_changed_.
7425 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7426 to determine if the table is empty.
7427 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7428 Remove.
7429 (Stub_table::add_reloc_stub): Define method in class definition
7430 instead of just declaring it there.
7431 (Stub_table::add_cortex_a8_stub): New method definition.
7432 (Stub_table::update_data_size_and_addralign): Ditto.
7433 (Stub_table::finalize_stubs): Ditto.
7434 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7435 (Stub_table::do_addralign_): Return address alignment in the
7436 (Stub_table::do_reset_address_and_file_offset): Define method in
7437 class definition instead of declaring it there. Set current data
7438 size to be the data size of the previous pass.
7439 (Stub_table::set_final_data_size): Use current data size as the
7440 final data size.
7441 (Stub_table::relocate_stub): Change parameter type of stub from
7442 Reloc_stub pointer to Stub pointer.
7443 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7444 (Stub_table::Cortex_a8_stub_list): New typedef.
7445 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7446 Stub_table::prev_addralign_): New data member.
7447 (Arm_relobj::Arm_relobj): Initialize data member
7448 section_has_cortex_a8_workaround_.
7449 (Arm_relobj::section_has_cortex_a8_workaround,
7450 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7451 definitions.
7452 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7453 declarations.
7454 (Target_arm::relocate_stub): Change parameter type of stub from
7455 Reloc_stub pointer to Stub pointer.
7456 (Insn_template::size, Insn_template::alignment): Handle
7457 THUMB16_SPECIAL_TYPE.
7458 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7459 Stub_table::update_data_size_and_addralign,
7460 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7461 definitions.
7462 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
7463 (Stub_table::do_write): Ditto.
7464 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 7465
880cd20d
ILT
74662010-01-08 Ian Lance Taylor <iant@google.com>
7467
7468 PR 11108
7469 * symtab.h (class Symbol): Remove fields is_target_special_ and
7470 has_plt_offset_. Add field is_defined_in_discarded_section_.
7471 (Symbol::is_defined_in_discarded_section): New function.
7472 (Symbol::set_is_defined_in_discarded_section): New function.
7473 (Symbol::has_plt_offset): Rewrite.
7474 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7475 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7476 Don't initialize is_target_special_ or has_plt_offset_.
7477 Initialize is_defined_in_discarded_section_.
7478 (Symbol_table::add_from_relobj): If appropriate, set
7479 is_defined_in_discarded_section.
7480 * resolve.cc (Symbol::override_base_with_special): Don't test
7481 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7482 * target-reloc.h (relocate_section): Do special handling for
7483 symbols defined in discarded sections for global symbols as well
7484 as local symbols.
7485
2703e3eb
ILT
74862010-01-08 Ian Lance Taylor <iant@google.com>
7487
7488 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7489 the SHT_SYMTAB case.
7490
339d40a3
ILT
74912010-01-08 Ian Lance Taylor <iant@google.com>
7492
7493 * object.cc (Sized_relobj::do_layout): Don't get confused if
7494 layout_eh_frame returns NULL.
7495
abecea76
ILT
74962010-01-08 Ian Lance Taylor <iant@google.com>
7497
7498 PR 11084
7499 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7500 dynamic symbol table, use the normal symbol table.
7501 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7502 symbol table.
7503
6b7dd3f3
ILT
75042010-01-08 Ian Lance Taylor <iant@google.com>
7505
7506 PR 11072
7507 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7508 sections.
7509
36c50e63
L
75102010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7511
7512 * version.cc (print_version): Change to "Copyright 2010".
7513
e291e7b9
ILT
75142010-01-08 Ian Lance Taylor <iant@google.com>
7515
7516 PR 10287
7517 PR 11063
7518 * i386.cc (class Target_i386): Change return type of plt_section
7519 to be non-const.
7520 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7521 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7522 tls_desc_rel_ field.
7523 (Output_data_plt_i386::rel_tls_desc): New function.
7524 (Target_i386::rel_tls_desc_section): New function.
7525 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7526 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7527 R_386_TLS_DESC reloc in rel_tls_desc_section.
7528 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7529 Define struct Tlsdesc_info.
7530 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7531 (Target_x86_64::do_reloc_symbol_index): New function.
7532 (Target_x86_64::add_tlsdesc_info): New function.
7533 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7534 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7535 tlsdesc_rel_ field.
7536 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7537 all callers.
7538 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7539 (Target_x86_64::rela_tlsdesc_section): New function.
7540 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7541 handling.
7542 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7543 (Target_x86_64::do_reloc_addend): New function.
7544 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7545 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7546 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7547 (Output_reloc::type): New function.
7548 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7549 (Output_reloc::is_target_specific): New function.
7550 (Output_reloc::target_arg): New function.
7551 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7552 absolute relocs and target specific relocs.
7553 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7554 add_target_specific.
7555 (class Output_data_reloc) [SHT_RELA]: Likewise.
7556 * output.cc (Output_reloc::Output_reloc): Add four new versions
7557 for absolute relocs and target specific relocs.
7558 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7559 (Output_reloc::get_symbol_index): Likewise.
7560 (Output_reloc::local_section_offset): Check that local_sym_index_
7561 is not TARGET_CODE or 0.
7562 (Output_reloc::symbol_value): Likewise.
7563 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7564 reloc.
7565 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7566 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7567 functions.
7568 * layout.cc (add_target_dynamic_tags): Use output section for
7569 DT_PLTRELSZ and DT_JMPREL.
7570
3a44184e
ILT
75712010-01-07 Ian Lance Taylor <iant@google.com>
7572
7573 PR 11061
7574 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7575 function.
7576 (class Output_data_reloc_generic): Define.
7577 (class Output_data_reloc_base): Change base class to
7578 Output_data_reloc_generic. Change add() method to call
7579 bump_relative_reloc_count for a relative reloc. Remove
7580 sort_relocs_ field.
7581 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7582 to sort_relocs().
7583 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7584 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7585 appropriate.
7586 * layout.h (class Layout): Update declaration.
7587
ea715a34
ILT
75882010-01-07 Ian Lance Taylor <iant@google.com>
7589
7590 * output.h (class Output_data): Add const version of
7591 output_section and do_output_section.
7592 (class Output_section_data): Add const version of
7593 do_output_section.
7594 (class Output_section): Likewise.
7595 * layout.cc (Layout::add_target_dynamic_tags): New function.
7596 * layout.h (class Layout): Update declarations.
7597 * arm.cc (Target_arm::do_finalize_sections): Use
7598 add_target_dynamic_tags.
7599 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7600 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7601 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7602 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7603
659948a4
ILT
76042010-01-07 Ian Lance Taylor <iant@google.com>
7605
7606 PR 11042
7607 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7608 object as needed.
7609
9d3b86f6
ILT
76102010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7611 Ian Lance Taylor <iant@google.com>
7612
7613 PR 11019
7614 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7615 Xindex::read_symtab_xindex.
7616
bb0d3eb0
DK
76172010-01-07 Doug Kwan <dougkwan@google.com>
7618
7619 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7620 (Insn_template::thumb16_bcond_insn): New method declaration.
7621 (Insn_template): Fix spelling.
7622 (Stub::thumb16_special): New method declaration.
7623 (Stub::do_write): Define virtual method which was previously pure
7624 virtual.
7625 (Stub::do_thumb16_special): New method declaration.
7626 (Stub::do_fixed_endian_write): New template member.
7627 (Reloc_stub::do_write): Remove.
7628 (Reloc_stub::do_fixed_endian_write): Remove.
7629 (Cortex_a8_stub): New class definition.
7630 (Stub_factory::make_cortex_a8_stub): New method definition.
7631 (Stub_factory::Stub_factory): Add missing static storage class
7632 qualifier for elf32_arm_stub_a8_veneer_blx.
7633
ffeef7df
ILT
76342010-01-07 Ian Lance Taylor <iant@google.com>
7635
dc3f80fe
ILT
7636 PR 10980
7637 * options.h (class General_options): Add --warn-unresolved-symbols
7638 and --error-unresolved-symbols.
7639 * errors.cc (Errors::undefined_symbol): Implement
7640 --warn-unresolved-symbols.
7641
ffeef7df
ILT
7642 * options.h (class General_options): Add -z text and -z textoff.
7643 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7644
f1ec9ded
ST
76452010-01-06 Sriraman Tallam <tmsriram@google.com>
7646
7647 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7648 (Garbage_collection::cident_sections): New function.
7649 (Garbage_collection::add_cident_section): New function.
7650 (Garbage_collection::cident_sections_): New member.
7651 (gc_process_relocs): Add references to sections whose names are C
7652 identifiers.
7653 * gold.h (cident_section_start_prefix): New constant.
7654 (cident_section_stop_prefix): New constant.
7655 (is_cident): New function.
7656 * layout.cc (Layout::define_section_symbols): Replace string constants
7657 with the newly defined constants.
7658 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7659 C identifiers.
7660 * testsuite/Makefile.am: Add gc_orphan_section_test.
7661 * testsuite/Makefile.in: Regenerate.
7662 * testsuite/gc_orphan_section_test.cc: New file.
7663 * testsuite/gc_orphan_section_test.sh: New file.
7664
6eda8c29
ILT
76652010-01-06 Ian Lance Taylor <iant@google.com>
7666
b9674e17
ILT
7667 PR 10980
7668 * options.h (class General_options): Add --warn-shared-textrel.
7669 * layout.cc (Layout::finish_dynamic_section): Implement
7670 --warn-shared-textrel.
7671
6eda8c29
ILT
7672 PR 10980
7673 * options.h (class General_options): Add --warn-multiple-gp.
7674
32dcd44e
ILT
76752010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7676
7677 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7678 $(THREADSLIB) and $(LIBDL).
7679 * Makefile.in: Rebuild.
7680
a192ba05
ILT
76812010-01-06 Ian Lance Taylor <iant@google.com>
7682
7683 PR 10980
7684 * options.cc (General_options::parse_section_start): New function.
7685 (General_options::section_start): New function.
7686 (General_options::General_options): Initialize all members.
7687 * options.h: Include <map>
7688 (class General_options): Add --section-start. Add section_starts_
7689 member.
7690 * layout.cc (Layout::attach_allocated_section_to_segment): If
7691 --section-start was used, set the address of the segment. Remove
7692 local sort_sections.
7693 (Layout::relaxation_loop_body): If the address of the load segment
7694 has been set by --section-start, don't use it.
7695 * output.h (Output_segment::update_flags_for_output_section): New
7696 function.
7697 * output.cc (Output_segment::add_output_section): Call
7698 update_flags_for_output_section.
7699
dde3f402
ILT
77002010-01-05 Ian Lance Taylor <iant@google.com>
7701
62dfdd4d
ILT
7702 PR 10980
7703 * options.h (class General_options): Add --undefined-version.
7704 * script.cc (struct Version_expression): Add was_matched_by_symbol
7705 field.
7706 (Version_script_info::matched_symbol): New function.
7707 (Version_script_info::get_symbol_version_helper): Call
7708 matched_symbol.
7709 (Version_script_info::check_unmatched_names): New function.
7710 * script.h (class Version_script_info): Update declarations.
7711 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7712
9c4ae156
ILT
7713 * options.h (class General_options): Use DEFINE_bool_alias for
7714 allow_multiple_definition.
7715 * resolve.cc (Symbol_table::should_override): Don't test
7716 allow_multiple_definition.
7717
dde3f402
ILT
7718 PR 10980
7719 * options.h (class General_options): Add --cref.
7720 * main.cc (main): Print cref table if --cref. Don't close mapfile
7721 until after printing cref table.
7722 * cref.cc: Include "symtab.h".
7723 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7724 (Cref_table_compare::operator()): New function.
7725 (Cref_inputs::gather_cref): New function.
7726 (filecol): New static const.
7727 (Cref_inputs::print_cref): New function.
7728 (Cref::print_cref): New function.
7729 * cref.h: Include <cstdio>.
7730 (class Cref): Update declarations.
7731 * mapfile.h (Mapfile::file): New function.
7732 * object.h (class Object): Define Symbols. Declare virtual
7733 do_get_global_symbols.
7734 (Object::get_global_symbols): New function.
7735 * object.cc (Input_objects::add_object): Pass object to cref_ if
7736 --cref.
7737 (Input_objects::archive_start): Likewise.
7738 (Input_objects::archive_stop): Likewise.
7739 (Input_objects::print_cref): New function.
7740 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7741 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7742 --cref.
7743 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7744 function.
7745 * plugin.h (class Sized_pluginobj): Update declarations.
7746
8781f709
ILT
77472010-01-05 Ian Lance Taylor <iant@google.com>
7748
7749 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7750 to is_default_version. Rename insdef to insdefault.
7751 (Symbol_table::add_from_relobj): Rename def to is_default_version
7752 and local to is_forced_local.
7753 (Symbol_table::add_from_pluginobj): Likewise.
7754 (Symbol_table::add_from_dynobj): Likewise.
7755 (Symbol_table::define_special_symbol): Rename insdef to
7756 insdefault.
7757
fe35d28d
ILT
77582010-01-04 Ian Lance Taylor <iant@google.com>
7759
30bc8c46
ILT
7760 PR 10980
7761 * options.h (class General_options): Add
7762 --allow-multiple-definition and -z muldefs.
7763 * resolve.cc (Symbol_table::should_override): Don't warn about a
7764 multiple symbol definition if --allow-multiple-definition or -z
7765 muldefs.
7766
7eaea549
ILT
7767 PR 10980
7768 * options.h (class General_options): Add --add-needed and
7769 --copy-dt-needed-entries. Tweak --as-needed help entry.
7770 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7771 error if --copy-dt-needed-entries aka --add-needed is used and
7772 would cause a change in behaviour.
7773
fe35d28d
ILT
7774 PR 10980
7775 * options.h (class General_options): Add -G as a short version of
7776 --shared. Add no-op options -assert, -g, and -i.
7777
55a2bb35
ST
77782010-01-04 Sriraman Tallam <tmsriram@google.com>
7779
7780 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7781 check for .text or .gnu.linkonce.t sections.
7782 * icf.cc (Icf::find_identical_sections): Ditto.
7783 Change the detection for mangled function name within the section
7784 name.
7785 * icf.h (is_section_foldable_candidate): New function.
7786
719328e1
ILT
77872009-12-30 Ian Lance Taylor <iant@google.com>
7788
7789 PR 10980
7790 * options.h (class General_options): Permit two dashes with
7791 --retain-symbols-file.
7792
d7bb5745
ILT
77932009-12-30 Ian Lance Taylor <iant@google.com>
7794
403a15dd
ILT
7795 PR 10979
7796 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7797 don't put the file header and segment headers in the text
7798 segment.
7799
eda294df
ILT
7800 PR 10979
7801 * common.cc (Sort_commons::operator()): Stabilize sort when both
7802 entries are NULL.
7803 (Symbol_table::do_allocate_commons_list): When allocating common
7804 symbols, skip a symbol which is no longer common.
7805 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7806 an object before checking its type.
7807 * testsuite/common_test_2.c: New file.
7808 * testsuite/common_test_3.c: New file.
7809 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7810 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7811 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7812 (common_test_2_pic.o, common_test_2.so): New targets.
7813 (common_test_3_pic.o, common_test_3.so): New targets.
7814 * testsuite/Makefile.in: Rebuild.
7815
d7bb5745
ILT
7816 PR 10979
7817 * script.cc (read_input_script): If we see a new SECTIONS clause,
7818 and we have added an input section, give an error.
7819 * layout.h (class Layout): Add have_added_input_section function.
7820 Add have_added_input_section_ field.
7821 * layout.cc (Layout::Layout): Initialize
7822 have_added_input_section_.
7823 (Layout::layout): Set have_added_input_section_.
7824 (Layout::layout_eh_frame): Likewise.
7825
fc59c572
ILT
78262009-12-30 Ian Lance Taylor <iant@google.com>
7827
7828 PR 10931
7829 * options.h (class General_options): Add --sort-common option.
7830 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7831 * common.cc (Sort_common): Add sort_order parameter to
7832 constructor. Add sort_order_ field.
7833 (Sort_commons::operator): Check sort_order_.
7834 (Symbol_table::allocate_commons): Determine the sort order.
7835 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7836 Change all callers.
7837 (Symbol_table::do_allocate_commons_list): Likewise.
7838
1c74fab0
ILT
78392009-12-30 Ian Lance Taylor <iant@google.com>
7840
7841 PR 10916
7842 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7843 symbols from this object, don't change the visibility of an
7844 undefined symbol.
7845 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7846
6affe781
ILT
78472009-12-30 Ian Lance Taylor <iant@google.com>
7848
7849 PR 10861
7850 * script.h (class Version_script_info): Define Language enum.
7851 Update declarations. Define Glob, Exact, and Lookup types. Add
7852 new fields globals_, locals_, and is_finalized_.
7853 * script.cc: Various formatting fixes.
7854 (class Parser_closure): Change language_stack_ from a vector of
7855 std::string to one of Version_script_info::Language. Adjust all
7856 uses accordingly.
7857 (class Lazy_demangler): Remove.
7858 (struct Version_expression): Change language from std::string to
7859 Version_script_info::Language.
7860 (Version_script_info::Version_script_info): New function.
7861 (Version_script_info::~Version_script_info): Don't call clear.
7862 (Version_script_info::finalize): New function.
7863 (Version_script_info::build_lookup_tables): New function.
7864 (Version_script_info::build_expression_list_lookup): New
7865 function.
7866 (Version_script_info::get_symbol_version_helper): Rewrite to use
7867 lookup tables.
7868 (Version_script_info::print_expression_list): Adjust to use
7869 Version_script_info::Language.
7870 (script_push_lex_into_version_mode): Check that the version script
7871 has not been finalized.
7872 (version_script_push_lang): Change language string to
7873 Version_script_info::Language.
7874 * options.cc (Command_line::version_script): New function.
7875 * options.h (class General_options): Add finalize_dynamic_list
7876 function. Change version_script from declaration to definition.
7877 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7878 * testsuite/version_script.map: Remove duplicate def of foo.
7879 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7880 version_script.map.
7881 * testsuite/Makefile.in: Rebuild.
7882
818bf354
ILT
78832009-12-30 Ian Lance Taylor <iant@google.com>
7884
7885 PR 10843
7886 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7887 if the input symbol index is 0, make the output symbol index 0.
7888
ebcc8304
ILT
78892009-12-30 Ian Lance Taylor <iant@google.com>
7890
7891 PR 10670
7892 * options.h (class General_options): Add -x/--discard-all.
7893 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7894 --discard-all. If the local symbol needs a dynamic entry, check
7895 that before handling --discard-locals.
7896
176fe33f
ILT
78972009-12-30 Ian Lance Taylor <iant@google.com>
7898
bb321bb1
ILT
7899 PR 10450
7900 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7901 flags to PF_R.
7902 (Output_segment::add_output_section): Don't change the flags if
7903 the type is PT_TLS.
7904
176fe33f
ILT
7905 PR 10450
7906 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7907 GNU hash table if they need a dynamic value. Otherwise, don't add
7908 them if they are defined in a dynamic object or are forced local.
7909
e8cd95c7
ILT
79102009-12-29 Ian Lance Taylor <iant@google.com>
7911
1b81fb71
ILT
7912 PR 10450
7913 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7914 .gnu.hash table for a 32-bit target.
7915
8d6d383d
ILT
7916 PR 10450
7917 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7918 regular and a dynamic object only needs a dynamic symbol table
7919 entry if it is externally visible.
7920
e785ec03
ILT
7921 PR 10450
7922 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7923 constructor. Add global_offset_table_ field.
7924 (Target_i386::got_section): Set global_offset_table_.
7925 (Target_i386::do_finalize_sections): Set global_offset_table_
7926 size.
7927 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7928 in constructor. Add global_offset_table_ field.
7929 (Target_x86_64::got_section): Set global_offset_table_.
7930 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7931 size.
7932
1a2dff53
ILT
7933 * layout.cc (Layout::Layout): Initialize increase_relro_.
7934 (Layout::get_output_section): Add is_relro, is_last_relro, and
7935 is_first_non_relro parameters. Change all callers.
7936 (Layout::choose_output_section): Likewise.
7937 (Layout::add_output_section_data): Likewise.
7938 (Layout::make_output_section): Likewise.
7939 (Layout::set_segment_offsets): Clear increase_relro when using a
7940 linker script.
7941 * layout.h (class Layout): Add increase_relro method. Add
7942 increase_relro_ field. Update declarations.
7943 * output.cc (Output_section::Output_section): Initialize
7944 is_last_relro_ and is_first_non_relro_.
7945 (Output_segment::add_output_section): Group relro sections is
7946 do_sort is true. Handle is_last_relro and is_first_non_relro.
7947 (Output_segment::maximum_alignment): Remove relro handling.
7948 (Output_segment::set_section_addresses): Add increase_relro
7949 parameter. Change all callers. Add initial alignment to align
7950 relro sections on separate page. Remove old relro handling.
7951 (Output_segment::set_section_list_addresses): Remove in_relro
7952 parameter. Change all callers.
7953 (Output_segment::set_offset): Add increase parameter. Change all
7954 callers. Remove old relro handling.
7955 * output.h (class Output_section): Add new methods: is_last_relro,
7956 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7957 Add is_last_relro_ and is_first_non_relro_ fields.
7958 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7959 Create separate .got.plt section. Call increase_relro.
7960 * x86_64.cc (Target_x86_64::got_section): Likewise.
7961 * testsuite/relro_script_test.t: Add .got.plt.
7962
f0ba79e2
ILT
7963 PR 10450
7964 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7965 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7966 (Layout::finalize): Call set_dynamic_symbol_size.
7967 (Layout::set_dynamic_symbol_size): New function.
7968 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7969 set_dynamic_symbol_size.
7970
e8cd95c7
ILT
7971 PR 10450
7972 * output.h (class Output_section): Add is_entsize_zero_ field.
7973 * output.cc (Output_section::Output_section): Initialize
7974 is_entsize_zero_.
7975 (Output_section::set_entsize): If two different entsizes are
7976 requested, force it to zero.
7977 (Output_section::add_input_section): Set flags for .debug_str
7978 before updating section flags. Set entsize.
7979 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7980 and SHF_STRING if all input sections have those flags.
7981
3e1b9a8a
RÁE
79822009-12-29 Rafael Espindola <espindola@google.com>
7983
7984 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7985 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7986 reporting.
3e1b9a8a 7987
3dcad376
ST
79882009-12-29 Sriraman Tallam <tmsriram@google.com>
7989
7990 * options.cc (General_options::parse_version): Allow -v to exit
7991 without an error if there is nothing to link.
7992
084e2665
ILT
79932009-12-29 Ian Lance Taylor <iant@google.com>
7994
7995 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7996 using a version of gcc before 4.1.
7997 * configure: Rebuild.
7998
250acde3
CD
79992009-12-28 Chris Demetriou <cgd@google.com>
8000
8001 * attributes.cc (Output_attributes_section_data::do_write): Use
8002 std::vector::front rather than std::vector::data.
8003
99fff23b
ILT
80042009-12-28 Ian Lance Taylor <iant@google.com>
8005
8006 * symtab.h (class Symbol_table): Add enum Defined.
8007 * resolve.cc (Symbol_table::should_override): Add defined
8008 parameter. Change all callers. Test whether object is NULL
8009 before calling a method on it.
8010 (Symbol_table::report_resolve_problem): Add defined parameter.
8011 Change all callers.
8012 (Symbol_table::should_override_with_special): Likewise.
8013 * symtab.cc (Symbol_table::define_in_output_data): Add defined
8014 parameter. Change all callers.
8015 (Symbol_table::do_define_in_output_data): Likewise.
8016 (Symbol_table::define_in_output_segment): Likewise.
8017 (Symbol_table::do_define_in_output_segment): Likewise.
8018 (Symbol_table::define_as_constant): Likewise.
8019 (Symbol_table::do_define_as_constant): Likewise.
8020 * script.h (class Symbol_assignment): Add is_defsym parameter to
8021 constructor; change all callers.
8022 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
8023 parameter. Change all callers. Add is_defsym_ field.
8024 (class Parser_closure): Add parsing_defsym parameter to
8025 constructor; change all callers. Add parsing_defsym accessor
8026 function. Add parsing_defsym_ field.
8027
556bd683
ILT
80282009-12-28 Ian Lance Taylor <iant@google.com>
8029
8030 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 8031 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 8032
1782c879
ILT
80332009-12-23 Ian Lance Taylor <iant@google.com>
8034
8035 * i386.cc (Target_i386::do_calls_non_split): Recognize
8036 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
8037 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
8038 -fsplit-stack prologue when using %r11.
1782c879 8039
329ca2b1
ST
80402009-12-21 Sriraman Tallam <tmsriram@google.com>
8041
8042 * options.cc (General_options::parse_version): Make -v continue and do
8043 the link like GNU ld does.
8044
d675ff46
RÁE
80452009-12-17 Rafael Avila de Espindola <espindola@google.com>
8046
8047 * Makefile.am (CCFILES): Add timer.cc.
8048 (HFILES): Add timer.h.
8049 * configure.ac: Check for sysconf and times.
8050 * main.cc: include timer.h.
8051 (main): Use Timer instead of get_run_time.
8052 * timer.cc: New.
8053 * timer.h: New.
8054 * workqueue.cc: include timer.h.
8055 (Workqueue::find_and_run_task):
8056 Report user, sys and wall time.
8057 * Makefile.in: Regenerate.
8058 * config.in: Regenerate.
8059 * configure: Regenerate.
8060
d6344fb5
DK
80612009-12-16 Doug Kwan <dougkwan@google.com>
8062
8063 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
8064 sections.
8065 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
8066 relaxed input sections.
8067 * output.cc (Output_section::find_relaxed_input_section): Change
8068 return type to Output_relaxed_input_section pointer. Adjust code
8069 for new type of relaxed_input_section_map_.
8070 * output.h (Output_section::find_relaxed_input_section): Change
8071 return type to Output_relaxed_input_section pointer.
8072 (Output_section::Output_relaxed_input_section_by_input_section_map):
8073 New type.
8074 (Output_section::relaxed_input_section_map_): Change type to
8075 Output_section::Output_relaxed_input_section_by_input_section_map.
8076 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
8077 input section.
8078
0e0d5469
ILT
80792009-12-15 Ian Lance Taylor <iant@google.com>
8080
8081 * layout.cc (Layout::create_shstrtab): Only write out after input
8082 sections if we are compressing debug sections.
8083
0649a889
ILT
80842009-12-15 Ian Lance Taylor <iant@google.com>
8085
8086 * archive.cc (Archive::add_symbols): Only look up a symbol without
8087 a version if there is, in fact, a version.
8088
2ea97941
ILT
80892009-12-14 Ian Lance Taylor <iant@google.com>
8090
8091 Revert -Wshadow changes, all changes from:
8092 2009-12-11 Doug Kwan <dougkwan@google.com>
8093 2009-12-11 Nick Clifton <nickc@redhat.com>
8094 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
8095
b0eec2cc
DK
80962009-12-11 Doug Kwan <dougkwan@google.com>
8097
8098 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
8099 due to -Wshadow.
8100 * attributes.cc (Object_attribute::size): Ditto.
8101 (Attributes_section_data::size): Ditto.
8102 (Attributes_section_data::Attributes_section_data): Ditto.
8103 (Output_attributes_section_data::do_write): Ditto.
8104 * attributes.h (Object_attribute::set_type): Ditto.
8105 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
8106
91d6fa6a
NC
81072009-12-11 Nick Clifton <nickc@redhat.com>
8108
8109 * archive.cc: Fix shadowed variable warnings.
8110 * arm.cc: Likewise.
8111 * compressed_output.cc: Likewise.
8112 * compressed_output.h: Likewise.
8113 * configure: Likewise.
8114 * dwarf_reader.cc: Likewise.
8115 * dynobj.cc: Likewise.
8116 * dynobj.h: Likewise.
8117 * ehframe.cc: Likewise.
8118 * ehframe.h: Likewise.
8119 * errors.cc: Likewise.
8120 * expression.cc: Likewise.
8121 * fileread.cc: Likewise.
8122 * fileread.h: Likewise.
8123 * freebsd.h: Likewise.
8124 * i386.cc: Likewise.
8125 * icf.cc: Likewise.
8126 * incremental.h: Likewise.
8127 * layout.cc: Likewise.
8128 * layout.h: Likewise.
8129 * mapfile.cc: Likewise.
8130 * merge.cc: Likewise.
8131 * merge.h: Likewise.
8132 * object.cc: Likewise.
8133 * object.h: Likewise.
8134 * options.h: Likewise.
8135 * output.cc: Likewise.
8136 * output.h: Likewise.
8137 * parameters.cc: Likewise.
8138 * plugin.cc: Likewise.
8139 * powerpc.cc: Likewise.
8140 * reduced_debug_output.cc: Likewise.
8141 * reduced_debug_output.h: Likewise.
8142 * reloc.cc: Likewise.
8143 * reloc.h: Likewise.
8144 * resolve.cc: Likewise.
8145 * script-sections.cc: Likewise.
8146 * script.cc: Likewise.
8147 * script.h: Likewise.
8148 * sparc.cc: Likewise.
8149 * symtab.cc: Likewise.
8150 * symtab.h: Likewise.
8151 * target-select.cc: Likewise.
8152 * target-select.h: Likewise.
8153 * token.h: Likewise.
8154 * workqueue.cc: Likewise.
8155 * workqueue.h: Likewise.
8156 * x86_64.cc: Likewise.
8157
a0351a69
DK
81582009-12-10 Doug Kwan <dougkwan@google.com>
8159
8160 * arm.cc (attributes.h): New include.
8161 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
8162 (Arm_relobj::~Arm_relobj): Delete object pointed by
8163 attributes_section_data_.
8164 (Arm_relobj::attributes_section_data): New method definition.
8165 (Arm_relobj::attributes_section_data_): New data member declaration.
8166 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
8167 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
8168 attributes_section_data_.
8169 (Arm_dynobj::attributes_section_data): New method definition.
8170 (Arm_dynobj::attributes_section_data_): New data member declaration.
8171 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
8172 initialization value of may_use_blx_ to false.
2e702c99 8173 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
8174 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
8175 object attributes to compute results instead of hard-coding.
8176 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
8177 Target_arm::get_secondary_compatible_arch,
8178 Target_arm::set_secondary_compatible_arch
8179 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8180 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
8181 New method declarations.
8182 (Target_arm::get_aeabi_object_attribute): New method definition.
8183 (Target_arm::attributes_section_data_): New data member declaration.
8184 (read_arm_attributes_section): New template definition.
8185 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
8186 (Arm_dynobj::do_read_symbols): Ditto.
8187 (Target_arm::do_finalize_sections): Merge attributes sections from
8188 input. Check for BLX use after attributes section merging.
8189 Fix __exidx_start and __exidx_end visibility. Create an
8190 .ARM.attributes section if necessary.
8191 (Target_arm::get_secondary_compatible_arch,
8192 Target_arm::set_secondary_compatible_arch,
8193 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
8194 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 8195 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
8196 New method definitions.
8197
b59befec
ILT
81982009-12-09 Ian Lance Taylor <iant@google.com>
8199
8200 * plugin.cc (Plugin::load): Don't cast from void* to a function
8201 pointer.
8202
1276bc89
ILT
82032009-12-09 Ian Lance Taylor <iant@google.com>
8204
8205 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
8206 information fields.
8207
2f2de248
L
82082009-12-09 H.J. Lu <hongjiu.lu@intel.com>
8209
8210 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
8211 Replace two_file_shared_1.so with two_file_shared_2.so.
8212 * testsuite/Makefile.in: Regenerated.
8213
4f787271
DK
82142009-12-08 Doug Kwan <dougkwan@google.com>
8215
8216 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
8217 (HFILES): Add attributes.h and int_encoding.h.
8218 * Makefile.in: Regenerate.
8219 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
8220 function definitions to int_encoding.cc
8221 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
8222 prototypes to int_encoding.h
8223 * reduced_debug_output.cc (int_encoding.h): New include.
8224 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
8225 function definitions to int_encoding.cc
8226 (insert_into_vector, read_from_pointer): Move template definitions to
8227 int_encoding.h
8228 * attributes.cc: New file.
8229 * attributes.h: New file.
8230 * int_encoding.cc: New file.
8231 * int_encoding.h: New file.
8232
20b52f1a
RÁE
82332009-12-07 Rafael Avila de Espindola <espindola@google.com>
8234
8235 PR gold/11055
8236 * incremental-dump.cc (dump_incremental_inputs): New.
8237 (main): Use dump_incremental_inputs.
8238
53d7974c
L
82392009-12-07 H.J. Lu <hongjiu.lu@intel.com>
8240
8241 PR gold/10893
8242 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
8243 checking elfcpp::STT_FUNC.
8244 (Target_i386::Relocate::relocate): Likewise.
8245 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
8246
8247 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
8248 symbols from shared libraries into normal FUNC symbols.
8249
8250 * symtab.h (Symbol): Add is_func and use it.
8251
05a352e6
DK
82522009-12-05 Doug Kwan <dougkwan@google.com>
8253
8254 * arm.cc (Target_arm::arm_info): Initialize new fields
8255 attributes_section and attributes_vendor.
8256 * i386.cc (Target_i386::i386_info): Same.
8257 * object.cc (Sized_relobj::do_layout): Skip attribute section.
8258 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
8259 fields attributes_section and attributes_vendor.
53d7974c 8260 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
8261 * target.h (Target::attributes_section, Target::attributes_vendor,
8262 Target::is_attributes_section, Target::attribute_arg_type,
8263 Target::attributes_order): New method definitions.
8264 (Target::Target_info::attributes_section,
8265 Target::Target_info::attributes_vendor): New fields.
8266 (Target::do_attribute_arg_type, Target::do_attributes_order): New
8267 virtual method definitions.
8268 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
8269 attributes_section and attributes_vendor.
8270 * testsuite/testfile.cc (Target_test::test_target_info): Same.
8271
f4e5969c
DK
82722009-12-05 Doug Kwan <dougkwan@google.com>
8273
8274 * arm.cc: Update comments about interworking and stub generation.
8275 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
8276 considered as non-PIC.
8277 (Arm_relocate_functions::base_abs): Fix formatting.
8278 (Arm_relocate_functions::got_prel): Fix comment. Change interface
8279 of function to use GOT entry address instead of offset.
8280 (Target_arm::Scan::global): Issue an error if a symbol would need a
8281 PLT does not get one because it is untyped. Remove code to create
8282 dynamic symbols for relative branches.
8283 (Target_arm::Relocate::relocate: Use 0 instead of false since function
8284 takes unsigned integer instead of boolean.
8285
1abce4a6
L
82862009-12-05 H.J. Lu <hongjiu.lu@intel.com>
8287
8288 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
8289 (two_file_test_LDADD): Likewise.
8290 (common_test_1_LDADD): Likewise.
8291 (exception_test_LDADD) Likewise.
8292 (weak_test_LDADD): Likewise.
8293 (many_sections_test_LDADD): Likewise.
8294 (initpri1_LDADD): Likewise.
8295 (script_test_1_LDADD): Likewise.
8296 (script_test_2_LDADD): Likewise.
8297 (justsyms_LDADD): Likewise.
8298 (binary_test_LDADD): Likewise.
8299 (large_LDADD): Likewise.
8300 * testsuite/Makefile.in: Regenerated.
8301
adcf2816 83022009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 8303
adcf2816
L
8304 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
8305 (Symbol_table::override_with_special): Likewise.
8306 (Symbol_table::add_from_object): Likewise.
8307
28e67f5d
RÁE
83082009-12-04 Rafael Avila de Espindola <espindola@google.com>
8309
8310 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8311 Don't set the data_offset twice.
8312
ae10a101
RÁE
83132009-12-04 Rafael Avila de Espindola <espindola@google.com>
8314
8315 * testsuite/Makefile.in: Regenerate.
8316
f59f41f3
DK
83172009-12-03 Doug Kwan <dougkwan@google.com>
8318
8319 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
8320 (Target_arm::do_finalize_sections): Add parameter for symbol table
8321 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
8322 * i386.cc (Target_i386::do_finalize_sections): Add an additional
8323 parameter for symbol table pointer.
8324 * layout.cc (Layout::finalize): Call Target::finalize_sections with
8325 an additional parameter for a pointer to symbol table.
8326 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
8327 parameter for a symbol table pointer.
8328 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
8329 * target.h (Target::finalize_sections, Target::do_finalize_sections):
8330 Ditto.
8331 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
8332 parameter for a symbol table pointer.
8333
ca55d848
RÁE
83342009-12-03 Rafael Avila de Espindola <espindola@google.com>
8335
8336 * incremental.cc (Incremental_inputs_header)
8337 (Incremental_inputs_header_write, Incremental_inputs_entry)
8338 (Incremental_inputs_entry_write): Move ...
8339 * incremental.h (Incremental_inputs_header)
8340 (Incremental_inputs_header_write, Incremental_inputs_entry)
8341 (Incremental_inputs_entry_write): here.
8342
3aec4f9c
RÁE
83432009-12-02 Rafael Avila de Espindola <espindola@google.com>
8344
8345 * incremental.cc (make_sized_incremental_binary): Set the target.
8346 Error if it is incompatible.
8347 * output.h (Output_file): Add filename method.
8348
9c0ae74d
RÁE
83492009-12-02 Rafael Avila de Espindola <espindola@google.com>
8350
8351 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8352 from the get_* methods.
8353
a45500ae
RÁE
83542009-12-02 Rafael Avila de Espindola <espindola@google.com>
8355
8356 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8357 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8358 Write 0 for the data_offset of scripts.
8359
325e6408
RÁE
83602009-12-02 Rafael Avila de Espindola <espindola@google.com>
8361
8362 * testsuite/Makefile.am: Add the incremental_test.sh test.
8363 * testsuite/incremental_test.sh: New.
8364 * testsuite/incremental_test_1.c: New.
8365 * testsuite/incremental_test_2.c: New.
8366
954c3e2e
RÁE
83672009-12-01 Rafael Avila de Espindola <espindola@google.com>
8368
703d02da 8369 * incremental-dump.cc (main): Fix typos.
954c3e2e 8370
f8086623
RÁE
83712009-11-27 Rafael Avila de Espindola <espindola@google.com>
8372
8373 PR gold/11025
8374 * incremental-dump.cc (main): Use llu to print 64 bit values.
8375
3b0dd6ac
L
83762009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8377 H.J. Lu <hongjiu.lu@intel.com>
8378
8379 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8380 $(LIBDL).
8381 (incremental_dump_LDADD): Likewise.
8382 * Makefile.in: Regenerated.
8383
a6d1ef57 83842009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8385
a6d1ef57
DK
8386 Revert:
8387
8388 2009-11-25 Doug Kwan <dougkwan@google.com>
8389
8390 * arm.cc (Target_arm::Target_arm): Move method definition
8391 outside of class definition. Add code to handle
8392 --target1-rel, --target1-abs and --target2= options.
8393 (Target_arm::get_reloc_reloc_type): Change method to be
8394 non-static and const.
8395 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8396 New data member declaration.
8397 (Target_arm::Scan::local, Target_arm::Scan::global,
8398 Target_arm::Relocate::relocate,
8399 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8400 Adjust call to Target_arm::get_real_reloc_type.
8401 (Target_arm::get_real_reloc_type): Use command line options
8402 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8403 * options.h (--target1-rel, --target1-abs, --target2): New
8404 ARM-only options.
8405
50aeb7d4
DK
84062009-11-25 Doug Kwan <dougkwan@google.com>
8407
8408 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8409 class definition. Add code to handle --target1-rel, --target1-abs
8410 and --target2= options.
8411 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8412 and const.
8413 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8414 member declaration.
8415 (Target_arm::Scan::local, Target_arm::Scan::global,
8416 Target_arm::Relocate::relocate,
8417 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8418 call to Target_arm::get_real_reloc_type.
8419 (Target_arm::get_real_reloc_type): Use command line options to
8420 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8421 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8422 options.
8423
51938283
DK
84242009-11-25 Doug Kwan <dougkwan@google.com>
8425
8426 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8427 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8428 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8429 formatting.
8430 (Arm_relocate_functions::thm_call): Replace body with a call to
8431 Arm_relocate_functions::thumb_branch_common.
8432 (Arm_relocate_functions::thm_jump24,
8433 Arm_relocate_functions::thm_xpc22): New method definitions.
8434 (Arm_relocate_functions::thumb_branch_common): New method definition.
8435 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8436 operator.
8437 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8438 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8439
e2b8f3c4
RÁE
84402009-11-24 Rafael Avila de Espindola <espindola@google.com>
8441
8442 * Makefile.am: Build incremental-dump
8443 * Makefile.in: Regenerate.
8444 * incremental-dump.cc: New.
8445 * incremental.cc (Incremental_inputs_header_data,
8446 Incremental_inputs_entry_data): Move to incremental.h
8447 * incremental.h: (Incremental_inputs_header_data,
8448 Incremental_inputs_entry_data): Move from incremental.cc
8449
bcba9aec
RÁE
84502009-11-24 Rafael Avila de Espindola <espindola@google.com>
8451
8452 * incremental.cc (Incremental_inputs_header,
8453 Incremental_inputs_header_write, Incremental_inputs_entry,
8454 Incremental_inputs_entry_write): Add a typedef with the data type.
8455
7c3afe08
RÁE
84562009-11-24 Rafael Avila de Espindola <espindola@google.com>
8457
8458 * incremental.cc (Incremental_inputs_header,
8459 Incremental_inputs_header_write, Incremental_inputs_entry,
8460 Incremental_inputs_entry_write): Update comment about which
8461 type has the filed descriptions.
8462
d204b6e9
DK
84632009-11-15 Doug Kwan <dougkwan@google.com>
8464
8465 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8466 (Arm_relocate_functions::arm_branch_common): Change method defintion
8467 in class definition to a method declaration and update list of formal
8468 parameters.
8469 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8470 Arm_relocation_functions::jump24): Adjust call to
8471 Arm_relocate_functions::arm_branch_common. Update list of formal
8472 parameters.
8473 (Arm_relocate_functions::xpc25): New method definition.
8474 (Arm_relocate_functions::arm_branch_common): Move method defintion
8475 out from class definition. Use stubs for mode-switching and extending
8476 branch ranges.
8477 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8478 specially. Change code to enable use of stubs in ARM branches.
8479
43d12afe
DK
84802009-11-10 Doug Kwan <dougkwan@google.com>
8481
8482 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8483 in method declaration.
8484 (Target_arm::relocate_stub): New method declaration.
8485 (Target_arm::default_target): Change to return a pointer instead of
8486 a const reference.
8487 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8488 Target_arm::default_target.
8489 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8490 method definition.
8491 (Target_arm::relocate_section): Adjust view.
8492 (Target_arm::relocate_stub): New method definition.
8493
ac33a407
DK
84942009-11-10 Doug Kwan <dougkwan@google.com>
8495
8496 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8497 a format warning.
8498 * incremental.cc (open_incremental_binary): Initialized local
8499 variables to avoid warnings.
8500 * object.cc (make_elf_object): Ditto.
8501 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8502 a format warning.
e1df38aa 8503
88ee28e9
L
8504009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8505
8506 PR gold/10930
8507 * testsuite/plugin_test.c: Include "config.h".
8508
2daedcd6
DK
85092009-11-09 Doug Kwan <dougkwan@google.com>
8510
8511 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8512 (arm_symbol_value): Remove.
8513 (Arm_relocate_functions::arm_branch_common,
8514 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8515 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8516 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8517 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8518 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8519 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8520 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8521 Arm_relocate_functions::thm_mobw_abs_nc,
8522 Arm_relocate_functions::thm_mov_abs,
8523 Arm_relocate_functions::movw_prel_nc,
8524 Arm_relocate_functions::thm_movt_abs,
8525 Arm_relocate_functions::movt_prel,
8526 Arm_relocate_functions::thm_movw_prel_nc,
8527 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8528 (Target_arm::Relocate::relocate): Only decompose address into two
8529 parts if relocation type uses the thumb-bit and pass the actual
8530 bit instead of a flag indicating that the thumb-bit is used. Adjust
8531 calls to methods in Arm_relocate_functions for this change.
8532
1276bc89 85332009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8534
8535 PR 10925
8536 * reloc.cc: Instantiate
8537 Sized_relobj::initialize_input_to_output_maps and
8538 Sized_relobj:free_input_to_output_maps.
8539
e53ad1b5
ILT
85402009-11-06 Ian Lance Taylor <iant@google.com>
8541
8542 PR 10876
8543 * defstd.cc (in_segment): Set only_if_ref true for "end".
8544
eb44217c
DK
85452009-11-06 Doug Kwan <dougkwan@google.com>
8546
8547 * arm.cc (class Reloc_stub): Correct a comment.
8548 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8549 (Target_arm::scan_section_for_stubs): New method declaration.
8550 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8551 Change methods from private to protected.
8552 (Target_arm::do_may_relax): New method definition.
8553 (Target_arm::do_relax, Target_arm::group_sections,
8554 Target_arm::scan_reloc_for_stub,
8555 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8556 (Target_arm::arm_input_section_map_): New data member declaration.
8557 (Target_arm::scan_reloc_for_stub,
8558 Target_arm::scan_reloc_section_for_stubs,
8559 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8560 Target_arm::do_relax): New method definitions.
8561
5d329b7d
ILT
85622009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8563
8564 * configure.ac: Check for (struct stat)::st_mtim
8565 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8566 * config.in: Regenerate.
8567 * configure: Regenerate.
8568
96a0d71b
ILT
85692009-11-05 Ian Lance Taylor <iant@google.com>
8570
8571 PR 10910
8572 * output.cc (Output_segment::add_output_section): Add missing
8573 return statement.
8574
594c8e5e
ILT
85752009-11-04 Ian Lance Taylor <iant@google.com>
8576
8577 PR 10880
8578 * object.h (class Object): Add is_needed and set_is_needed
8579 methods. Add is_needed_ field. Make bool fields into bitfields.
8580 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8581 defined in a dynamic object and referenced by a regular object,
8582 set is_needed for the dynamic object.
8583 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8584 if the file is marked with as_needed and it is not needed.
8585
22b127cc
ILT
85862009-11-04 Ian Lance Taylor <iant@google.com>
8587
8588 PR 10887
8589 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8590 tags if data is discarded by linker script.
8591 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8592 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8593 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8594 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8595
f5c870d2
ILT
85962009-11-04 Ian Lance Taylor <iant@google.com>
8597
8598 * layout.cc (Layout::get_output_section): Add is_interp and
8599 is_dynamic_linker_section parameters. Change all callers.
8600 (Layout::choose_output_section): Likewise.
8601 (Layout::make_output_section): Likewise.
8602 (Layout::add_output_section_data): Add is_dynamic_linker_section
8603 parameter. Change all callers.
8604 * layout.h (class Layout): Update declarations.
8605 * output.h (class Output_section): Add is_interp, set_is_interp,
8606 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8607 Add is_interp_, is_dynamic_linker_section_ fields. Change
8608 generate_code_fills_at_write_ to a bitfield.
8609 * output.cc (Output_section::Output_sections): Initialize new
8610 fields.
8611 (Output_segment::add_output_section): Add do_sort parameter.
8612 Change all callers.
8613
1ae4d23b
ILT
86142009-11-03 Ian Lance Taylor <iant@google.com>
8615
8616 PR 10860
8617 * options.h (class General_options): Add --warn-common.
8618 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8619 merging two common symbols.
8620 (Symbol_table::should_override): Handle --warn-common when merging
8621 a common symbol with a defined symbol. Use report_resolve_problem
8622 for multiple definitions.
8623 (Symbol_table::report_resolve_problem): New function.
8624 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8625
55da9579
DK
86262009-11-03 Doug Kwan <dougkwan@google.com>
8627
8628 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8629 stub_factory_.
8630 (Target_arm::stub_factory): New method definition.
8631 (Target_arm::new_arm_input_section,
8632 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8633 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8634 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8635 New type definitions.
8636 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8637 member declarations.
8638 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8639 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8640 New method definitions.
8641
37a9ac43
ILT
86422009-11-03 Ian Lance Taylor <iant@google.com>
8643
8644 * options.h (class General_options): Add --warn_constructors.
8645
b3d6a3d4
ILT
86462009-11-03 Ian Lance Taylor <iant@google.com>
8647
8648 PR 10893
8649 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8650 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8651
934b01dd
ILT
86522009-11-03 Ian Lance Taylor <iant@google.com>
8653
8654 PR 10895
8655 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8656 --msgid-bugs-address.
8657 (install-pdf): New target.
8658 (install-data_yes): Look up one directory to find mkinstalldirs.
8659
03c1939b
L
86602009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8661
8662 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8663 tree.
8664
ebd95253
DK
86652009-10-30 Doug Kwan <dougkwan@google.com>
8666
8667 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8668
e9bbb538
DK
86692009-10-30 Doug Kwan <dougkwan@google.com>
8670
8671 * arm.cc (Stub_addend_reader): New struct template definition
8672 and partial specializations.
8673 (Stub_addend_reader::operator()): New method definition for a
8674 partially specialized template.
8675
d5b40221
DK
86762009-10-30 Doug Kwan <dougkwan@google.com>
8677
8678 * arm.cc (Arm_relobj::processor_specific_flags): New method
8679 definition.
8680 (Arm_relobj::do_read_symbols): New method declaration.
8681 (Arm_relobj::processor_specific_flags_): New data member declaration.
8682 (Arm_dynobj): New class definition.
8683 (Target_arm::do_finalize_sections): Add input_objects parameter.
8684 (Target_arm::do_adjust_elf_header): New method declaration.
8685 (Target_arm::are_eabi_versions_compatible,
8686 (Target_arm::merge_processor_specific_flags): New method declaration.
8687 (Target_arm::do_make_elf_object): New overloaded method definitions
8688 and declaration.
8689 (Arm_relobj::do_read_symbols): New method definition.
8690 (Arm_dynobj::do_read_symbols): Ditto.
8691 (Target_arm::do_finalize_sections): Add input_objects parameters.
8692 Merge processor-specific flags from all input objects.
8693 (Target_arm::are_eabi_versions_compatible,
8694 Target_arm::merge_processor_specific_flags,
8695 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8696 New method definitions.
8697 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8698 Input_objects pointer type parameter.
8699 * layout.cc (Layout::finalize): Pass input objects to target's.
8700 finalize_sections function.
8701 * output.cc (Output_file_header::do_sized_write): Set ELF file
8702 header's processor-specific flags.
8703 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8704 Input_objects pointer type parameter.
8705 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8706 * target.h (Input_objects): New forward class declaration.
8707 (Target::processor_specific_flags,
8708 Target::are_processor_specific_flags_sect): New method definitions.
8709 (Target::finalize_sections): Add input_objects parameter.
8710 (Target::Target): Initialize processor_specific_flags_ and
8711 are_processor_specific_flags_set_.
8712 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8713 parameter.
8714 (Target::set_processor_specific_flags): New method definition.
8715 (Target::processor_specific_flags_,
8716 Target::are_processor_specific_flags_set_): New data member
8717 declarations.
8718 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8719 Input_objects pointer type parameter.
8720
ebabffbd
DK
87212009-10-30 Doug Kwan <dougkwan@google.com>
8722
8723 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8724
ad0f2072
ILT
87252009-10-28 Ian Lance Taylor <iant@google.com>
8726
8727 * object.h (class Relobj): Drop options parameter from
8728 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8729 do_scan_relocs, do_relocate. Change all callers.
8730 (class Sized_relobj): Drop options parameters from
8731 do_gc_process_relocs, do_scan_relocs, do_relocate,
8732 do_relocate_sections, relocate_sections, emit_relocs_scan,
8733 emit_relocs_scan_reltype. Change all callers.
8734 (struct Relocate_info): Remove options field and all references to
8735 it.
8736 * reloc.h (class Read_relocs): Remove options constructor
8737 parameter and options_ field. Change all callers.
8738 (class Gc_process_relocs, class Scan_relocs): Likewise.
8739 (class Relocate_task): Likewise.
8740 * target-reloc.h (scan_relocs): Remove options parameter. Change
8741 all callers.
8742 (scan_relocatable_relocs): Likewise.
8743 * target.h (class Sized_target): Remove options parameter from
8744 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8745 all callers.
8746 * gc.h (gc_process_relocs): Remove options parameter. Change all
8747 callers.
8748 * arm.cc: Update functions to remove options parameters.
8749 * i386.cc: Likewise.
8750 * powerpc.cc: Likewise.
8751 * sparc.cc: Likewise.
8752 * x86_64.cc: Likewise.
8753 * testsuite/testfile.cc: Likewise.
8754
8ffa3667
DK
87552009-10-28 Doug Kwan <dougkwan@google.com>
8756
8757 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8758 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8759 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8760 New method definitions.
8761
40f36857
CC
87622009-10-28 Cary Coutant <ccoutant@google.com>
8763
8764 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8765 (Plugin::cleanup_done_): New member.
8766 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8767 (Plugin_manager::cleanup_done_): Remove.
8768 (Plugin_manager::add_input_file): Edit error message.
8769 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8770 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8771
2c849493
ILT
87722009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8773
8774 * fileread.cc: (File_read::View::~View): Use the new
8775 data_ownership_ filed.
8776 (File_read::~File_read): Dispose the new whole_file_view_.
8777 (File_read::open): Mmap the whole file if needed.
8778 (File_read::open): Use whole_file_view_ instead of contents_.
8779 (File_read::find_view): Use whole_file_view_ if applicable.
8780 (File_read::do_read): Use whole_file_view_ instead of contents_.
8781 (File_read::make_view): Use whole_file_view_ instead of contents_,
8782 update File_read::View::View call.
8783 (File_read::find_or_make_view): Update File_read::View::View
8784 call.
8785 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8786 remove contents_
8787 (File_read::View::Data_ownership): New enum.
8788 (File_read::View::View): Replace bool mapped_ with Data_ownership
8789 argument.
8790 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8791 (File_read::View::data_ownership_): New field.
8792 (File_read::contents_): Remove (replaced by whole_file_view_).
8793 (File_read::whole_file_view_): New field.
8794 * options.h (class General_options): Add --keep-files-mapped.
8795
24998053
CC
87962009-10-27 Cary Coutant <ccoutant@google.com>
8797
8798 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8799 * testsuite/Makefile.am (plugin_test_5): New test case.
8800 * testsuite/Makefile.in: Regenerate.
8801
72adc4fa
DK
88022009-10-25 Doug Kwan <dougkwan@google.com>
8803
8804 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8805 from private to protected to allow access by child class.
8806 (Sized_relobj::do_relocate_sections): New method declaration.
8807 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8808 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8809 Sized_relobj::relocate_sections. Instantiate template explicitly
8810 for different target sizes and endianity.
8811
07f508a2
DK
88122009-10-24 Doug Kwan <dougkwan@google.com>
8813
8814 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8815 (Arm_input_section::as_arm_input_section): New method.
8816 (Arm_output_section): New class definition.
8817 (Arm_output_section::create_stub_group,
8818 Arm_output_section::group_sections): New method definitions.
8819
10ad9fe5
DK
88202009-10-22 Doug Kwan <dougkwan@google.com>
8821
8822 * arm.cc (Arm_input_section): New class definition.
8823 (Arm_input_section::init, Arm_input_section:do_write,
8824 Arm_input_section::set_final_data_size,
8825 Arm_input_section::do_reset_address_and_file_offset): New method
8826 definitions.
8827
56ee5e00
DK
88282009-10-21 Doug Kwan <dougkwan@google.com>
8829
8830 * arm.cc (Stub_table, Arm_input_section): New forward class
8831 declarations.
8832 (Stub_table): New class defintion.
8833 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8834 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8835 New method definition.
8836
b569affa
DK
88372009-10-21 Doug Kwan <dougkwan@google.com>
8838
8839 * arm.cc: Update copyright comments.
8840 (Target_arm): New forward class template declaration.
8841 (Arm_address): New type.
8842 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8843 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8844 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8845 constants.
8846 (Insn_template): Same.
8847 (DEF_STUBS): New macro.
8848 (Stub_type): New enum type.
8849 (Stub_template): New class definition.
8850 (Stub): Same.
8851 (Reloc_stub): Same.
8852 (Stub_factory): Same.
8853 (Target_arm::Target_arm): Initialize may_use_blx_ and
8854 should_force_pic_veneer_.
8855 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8856 Target_arm::should_force_pic_veneer,
8857 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8858 Target_arm::using_thumb_only, Target_arm:;default_target): New
8859 method defintions.
8860 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8861 New data member declarations.
8862 (Insn_template::size, Insn_template::alignment): New method defintions.
8863 (Stub_template::Stub_template): New method definition.
8864 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8865 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8866 (Stub_factory::Stub_factory): New method definition.
8867 * gold.h (string_hash): New template.
8868 * output.h (Input_section_specifier::hash_value): Use
8869 gold::string_hash.
8870 (Input_section_specifier::string_hash): Remove.
8871 * stringpool.cc (Stringpool_template::string_hash): Use
8872 gold::string_hash.
8873
6c172549
DK
88742009-10-20 Doug Kwan <dougkwan@google.com>
8875
8876 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8877 symbols of relaxed input sections.
8878 * output.h (Output_section::find_relaxed_input_section): Make
8879 method public.
8880
c5617f2f
DK
88812009-10-16 Doug Kwan <dougkwan@google.com>
8882
8883 * dynobj.cc (Versions::Versions): Initialize version_script_.
8884 Only insert base version symbol definition for a shared object
8885 if version script defines any version versions.
8886 (Versions::define_base_version): New method definition.
8887 (Versions::add_def): Check that base version is not needed.
8888 (Versions::add_need): Define base version lazily.
8889 * dynobj.h (Versions::define_base_version): New method declaration.
8890 (Versions::needs_base_version_): New data member declaration.
8891 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8892 (check_DATA): Add no_version_test.stdout.
8893 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8894 New make rules.
8895 * testsuite/Makefile.in: Regenerate.
8896 * testsuite/no_version_test.c: New file.
8897 * testsuite/no_version_test.sh: Ditto.
8898
3c12dcdb
DK
88992009-10-16 Doug Kwan <dougkwan@google.com>
8900
8901 * expression.cc (class Segment_start_expression): New class definition.
8902 (Segment_start_expression::value): New method definition.
8903 (script_exp_function_segment_start): Return a new
8904 Segment_start_expression.
8905 * gold/script-c.h (script_saw_segment_start_expression): New function
8906 prototype.
8907 * script-sections.cc (Script_sections::Script_sections): Initialize
8908 SAW_SEGMENT_START_EXPRESSION_ to false.
8909 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8910 and -Tbbs options to specify section addresses if given in
8911 command line and no SEGMENT_START expression is seen in a script.
8912 * script-sections.h (Script_sections::saw_segment_start_expression,
8913 Script_sections::set_saw_segment_start_expression): New method
8914 definition.
8915 (Script_sections::saw_segment_start_expression_): New data member
8916 declaration.
8917 * script.cc (script_saw_segment_start_expression): New function.
8918 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8919 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8920 script_test_7.sh and script_test_8.sh.
8921 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8922 script_test_8.stdout.
8923 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8924 (script_test_6, script_test_6.stdout, script_test_7,
8925 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8926 * Makefile.in: Regenerate.
8927 * testsuite/script_test_6.sh: New file.
8928 * testsuite/script_test_6.t: Same.
8929 * testsuite/script_test_7.sh: Same.
8930 * testsuite/script_test_7.t: Same.
8931 * testsuite/script_test_8.sh: Same.
8932
64b1ae37
DK
89332009-10-16 Doug Kwan <dougkwan@google.com>
8934
8935 * output.cc (Output_segment::set_section_list_address): Cast
8936 expressions to unsigned long long type to avoid format warnings.
8937
661be1e2
ILT
89382009-10-15 Ian Lance Taylor <iant@google.com>
8939
12edd763 8940 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8941 dot assignment to script_sections_.
12edd763
ILT
8942 * script-sections.cc (Script_sections::add_dot_assignment):
8943 Initialize if necessary.
8944
68b6574b
ILT
8945 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8946 program headers with no load segment if there is a linker script.
8947
661be1e2
ILT
8948 * layout.cc (Layout::set_segment_offsets): Align the file offset
8949 to the segment aligment for -N or -n with no load segment.
8950 * output.cc (Output_segment::add_output_section): Don't crash if
8951 the first section is a TLS section.
8952 (Output_segment::set_section_list_addresses): Print an error
8953 message if the address moves backward in a linker script.
8954 * script-sections.cc
8955 (Output_section_element_input::set_section_addresses): Don't
8956 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8957 (Orphan_output_section::set_section_addresses): Likewise.
8958
f15f61a7
DK
89592009-10-15 Doug Kwan <dougkwan@google.com>
8960
8961 * layout.cc (Layout::finish_dynamic_section): Generate tags
8962 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8963 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8964 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8965
82bb573a
ILT
89662009-10-14 Ian Lance Taylor <iant@google.com>
8967
8968 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8969 fields.
8970 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8971 data_shdr fields of relinfo.
8972 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8973 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8974 R_386_TLS_LDO_32, adjust based on section flags.
8975 (Target_i386::Relocate::fix_up_ldo): Remove.
8976
374ad285
ILT
89772009-10-13 Ian Lance Taylor <iant@google.com>
8978
8979 Add support for -pie.
8980 * options.h (class General_options): Add -pie and
8981 --pic-executable.
8982 (General_options::output_is_position_independent): Test -pie.
8983 (General_options::output_is_executable): Return true if not shared
8984 and not relocatable.
8985 (General_options::output_is_pie): Remove.
8986 * options.cc (General_options::finalize): Reject incompatible uses
8987 of -pie.
8988 * gold.cc (queue_middle_tasks): A -pie link is not static.
8989 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8990 * symtab.cc (Symbol::final_value_is_known): Return false if
8991 output_is_position_independent.
8992 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8993 output_is_position_independent.
8994 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8995 output_is_position_independent.
8996 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8997 output_is_position_independent.
8998 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8999 two_file_pie_test.
9000 (basic_pie_test.o, basic_pie_test): New targets.
9001 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
9002 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
9003 (two_file_pie_test): New target.
9004 * testsuite/Makefile.in: Rebuild.
9005 * README: Remove note saying that -pie is not supported.
9006
c6585162
ILT
90072009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
9008
9009 * options.h (class General_options): Add -init and -fini.
9010 * layout.cc (Layout::finish_dynamic_section): Emit
9011 given init and fini functions.
9012
032ce4e9
ST
90132009-10-13 Sriraman Tallam <tmsriram@google.com>
9014
9015 * gc.h (gc_process_relocs): Check if icf is enabled using new
9016 function.
9017 * gold.cc (queue_initial_tasks): Likewise.
9018 (queue_middle_tasks): Likewise.
9019 * object.cc (do_layout): Likewise.
9020 * symtab.cc (is_section_folded): Likewise.
9021 * main.cc (main): Likewise.
9022 * reloc.cc (Read_relocs::run): Likewise.
9023 (Sized_relobj::do_scan_relocs): Likewise.
9024 * icf.cc (is_function_ctor_or_dtor): New function.
9025 (Icf::find_identical_sections): Check if function is ctor or dtor when
9026 safe icf is chosen.
9027 * options.h (General_options::icf): Change option to be an enum.
9028 (Icf_status): New enum.
9029 (icf_enabled): New method.
9030 (icf_safe_folding): New method.
9031 (set_icf_status): New method.
9032 (icf_status_): New variable.
9033 * (options.cc) (General_options::finalize): Set icf_status_.
9034 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
9035 icf_test and icf_keep_unique_test to use the --icf enum flag.
9036 * testsuite/icf_safe_test.sh: New file.
e1df38aa 9037 * testsuite/icf_safe_test.cc: New file.
032ce4e9 9038
f345227a
ST
90392009-10-12 Sriraman Tallam <tmsriram@google.com>
9040
9041 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
9042 includes to gc.h and icf.h.
9043 * arm.cc: Include gc.h.
9044 * gold.cc: Likewise.
9045 * i386.cc: Likewise.
9046 * powerpc.cc: Likewise.
9047 * sparc.cc: Likewise.
9048 * x86_64.cc: Likewise.
9049 * gc.h: Include icf.h.
9050
1c7814ed
ILT
90512009-10-11 Ian Lance Taylor <iant@google.com>
9052
9053 * plugin.cc: Include "gold.h" before other header files.
9054
ae3b5189
CD
90552009-10-10 Chris Demetriou <cgd@google.com>
9056
9057 * options.h (Input_file_argument::Input_file_type): New enum.
9058 (Input_file_argument::is_lib_): Replace with...
9059 (Input_file_argument::type_): New member.
9060 (Input_file_argument::Input_file_argument): Take Input_file_type
9061 'type' rather than boolean 'is_lib' as second argument.
9062 (Input_file_argument::is_lib): Use type_.
9063 (Input_file_argument::is_searched_file): New function.
9064 (Input_file_argument::may_need_search): Handle is_searched_file.
9065 * options.cc (General_options::parse_library): Support -l:filename.
9066 (General_options::parse_just_symbols): Update for Input_file_argument
9067 changes.
9068 (Command_line::process): Likewise.
9069 * archive.cc (Archive::get_file_and_offset): Likewise.
9070 * plugin.cc (Plugin_manager::release_input_file): Likewise.
9071 * script.cc (read_script_file, script_add_file): Likewise.
9072 * fileread.cc (Input_file::Input_file): Likewise.
9073 (Input_file::will_search_for): Handle is_searched_file.
9074 (Input_file::open): Likewise.
9075 * readsyms.cc (Read_symbols::get_name): Likewise.
9076 * testsuite/Makefile.am (searched_file_test): New test.
9077 * testsuite/Makefile.in: Regenerate.
9078 * testsuite/searched_file_test.cc: New file.
9079 * testsuite/searched_file_test_lib.cc: New file.
9080
f3048a1d
ILT
90812009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9082 Ian Lance Taylor <iant@google.com>
9083
9084 * descriptor.cc: Include <cstdio> and "binary-io.h".
9085 (Descriptors::open): Open the files in binary mode always.
9086 * script.cc (Lex::get_token): Treat \r as whitespace.
9087
d4780e57
ILT
90882009-10-09 Ian Lance Taylor <iant@google.com>
9089
9090 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
9091
d9a893b8
ILT
90922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9093 Ian Lance Taylor <iant@google.com>
9094
9095 * configure.ac: Check for readv function also.
9096 * fileread.cc (readv): Define if not HAVE_READV.
9097 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
9098 does not exist.
9099 * config.in: Regenerate.
9100 * configure: Regenerate.
9101
c0a62865
DK
91022009-10-09 Doug Kwan <dougkwan@google.com>
9103
9104 * layout.cc (Layout::make_output_section): Call target hook to make
9105 ordinary output section.
9106 (Layout::finalize): Adjust parameter list of call the
9107 Target::may_relax().
9108 * layout.h (class Layout::section_list): New method.
9109 * merge.h (Output_merge_base::entsize): Change visibility to public.
9110 (Output_merge_base::is_string, Output_merge_base::do_is_string):
9111 New methods.
9112 (Output_merge_string::do_is_string): New method.
9113 * object.cc (Sized_relobj::do_setup): renamed from
9114 Sized_relobj::set_up.
9115 * object.h (Sized_relobj::adjust_shndx,
9116 Sized_relobj::initializ_input_to_output_maps,
9117 Sized_relobj::free_input_to_output_maps): Change visibilities to
9118 protected.
9119 (Sized_relobj::setup): Virtualize.
9120 (Sized_relobj::do_setup): New method declaration.
9121 (Sized_relobj::invalidate_section_offset,
9122 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
9123 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
9124 * options.cc (parse_int): New function.
9125 * options.h (parse_int): New declaration.
9126 (DEFINE_int): New macro.
9127 (stub_group_size): New option.
9128 * output.cc (Output_section::Output_section): Initialize memebers
9129 merge_section_map_, merge_section_by_properties_map_,
9130 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
9131 (Output_section::add_input_section): Handled deferred code-fill
9132 generation and remove an old comment.
9133 (Output_section::add_relaxed_input_section): New method definition.
9134 (Output_section::add_merge_input_section): Use merge section by
9135 properties map to speed to search. Update merge section maps
9136 as appropriate.
9137 (Output_section::build_relaxation_map): New method definition.
9138 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
9139 Same.
9140 (Output_section::relax_input_section): Renamed to
9141 Output_section::convert_input_sections_to_relaxed_sections and change
9142 interface to take a vector of pointers to relaxed sections.
9143 (Output_section::find_merge_section,
9144 Output_section::find_relaxed_input_section): New method definitions.
9145 (Output_section::is_input_address_mapped,
9146 Output_section::output_offset, Output_section::output_address):
9147 Use output section data maps to speed up searching.
9148 (Output_section::find_starting_output_address): Add comments.
9149 (Output_section::do_write,
9150 Output_section::write_to_postprocessing_buffer): Do code-fill
9151 generation as appropriate.
9152 (Output_section::get_input_sections): Invalidate relaxed input section
9153 map.
9154 (Output_section::restore_states): Adjust type of checkpoint .
9155 Invalidate relaxed input section map.
9156 * output.h (Output_merge_base): New class declaration.
9157 (Input_section_specifier): New class defintion.
9158 (class Output_relaxed_input_section) Change base class to
9159 Output_section_data_build.
9160 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
9161 base class initializer.
9162 (Output_section::add_relaxed_input_section): New method declaration.
9163 (Output_section::Input_section): Change visibility to protected.
2e702c99 9164 (Output_section::Input_section::relobj,
c0a62865
DK
9165 Output_section::Input_section::shndx): Handle relaxed input sections.
9166 Output_section::input_sections) Change visibility to protected. Also
9167 define overload to return a non-const pointer.
9168 (Output_section::Merge_section_properties): New class defintion.
9169 (Output_section::Merge_section_by_properties_map,
9170 Output_section::Output_section_data_by_input_section_map,
9171 Output_section::Relaxation_map): New types.
9172 (Output_section::relax_input_section): Rename method to
9173 Output_section::convert_input_sections_to_relaxed_sections and change
9174 interface to take a vector of relaxed section pointers.
9175 (Output_section::find_merge_section,
9176 Output_section::find_relaxed_input_section,
9177 Output_section::build_relaxation_map,
9178 Output_section::convert_input_sections_in_list_to_relaxed_sections):
9179 New method declarations.
9180 (Output_section::merge_section_map_
9181 Output_section::merge_section_by_properties_map_,
9182 Output_section::relaxed_input_section_map_,
9183 Output_section::is_relaxed_input_section_map_valid_,
9184 Output_section::generate_code_fills_at_write_): New data members.
9185 * script-sections.cc
9186 (Output_section_element_input::set_section_addresses): Call
9187 current_data_size and addralign methods of relaxed input sections.
9188 (Orphan_output_section::set_section_addresses): Call current_data_size
9189 and addralign methods of relaxed input sections.
9190 * symtab.cc (Symbol_table::compute_final_value): Extract template
9191 from the body of Symbol_table::sized_finalize_symbol.
9192 (Symbol_table::sized_finalized_symbol): Call
9193 Symbol_table::compute_final_value.
9194 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
9195 (Symbol_table::compute_final_value): New templated method declaration.
9196 * target.cc (Target::do_make_output_section): New method defintion.
9197 * target.h (Target::make_output_section): New method declaration.
9198 (Target::relax): Add more parameters for input objects, symbol table
9199 and layout. Adjust call to do_relax.
9200 (Target::do_make_output_section): New method declaration.
9201 (Target::do_relax): Add parameters for input objects, symbol table
9202 and layout.
9203
d446d6c4
ILT
92042009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9205
9206 * pread.c: Include stdio.h.
9207
bc06c745
ILT
92082009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9209
9210 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
9211 defined.
9212
75aea3d0
ILT
92132009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
9214
9215 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
9216 Change read_shndx type to unsigned int.
9217 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9218 int.
9219 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9220 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
9221 Change read_shndx type to unsigned int.
9222 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
9223 int.
9224 (Sized_dwarf_line_info::read_line_mappings): Likewise.
9225 * layout.cc (Layout::create_symtab_sections): Cast the result of
9226 local_symcount * symsize to off_t in the gold_assert.
9227
be8fcb75
ILT
92282009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9229
9230 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
9231 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
9232 R_ARM_BASE_ABS.
9233 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
9234 (Arm_relocate_functions::thm_abs5): New function.
9235 (Arm_relocate_functions::abs12): New function.
9236 (Arm_relocate_functions::abs16): New function.
9237 (Arm_relocate_functions::base_abs): New function.
9238 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
9239 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
9240 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
9241 R_ARM_BASE_ABS.
9242 (Scan::global): Likewise.
9243 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
9244 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
9245 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
9246 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
9247 R_ARM_BASE_ABS.
9248
c2a122b6
ILT
92492009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9250
9251 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
9252 (Arm_relocate_functions::movt_prel): New function.
9253 (Arm_relocate_functions::thm_movw_prel_nc): New function.
9254 (Arm_relocate_functions::thm_movt_prel): New function.
9255 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
9256 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
9257 (Scan::global, Relocate::relocate): Likewise.
9258 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9259
c4aa1e2d
ILT
92602009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9261
9262 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
9263 Incremental_checker.
9264 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
9265 unsigned int.
9266 (class Incremental_inputs_header): New class.
9267 (Incremental_inputs_header_writer): Edit comment.
9268 (Incremental_inputs_entry): New class.
9269 (Incremental_inputs_entry_writer): Edit comment.
9270 (Sized_incremental_binary::do_find_incremental_inputs_section):
9271 Add *strtab_shndx parameter, fill it.
9272 (Sized_incremental_binary::do_check_inputs): New method.
9273 (Incremental_checker::can_incrementally_link_output_file): Use
9274 Sized_incremental_binary::check_inputs.
9275 (Incremental_inputs::report_command_line): Save command line in
9276 command_line_.
9277 * incremental.h:
9278 (Incremental_binary::find_incremental_inputs_section): New
9279 method.
9280 (Incremental_binary::do_find_incremental_inputs_section): Add
9281 strtab_shndx parameter.
9282 (Incremental_binary::do_check_inputs): New pure virtual method.
9283 (Sized_incremental_binary::do_check_inputs): Declare.
9284 (Incremental_checker::Incremental_checker): Add incremental_inputs
9285 parameter, use it to initialize incremental_inputs_.
9286 (Incremental_checker::incremental_inputs_): New field.
9287 (Incremental_checker::command_line): New method.
9288 (Incremental_checker::inputs): New method.
9289 (Incremental_checker::command_line_): New field.
9290
c549a694
ILT
92912009-10-09 Mikolaj Zalewski <mikolajz@google.com>
9292
9293 * incremental.cc: Include <cstdarg> and "target-select.h".
9294 (vexplain_no_incremental): New function.
9295 (explain_no_incremental): New function.
9296 (Incremental_binary::error): New method.
9297 (Sized_incremental_binary::do_find_incremental_inputs_section): New
9298 method.
9299 (make_sized_incremental_binary): New function.
9300 (open_incremental_binary): New function.
9301 (can_incrementally_link_file): Add checks if output is ELF and has
9302 inputs section.
9303 * incremental.h: Include "elfcpp_file.h" and "output.h".
9304 (Incremental_binary): New class.
9305 (Sized_incremental_binary): New class.
9306 (open_incremental_binary): Declare.
9307 * object.cc (is_elf_object): Use
9308 elfcpp::Elf_recognizer::is_elf_file.
9309 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
9310 * output.h (Output_file::filesize): New method.
9311
fd3c5f0b
ILT
93122009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9313
9314 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
9315 New function.
9316 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
9317 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
9318 function.
9319 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
9320 function.
9321 (Arm_relocate_functions::movw_abs_nc): New function.
9322 (Arm_relocate_functions::movt_abs): New function.
9323 (Arm_relocate_functions::thm_movw_abs_nc): New function.
9324 (Arm_relocate_functions::thm_movt_abs): New function.
9325 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
9326 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
9327 (Scan::global): Likewise.
9328 (Relocate::relocate): Likewise.
9329 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9330
7f5309a5
ILT
93312009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9332
9333 * arm.cc (Arm_relocate_functions::got_prel) New function.
9334 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
9335 (Relocate::relocate): Likewise.
9336 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
9337
364c7fa5
ILT
93382009-10-06 Ian Lance Taylor <iant@google.com>
9339
9340 * options.h (class General_options): Define
9341 split_stack_adjust_size parameter.
9342 * object.h (class Object): Add uses_split_stack_ and
9343 has_no_split_stack_ fields. Add uses_split_stack and
9344 has_no_split_stack accessor functions. Declare
9345 handle_split_stack_section.
9346 (class Reloc_symbol_changes): Define.
9347 (class Sized_relobj): Define Function_offsets. Declare
9348 split_stack_adjust, split_stack_adjust_reltype, and
9349 find_functions.
9350 * object.cc (Object::handle_split_stack_section): New function.
9351 (Sized_relobj::do_layout): Call handle_split_stack_section.
9352 * dynobj.cc (Sized_dynobj::do_layout): Call
9353 handle_split_stack_section.
9354 * reloc.cc (Sized_relobj::relocate_sections): Call
9355 split_stack_adjust for executable sections in split_stack
9356 objects. Pass reloc_map to relocate_section.
9357 (Sized_relobj::split_stack_adjust): New function.
9358 (Sized_relobj::split_stack_adjust_reltype): New function.
9359 (Sized_relobj::find_functions): New function.
9360 * target-reloc.h: Include "object.h".
9361 (relocate_section): Add reloc_symbol_changes parameter. Change
9362 all callers.
9363 * target.h (class Target): Add calls_non_split method. Declare
9364 do_calls_non_split virtual method. Declare match_view and
9365 set_view_to_nop.
9366 * target.cc: Include "elfcpp.h".
9367 (Target::do_calls_non_split): New function.
9368 (Target::match_view): New function.
9369 (Target::set_view_to_nop): New function.
9370 * gold.cc (queue_middle_tasks): Give an error if mixing
9371 split-stack and non-split-stack objects with -r.
9372 * i386.cc (Target_i386::relocate_section): Add
9373 reloc_symbol_changes parameter.
9374 (Target_i386::do_calls_non_split): New function.
9375 * x86_64.cc (Target_x86_64::relocate_section): Add
9376 reloc_symbol_changes parameter.
9377 (Target_x86_64::do_calls_non_split): New function.
9378 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9379 parameter.
9380 * powerpc.cc (Target_powerpc::relocate_section): Add
9381 reloc_symbol_changes parameter.
9382 * sparc.cc (Target_sparc::relocate_section): Add
9383 reloc_symbol_changes parameter.
9384 * configure.ac: Call AM_CONDITIONAL for the default target.
9385 * configure: Rebuild.
9386 * testsuite/Makefile.am (TEST_AS): New variable.
9387 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9388 (check_DATA): Add split_i386 and split_x86_64 files.
9389 (SPLIT_DEFSYMS): Define.
9390 (split_i386_[1234n].o): New targets.
9391 (split_i386_[124]): New targets.
9392 (split_i386_[1234r].stdout): New targets.
9393 (split_x86_64_[1234n].o): New targets.
9394 (split_x86_64_[124]): New targets.
9395 (split_x86_64_[1234r].stdout): New targets.
9396 (MOSTLYCLEANFILES): Add new executables.
9397 * testsuite/split_i386.sh: New file.
9398 * testsuite/split_x86_64.sh: New file.
9399 * testsuite/split_i386_1.s: New file.
9400 * testsuite/split_i386_2.s: New file.
9401 * testsuite/split_i386_3.s: New file.
9402 * testsuite/split_i386_4.s: New file.
9403 * testsuite/split_i386_n.s: New file.
9404 * testsuite/split_x86_64_1.s: New file.
9405 * testsuite/split_x86_64_2.s: New file.
9406 * testsuite/split_x86_64_3.s: New file.
9407 * testsuite/split_x86_64_4.s: New file.
9408 * testsuite/split_x86_64_n.s: New file.
9409 * testsuite/testfile.cc (Target_test): Update relocation_section
9410 function.
9411 * testsuite/Makefile.in: Rebuild.
9412
e8a9fcda
ILT
94132009-10-06 Ian Lance Taylor <iant@google.com>
9414
9415 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9416 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9417 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9418 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9419 the address on ldo_addrs_.
9420 (Target_i386::Relocate::fix_up_ldo): New function.
9421
e99daf92
ILT
94222009-10-06 Rafael Espindola <espindola@google.com>
9423
9424 * plugin.cc (add_input_library): New.
9425 (Plugin::load): Add add_input_library to tv.
9426 (Plugin_manager::add_input_file): Add the is_lib argument.
9427 (add_input_file): Update call to Plugin_manager::add_input_file.
9428 (add_input_library): New.
9429 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9430
966d4097
DK
94312009-09-30 Doug Kwan <dougkwan@google.com>
9432
9433 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9434 symbol and call Symbol::may_need_copy_reloc to determine if
9435 a copy reloc is needed.
9436 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9437 nocopyreloc is given in command line.
9438 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9439 given in command line.
9440 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9441 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9442 of the removed Target_i386::may_need_copy_reloc.
9443 * options.h (copyreloc): New option with default value false.
9444 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9445 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9446 instead of the removed Target_powerpc::may_need_copy_reloc.
9447 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9448 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9449 instead of the removed Target_sparc::may_need_copy_reloc.
9450 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9451 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9452 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9453 instead of the removed Target_x86_64::may_need_copy_reloc.
9454
029ba973
ILT
94552009-09-30 Ian Lance Taylor <iant@google.com>
9456
9457 * object.h (class Object): Remove target_ field, and target,
9458 sized_target, and set_target methods.
9459 (Object::sized_target): Remove.
9460 (class Sized_relobj): Update declarations. Remove sized_target.
9461 * object.cc (Sized_relobj::setup): Remove target parameter.
9462 Change all callers.
9463 (Input_objects::add_object): Don't do anything with the target.
9464 (make_elf_sized_object): Add punconfigured parameter. Change all
9465 callers. Set or test parameter target.
9466 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9467 Change all callers.
9468 * parameters.cc (Parameters::set_target): Change parameter type to
9469 be non-const.
9470 (Parameters::default_target): Remove.
9471 (set_parameters_target): Change parameter type to be non-const.
9472 (parameters_force_valid_target): New function.
9473 (parameters_clear_target): New function.
9474 * parameters.h (class Parameters): Update declarations. Remove
9475 default_target method. Add sized_target and clear_target
9476 methods. Change target_ to be non-const.
9477 (set_parameters_target): Update declaration.
9478 (parameters_force_valid_target): Declare.
9479 (parameters_clear_target): Declare.
9480 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9481 as NULL if we aren't searching.
9482 (Add_symbols::run): Don't check for compatible target.
9483 * fileread.cc (Input_file::open_binary): Call
9484 parameters_force_valid_target.
9485 * gold.cc (queue_middle_tasks): Likewise.
9486 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9487 set_target on object.
9488 * dynobj.h (class Sized_dynobj): Update declarations.
9489 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9490 make_elf_object returns NULL.
9491 (Archive::include_member): Don't check whether object target is
9492 compatible.
9493 * output.cc (Output_section::add_input_section): Get target from
9494 parameters.
9495 (Output_section::relax_input_section): Likewise.
9496 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9497 parameters.
9498 (Sized_relobj::do_scan_relocs): Likewise.
9499 (Sized_relobj::relocate_sections): Likewise.
9500 * resolve.cc (Symbol_table::resolve): Likewise.
9501 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9502 parameter. Change all callers.
9503 (Symbol_table::add_from_object): Get target from parameters.
9504 (Symbol_table::add_from_relobj): Don't check object target.
9505 (Symbol_table::add_from_dynobj): Likewise.
9506 (Symbol_table::define_special_symbol): Get target from
9507 parameters.
9508 * symtab.h (class Symbol_table): Update declaration.
9509 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9510 parameter. Change all callers. Clear parameter target.
9511 (Binary_test): Test target here.
9512 * testsuite/object_unittest.cc (gold_testsuite): Remove
9513 target_test_pointer parameter. Change all callers.
9514 (Object_test): Test target here.
9515
a6a22b83
ILT
95162009-09-26 Ian Lance Taylor <iant@google.com>
9517
9518 * testsuite/initpri1.c: Don't try to use constructor priorities if
9519 compiling with gcc before 4.3.
9520
6a8f49fe
ILT
95212009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9522
9523 * testsuite/retain_symbols_file_test.sh (check_present): Change
9524 output file name to retain_symbols_file_test.stdout.
9525 (check_absent): Likewise.
9526
8c604651
CS
95272009-09-18 Craig Silverstein <csilvers@google.com>
9528
9529 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9530 * options.cc: Include <cerrno> and <fstream>.
9531 (General_options::finalize): Parse -retain-symbols-file tag.
9532 * options.h: New flag.
9533 (General_options): New method should_retain_symbol, new
9534 variable symbols_to_retain.
9535 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9536 should_retain_symbol map.
9537 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9538 * testsuite/Makefile.in: Regenerate.
9539 * testsuite/retain_symbols_file_test.sh: New file.
9540
ca58b19f
NC
95412009-09-18 Nick Clifton <nickc@redhat.com>
9542
9543 * po/es.po: Updated Spanish translation.
9544
20e6d0d6
DK
95452009-09-17 Doug Kwan <dougkwan@google.com>
9546
9547 * debug.h (DEBUG_RELAXATION): New constant.
9548 (DEBUG_ALL): Add DEBUG_RELAXATION.
9549 (debug_string_to_enum): Add relaxation debug option.
9550 * layout.cc
9551 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9552 Layout::Relaxation_debug_check::read_sections,
9553 Layout::Relaxation_debug_check::read_sections): New method definitions.
9554 (Layout::Layout): Initialize data members
9555 record_output_section_data_from_scrips_,
9556 script_output_section_data_list_ and relaxation_debug_check_.
9557 (Layout::save_segments, Layout::restore_segments,
9558 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9559 Layout::relaxation_loop_body): New method definitions.
9560 (Layout::finalize): Support relaxation. Move section layout code to
9561 Layout::relaxation_loop_body.
9562 (Layout::set_asection_address_from_script): Move code for orphan
9563 section placement out.
9564 (Layout::place_orphan_sections_in_script): New method definition.
9565 * layout.h (Output_segment_headers, Output_file_header):
9566 New forward class declarations.
9567 (Layout::~Layout): Define.
9568 (Layout::new_output_section_data_from_script): New method definition.
9569 (Layout::place_orphan_sections_in_script): New method declaration.
9570 (Layout::Segment_states): New type declaration.
9571 (Layout::save_segments, Layout::restore_segments,
9572 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9573 Layout::relaxation_loop_body): New method declarations.
9574 (Layout::Output_section_data_list): New type declaration.
9575 (Layout::Relaxation_debug_check): New class definition.
9576 (Layout::record_output_section_data_from_script_,
9577 Layout::script_output_section_data_list_, Layout::segment_states_,
9578 Layout::relaxation_debug_check_): New data members.
9579 * output.cc: (Output_section_headers::do_size): New method definition.
9580 (Output_section_headers::Output_section_headers): Move size
9581 computation to Output_section_headers::do_size.
9582 (Output_segment_headers::do_size): New method definition.
e1df38aa 9583 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9584 Output_file_header::do_size and call it.
9585 (Output_file_header::do_size): New method definition.
9586 (Output_data_group::Output_data_group): Adjust call to
9587 Output_section_data.
9588 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9589 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9590 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9591 RELAXED_INPUT_SECTION_CODE.
9592 (Output_section::Output_section): Initialize data member checkpoint_.
9593 (Output_section::~Output_section): Delete checkpoint object pointed
9594 by checkpoint_.
9595 (Output_section::add_input_section): Always add an Input_section if
9596 relaxing.
9597 (Output_section::add_merge_input_section): Add assert.
9598 (Output_section::relax_input_section): New method definition.
9599 (Output_section::set_final_data_size): Set load address to zero for
9600 an unallocated section.
9601 (Output_section::do_address_and_file_offset_have_reset_values):
9602 New method definition.
9603 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9604 Handle relaxed input section.
9605 (Output_section::sort_attached_input_sections): Checkpoint input
9606 section list lazily.
9607 (Output_section::get_input_sections): Change type of input_sections to
9608 list of Simple_input_section pointers. Checkpoint input section list
9609 lazily. Also handle relaxed input sections.
9610 (Output_section::add_input_section_for_script): Take a reference to
9611 a Simple_input_section object instead of Relobj pointer and section
9612 index as parameter. Handle relaxed input sections.
9613 (Output_section::save_states, Output_section::restore_states): New
9614 method definitions.
9615 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9616 (Output_data::is_data_size_fixed): New method definition.
9617 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9618 if it is fixed.
9619 (Output_data::address_and_file_offset_have_reset_values): New method
9620 definition.
9621 (Output_data::do_address_and_file_offset_have_reset_values): New method
9622 definition.
9623 (Output_data::set_data_size): Check that data size is not fixed.
9624 (Output_data::fix_data_size): New method definition.
9625 (Output_data::is_data_size_fixed_): New data member.
9626 (Output_section_headers::set_final_data_size): New method definition.
9627 (Output_section_headers::do_size): New method declaration.
9628 (Output_segment_headers::set_final_data_size): New method definition.
9629 (Output_segment_headers::do_size): New method declaration.
9630 (Output_file_header::set_final_data_size)::New method definition.
9631 (Output_file_header::do_size)::New method declaration.
9632 (Output_section_data::Output_section_data): Add new parameter
9633 is_data_size_fixed and use it to fix data size.
9634 (Output_data_const::Output_data_const): Adjust call to base class
9635 constructor and fix data size.
9636 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9637 base class constructor and fix data size.
9638 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9639 base class constructor and fix data size.
9640 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9641 class constructor and fix data size.
9642 (Output_data_group::set_final_data_size): New method definition.
9643 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9644 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9645 class constructor and fix data size.
9646 (Output_relaxed_input_section): New class definition.
9647 (Output_section::Simple_input_section): New class definition.
9648 (Output_section::get_input_sections): Adjust parameter list.
9649 (Output_section::add_input_section_for_script): Same.
9650 (Output_section::save_states, Output_section::restore_states,
9651 Output_section::do_address_and_file_offset_have_reset_values,
9652 (Output_section::Input_section::Input_section): Handle
9653 RELAXED_INPUT_SECTION_CODE. Add new overload for
9654 Output_relaxed_input_section.
9655 (Output_section::Input_section::is_input_section,
9656 Output_section::Input_section::set_output_section): Handle relaxed
9657 input section.
9658 (Output_section::Input_section::is_relaxed_input_section,
9659 Output_section::Input_section::output_section_data,
9660 Output_section::Input_section::relaxed_input_section): New method
9661 definitions.
9662 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9663 value.
9664 (Output_section::Input_section::u1_): Update comments.
9665 (Output_section::Input_section::u2_): Add new union member poris.
9666 (Output_section::Checkpoint_output_section): New classs definition.
9667 (Output_section::relax_input_section): New method declaration.
9668 (Output_section::checkpoint_): New data member.
9669 (Output_segment): Update comments.
9670 (Output_segment::Output_segment): Un-privatize copy constructor.
9671 (Output_segment::operator=): Un-privatize.
9672 * script-sections.cc (Output_section_element::Input_section_list):
9673 Change element type to Output_section::Simple_input_section.
9674 (Output_section_element_dot_assignment::set_section_addresses):
9675 Register output section data for relaxation clean up.
9676 (Output_data_exression::Output_data_expression): Adjust call to base
9677 constructor to fix data size.
9678 (Output_section_element_data::set_section_addresses): Register
9679 Output_data_expression object for relaxation clean up.
9680 (struct Input_section_info): Replace Relobj pointer and section index
9681 pair with Output_section::Simple_input_section and Convert struct to a
9682 class.
9683 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9684 Input_section_info data member to use accessors.
20e6d0d6
DK
9685 (Output_section_element_input::set_section_addresses): Use layout
9686 parameter. Adjust code to use Output_section::Simple_input_section
9687 and Input_secction_info classes. Register filler for relaxation
9688 clean up.
9689 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9690 and section index pair with Output_section::Simple_input_section
9691 class. Adjust code accordingly.
9692 (Phdrs_element::release_segment): New method definition.
9693 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9694 segment list.
9695 (Script_sections::release_segments): New method definition.
9696 * gold/script-sections.h (Script_sections::release_segments): New
9697 method declaration.
9698 * gold/target.h (Target::may_relax, Target::relax,
9699 Target::do_may_relax, Target::do_relax): New method definitions.
9700
5e445df6
ILT
97012009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9702
9703 * arm.cc (has_signed_unsigned_overflow): New function.
9704 (Arm_relocate_functions::abs8): New function.
9705 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9706 (Target_arm::Scan::global): Likewise.
9707 (Target_arm::relocate::relocate): Likewise.
9708 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9709 Likewise.
9710
8c604651 97112009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9712
9713 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9714 * testsuite/Makefile.in: Regenerate.
9715
1e9cc1c2
NC
97162009-09-11 Nick Clifton <nickc@redhat.com>
9717
9718 * po/gold.pot: Updated by the Translation project.
9719
6a89f575
CC
97202009-09-08 Cary Coutant <ccoutant@google.com>
9721
9722 * output.cc (Output_file::open): Add execute permission to empty file.
9723 * testsuite/Makefile.am (permission_test): New test.
9724 * testsuite/Makefile.in: Regenerate.
9725
fdcac5af
ILT
97262009-09-02 Ian Lance Taylor <iant@google.com>
9727
9728 * output.cc (Output_file::resize): Call map_no_anonymous rather
9729 than map.
9730
44453f85
ILT
97312009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9732
9733 * gold.cc: Include "incremental.h".
9734 (queue_initial_tasks): Call Incremental_checker methods.
9735 * incremental.cc: Include "output.h".
9736 (Incremental_checker::can_incrementally_link_output_file): New
9737 method.
9738 * incremental.h (Incremental_checker): New class.
9739
9740 * output.cc (Output_file::open_for_modification): New method.
9741 (Output_file::map_anonymous): Changed return type to bool. Record
9742 map in base_ field.
9743 (Output_file::map_no_anonymous): New method, broken out of map.
9744 (Output_file::map): Use map_no_anonymous and map_anonymous.
9745 * output.h (class Output_file): Update declarations.
9746
293c1386
CC
97472009-08-24 Cary Coutant <ccoutant@google.com>
9748
9749 * options.h (Command_line::Pre_options): New class.
9750 (Command_line::pre_options): New member.
9751 * options.cc (gold::options::ready_to_register): New variable.
9752 (One_option::register_option): Do nothing if not registering options.
9753 Assert if same short option registered twice.
9754 (General_options::General_options): Turn off option registration when
9755 done constructing.
9756 (Command_line::Pre_options::Pre_options): New constructor.
9757
f773f3d2
CC
97582009-08-24 Cary Coutant <ccoutant@google.com>
9759
06a73cfe
CC
9760 * options.h (General_options::no_keep_memory): Remove incorrect
9761 short option.
f773f3d2 9762
a15af8e2
RW
97632009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9764
9765 * Makefile.am (am__skiplex, am__skipyacc): New.
9766 * Makefile.in: Regenerate.
9767
c462b41b
RW
97682009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9769
14ec8efd
RW
9770 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9771 (INCLUDES): ... this.
9772 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9773 (AM_CPPFLAGS): Renamed from ...
9774 (INCLUDE): ... this.
9775 * Makefile.in, testsuite/Makefile.in: Regenerate.
9776
81ecdfbb
RW
9777 * Makefile.in: Regenerate.
9778 * aclocal.m4: Likewise.
9779 * config.in: Likewise.
9780 * configure: Likewise.
9781 * testsuite/Makefile.in: Likewise.
9782
c462b41b
RW
9783 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9784 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9785 * Makefile.in: Regenerate.
9786 * testsuite/Makefile.in: Regenerate.
9787
2da73f13
CC
97882009-08-19 Cary Coutant <ccoutant@google.com>
9789
9790 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9791 symbols in shared libraries overridden by hidden or internal symbols
9792 in the main program.
9793
2db70501
CD
97942009-08-19 Chris Demetriou <cgd@google.com>
9795
9796 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9797 checking source file names in error messages.
9798
f733487b
DK
97992009-08-18 Doug Kwan <dougkwan@google.com>
9800
9801 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9802 an elcpp::Ehdr as parameter. Adjust call to set_target.
9803 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9804 an elfcpp::Ehdr as parameter.
9805 * object.cc (Object::set_target): Remove the version that looks up
9806 a target and sets it.
9807 (Sized_relobj::setup): Take a Target object instead of
9808 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9809 (make_elf_sized_object): Find target and ask target to
9810 make an ELF object.
9811 * object.h: (Object::set_target): Remove the version that looks up
9812 a target and sets it.
9813 (Sized_relobj::setup): Take a Target object instead of
9814 an elfcpp:Ehdr as parameter.
9815 * target.cc: Include dynobj.h.
9816 (Target::do_make_elf_object_implementation): New.
2e702c99 9817 (Target::do_make_elf_object): New.
f733487b
DK
9818 * target.h (Target::make_elf_object): New template declaration.
9819 (Target::do_make_elf_object): New method declarations.
9820 (Target::do_make_elf_object_implementation): New template declaration.
9821
cc70f101
ILT
98222009-08-14 Ian Lance Taylor <iant@google.com>
9823
9824 * gold.h (FUNCTION_NAME): Define.
9825 (gold_unreachable): Use FUNCTION_NAME.
9826
ef5e0cb1
ST
98272009-08-12 Sriraman Tallam <tmsriram@google.com>
9828
9829 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9830 symbol in the --keep-unique list is not found.
9831
48c187ce
ST
98322009-08-12 Sriraman Tallam <tmsriram@google.com>
9833
9834 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9835 been maked as --keep-unique.
9836 (Icf::unfold_section): New function.
9837 * icf.h (Icf::unfold_section): New function.
9838 * options.h (General_options::keep_unique): New option.
9839 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9840 * testsuite/Makefile.in: Regenerate.
9841 * testsuite/icf_keep_unique_test.sh: New file.
9842 * testsuite/icf_keep_unique_test.cc: New file.
9843
645afe0c
CC
98442009-08-12 Cary Coutant <ccoutant@google.com>
9845
9846 PR 10471
9847 * resolve.cc (Symbol_table::resolve): Check for references from
9848 dynamic objects to hidden and internal symbols.
9849 * testsuite/Makefile.am (hidden_test.sh): New test.
9850 * testsuite/Makefile.in: Regenerate.
9851 * testsuite/hidden_test.sh: New script.
9852 * testsuite/hidden_test_1.c: New test source.
9853 * testsuite/hidden_test_main.c: New test source.
9854
11af873f
DK
98552009-08-11 Doug Kwan <dougkwan@google.com>
9856
9857 * arm.cc: Update comments.
9858 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9859 segment to locate the .ARM.exidx section if present.
9860
b9f7d72d
DK
98612009-08-09 Doug Kwan <dougkwan@google.com>
9862
9863 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9864 patch.
9865
ddd3c53c
ST
98662009-08-07 Sriraman Tallam <tmsriram@google.com>
9867 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9868 compiler warnings.
9869
27721062
ST
98702009-08-06 Sriraman Tallam <tmsriram@google.com>
9871
9872 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9873 valid tls_segment only for non-debug-section relocations.
9874 * testsuite/Makefile.am: Add gc_tls_test.
9875 * testsuite/Makefile.in: Regenerate.
9876 * testsuite/gc_tls_test.cc: New file.
9877 * testsuite/gc_tls_test.sh: New file.
9878
ef15dade 98792009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9880
ef15dade
ST
9881 * icf.cc: New file.
9882 * icf.h: New file.
9883 * Makefile.am (CCFILES): Add icf.cc.
9884 (HFILES): Add icf.h
9885 * Makefile.in: Regenerate.
9886 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9887 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9888 section, symbol and addend information for the relocs.
9889 * gold.cc (queue_middle_tasks): Call identical code folding.
9890 * gold.h: Add defines for multimap.
9891 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9892 to the call of finalize_local_symbols.
9893 * main.cc (main): Create object of class Icf.
9894 * object.cc (Sized_relobj::do_layout): Allow this function to be
9895 called twice during icf.
9896 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9897 to sections marked as identical by icf.
9898 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9899 when available.
9900 (Sized_relobj::do_section_entsize): New function.
9901 * object.h (Object::section_entsize): New function.
9902 (Object::do_section_entsize): New pure virtual function.
9903 (Relobj::finalize_local_symbols): Add new parameter.
9904 (Relobj::do_section_entsize): New function.
9905 * options.h (General_options::icf): New option.
9906 (General_options::icf_iterations): New option.
9907 (General_options::print_icf_sections): New option.
9908 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9909 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9910 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9911 icf.
9912 * symtab.cc (Symbol_table::is_section_folded): New function.
9913 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9914 to sections marked as identical by icf.
9915 * symtab.h (Symbol_table::set_icf): New function.
9916 (Symbol_table::icf): New function.
9917 (Symbol_table::is_section_folded): New function.
9918 (Symbol_table::icf_): New data member.
9919 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9920 * testsuite/Makefile.am: Add commands to build icf_test.
9921 * testsuite/Makefile.in: Regenerate.
9922 * testsuite/icf_test.sh: New file.
9923 * testsuite/icf_test.cc: New file.
9924
c3b65ac4
CD
99252009-07-24 Chris Demetriou <cgd@google.com>
9926
9927 * layout.cc (is_compressible_debug_section): Fix incorrect
9928 comment about compressed section names.
9929
1caf2c51
ILT
99302009-07-20 Ian Lance Taylor <ian@airs.com>
9931
9932 PR 10419
9933 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9934
1ef4d87f
ILT
99352009-07-16 Ian Lance Taylor <iant@google.com>
9936
9937 PR 10400
9938 * layout.h: #include <map>.
9939 (class Kept_section): Change from struct to class. Add accessors
9940 and setters. Add section size to Comdat_group mapping. Change
9941 Comdat_group to std::map. Add is_comdat_ field. Add
9942 linkonce_size field in union.
9943 (class Layout): Update declaration of find_or_add_kept_section.
9944 Don't declare find_kept_object.
9945 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9946 parameter. Add object, shndx, is_comdat, and is_group_name
9947 parameters. Change all callers. Adjust for new Kept_section.
9948 (Layout::find_kept_object): Remove.
9949 * object.cc (Sized_relobj::include_section_group): Update use of
9950 Kept_section. Rename secnum to shndx. Only record
9951 Kept_comdat_section if sections are the same size.
9952 (Sized_relobj::include_linkonce_section): Update use of
9953 Kept_section. Only record Kept_comdat_section if sections are the
9954 same size. Set size of linkonce section.
9955 (Sized_relobj::map_to_kept_section): Update call to
9956 get_kept_comdat_section.
9957 * object.h (class Sized_relobj): Rename fields in
9958 Kept_comdat_section to drop trailing underscores; change object
9959 field to Relobj*. Change Kept_comdat_section_table to store
9960 struct rather than pointer.
9961 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9962 Add kept_object and kept_shndx parameters. Change all callers.
9963 (Sized_relobj::get_kept_comdat_section): Change return type to
9964 bool. Add kept_object and kept_shndx parameters. Change all
9965 callers.
9966 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9967 Layout::find_or_add_kept_section.
9968
37c3b7b0
ILT
99692009-07-09 Ian Lance Taylor <iant@google.com>
9970
9971 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9972 Reserve space in the hash table.
9973
98fa85cb
ILT
99742009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9975
9976 * fileread.cc (File_read::get_mtime): New method.
9977 * fileread.h (Timespec): New structure.
9978 (File_read::get_mtime): New method.
9979 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9980 Renamed from timestamp_nsec.
9981 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9982 Elf_Xword.
e1df38aa 9983 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9984 timestamp_nsec.
e1df38aa 9985 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9986 (Incremental_inputs::report_obejct): Save mtime; style fix.
9987 (Incremental_inputs::report_script): Save mtime; style fix.
9988 (Incremental_inputs::finalize_inputs): Style fix.
9989 (Incremental_inputs::finalize): Style fix.
9990 (Incremental_inputs::create_input_section_data): Store inputs
9991 mtime.
9992 * incremental.h (Incremental_inputs::report_script): Add mtime
9993 argument.
9994 (Incremental_inputs::Input_info::Input_info): Intialize only one
9995 union member.
9996 (Incremental_inputs::Input_info::archive): Move to nameless
9997 union.
9998 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9999 (Incremental_inputs::Input_info::script): Move to nameless union.
10000 (Incremental_inputs::mtime): New field.
10001 * script.cc (read_input_script): Pass file mtime to
10002 Incremental_input.
10003 * script.h (Script_info::inputs): Style fix.
10004
c9d70757
ILT
100052009-07-01 Ian Lance Taylor <ian@airs.com>
10006
10007 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
10008 instead of 32.
10009
9c547ec3
ILT
100102009-06-24 Ian Lance Taylor <iant@google.com>
10011
10012 PR 10156
10013 * layout.cc (Layout::choose_output_section): If we find an
10014 existing section, update the flags.
10015 (Layout::create_notes): New function, broken out of
10016 Layout::finalize.
10017 (Layout::finalize): Don't create note sections.
10018 (Layout::create_note): Don't crash if linker script discards
10019 section.
10020 (Layout::create_gold_note): Likewise.
10021 (Layout::create_build_id): Likewise. Don't set
10022 after_input_sections on the section.
10023 (Layout::create_executable_stack_info): Remove target parameter.
10024 Change caller.
10025 * layout.h (class Layout): Declare create_notes. Update
10026 declaration of create_executable_stack_info.
10027 * gold.cc (queue_middle_tasks): Call create_notes.
10028 * output.cc (Output_section::update_flags_for_input_section): Move
10029 here from output.h. If SHF_ALLOC flag is newly set, mark address
10030 invalid.
10031 * output.h (Output_data::mark_address_invalid): New function.
10032 (class Output_section): Only declare, not define,
10033 update_flags_for_input_section. Remove set_flags.
10034
55458500
ILT
100352009-06-24 Ian Lance Taylor <iant@google.com>
10036
10037 * script-sections.cc (Output_section_definition::
10038 set_section_addresses): Rename shadowing local load_address to
10039 laddr.
10040
1307d6cd
ILT
100412009-06-24 Ian Lance Taylor <iant@google.com>
10042
10043 PR 10244
10044 * reloc.cc (relocate_sections): Skip empty relocation sections.
10045
ec3f783e
ILT
100462009-06-23 Ian Lance Taylor <iant@google.com>
10047
10048 PR 10156
10049 * layout.cc (Layout::create_note): Use choose_output_section
10050 rather than make_output_section.
10051
459c9f1c
ILT
100522009-06-23 Ian Lance Taylor <iant@google.com>
10053
10054 PR 10237
10055 * options.cc (General_options::parse_V): Set printed_version_.
10056 (General_options::General_options): Initialize printed_version_.
10057 * options.h (class General_options): Add printed_version_ field.
10058 * gold.cc (queue_initial_tasks): If there are no input files,
10059 don't give a fatal error if we printed the version information.
10060 (queue_middle_tasks): If using -r with a shared object, give a
10061 fatal error rather than an ordinary error.
10062
1518dc8f
ILT
100632009-06-23 Ian Lance Taylor <iant@google.com>
10064
10065 PR 10219
10066 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
10067 (Layout::make_output_section): Set have_stabstr_section_ if we see
10068 a .stab*str section.
10069 (Layout::finalize): Call link_stabs_sections.
10070 (Layout::link_stabs_sections): New file.
10071 * layout.h (class Layout): Add have_stabstr_section_ field.
10072 Declare link_stabs_sections.
10073
3d857b98
DK
100742009-06-23 Doug Kwan <dougkwan@google.com>
10075
10076 * Makefile.am (libgold_a_LIBADD): New.
10077 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 10078 * Makefile.in: Regenerate.
3d857b98
DK
10079 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
10080 * configure: Regenerate.
10081 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
10082 * fileread.cc: Include sys/state.h
10083 * gold.h: Declare memmem and strndup if found missing.
10084 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
10085
0639a6f6
ILT
100862009-06-23 Ian Lance Taylor <iant@google.com>
10087
10088 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
10089 * configure: Rebuild.
10090
8d63875c
ILT
100912009-06-23 Ian Lance Taylor <iant@google.com>
10092
10093 PR 10147
10094 * object.cc (Object::section_contents): Don't try to get a view if
10095 the section has length zero.
10096 (Object::handle_gnu_warning_section): If the section is empty, use
10097 the name of the section as the warning.
10098
f7c8a183
ILT
100992009-06-23 Ian Lance Taylor <iant@google.com>
10100
10101 PR 10133
10102 * stringpool.h (class Stringpool_template): Add optimize_ field.
10103 (Stringpool_template::set_optimize): New function.
10104 * stringpool.cc (Stringpool_template::Stringpool_template):
10105 Initialize optimize_ field.
10106 (Stringpool_template::set_string_offsets): Test local optimize
10107 fild rather than parameter.
10108 * layout.cc (Layout::Layout): Call set_optimize on the section
10109 name stringpool.
10110
e6a307ba
ILT
101112009-06-22 Ian Lance Taylor <iant@google.com>
10112
10113 PR 10030
10114 * yyscript.y: Parse TARGET.
10115 * script.cc (script_set_target): New function.
10116 * script-c.h (script_set_target): Declare.
10117 * options.cc (General_options::string_to_object_format): Rename
10118 from string_to_object_format in anonymous namespace. Change
10119 callers.
10120 * options.h (class General_options): Declare
10121 string_to_object_format.
10122
3ee173de
ILT
101232009-06-22 Ian Lance Taylor <iant@google.com>
10124
10125 * script-sections.cc (Script_sections::create_segments): Don't put
10126 program headers in a PT_LOAD segment if -n or -N.
10127
101282009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
10129
10130 PR 10141
10131 * options.h (class General_options): Add -z lazy and -z now. Sort
10132 -z options into alphabetical order.
10133 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
10134
cd6739a1 101352009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
10136
10137 * layout.cc (Layout::make_output_section): Call
10138 Target::new_output_section.
10139 (Layout::attach_allocated_section_to_segment): Put large section
10140 sections in a separate load segment with the large segment flag
10141 set.
10142 (Layout::segment_precedes): Sort large data segments after other
10143 load segments.
10144 (align_file_offset): New static function.
10145 (Layout::set_segment_offsets): Use align_file_offset.
10146 * output.h (class Output_section): Add is_small_section_ and
10147 is_large_section_ fields.
10148 (Output_section::is_small_section): New function.
10149 (Output_section::set_is_small_section): New function.
10150 (Output_section::is_large_section): New function.
10151 (Output_section::set_is_large_section): New function.
10152 (Output_section::is_large_data_section): New function.
10153 (class Output_segment): Add is_large_data_segment_ field.
10154 (Output_segment::is_large_data_segment): New function.
10155 (Output_segment::set_is_large_data_segment): New function.
10156 * output.cc (Output_section::Output_section): Initialize new
10157 fields.
10158 (Output_segment::Output_segment): Likewise.
10159 (Output_segment::add_output_section): Add assertion that large
10160 data sections always go in large data segments. Force small data
10161 sections to the end of the list of data sections. Force small BSS
10162 sections to the start of the list of BSS sections. For large BSS
10163 sections to the end of the list of BSS sections.
10164 * symtab.h (class Symbol): Declare is_common_shndx.
10165 (Symbol::is_defined): Check Symbol::is_common_shndx.
10166 (Symbol::is_common): Likewise.
10167 (class Symbol_table): Define enum Commons_section_type. Update
10168 declarations. Add small_commons_ and large_commons_ fields.
10169 * symtab.cc (Symbol::is_common_shndx): New function.
10170 (Symbol_table::Symbol_table): Initialize new fields.
10171 (Symbol_table::add_from_object): Put small and large common
10172 symbols in the right list.
10173 (Symbol_table::sized_finalized_symbol): Check
10174 Symbol::is_common_shndx.
10175 (Symbol_table::sized_write_globals): Likewise.
10176 * common.cc (Symbol_table::do_allocate_commons): Allocate new
10177 common symbol lists. Don't call do_allocate_commons_list if the
10178 list is empty.
10179 (Symbol_table::do_allocate_commons_list): Remove is_tls
10180 parameter. Add comons_section_type parameter. Change all
10181 callers. Handle small and large common symbols.
10182 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
10183 Symbol::is_common_shndx.
10184 * resolve.cc (symbol_to_bits): Likewise.
10185 * target.h (Target::small_common_shndx): New function.
10186 (Target::small_common_section_flags): New function.
10187 (Target::large_common_shndx): New function.
10188 (Target::large_common_section_flags): New function.
10189 (Target::new_output_section): New function.
10190 (Target::Target_info): Add small_common_shndx, large_common_shndx,
10191 small_common_section_flags, and large_common_section_flags
10192 fields.
10193 (Target::do_new_output_section): New virtual function.
10194 * arm.cc (Target_arm::arm_info): Initialize new fields.
10195 * i386.cc (Target_i386::i386_info): Likewise.
10196 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
10197 Likewise.
10198 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
10199 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10200 (Target_x86_64::do_new_output_section): New function.
10201 * configure.ac: Define conditional MCMODEL_MEDIUM.
10202 * testsuite/Makefile.am (check_PROGRAMS): Add large.
10203 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
10204 (large_LDFLAGS): Define.
10205 * testsuite/large.c: New file.
10206 * testsuite/testfile.cc (Target_test::test_target_info):
10207 Initialize new fields.
10208 * configure, testsuite/Makefile.in: Rebuild.
10209
bb04269c
DK
102102009-06-05 Doug Kwan <dougkwan@google.com>
10211
10212 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 10213 * Makefile.in: Regenerate.
bb04269c
DK
10214 * i386.cc (class Target_i386): Define new virtual method to
10215 override do_is_local_label_name in parent.
10216 * object.cc (Sized_relobj::do_count_local_symbols): Discard
10217 local symbols if --discard-locals or -X is given.
10218 * options.h (class General_options): Declare new options
10219 '--discard-locals' and '-X' for discarding locals.
10220 * target.h (class Target): Define new methods is_local_label_name.
10221 Declare new virtual method do_is_local_label_name.
10222 * target.cc: New file.
10223 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
10224 (check_SCRIPTS): Add discard_locals_test.sh.
10225 (check_DATA): Add discard_local_tests.syms.
10226 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
10227 (discard_local_tests.syms, discard_locals_test.o): New make rules.
10228 * testsuite/Makefile.in: Regenerate.
10229 * testsuite/discard_locals_test.c: New file.
10230 * testsuite/discard_locals_test.sh: Same.
10231
805bb01c
DK
102322009-06-05 Doug Kwan <dougkwan@google.com>
10233
10234 * object.cc (Sized_relobj::Sized_relobj): Initialize
10235 discarded_eh_frame_shndx_ to -1U.
10236 (Sized_relobj::do_layout): Record index of a discard .eh_frame
10237 section.
10238 (Sized_relobj::do_count_local_symbols): Skip local symbols in
10239 a discarded .eh_frame section.
10240 (Sized_relobj::do_finalize_local_symbols): Ditto.
10241 * object.h (class Sized_relobj): Declare new member
10242 discarded_eh_frame_shndx_.
10243 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
10244 (local_labels_test.o, local_labels_test): New rules.
10245 * testsuite/Makefile.in: Regenerate.
10246
1dcd334d
DK
102472009-06-04 Doug Kwan <dougkwan@google.com>
10248
10249 * layout.cc (Layout::section_name_mapping): Add mapping for
10250 special ARM sections.
10251
96d49306
DK
102522009-06-03 Doug Kwan <dougkwan@google.com>
10253
10254 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
10255 (utils::has_overflow): Same.
10256
dff16297
ILT
102572009-06-03 Ian Lance Taylor <iant@google.com>
10258
10259 * layout.cc (Layout::section_name_mapping): New array, replacing
10260 Layout::linkonce_mapping.
10261 (Layout::section_name_mapping_count): New variable, replacing
10262 Layout::linkonce_mapping_count.
10263 (Layout::linkonce_output_name): Remove.
10264 (Layout::output_section_name): Rewrite.
10265 * layout.h (class Layout): Rename Linkonce_mapping to
10266 Section_name_mapping, linkonce_mapping to section_name_mapping,
10267 linkonce_mapping_count to section_name_mapping_count. Don't
10268 declare linkonce_output_name.
10269
c121c671
DK
102702009-06-03 Doug Kwan <dougkwan@google.com>
10271
10272 * gold/arm.cc (namespace utils): New.
10273 (Target_arm::reloc_is_non_pic): Define new method.
10274 (class Arm_relocate_functions): New.
10275 (Target_arm::Relocate::relocate): Handle relocation types used by
10276 Android.
10277
07800fab
ILT
102782009-06-03 Ian Lance Taylor <iant@google.com>
10279
10280 * arm.cc (Target_arm::scan::global): Use || instead of |.
10281
c121c671
DK
102822009-06-02 Doug Kwan <dougkwan@google.com>
10283
10284 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
10285 issued_non_pic_error_.
10286 (class Target_arm::Scan): Declare new method check_non_pic.
10287 Define new method symbol_needs_plt_entry.
10288 Declare new data member issued_non_pic_error_.
10289 (class Target_arm::Relocate): Declare new method
10290 should_apply_static_reloc.
10291 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
10292 (Target_arm::Scan::check_non_pic): Define new method.
10293 (Target_arm::Scan::local): Handle a small subset of reloc types used
10294 by Android.
10295 (Target_arm::Scan::local): Same.
10296 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
10297
b19b0c6d
ILT
102982009-05-31 Mikolaj Zalewski <mikolajz@google.com>
10299
10300 * incremental.cc (Incremental_inputs::report_command_line): Filter
10301 out --incremental-* options.
10302
94cdfcff
DK
103032009-05-29 Doug Kwan <dougkwan@google.com>
10304
10305 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
10306 template class.
10307 (class Target_arm): Update comment.
10308 (Target_arm::Target_arm): Initialize new data members GOT_,
10309 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
10310 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
10311 and Target_arm::rel_dyn_section.
10312 Declare new_enum Target_arm::Got_type.
10313 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
10314 and DYNBSS_.
10315 Update commments for member do_dynsym_value.
10316 (Target_arm::got_size, Target_arm::plt_section,
10317 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
10318 new methods inside class defintion.
10319 (Target_arm::got_section): Define new method.
10320 (Target_arm::rel_dyn_section): Same.
10321 (Output_data_plt_arm): New template class.
10322 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
10323 (Output_data_plt_arm:do_adjust_output_section): Define new method.
10324 (Output_data_plt_arm::add_entry): Same.
10325 (Output_data_plt_arm::first_plt_entry): Define new
10326 static data member for PLT instruction template.
10327 (Output_data_plt_arm::plt_entry): Same.
10328 (Output_data_plt_arm::do_write): Define new method.
10329 (Target_arm::make_plt_entry): Same.
10330 (Target_arm::do_finalize_sections): Same.
10331 (Target_arm::do_dynsym_value): Same.
10332
4a657b0d
DK
103332009-05-28 Doug Kwan <dougkwan@google.com>
10334
10335 * Makefile.am (TARGETSOURCES): Add arm.cc.
10336 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
10337 * Makefile.in: Regenerate.
10338 * arm.cc: New file.
10339 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
10340
e7ae8c36
DK
103412009-05-26 Doug Kwan <dougkwan@google.com>
10342
10343 * options.cc (General_options::parse_exclude_libs). Fix a comment.
10344 (General_options::check_excluded_libs): Strip off directories in
10345 archive name before matching like GNU ld does.
10346 * testsuite/Makefile.am (MOSTLYCLEANFILES,
10347 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
10348 (exclude_libs_test_LDFLAGS): Add linker option
10349 -Wl,--exclude-libs,libexclude_libs_test_3
10350 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
10351 an explicit archive without using -l.
10352 (alt/libexclude_libs_test_3.a): New make rule.
10353 * testsuite/Makefile.in: Regenerate.
10354 * testsuite/exclude_libs_test.c : Declare lib3_default().
10355 (main): Call it.
10356 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10357 * exclude_libs_test_3.c: New file.
10358
f12e7348
NC
103592009-05-26 Nick Clifton <nickc@redhat.com>
10360
10361 * po/id.po: New Indonesian translation.
10362 * po/gold.pot: Updated template file.
10363
4daadc0d
ST
103642009-05-22 Sriraman Tallam <tmsriram@google.com>
10365
e1df38aa 10366 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10367 gc_comdat_test files. Add -Wl,--gc-sections to build
10368 gc_comdat_test.
10369 * testsuite/Makefile.in: Regenerate.
10370 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10371
531813ad
ST
103722009-05-21 Sriraman Tallam <tmsriram@google.com>
10373
10374 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10375 kept comdat section was garbage collected.
10376 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10377 * testsuite/Makefile.in: Regenerate.
10378 * testsuite/gc_comdat_test.sh: New file.
10379 * testsuite/gc_comdat_test_1.cc: New file.
10380 * testsuite/gc_comdat_test_2.cc: New file.
10381
65514900
CC
103822009-05-19 Doug Kwan <dougkwan@google.com>
10383
10384 * archive.cc (Archive::Archive): Move constructor from archive.h
10385 to here. Initialize no_export_.
10386 (Archive::get_elf_object_for_member): Set no_export flag of object.
10387 * archive.h (Archive::Archive): Move constructor body to
10388 archive.cc.
10389 (Archive::no_export): New method.
10390 (Archive::no_export_): New field.
10391 * object.h (Object::Object): Initialize no_export_ to false.
10392 (Object::no_export, Object::set_no_export): New methods.
10393 (Object::no_export_): New field.
10394 * options.cc (General_options::parse_exclude_libs): New method.
10395 (General_options::check_excluded_libs) Same.
10396 * options.h (exclude_libs): New option.
10397 (General_options::check_excluded_libs): New method declaration.
10398 (General_options::excluded_libs_): New field.
10399 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10400 default or protected visibility if an object has no-export flag set.
10401 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10402 (check_SCRIPTS): Add exclude_libs_test.sh.
10403 (check_DATA): Add exclude_libs_test.syms.
10404 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10405 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10406 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10407 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10408 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10409 libexclude_libs_test_2.a): New rules.
10410 * testsuite/Makefile.in: Regenerate.
10411 * testsuite/exclude_libs_test.c: New file.
10412 * testsuite/exclude_libs_test.sh: Ditto.
10413 * testsuite/exclude_libs_test_1.c: Ditto.
10414 * testsuite/exclude_libs_test_2.c: Ditto.
10415
1b77ea50
ILT
104162009-05-15 Ian Lance Taylor <iant@google.com>
10417
10418 * configure.ac: Check for declarations for cases where libiberty.h
10419 checks HAVE_DECL_xxx.
10420 * configure, config.in: Rebuild.
10421
072fe7ce
ILT
104222009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10423
10424 * gold.h (Incremental_argument_list): Remove (invalid) forward
10425 declaration.
10426 * incremental.cc (Incremental_inputs::report_achive): New method.
10427 (Incremental_inputs::report_object): New method.
10428 (Incremental_inputs::report_script): New method.
10429 (Incremental_inputs::finalize_inputs): New method.
10430 (Incremental_inputs::finalize): Call finalize_inputs().
10431 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10432 Create inputs entries.
10433 * incremental.h (Incremental_input_type): New enum.
10434 (Incremental_inputs::Incremental_input): Initialize new fields.
10435 (Incremental_inputs::report_inputs): New method.
10436 (Incremental_inputs::report_achive): New method.
10437 (Incremental_inputs::report_object): New method.
10438 (Incremental_inputs::report_script): New method.
10439 (Incremental_inputs::finalize_inputs): New method.
10440 (Incremental_inputs::Input_info): New struct.
10441 (Incremental_inputs::Input_info_map): New typedef.
10442 (Incremental_inputs::lock_): New field.
10443 (Incremental_inputs::Inputs_): New field.
10444 (Incremental_inputs::Inputs_map): New field.
10445 * main.cc (main): Call Incremental_input::report_inputs.
10446 * options.h (Input_argument_list): Typedef moved from
10447 Input_arguments.
10448 (Input_file_group::Files): Remove, use ::Input_argument_list.
10449 (Input_file_group::Input_argument_list): Remove, use
10450 ::Input_argument_list.
10451 * plugin.cc (Plugin_manager::add_input_file): Add error in
10452 incremental build.
10453 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10454 functions.
10455 * script.cc (read_input_script): Call
10456 Incremental_input::report_script.
10457 * script.h (Script_info): New class.
10458
b0481b0b
ILT
104592009-04-27 Ian Lance Taylor <iant@google.com>
10460
10461 * x86_64.cc (do_adjust_output_section): Set entsize to
10462 plt_entry_size.
10463
b22a5a41 104642009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10465
10466 * output.cc (Output_file::close): After short writes, continue
10467 writing from the correct offset in the buffer being written.
10468
40fde488
CD
104692009-04-23 Chris Demetriou <cgd@google.com>
10470
10471 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10472 * configure: Regenerate.
10473 * config.in: Regenerate.
10474 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10475 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10476
3ce2c28e
ILT
104772009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10478
10479 * incremental.cc (Incremental_inputs_header_data): Renamed from
10480 Incremental_input_header_data.
10481 (Incremental_inputs_header_data::data_size): New field.
10482 (Incremental_inputs_header_data::put_input_file_count): Renamed
10483 from input_file_count.
10484 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10485 from command_line_offset.
10486 (Incremental_inputs_header_data::put_reserved): Renamed from
10487 put_reserved.
10488 (Incremental_inputs_entry_data): Renamed from
10489 Incremental_input_entry_data.
10490 (Incremental_inputs_entry_data::data_size): New field.
10491 (Incremental_inputs::report_command_line): New method.
10492 (Incremental_inputs::finalize): New method.
10493 (Incremental_inputs::create_incremental_inputs_data): New method.
10494 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10495 * incremental.h: New file.
10496 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 10497 (Layout::finalize): Create incremental inputs section in
3ce2c28e 10498 incremental builds.
703d02da 10499 (Layout::create_incremental_info_sections): New method.
3ce2c28e 10500 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
10501 (Layout::create_incremental_info_sections): New method.
10502 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
10503 * main.cc (main): Notify Incremental_input of the command line.
10504
e55bde5e
ILT
105052009-04-01 Ian Lance Taylor <iant@google.com>
10506 Mikolaj Zalewski <mikolajz@google.com>
10507
10508 * gold.h (reserve_unordered_map): Define, three versions, one for
10509 each version of Unordered_map.
10510 * layout.cc (Layout::Layout): Remove options parameter. Add
10511 number_of_input_files parameter. Don't initialize options_.
10512 Initialize number_of_input_files_ and resized_signatures_. Move
10513 sections_are_attached_.
10514 (Layout::layout_group): Reserve space for group_signatures_.
10515 (Layout::find_or_add_kept_section): Change name parameter to be a
10516 reference. Resize signatures_ map when it gets large enough.
10517 (Layout::layout_eh_frame): Use parameters->options() instead of
10518 this->options_.
10519 (Layout::make_output_section): Likewise.
10520 (Layout::attach_allocated_section_to_segment): Likewise.
10521 (Layout::finalize, Layout::create_executable_stack): Likewise.
10522 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10523 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10524 * layout.h (class Layout): Update declarations. Remove options_
10525 field. Add number_of_input_files_ and resized_signatures_
10526 fields. Move sections_are_attached_ field.
10527 * main.cc (main): Pass number of input files to Layout
10528 constructor. Don't pass options.
10529
154b857c
ILT
105302009-03-30 Ian Lance Taylor <iant@google.com>
10531
10532 * ffsll.c (ffsll): Correct implementation.
10533
2f35ab9b
ILT
105342009-03-27 Ian Lance Taylor <iant@google.com>
10535
fd03461a
ILT
10536 * ffsll.c: New file.
10537 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10538 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10539 * ftruncate.c (ftruncate): Declare before definition.
10540 * mremap.c (mremap): Likewise.
10541 * pread.c (pread): Likewise.
10542 * configure, Makefile.in, config.in: Rebuild.
10543
2f35ab9b
ILT
10544 * mremap.c: New file.
10545 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10546 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10547 (mremap): Declare if HAVE_MREMAP is not defined.
10548 * configure, Makefile.in, config.in: Rebuild.
10549
33aea2fd
CC
105502009-03-27 Cary Coutant <ccoutant@google.com>
10551
10552 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10553 position independent.
10554 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10555 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10556
6d479619
CC
105572009-03-24 Cary Coutant <ccoutant@google.com>
10558
10559 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10560 an executable.
10561 (needs_dynamic_reloc): Likewise.
10562
afc06bb8
ILT
105632009-03-24 Ian Lance Taylor <iant@google.com>
10564
10565 * yyscript.y (file_cmd): Recognize EXTERN.
10566 (extern_name_list, extern_name_list_body): New nonterminals.
10567 * script.cc (script_add_extern): Define.
10568 * script-c.h (script_add_extern): Declare.
10569
f6060a4d
ILT
105702009-03-24 Rafael Avila de Espindola <espindola@google.com>
10571
10572 * object.cc (is_elf_object): Define.
10573 * object.h (is_elf_object): Declare.
10574 * archive.cc (Archive::get_elf_object_for_member): Call
10575 is_elf_object.
33aea2fd 10576 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10577
26736d8e
ILT
105782009-03-24 Elliott Hughes <enh@google.com>
10579
10580 * output.cc (Output_file::map_anonymous): Define.
10581 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10582 try an anonymous one. Report the size if the mmap fails.
10583 * output.h (class Output_file): Declare map_anonymous.
10584
22fd9730
ILT
105852009-03-24 Ian Lance Taylor <iant@google.com>
10586
10587 * target-select.cc (instantiate_target): Don't acquire the lock if
10588 the instantiated_target_ field has already been set.
10589
cb010894
ILT
105902009-03-23 Ian Lance Taylor <iant@google.com>
10591
7f055c20
ILT
10592 * gold-threads.h (class Initialize_lock): Define.
10593 * gold-threads.cc (class Initialize_lock_once): Define.
10594 (initialize_lock_control): New static variable.
10595 (initialize_lock_pointer): New static variable.
10596 (initialize_lock_once): New static function.
10597 (Initialize_lock::Initialize_lock): Define.
10598 (Initialize_lock::initialize): Define.
10599 * target-select.h: Include "gold-threads.h".
10600 (class Target_selector): Add lock_ and initialize_lock_ fields.
10601 Don't define instantiate_target, just declare it.
10602 * target-select.cc (Target_selector::Target_selector): Initialize
10603 new fields.
10604 (Target_selector::instantiate_target): Define.
10605 * descriptors.h: Include "gold-threads.h".
10606 (class Descriptors): Add initialize_lock_ field.
10607 * descriptors.cc (Descriptors::Descriptors): Initialize new
10608 field.
10609 (Descriptors::open): Use initialize_lock_ field
10610 * errors.h (class Errors): Add initialize_lock_ field.
10611 * errors.cc (Errors::Errors): Initialize new field.
10612 (Errors::initialize_lock): Use initialize_lock_ field.
10613 * powerpc.cc (class Target_selector_powerpc): Remove
10614 instantiated_target_ field. In do_recognize call
10615 instantiate_target rather than do_instantiate_target. In
10616 do_instantiate_target just allocate a new target.
10617 * sparc.cc (class Target_selector_sparc): Likewise.
10618
36959681
ILT
10619 * freebsd.h: New file.
10620 * i386.cc: Include "freebsd.h".
10621 (Target_i386): Derive from Target_freebsd rather than
10622 Sized_target.
10623 (Target_selector_i386): Derive from Target_selector_freebsd rather
10624 than Target_selector.
10625 * x86_64.cc: Include "freebsd.h".
10626 (Target_x86_64): Derive from Target_freebsd rather than
10627 Sized_target.
10628 (Target_selector_x86_64): Derive from Target_selector_freebsd
10629 rather than Target_selector.
10630 * target.h (class Target): Add adjust_elf_header and
10631 do_adjust_elf_header.
10632 * output.cc (Output_file_header:: do_sized_write): Call target
10633 adjust_elf_header routine.
10634 * configure.tgt: Set targ_osabi.
10635 * configure.ac: Define GOLD_DEFAULT_OSABI.
10636 * parameters.cc (Parameters::default_target): Pass
10637 GOLD_DEFAULT_OSABI to select_target.
10638 * target-select.h (class Target_selector): Make instantiate_target
10639 protected rather than private.
10640 * Makefile.am (HFILES): Add freebsd.h.
10641 * configure, Makefile.in, config.in: Rebuild.
10642
cb010894
ILT
10643 * merge.cc (do_add_input_section): Correct pend value. Change
10644 message about last entry not being null terminated from error to
10645 warning.
10646
0e879927
ILT
106472009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10648
10649 * incremental.cc: New file.
10650 * Makefile.am (CCFILES): Add incremental.cc.
10651 * Makefile.in: Rebuild.
10652
41105937
PP
106532009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10654
10655 * layout.cc (Layout::output_section_name): Preserve names
10656 of '.note.' sections.
e1df38aa 10657
60439920
ILT
106582009-03-19 Ian Lance Taylor <iant@google.com>
10659
10660 * descriptors.cc (Descriptors::open): Check that the options are
10661 valid before using them.
10662
0d371ad3
ILT
106632009-03-18 Ian Lance Taylor <iant@google.com>
10664
10665 * script-sections.h: Include <list>.
10666 (class Script_sections): Change Sections_elements from std::vector
10667 to std::list. Typedef public Elements_iterator. Add
10668 orphan_section_placement_, data_segment_align_start_, and
10669 saw_data_segment_align_ fields. Remove data_segment_align_index_
10670 field.
10671 * script-sections.cc (class Orphan_section_placement): New class.
10672 (class Sections_element): Add virtual functions is_relro and
10673 orphan_section_init. Remove virtual function place_orphan_here.
10674 (class Output_section_definition): Add is_relro and
10675 orphan_section_init. Remove place_orphan_here.
10676 (class Orphan_output_section): Likewise.
10677 (Script_sections::Script_sections): Update for field changes.
10678 (Script_sections::data_segment_align): Set saw_data_segment_align_
10679 and data_segment_align_start_, not data_segment_align_index.
10680 (Script_sections::data_segment_relro_end): Check
10681 saw_data_segment_align_. Use data_segment_align_start_ rather
10682 than data_segment_align_index_.
10683 (Script_sections::place_orphan): Rewrite to use
10684 Orphan_section_placement.
10685
9201d894
ILT
106862009-03-17 Ian Lance Taylor <iant@google.com>
10687
9c5b8369
ILT
10688 * archive.cc (Archive::add_symbols): Check for a version attached
10689 to the symbol name in the archive map.
10690 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10691 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10692 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10693 (ver_test_11.a): New target.
10694 * testsuite/Makefile.in: Rebuild.
10695
9201d894
ILT
10696 * configure.ac: Check for chsize and posix_fallocate. Replace
10697 ftruncate.
10698 * ftruncate.c: New file, from gnulib.
10699 * output.cc (posix_fallocate): Define dummy version if not
10700 HAVE_POSIX_FALLOCATE.
10701 (Output_file::map): Call posix_fallocate rather than lseek and
10702 write.
10703 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10704 * configure, Makefile.in, config.in: Rebuild.
10705
ef4ab7a8 107062009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10707
ef4ab7a8
PP
10708 * layout.h (Layout::create_note): Add section_name parameter.
10709 * layout.cc (Layout::create_note): Likewise.
10710 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10711
8c500701
ILT
107122009-03-17 Ian Lance Taylor <iant@google.com>
10713
e85b18e1
ILT
10714 * descriptors.cc: Include "options.h".
10715 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10716 (Descriptors::open): Always use O_CLOEXEC when opening a new
10717 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10718 then set FD_CLOEXEC.
10719
9efe6174
ILT
10720 * sparc.cc (class Target_sparc): Add has_got_section.
10721 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10722 make sure we have a GOT section.
10723
10724 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10725 (Target_sparc::Scan::local): Likewise.
10726 (Target_sparc::Scan::global): Likewise.
10727 (Target_sparc::Relocate::relocate): Likewise.
10728 (Target_sparc::Relocate::relocate_tls): Likewise.
10729
8c500701
ILT
10730 * symtab.cc (Symbol_table::define_default_version): New function,
10731 broken out of add_from_object.
10732 (Symbol_table::add_from_object): Call define_default_version.
10733 (Symbol_table::define_special_symbol): Add resolve_oldsym
10734 parameter. Change all callers. If the version for a symbol comes
10735 from a version script, resolve it with the symbol with the same
10736 name with no version. Also add the symbol without a version if
10737 appropriate.
10738 (do_define_in_output_data): If resolving with oldsym, don't delete
10739 sym.
10740 (do_define_in_output_segment): Likewise.
10741 (do_define_as_constant): Likewise.
10742 * symtab.h (class Symbol_table): Update declarations.
10743
f1ed28fb
ILT
107442009-03-13 Ian Lance Taylor <iant@google.com>
10745
15f8229b
ILT
10746 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10747 (Read_symbols::requeue): New function.
10748 (Read_symbols::do_read_symbols): If make_elf_object fails because
10749 the target type is not configured, and the file was searched for,
10750 issue a warning and retry with the next directory.
10751 (Add_symbols::run): If the file has an incompatible format, and
10752 it was searched for, requeue the Read_symbols task. On error,
10753 release the object.
10754 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10755 dirindex parameter to constructor. Change all callers. Declare
10756 incompatible_warning and requeue.
10757 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10758 input_argument_ and input_group_ fields. Add them to
10759 constructor. Change all callers.
10760 (class Read_script): Add dirindex_ field. Add it to constructor.
10761 Change all callers.
10762 * archive.cc (Archive::setup): Remove input_objects parameter.
10763 Change all callers.
10764 (Archive::get_file_and_offset): Likewise.
10765 (Archive::read_all_symbols): Likewise.
10766 (Archive::read_symbols): Likewise.
10767 (Archive::get_elf_object_for_member): Remove input_objects
10768 parameter. Add punconfigured parameter. Change all callers.
10769 (Archive::add_symbols): Change return type to bool. Check return
10770 value of include_member.
10771 (Archive::include_all_members): Likewise.
10772 (Archive::include_member): Change return type to bool. Return
10773 false if first included object has incompatible target. Set
10774 included_member_ field.
10775 (Add_archive_symbols::run): If add_symbols returns false, requeue
10776 Read_symbols task.
10777 * archive.h (class Archive): Add included_member_ field.
10778 Initialize it in constructor. Add input_file and searched_for
10779 methods. Update declarations.
10780 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10781 input_argument_ fields. Add them to constructor. Change all
10782 callers.
10783 * script.cc: Include "target-select.h".
10784 (class Parser_closure): Add skip_on_incompatible_target_ and
10785 found_incompatible_target_ fields. Add
10786 skip_on_incompatible_target parameter to constructor. Change all
10787 callers. Add methods skip_on_incompatible_target,
10788 clear_skip_on_incompatible_target, found_incompatible_target, and
10789 set_found_incompatible_target.
10790 (read_input_script): Add dirindex parameter. Change all callers.
10791 If parser finds an incompatible target, requeue Read_symbols
10792 task.
10793 (script_set_symbol): Clear skip_on_incompatible_target in
10794 closure.
10795 (script_add_assertion, script_parse_option): Likewise.
10796 (script_start_sections, script_add_phdr): Likewise.
10797 (script_check_output_format): New function.
10798 * script.h (read_input_script): Update declaration.
10799 * script-c.h (script_check_output_format): Declare.
10800 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10801 (ignore_cmd): Remove OUTPUT_FORMAT.
10802 * fileread.cc (Input_file::Input_file): Add explicit this.
10803 (Input_file::will_search_for): New function.
10804 (Input_file::open): Add pindex parameter. Change all callers.
10805 * fileread.h (class Input_file): Add input_file_argument method.
10806 Declare will_search_for. Update declarations.
10807 * object.cc (make_elf_object): Add punconfigured parameter.
10808 Change all callers.
10809 * object.h (class Object): Make input_file public. Add
10810 searched_for method.
10811 (make_elf_object): Update declaration.
10812 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10813 restart search.
10814 * dirsearch.h (class Dirsearch): Update declaration.
10815 * options.h (class General_options): Add --warn-search-mismatch.
10816 * parameters.cc (Parameters::is_compatible_target): New function.
10817 * parameters.h (class Parameters): Declare is_compatible_target.
10818 * workqueue.cc (Workqueue::add_blocker): New function.
10819 * workqueue.h (class Workqueue): Declare add_blocker.
10820
f1ed28fb
ILT
10821 * fileread.cc (Input_file::open): Remove options parameter.
10822 Change all callers.
10823 (Input_file::open_binary): Likewise.
10824 * script.cc (read_input_script): Likewise.
10825 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10826 options parameter from constructor. Change all callers.
10827 (class Read_script): Likewise.
10828 * fileread.h (class Input_file): Update declarations.
10829 * script.h (read_input_script): Update declaration.
10830
34dd024a
NC
108312009-03-10 Nick Clifton <nickc@redhat.com>
10832
10833 * po/es.po: New Spanish translation.
10834
6d71b17c
CC
108352009-03-06 Cary Coutant <ccoutant@google.com>
10836
10837 * options.cc (parse_short_option): Keep dash_z from registering itself.
10838
031cdbed
ILT
108392009-03-03 Ian Lance Taylor <iant@google.com>
10840
10841 PR 9918
10842 * target-reloc.h (relocate_section): Pass output_section to
10843 relocate.
10844 * i386.cc (Target_i386::should_apply_static_reloc): Add
10845 output_section parameter. Change all callers.
10846 (Target_i386::Relocate::relocate): Add output_section parameter.
10847 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10848 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10849 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10850 * testsuite/two_file_shared.sh: New script.
10851 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10852 (check_DATA): Add two_file_shared.dbg.
10853 (two_file_shared.dbg): New target.
10854 * testsuite/Makefile.in: Rebuild.
10855
15d5fa16
ILT
108562009-03-01 Ian Lance Taylor <iant@google.com>
10857
10858 * configure.ac: Check for byteswap.h.
10859 * configure: Rebuild.
10860 * config.in: Rebuild.
10861
8a4c0b0d
ILT
108622009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10863
10864 * layout.cc (Layout::find_or_add_kept_section): New function.
10865 (Layout::add_comdat): Removed.
10866 * layout.h (struct Kept_section): Move out of class Layout.
10867 Remove trailing underscores from field names. Add group_sections
10868 field. Rename group_ field to is_group. Change all uses.
10869 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10870 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10871 comdat_groups_ field.
10872 (Sized_relobj::include_section_group): Use
10873 find_or_add_kept_section and Kept_section::group_sections.
10874 (Sized_relobj::include_linkonce_section): Likewise.
10875 * object.cc (class Sized_relobj): Don't define Comdat_group or
10876 Comdat_group_table. Remove find_comdat_group and
10877 add_comdat_group. Remove comdat_groups_ field.
10878 * plugin.cc (include_comdat_group): Use
10879 Layout::find_or_add_kept_section.
10880
b4ecf66b
ILT
108812009-02-28 Ian Lance Taylor <iant@google.com>
10882
14359ca0
ILT
10883 * README: --gc-sections and map files are now supported. Document
10884 some build requirements.
10885
b4ecf66b
ILT
10886 PR 6992
10887 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10888 relocatable link set the value of the section symbol to zero.
10889 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10890 relocatable link don't include the section address in the local
10891 symbol value.
10892
0602e05a
ILT
108932009-02-27 Ian Lance Taylor <iant@google.com>
10894
fd9d194f
ILT
10895 PR 6811
10896 * options.h (class Search_directory): Add is_system_directory.
10897 (class General_options): Declare is_in_system_directory.
10898 * options.cc (get_relative_sysroot): Make static.
10899 (get_default_sysroot): Make static.
10900 (General_optoins::is_in_system_directory): New function.
10901 * fileread.cc (Input_file::is_in_system_directory): New function.
10902 * fileread.h (class Input_file): Declare is_in_system_directory.
10903 * object.h (class Object): Add is_in_system_directory.
10904 (class Input_objects): Remove system_library_directory_ field.
10905 * object.cc (Input_objects::add_object): Don't set
10906 system_library_directory_.
10907 (input_objects::found_in_system_library_directory): Remove.
10908 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10909 parameter. Change all callers.
10910 (Symbol_table::sized_write_globals): Likewise.
10911 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10912 Call Object::is_in_system_directory.
10913 * symtab.h (class Symbol_table): Update declarations.
10914
61edd21f
ILT
10915 PR 5990
10916 * descriptors.h (Open_descriptor): Add is_on_stack field.
10917 * descriptors.cc (Descriptors::open): If the descriptor is on the
10918 top of the stack, remove it. Initialize is_on_stack field.
10919 (Descriptors::release): Only add pod to stack if it is not on the
10920 stack already.
10921 (Descriptors::close_some_descriptor): Clear stack_next and
10922 is_on_stack fields.
10923
e29e076a
ILT
10924 PR 7091
10925 * output.cc (Output_section::find_starting_output_address): Rename
10926 from starting_output_address; add PADDR parameter; change return
10927 type.
10928 * output.h (class Output_section): Declare
10929 find_starting_output_address instead of starting_output_address.
10930 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10931 section symbol for which we can't find a merge section.
10932
0602e05a
ILT
10933 PR 9836
10934 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10935 hidden or internal, force the symbol to be local.
10936 * resolve.cc (Symbol::override_visibility): Define.
10937 (Symbol::override_base): Use override_visibility.
10938 (Symbol_table::resolve): Likewise.
10939 (Symbol::override_base_with_special): Likewise.
10940 (Symbol_table::override_with_special): If the visibility is hidden
10941 or internal, force the symbol to be local.
10942 * symtab.h (class Symbol): Add set_visibility and
10943 override_visibility.
10944 * testsuite/ver_test_1.sh: New file.
10945 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10946 (check_DATA): Add ver_test_1.syms.
10947 (ver_test_1.syms): New target.
10948 * testsuite/Makefile.in: Rebuild.
10949
401a9a73
CC
109502009-02-25 Cary Coutant <ccoutant@google.com>
10951
10952 * layout.cc (Layout::choose_output_section): Don't rename sections
10953 when using a linker script that has a SECTIONS clause.
10954 * Makefile.in: Regenerate.
10955
10956 * testsuite/Makefile.am (script_test_5.sh): New test case.
10957 * testsuite/Makefile.in: Regenerate.
10958 * testsuite/script_test_5.cc: New file.
10959 * testsuite/script_test_5.sh: New file.
10960 * testsuite/script_test_5.t: New file.
10961
f488e4b0
CC
109622009-02-13 Rafael Avila de Espindola <espindola@google.com>
10963
10964 * archive.cc (Archive::include_member): Update calls to add_symbols.
10965 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10966 the Layout argument.
10967 * dynobj.h (do_add_symbols): Add the Layout argument.
10968 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10969 Layout argument.
10970 * object.h (Object::add_symbols): Add the Layout argument.
10971 (Object::do_add_symbols): Add the Layout argument.
10972 (Sized_relobj::do_add_symbols): Add the Layout argument.
10973 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10974 Unify the two versions.
10975 (Add_plugin_symbols): Remove.
10976 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10977 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10978 (Add_plugin_symbols): Remove.
10979 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10980 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10981 (Add_symbols::run): Make it work with Pulginobj.
10982
89dd1680
ILT
109832009-02-06 Ian Lance Taylor <iant@google.com>
10984
10985 * object.cc (Sized_relobj::do_layout): Make info message start
10986 with lower case letter.
10987
266d0a74
ILT
109882009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10989
602b464e
ILT
10990 * binary.cc: Fix file comment.
10991
266d0a74
ILT
10992 * options.h (enum Incremental_disposition): Define.
10993 (class General_options): Add new options: --incremental,
10994 --incremental_changed, --incremental_unchanged,
10995 --incremental_unknown. Add incremental_disposition_ and
10996 implicit_incremental_ fields.
10997 (General_options::incremental_disposition): New function.
10998 (class Position_dependent_options): Add incremental_disposition
10999 option.
11000 (Position_dependent_options::copy_from_options): Set incremental
11001 dispositions.
11002 * options.cc (General_options::parse_incremental_changed): New
11003 function.
2e702c99
RM
11004 (General_options::parse_incremental_unchanged): New function.
11005 (General_options::parse_incremental_unknown): New function.
11006 (General_options::General_options): Initialize new fields
266d0a74 11007 incremental_disposition_ and implicit_incremental_.
2e702c99 11008 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
11009 without --incremental.
11010
f073bbf7
CD
110112009-02-06 Chris Demetriou <cgd@google.com>
11012
11013 * gold.h (gold_undefined_symbol): Change to take only a Symbol
11014 pointer and to report location as the file name associated with
11015 the symbol.
11016 (gold_undefined_symbol_at_location): New function to replace the
11017 old gold_undefined_symbol functionality.
11018 * target-reloc.h (relocate_section): Update to use
11019 gold_undefined_symbol_at_location.
11020 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11021 Call gold_undefined_symbol function rather than gold_error.
11022 * errors.h (Errors::undefined_symbol): Take location as a
11023 string, rather than calculating it from a relocation.
11024 * errors.cc (Errors::fatal): Print "fatal error:" before the
11025 formatted message.
11026 (Errors::error, Errors::error_at_location): Print "error: "
11027 before the formatted message.
11028 (Errors::undefined_symbol): Take location as a string, rather
11029 than calculating it from a relocation.
11030 (gold_undefined_symbol_at_location): New function akin to
11031 old gold_undefined_symbol, calculates location from relocation.
11032 (gold_undefined_symbol): Change to take only a Symbol pointer
11033 and to report location as the file name associated with the symbol.
11034 * testsuite/debug_msg.sh: Update for changed error messages.
11035 * testsuite/undef_symbol.sh: Likewise.
11036
8e94a90c
ILT
110372009-02-04 Duncan Sands <baldrick@free.fr>
11038
11039 PR 9812
11040 * reduced_debug_output.h
11041 (Output_reduced_debug_abbrev_section::failed): Use format for
11042 gold_warning.
11043 (Output_reduced_debug_info_section::faild): Likewise.
11044
88a0e15b
ILT
110452009-01-31 Mikolaj Zalewski <mikolajz@google.com>
11046
11047 * script.cc (Lazy_demangler): New class.
2e702c99 11048 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
11049 symbol only once.
11050
5efc7cd2
CC
110512009-01-29 Cary Coutant <ccoutant@google.com>
11052
11053 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
11054 to __tls_get_addr.
11055 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
11056
e0ebcf42
ILT
110572009-01-28 Ian Lance Taylor <iant@google.com>
11058
5efc7cd2 11059 * version.cc (version_string): Bump to 1.9.
75fe7426 11060
e0ebcf42
ILT
11061 * gold.h: Include <cstring> and <stdint.h>.
11062 * version.cc: Include <cstdio>.
11063 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
11064 warning.
11065 * reduced_debug_output.cc (insert_into_vector): Rename from
11066 Insert_into_vector; change all callers. Use Swap_unaligned to
11067 avoid aliasing issue; remove union since it is unnecessary.
11068
8e2813be 110692009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
11070
11071 * Makefile.am (CCFILES): Add gc.cc.
11072 (HFILES): Add gc.h.
11073 * Makefile.in: Regenerate.
11074 * gold.cc (Gc_runner): New class.
11075 (queue_initial_tasks): Call garbage collection related tasks
11076 when corresponding options are invoked.
11077 (queue_middle_gc_tasks): New function.
11078 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
11079 processed early before laying out sections during garbage collection.
11080 * gold.h (queue_middle_gc_tasks): New function.
11081 (is_prefix_of): Move from "layout.cc".
11082 * i386.cc (Target_i386::gc_process_relocs): New function.
11083 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
11084 * main.cc (main): Create object of class "Garbage_collection".
11085 * object.cc (Relobj::copy_symbols_data): New function.
11086 (Relobj::is_section_name_included): New function.
e1df38aa
NC
11087 (Sized_relobj::do_layout): Allow this function to be called twice
11088 during garbage collection and defer layout of section during the
6d03d481
ST
11089 first call.
11090 * object.h (Relobj::get_symbols_data): New function.
11091 (Relobj::is_section_name_included): New function.
11092 (Relobj::copy_symbols_data): New function.
11093 (Relobj::set_symbols_data): New function.
11094 (Relobj::get_relocs_data): New function.
11095 (Relobj::set_relocs_data): New function.
11096 (Relobj::is_output_section_offset_invalid): New pure virtual function.
11097 (Relobj::gc_process_relocs): New function.
11098 (Relobj::do_gc_process_relocs): New pure virtual function.
11099 (Relobj::sd_): New data member.
11100 (Sized_relobj::is_output_section_offset_invalid): New function.
11101 (Sized_relobj::do_gc_process_relocs): New function.
11102 * options.h (General_options::gc_sections): Modify to not be a no-op.
11103 (General_options::print_gc_sections): New option.
11104 * plugin.cc (Plugin_finish::run): Remove function call to
11105 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
11106 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
11107 * reloc.cc (Read_relocs::run): Add task to process relocs and
11108 determine unreferenced sections when doing garbage collection.
11109 (Gc_process_relocs): New class.
11110 (Sized_relobj::do_gc_process_relocs): New function.
11111 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
11112 sections that are garbage collected.
11113 * reloc.h (Gc_process_relocs): New class.
11114 * sparc.cc (Target_sparc::gc_process_relocs): New function.
11115 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
11116 symbols whose corresponding sections are garbage collected.
11117 (Symbol_table::Symbol_table): Add new parameter for the garbage
11118 collection object.
11119 (Symbol_table::gc_mark_undef_symbols): New function.
11120 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11121 (Symbol_table::gc_mark_dyn_syms): New function.
11122 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
11123 as garbage.
11124 (Symbol_table::add_from_object): Likewise.
11125 (Symbol_table::add_from_relobj): When building shared objects, do not
11126 treat externally visible symbols as garbage.
11127 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
11128 table information for static and relocatable links.
11129 * symtab.h (Symbol_table::set_gc): New function.
11130 (Symbol_table::gc): New function.
11131 (Symbol_table::gc_mark_undef_symbols): New function.
11132 (Symbol_table::gc_mark_symbol_for_shlib): New function.
11133 (Symbol_table::gc_mark_dyn_syms): New function.
11134 (Symbol_table::gc_): New data member.
e1df38aa 11135 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
11136 function.
11137 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
11138 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
11139
3b293544
CF
111402009-01-20 Chris Faylor <me.sourceware@sourceware.org>
11141
11142 * options.h (General_options::gc_sections): Define as a no-op for now.
11143 (General_options::no_keep_memory): Ditto.
11144 (General_options::Bshareable): Define.
11145 * options.cc (General_options::finalize): Honor -Bshareable.
11146
83d22aa8
AS
111472009-01-20 Andreas Schwab <schwab@suse.de>
11148
11149 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
11150 read the value in the contents, since we don't use it. Use the
11151 template endianness when writing.
11152 (Relocate::relocate): Use it for R_PPC_REL16_HA.
11153
cd536b21
AS
111542009-01-19 Andreas Schwab <schwab@suse.de>
11155
11156 * configure.tgt (powerpc64-*): Fix targ_obj.
11157
99e9a495
ILT
111582009-01-15 Ian Lance Taylor <iant@google.com>
11159
11160 * object.cc (Sized_relobj::write_local_symbols): Don't write out
11161 local symbols when stripping all symbols.
11162
bbbfea06
CC
111632009-01-14 Cary Coutant <ccoutant@google.com>
11164
99e9a495 11165 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 11166
0f7c0701
CC
111672009-01-14 Cary Coutant <ccoutant@google.com>
11168
11169 * archive.cc (Archive::get_elf_object_for_member): Remove call
11170 to File_read::claim_for_plugin.
11171 * descriptors.cc (Descriptors::open): Remove reference to
11172 is_claimed.
11173 (Descriptors::claim_for_plugin): Remove.
11174 * descriptors.h (Descriptors::claim_for_plugin): Remove.
11175 (Descriptors::is_claimed): Remove.
11176 (claim_descriptor_for_plugin): Remove.
11177 * fileread.cc (File_read::claim_for_plugin): Remove.
11178 * fileread.h (File_read::claim_for_plugin): Remove.
11179 (File_read::descriptor): Reopen descriptor if necessary.
11180 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
11181 (Plugin_manager::all_symbols_read): Add task parameter. Change
11182 all callers.
11183 (Plugin_manager::get_input_file): New function.
11184 (Plugin_manager::release_input_file): New function.
11185 (Pluginobj::Pluginobj): Add filesize parameter and initialize
11186 corresponding data member.
11187 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
11188 and pass to base constructor. Change all callers.
11189 (get_input_file, release_input_file): New functions.
11190 (make_sized_plugin_object): Add filesize parameter. Change all callers.
11191 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
11192 (Plugin_manager::all_symbols_read): Add task parameter.
11193 (Plugin_manager::get_input_file): New function.
11194 (Plugin_manager::release_input_file): New function.
11195 (Plugin_manager::task_): New data member.
11196 (Pluginobj::Pluginobj): Add filesize parameter.
11197 (Pluginobj::filename): New function.
11198 (Pluginobj::descriptor): New function.
11199 (Pluginobj::filesize): New function.
11200 (Pluginobj::filesize_): New data member.
11201 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
11202 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
11203 File_read::claim_for_plugin; use Object::unlock to unlock the file.
11204
11205 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
11206 with archive libraries.
11207 * testsuite/Makefile.in: Regenerate.
11208 * testsuite/plugin_test.c (struct sym_info): New type.
11209 (get_input_file, release_input_file): New static variables.
11210 (onload): Capture new transfer vector entries.
11211 (claim_file_hook): Stop reading at end of file according to filesize.
11212 Factor out parsing of readelf output into separate function.
11213 (all_symbols_read_hook): Exercise get_input_file and release_input_file
11214 APIs and get the source file name from the symbol table. Convert
11215 source file name to corresponding object file name. Print info
11216 message when adding new input files.
11217 (parse_readelf_line): New function.
11218 * testsuite/plugin_test_1.sh: Add checks for new info messages.
11219 * testsuite/plugin_test_2.sh: Likewise.
11220 * testsuite/plugin_test_3.sh: Likewise.
11221 * testsuite/plugin_test_4.sh: New test case.
11222
62a6d109
ILT
112232009-01-07 Ian Lance Taylor <iant@google.com>
11224
11225 * version.cc (version_string): Bump to 1.8.
11226
483620e8
CC
112272008-12-23 Cary Coutant <ccoutant@google.com>
11228
11229 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
11230 * plugin.cc (Plugin_manager::finish): Rename as
11231 layout_deferred_objects. Move cleanup to separate function.
11232 (Plugin_manager::cleanup): New function.
11233 (Plugin_finish::run): Call layout_deferred_objects and cleanup
11234 separately.
11235 * plugin.h (Plugin_manager::finish): Rename as
11236 layout_deferred_objects.
11237 (Plugin_manager::cleanup): New function.
11238 (Plugin_manager::cleanup_done): New field.
11239
d66a9eb3
CC
112402008-12-23 Cary Coutant <ccoutant@google.com>
11241
11242 * plugin.cc (is_visible_from_outside): New function.
11243 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
11244 so we don't return "IR only" status for exported symbols or -r links.
11245
11246 * testsuite/Makefile.am (plugin_test_3): New test case.
11247 * testsuite/Makefile.in: Regenerate.
11248 * testsuite/plugin_test_3.sh: New file.
11249
5995b570
CC
112502008-12-22 Cary Coutant <ccoutant@google.com>
11251
11252 * object.cc (Sized_relobj::layout_section): New function.
11253 (Sized_relobj::do_layout): Defer layout of input sections until after
11254 plugin has provided replacement files.
11255 (Sized_relobj::do_layout_deferred_sections): New function.
11256 * object.h (Relobj::set_section_offset): Remove virtual keyword.
11257 (Relobj::layout_deferred_sections): New function.
11258 (Relobj::do_layout_deferred_sections): New function.
11259 (Sized_relobj::do_layout_deferred_sections): New function.
11260 (Sized_relobj::layout_section): New function.
11261 (Sized_relobj::Deferred_layout): New structure.
11262 (Sized_relobj::deferred_layout_): New field.
11263 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
11264 Change all callers. Layout deferred sections.
11265 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
11266 references.
11267 (Plugin_hook::run): Move code from do_plugin_hook inline.
11268 (Plugin_hook::do_plugin_hook): Remove.
11269 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
11270 (Plugin_manager::finish): Renamed, was cleanup.
11271 (Plugin_manager::should_defer_layout): New function.
11272 (Plugin_manager::add_deferred_layout_object): New function.
11273 (Plugin_manager::Deferred_layout_list): New type.
11274 (Plugin_manager::deferred_layout_objects_): New field.
11275 (Plugin_hook::do_plugin_hook): Remove.
11276
ee769c88
ILT
112772008-12-17 Ian Lance Taylor <iant@google.com>
11278
11279 * options.h (class General_options): Add --no case for
11280 --export-dynamic.
11281
abc8dcba
CC
112822008-12-16 Cary Coutant <ccoutant@google.com>
11283
11284 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
11285 vector.
11286 (Plugin_manager::claim_file): Create plugin object even if
11287 plugin did not call the add_symbols callback.
11288 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
11289 asking for more symbols than were added.
11290 * testsuite/Makefile.am (plugin_test_1): Add test case with
11291 no global symbols.
11292 (empty.syms): New target.
11293 * testsuite/Makefile.in: Regenerate.
11294 * testsuite/plugin_test.c (claim_file_hook): Add new debug
11295 message. Don't call add_symbols if no globals.
11296 (all_symbols_read_hook): Don't provide replacement for empty
11297 claimed file.
11298
b0074644
ILT
112992008-12-12 Ian Lance Taylor <iant@google.com>
11300
68943102
ILT
11301 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
11302 r_type == 0 for a local symbol with r_sym == 0.
11303 (scan_relocatable_relocs): Pass r_sym to
11304 local_non_section_strategy.
11305 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
11306 r_sym parameter.
11307
b0074644
ILT
11308 * configure.ac: Update test for TLS descriptors: they are
11309 supported as of glibc 2.9.
11310 * configure: Rebuild.
11311
c2508178
ILT
113122008-12-11 Ian Lance Taylor <iant@google.com>
11313
11314 PR 7091
11315 * target-reloc.h (Default_scan_relocatable_relocs): For each
11316 function, map r_type == 0 to RELOC_DISCARD.
11317
2756a258
CC
113182008-12-10 Cary Coutant <ccoutant@google.com>
11319
11320 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
11321 object to override a kept COMDAT group from a plugin object.
11322
bb6f53d3
ILT
113232008-12-09 Ian Lance Taylor <iant@google.com>
11324
fbc558e1
ILT
11325 PR 7088
11326 * yyscript.y (file_cmd): Handle INPUT.
11327
bb6f53d3
ILT
11328 * testsuite/initpri1.c: Change all declarations to be full
11329 prototypes by adding void, to avoid compiler warnings.
11330
4674ecfc
CC
113312008-12-05 Rafael Avila de Espindola <espindola@google.com>
11332
11333 * options.cc (General_options::parse_plugin_opt): New.
11334 (General_options::add_plugin): The argument now is just the filename.
11335 (General_options::add_plugin_option): New.
11336 * options.h (plugin_opt): New.
11337 (add_plugin): Change argument name.
11338 (add_plugin_option): New.
11339 * plugin.cc (Plugin::load): Don't parse the plugin option.
11340 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
11341 (Plugin::add_option): New.
11342 (Plugin::args_): Change type.
11343 (Plugin::filename_): New.
11344 (Plugin_manager::add_plugin_option): New.
11345 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
11346 * testsuite/Makefile.in: Regenerate.
11347
fd06b4aa
CC
113482008-12-05 Cary Coutant <ccoutant@google.com>
11349
11350 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
11351 Handle --strip-lto-sections option.
11352 * options.h (strip_lto_sections): New option.
11353
6c52134c
CC
113542008-12-01 Cary Coutant <ccoutant@google.com>
11355
11356 * plugin.cc (ld_plugin_message): Change format parameter to const.
11357 Fix mismatch between new[] and delete.
11358
a45248e0
CC
113592008-11-14 Cary Coutant <ccoutant@google.com>
11360
11361 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11362 instead of -1U.
11363
c82fbeee
CS
113642008-11-05 Craig Silverstein <csilvers@google.com>
11365
11366 * options.cc (General_options::parse_dynamic_list): New function.
11367 * options.h (General_options): New flags dynamic_list,
11368 dynamic_list_data, dynamic_list_cpp_new, and
11369 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11370 (General_options::in_dynamic_list): New function.
11371 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11372 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11373 (Lex::can_continue_name): Likewise.
11374 (yylex): Likewise.
11375 (read_script_file): New parameter script_options.
11376 (read_dynamic_list): New function.
11377 (Script_options::define_dynamic_list): New function.
11378 (dynamic_list_keyword_parsecodes): New variable.
11379 (dynamic_list_keywords): New variable.
11380 * script.h (Script_options::define_dynamic_list): New function
11381 prototype.
11382 (read_dynamic_list): New function prototype.
11383 * symtab.cc (strprefix): New macro.
11384 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11385 dynamic_list_data, dynamic_list_cpp_new, and
11386 dynamic_list_cpp_typeinfo.
11387 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11388 (dynamic_list_expr): New rule.
11389 (dynamic_list_nodes): Likewise.
11390 (dynamic_list_node): Likewise.
11391 * testsuite/Makefile.am (dynamic_list): New test.
11392 * testsuite/Makefile.in: Regenerated.
11393 * testsuite/dynamic_list.t: New file.
11394 * testsuite/dynamic_list.sh: New file.
11395
e0bb29a5
CS
113962008-11-05 Craig Silverstein <csilvers@google.com>
11397
11398 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11399 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11400 (t11_last): Likewise.
11401 * testsuite/ver_test_6.c (main): Likewise.
11402
4e1e25e0
CC
114032008-10-07 Cary Coutant <ccoutant@google.com>
11404
11405 * options.c (General_options::finalize): Add check for -static and
11406 -shared.
11407 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11408 is not empty.
11409
92f03fcb
CC
114102008-10-02 Cary Coutant <ccoutant@google.com>
11411
11412 * plugin.cc (make_sized_plugin_object): Fix conditional
11413 compilation to work when not all targets are enabled.
11414
fbd8a257
CC
114152008-09-29 Cary Coutant <ccoutant@google.com>
11416
11417 * archive.cc (Archive::get_file_and_offset): Use filename instead
11418 of name to get library path.
11419 (Archive::include_member): Unlock external member of a thin archive.
11420
11421 * testsuite/Makefile.am (TEST_AR): New variable.
11422 (thin_archive_test_1): New test.
11423 (thin_archive_test_2): New test.
81636b3f
CC
11424 * testsuite/Makefile.in: Regenerate.
11425 * testsuite/thin_archive_main.cc: New file.
11426 * testsuite/thin_archive_test_1.cc: New file.
11427 * testsuite/thin_archive_test_2.cc: New file.
11428 * testsuite/thin_archive_test_3.cc: New file.
11429 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11430
eff45813
CC
114312008-09-29 Cary Coutant <ccoutant@google.com>
11432
11433 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11434 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11435 instead of -1U.
11436 (Sized_relobj::do_finalize_local_symbols): Likewise.
11437 (Sized_relobj::map_to_kept_section): Likewise.
11438 * object.h (Sized_relobj::invalid_address): New constant.
11439 (Sized_relobj::do_output_section_offset): Check for invalid_address
11440 and return -1ULL.
11441 * output.cc (Output_reloc::local_section_offset): Use constant
11442 invalid_address instead of -1U.
11443 (Output_reloc::get_address): Likewise.
11444 (Output_section::output_address): Change -1U to -1ULL.
11445 * output.h (Output_reloc::invalid_address): New constant.
11446 * reloc.cc (Sized_relobj::write_sections): Use constant
11447 invalid_address instead of -1U.
11448 (Sized_relobj::relocate_sections): Likewise.
11449 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11450 values for merge sections.
11451 * target-reloc.h (relocate_for_relocatable): Use constant
11452 invalid_address instead of -1U.
11453
89fc3421
CC
114542008-09-19 Cary Coutant <ccoutant@google.com>
11455
11456 Add plugin functionality for link-time optimization (LTO).
11457 * configure.ac (plugins): Add --enable-plugins option.
11458 * configure: Regenerate.
11459 * config.in: Regenerate.
11460 * Makefile.am (LIBDL): New variable.
11461 (CCFILES): Add plugin.cc.
11462 (HFILES): Add plugin.h.
11463 (ldadd_var): Add LIBDL.
11464 * Makefile.in: Regenerate.
11465
11466 * archive.cc: Include "plugin.h".
11467 (Archive::setup): Don't preread archive symbols when using a plugin.
11468 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11469 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11470 files.
11471 (Archive::include_member): Add symbols from plugin objects.
11472 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11473 * descriptors.cc (Descriptors::open): Check for file descriptors
11474 abandoned by plugins.
11475 (Descriptors::claim_for_plugin): New function.
11476 * descriptors.h (Descriptors::claim_for_plugin): New function.
11477 (Open_descriptor::is_claimed): New field.
11478 (claim_descriptor_for_plugin): New function.
11479 * fileread.cc (File_read::claim_for_plugin): New function.
11480 * fileread.h (File_read::claim_for_plugin): New function.
11481 (File_read::descriptor): New function.
11482 * gold.cc: Include "plugin.h".
11483 (queue_initial_tasks): Add task to call plugin hooks for generating
11484 new object files.
11485 * main.cc: Include "plugin.h".
11486 (main): Load plugin libraries.
11487 * object.h (Pluginobj): Declare.
11488 (Object::pluginobj): New function.
11489 (Object::do_pluginobj): New function.
11490 (Object::set_target): New function.
11491 * options.cc: Include "plugin.h".
11492 (General_options::parse_plugin): New function.
11493 (General_options::General_options): Initialize plugins_ field.
11494 (General_options::add_plugin): New function.
11495 * options.h (Plugin_manager): Declare.
11496 (General_options): Add --plugin option.
11497 (General_options::has_plugins): New function.
11498 (General_options::plugins): New function.
11499 (General_options::add_plugin): New function.
11500 (General_options::plugins_): New field.
11501 * plugin.cc: New file.
11502 * plugin.h: New file.
11503 * readsyms.cc: Include "plugin.h".
11504 (Read_symbols::do_read_symbols): Check for archive before checking
11505 for ELF file. Call plugin hooks to claim files.
11506 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11507 from a real object file; force override when processing replacement
11508 files.
11509 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11510 (Symbol::init_base_object): Likewise.
11511 (Symbol::init_base_output_data): Likewise.
11512 (Symbol::init_base_output_segment): Likewise.
11513 (Symbol::init_base_constant): Likewise.
11514 (Symbol::init_base_undefined): Likewise.
11515 (Symbol::output_section): Assert that object is not a plugin.
11516 (Symbol_table::add_from_pluginobj): New function.
11517 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11518 undefined.
11519 (Symbol_table::sized_write_globals): Likewise.
11520 (Symbol_table::add_from_pluginobj): Instantiate template.
11521 * symtab.h (Sized_pluginobj): Declare.
11522 (Symbol::in_real_elf): New function.
11523 (Symbol::set_in_real_elf): New function.
11524 (Symbol::in_real_elf_): New field.
11525 (Symbol_table::add_from_pluginobj): New function.
11526
11527 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11528 (LIBDL): New variable.
11529 (LDADD): Add LIBDL.
11530 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11531 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11532 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11533 (MOSTLYCLEANFILES): Likewise.
11534 * testsuite/Makefile.in: Regenerate.
11535 * testsuite/plugin_test.c: New file.
11536 * testsuite/plugin_test_1.sh: New file.
11537 * testsuite/plugin_test_2.sh: New file.
11538
de31bda5
ILT
115392008-09-16 Ian Lance Taylor <iant@google.com>
11540
9c2d0ef9
ILT
11541 * target-reloc.h (relocate_section): Check whether a symbol is
11542 defined by the ABI before reporting an undefined symbol error.
11543 * target.h (Target::is_defined_by_abi): Make parameter const.
11544 (Target::do_is_defined_by_abi): Likewise.
11545 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11546 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11547 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11548 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11549 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11550 * testsuite/Makefile.in: Rebuild.
11551
de31bda5
ILT
11552 * fileread.cc (make_view): Add casts to avoid warning.
11553
9fa33bee
AO
115542008-09-16 Alexandre Oliva <aoliva@redhat.com>
11555
11556 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11557 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11558
183fd0e3
AO
115592008-09-16 Alexandre Oliva <aoliva@redhat.com>
11560
11561 * options.h (General_options::output_is_executable): New.
11562 (General_options::output_is_pie): New.
11563 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11564 for shared libraries.
11565 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11566
7be8330a
CD
115672008-09-11 Chris Demetriou <cgd@google.com>
11568
11569 * options.h (origin): New -z option.
11570 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11571 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11572 in DT_FLAGS_1.
11573
a9caad02
CC
115742008-09-05 Cary Coutant <ccoutant@google.com>
11575
11576 * fileread.cc (File_read::make_view): Add check for attempt to map
11577 beyond end of file.
11578
ae6dce4d
CC
115792008-09-05 Cary Coutant <ccoutant@google.com>
11580
11581 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11582 explicit instantiations.
11583
d7ab2a47
KVH
115842008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11585
11586 PR gold/6858
11587 * options.cc (General_options::finalize): Allow undefined symbols
11588 in shlibs if linking -shared.
11589
11590 PR gold/6859
11591 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11592 symbols as not needing a dynsym entry.
11593
1e52a9c1
CS
115942008-08-20 Craig Silverstein <csilvers@google.com>
11595
11596 * fileread.cc (File_read::open): Do not lock the file unless it
11597 was successfully opened.
11598
d85c80a3
CC
115992008-08-14 Cary Coutant <ccoutant@google.com>
11600
11601 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11602 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11603 * testsuite/tls_test.cc (struct int128): 128-bit struct
11604 for testing TLS relocs with non-zero addend.
11605 (v12): New TLS variable.
11606 (t12): New test.
11607 (t_last): Add check for v12.
11608 * testsuite/tls_test.h (t12): New function.
11609 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11610
2d924fd9
ILT
116112008-08-13 Ian Lance Taylor <iant@google.com>
11612
11613 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11614 set tls_segment_ or relro_segment_.
11615 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11616 when appropriate.
11617 * output.h (Output_section::clear_is_relro): New function.
11618 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11619 sections specially even when output_data_ is empty.
11620 (Output_segment::maximum_alignment): When first section is relro,
11621 only force alignment for PT_LOAD segments.
11622 * script.cc (script_data_segment_align): New function.
11623 (script_data_segment_relro_end): New function.
11624 * script-c.h (script_data_segment_align): Declare.
11625 (script_data_segment_relro_end): Declare.
11626 * script-sections.h (class Script_sections): Declare
11627 data_segment_align and data_segment_relro_end. Add fields
11628 segment_align_index_ and saw_relro_end_.
11629 * script-sections.cc (class Sections_element): Add set_is_relro
11630 virtual function. Add new bool* parameter to place_orphan_here.
11631 Add get_output_section virtual function.
11632 (class Output_section_definition): Add set_is_relro. Add new
11633 bool* parameter to place_orphan_here. Add get_output_section.
11634 Add is_relro_ field.
11635 (Output_section_definition::Output_section_definition): Initialize
11636 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11637 and is_relro_ fields.
11638 (Output_section_definition::place_orphan_here): Add is_relro
11639 parameter.
11640 (Output_section_definition::set_section_addresses): Set relro for
11641 output section.
11642 (Output_section_definition::alternate_constraint): Likewise.
11643 (class Orphan_output_section): Add new bool* parameter to
11644 place_orphan_here. Add get_output_section.
11645 (Orphan_output_section::place_orphan_here): Add is_relro
11646 parameter.
11647 (Script_sections::Script_sections): Initialize
11648 data_segment_align_index_ and saw_relro_end_.
11649 (Script_sections::data_segment_align): New function.
11650 (Script_sections::data_segment_relro_end): New function.
11651 (Script_sections::place_orphan): Set or clear is_relro.
11652 (Script_sections::set_section_addresses): Force alignment of first
11653 TLS section.
11654 * yyscript.y (exp): Call script_data_segment_align and
11655 script_data_segment_relro_end.
11656 * testsuite/relro_script_test.t: New file.
11657 * testsuite/relro_test.cc (using_script): Declare.
11658 (t1, t2): Test using_script.
11659 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11660 (relro_script_test_SOURCES): Define.
11661 (relro_script_test_DEPENDENCIES): Define.
11662 (relro_script_test_LDFLAGS): Define.
11663 (relro_script_test_LDADD): Define.
11664 (relro_script_test.so): New target.
11665 * testsuite/Makefile.in: Rebuild.
11666
f827c9a9
CC
116672008-08-06 Cary Coutant <ccoutant@google.com>
11668
11669 * archive.cc (Archive::total_archives, Archive::total_members)
11670 (Archive::total_members_loaded): New variables.
11671 (Archive::setup): Add parameter. Add option to preread
11672 archive symbols.
11673 (Archive::read_armap): Add counter.
11674 (Archive::get_file_and_offset): New function.
11675 (Archive::get_elf_object_for_member): New function.
11676 (Archive::read_all_symbols): New function.
11677 (Archive::read_symbols): New function.
11678 (Archive::add_symbols): Add counters.
11679 (Archive::include_all_members): Use armap to find members if it's
11680 already built.
11681 (Archive::include_member): Skip reading symbols if already read.
11682 Factored code into Archive::get_file_and_offset and
11683 Archive::get_elf_object_for_member. Changed call to
11684 Mapfile::report_include_archive_member.
11685 (Archive::print_stats): New function.
11686 * archive.h: Declare Object and Read_symbols_data classes.
11687 (Archive::Archive): Add initializers for new members.
11688 (Archive::setup): Add parameter.
11689 (Archive::print_stats): New function.
11690 (Archive::total_archives, Archive::total_members)
11691 (Archive::total_members_loaded): New variables.
11692 (Archive::get_file_and_offset): New function.
11693 (Archive::get_elf_object_for_member): New function.
11694 (Archive::read_all_symbols): New function.
11695 (Archive::read_symbols): New function.
11696 (Archive::Archive_member): New class.
11697 (Archive::members_): New member.
11698 (Archive::num_members_): New member.
11699 * main.cc: Include archive.h.
11700 (main): Call Archive::print_stats.
11701 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11702 archive parameter; member_name is now the fully-decorated name.
11703 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11704 * options.h: (General_options): Add --preread-archive-symbols option.
11705 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11706 Archive::setup.
11707
de4c45bd
ILT
117082008-08-04 Ian Lance Taylor <iant@google.com>
11709
11710 * symtab.h (Symbol::use_plt_offset): New function.
11711 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11712 * powerpc.cc (Relocate::relocate): Likewise.
11713 * sparc.cc (Relocate::relocate): Likewise.
11714 * x86_64.cc (Relocate::relocate): Likewise.
11715 * testsuite/weak_plt.sh: New test.
11716 * testsuite/weak_plt_main.cc: New test.
11717 * testsuite/weak_plt_shared.cc: New test.
11718 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11719 (check_PROGRAMS): Add weak_plt.
11720 (check_DATA): Add weak_plt_shared.so.
11721 (weak_plt_main_pic.o, weak_plt): New targets.
11722 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11723 * testsuite/Makefile.in: Rebuild.
11724
11725 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11726 gcctestdir/ld.
11727 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11728 * testsuite/Makefile.in: Rebuild.
11729
323ee3f4
AM
117302008-08-04 Alan Modra <amodra@bigpond.net.au>
11731
11732 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11733 * Makefile.in: Regenerate.
11734 * po/POTFILES.in: Regenerate.
11735
7c07ecec
ILT
117362008-07-29 Ian Lance Taylor <iant@google.com>
11737
11738 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11739 symbols before other symbols.
11740 * testsuite/script_test_2.cc (test_addr): Declare.
11741 (test_addr_alias): Declare.
11742 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11743 values.
7c07ecec
ILT
11744 * testsuite/script_test_2.t: Define test_addr_alias and
11745 test_addr.
11746
5778530e
ILT
117472008-07-24 Ian Lance Taylor <iant@google.com>
11748
2a00e4fb
ILT
11749 PR 5990
11750 * descriptors.cc: New file.
11751 * descriptors.h: New file.
11752 * gold-threads.h (class Hold_optional_lock): New class.
11753 * fileread.cc: Include "descriptors.h".
11754 (File_read::~File_read): Release descriptor rather than closing
11755 it.
11756 (File_read::open) [file]: Call open_descriptor rather than open.
11757 Set is_descriptor_opened_.
11758 (File_read::open) [memory]: Assert that descriptor is not open.
11759 (File_read::reopen_descriptor): New function.
11760 (File_read::release): Release descriptor.
11761 (File_read::do_read): Make non-const. Reopen descriptor.
11762 (File_read::read): Make non-const.
11763 (File_read::make_view): Reopen descriptor.
11764 (File_read::do_readv): Likewise.
11765 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11766 Update declarations.
11767 * layout.cc: Include "descriptors.h".
11768 (Layout::create_build_id): Use open_descriptor rather than open.
11769 * output.cc: Include "descriptors.h".
11770 (Output_file::open): Use open_descriptor rather than open.
11771 * archive.cc (Archive::const_iterator): Change Archive to be
11772 non-const.
11773 (Archive::begin, Archive::end): Make non-const.
11774 (Archive::count_members): Likewise.
11775 * archive.h (class Archive): Update declarations.
11776 * object.h (Object::read): Make non-const.
11777 * Makefile.am (CCFILES): Add descriptors.cc.
11778 (HFILES): Add descriptors.h.
11779 * Makefile.in: Rebuild.
11780
801647d1
ILT
11781 PR 6716
11782 * gold.h: Always include <clocale>. Add Solaris workarounds
11783 following code in binutils/sysdep.h.
11784
5edd166e
ILT
11785 PR 6048
11786 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11787 this->eh_frame_hdr_ is NULL before using it.
11788
c89ad728
ILT
11789 * dynobj.cc (Versions::Versions): Update comment.
11790
aa86f06b
ILT
11791 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11792 the base version name.
11793
5778530e
ILT
11794 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11795 array size plus one.
11796 (Stringpool_template::set_string_offsets): Subtract one from key
11797 before using it as an array index.
11798 (Stringpool_template::get_offset_with_length): Likewise.
11799 (Stringpool_template::write_to_buffer): Likewise.
11800 * stringpool.h (Stringpool_template::get_offset_from_key):
11801 Likewise.
11802
057ead22
ILT
118032008-07-23 Ian Lance Taylor <iant@google.com>
11804
7f649c59
ILT
11805 PR 6658
11806 * object.h (Merged_symbol_value::value): Do our best to handle a
11807 negative addend.
11808
057ead22
ILT
11809 PR 6647
11810 * script.cc (Version_script_info::get_versions): Don't add empty
11811 version tag to return value.
11812 (Version_script_info::get_symbol_version_helper): Change return
11813 type to bool. Add pversion parameter. Change all callers.
11814 (script_register_vers_node): Don't require a non-NULL tag.
11815 * script.h (class Version_script_info): Update declarations.
11816 (Version_script_info::get_symbol_version): Change return type to
11817 bool. Add version parameter. Change all callers.
11818 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11819 handling. Handle an empty version from a version script.
11820 (Symbol_table::define_special_symbol): Likewise.
11821 * testsuite/ver_test_10.script: New file.
11822 * testsuite/ver_test_10.sh: New file.
11823 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11824 (check_DATA): Add ver_test_10.syms.
11825 (ver_test_10.syms, ver_test_10.so): New target.
11826 * testsuite/Makefile.in: Rebuild.
11827
58e54ac2
CD
118282008-07-23 Simon Baldwin <simonb@google.com>
11829
11830 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11831 to zero for undefined symbols from dynamic libraries.
11832
95d14cd3
ILT
118332008-07-23 Ian Lance Taylor <iant@google.com>
11834
11835 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11836 Change all callers.
11837 * symtab.h (class Symbol_table): Update declaration.
11838 * testsuite/ver_test_9.cc: New file.
11839 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11840 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11841 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11842 (ver_test_9.so, ver_test_9.o): New targets.
11843 * testsuite/Makefile.in: Rebuild.
11844
92de84a6
ILT
118452008-07-22 Ian Lance Taylor <iant@google.com>
11846
34810851
ILT
11847 * options.h (class General_options): Define --check-sections.
11848 * layout.cc (Layout::set_segment_offsets): Handle
11849 --check-sections.
11850
af6156ef
ILT
11851 * options.h (class General_options): Define -n/--nmagic and
11852 -N/--omagic.
11853 * options.cc (General_options::finalize): For -n/--nmagic or
11854 -N/--omagic, set -static.
11855 * layout.cc (Layout::attach_allocated_section_to_segment): If
11856 -N/--omagic, don't put read-only and read-write sections in
11857 different segments.
11858 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11859 finding a read-only segment.
11860 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11861 don't set the minimum segment alignment to the common page size,
11862 and don't set the file offset to the address modulo the page size.
11863 * script-sections.cc (Script_sections::create_segments): If
11864 -n/--omagic, don't put read-only and read-write sections in
11865 different segments.
11866
92de84a6
ILT
11867 * cref.cc: New file.
11868 * cref.h: New file.
11869 * options.h (class General_options): Add --print-symbol-counts.
11870 * main.cc (main): Issue defined symbol report if requested.
11871 * archive.cc (Archive::interpret_header): Make into a const member
11872 function.
11873 (Archive::add_symbols): Call Input_objects::archive_start and
11874 archive_stop.
11875 (Archive::const_iterator): Define new class.
11876 (Archive::begin, Archive::end): New functions.
11877 (Archive::include_all_members): Rewrite to use iterator.
11878 (Archive::count_members): New function.
11879 * archive.h (class Archive): Update declarations.
11880 (Archive::filename): New function.
11881 * object.cc: Include "cref.h".
11882 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11883 (Sized_relobj::do_get_global_symbol_counts): New function.
11884 (Input_objects::add_object): Add object to cross-referencer.
11885 (Input_objects::archive_start): New function.
11886 (Input_objects::archive_stop): New function.
11887 (Input_objects::print_symbol_counts): New function.
11888 * object.h: Declare Cref and Archive.
11889 (Object::get_global_symbol_counts): New function.
11890 (Object::do_get_global_symbol_counts): New pure virtual function.
11891 (class Sized_relobj): Add defined_count_ field. Update
11892 declarations.
11893 (class Input_objects): Add cref_ field. Update constructor.
11894 Update declarations.
11895 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11896 defined_count_.
11897 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11898 symbol counts.
11899 (Sized_dynobj::do_get_global_symbol_counts): New function.
11900 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11901 defined_count_. Update declarations. Define Symbols typedef.
11902 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11903 parameter. Change all callers.
11904 (Symbol_table::add_from_dynobj): Add sympointers and defined
11905 parameters. Change all callers.
11906 * symtab.h (class Symbol_table): Update declarations.
11907 * Makefile.am (CCFILES): Add cref.cc.
11908 (HFILES): Add cref.h.
11909 * Makefile.in: Rebuild.
11910
3f7c5e1d
CD
119112008-07-22 Simon Baldwin <simonb@google.com>
11912
11913 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11914 to zero when writing undefined symbols.
11915
e0b64032
ILT
119162008-07-22 Ian Lance Taylor <iant@google.com>
11917
11918 * output.cc (Output_section::add_input_section): Don't try to
11919 merge empty merge sections.
11920
096b02cf
CS
119212008-07-21 Craig Silverstein <csilvers@google.com>
11922
11923 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11924 Include symbol version in error message.
cd536b21 11925
1d1f116d
CD
119262008-07-20 Chris Demetriou <cgd@google.com>
11927
cd536b21 11928 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11929 (RANDOM_SEED_CFLAGS): New substituted variable.
11930 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11931 * configure: Rebuild.
11932 * Makefile.in: Likewise.
11933 * testsuite/Makefile.in: Likewise.
11934
a18f591e
ILT
119352008-07-18 Ian Lance Taylor <iant@google.com>
11936
11937 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11938 where we see NAME/NULL and NAME/VERSION as separate symbols.
11939 * testsuite/ver_test_main.cc (main): Call t4.
11940 (t4, t4_2a): Define.
11941 * testsuite/ver_test_2.cc (t4_2): Define.
11942 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11943 * testsuite/ver_test_4.cc (t4_2a): Define.
11944 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11945 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11946
c6e3f6ed
ILT
119472008-07-17 Ian Lance Taylor <iant@google.com>
11948
11949 * dynobj.cc (Versions::add_def): If we give an error about a
11950 missing version, go ahead and create the version anyhow.
11951
ef9beddf
ILT
119522008-07-10 Ian Lance Taylor <iant@google.com>
11953
11954 Handle output sections with more than 0x7fffffff bytes.
11955 * object.h (class Relobj): Change map_to_output_ to
11956 output_sections_, and just keep a section pointer. Change all
11957 uses. Move comdat group support to Sized_relobj.
11958 (Relobj::is_section_specially_mapped): Remove.
11959 (Relobj::output_section): Remove poff parameter. Change all
11960 callers.
11961 (Relobj::output_section_offset): New function.
11962 (Relobj::set_section_offset): Rewrite.
11963 (Relobj::map_to_output): Remove.
11964 (Relobj::output_sections): New function.
11965 (Relobj::do_output_section_offset): New pure virtual function.
11966 (Relobj::do_set_section_offset): Likewise.
11967 (class Sized_relobj): Add section_offsets_ field. Add comdat
11968 group support from Relobj. Update declarations.
11969 (Sized_relobj::get_output_section_offset): New function.
11970 (Sized_relobj::do_output_section_offset): New function.
11971 (Sized_relobj::do_set_section_offset): New function.
11972 * object.cc (Relobj::output_section_address): Remove.
11973 (Sized_relobj::Sized_relobj): Initialize new fields.
11974 (Sized_relobj::include_section_group): Cast find_kept_object to
11975 Sized_relobj.
11976 (Sized_relobj::include_linkonce_section): Likewise.
11977 (Sized_relobj::do_layout): Use separate arrays for output section
11978 and output offset.
11979 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11980 output_sections.
11981 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11982 output_sections and section_offsets.
11983 (Sized_relobj::write_local_symbols): Likewise.
11984 (map_to_kept_section): Compute output address directly.
11985 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11986 output_sections and section_offsets.
11987 (Sized_relobj::write_sections): Likewise.
11988 (Sized_relobj::relocate_sections): Likewise.
11989 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11990 * output.h (class Output_reloc): Update declarations. Change
11991 u2_.relobj to Sized_relobj*.
11992 (class Output_data_reloc): Change add functions to use
11993 Sized_relobj*.
11994 * output.cc (Output_reloc::Output_reloc): Change relobj to
11995 Sized_relobj*.
11996 (Output_reloc::local_section_offset): Change return type to
11997 Elf_Addr. Use get_output_section_offset.
11998 (Output_reloc::get_address): Likewise.
11999 (Output_section::is_input_address_mapped): Don't call
12000 is_section_specially_mapped.
12001 (Output_section::output_offset): Likewise.
12002 (Output_section::output_address): Likewise.
12003 (Output_section::starting_output_address): Likewise.
12004 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
12005 parameter to Sized_relobj*.
12006 (Copy_relocs::need_copy_reloc): Likewise.
12007 (Copy_relocs::save): Likewise.
12008 * copy-relocs.h (class Copy_relocs): Update declarations.
12009 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
12010 Sized_relobj*. Change relobj_ field to Sized_relobj*.
12011 * target-reloc.h (relocate_for_relocatable): Change
12012 offset_in_output_section type to Elf_Addr. Change code that uses
12013 it as well.
12014 * layout.cc (Layout::layout): Always set *off.
12015 * mapfile.cc (Mapfile::print_input_section): Use
12016 output_section_offset.
12017 * i386.cc (Target_i386::copy_reloc): Change object parameter to
12018 Sized_relobj*.
12019 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
12020 * sparc.cc (Target_sparc::copy_reloc): Likewise.
12021 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
12022
5cb66f97
ILT
120232008-07-03 Ian Lance Taylor <iant@google.com>
12024
12025 * layout.cc (Layout::include_section): Do not discard unrecognized
12026 SHT_STRTAB sections.
12027
afe47622
CS
120282008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
12029
12030 * script.cc (Lex::can_continue_name): Make '?' allowable in
12031 version-script names.
12032 * testsuite/version_script.map: Change glob pattern to use '?'
12033
5adf9721
ILT
120342008-06-30 Manish Singh <yosh@gimp.org>
12035
12036 PR 6585
12037 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
12038 Correct typo.
12039
e6fde208
ILT
120402008-06-30 Ian Lance Taylor <iant@google.com>
12041
12042 PR 6660
12043 PR 6682
12044 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
12045 versions]: Don't try to read the value in the contents, since we
12046 don't use it. Use the template endianness when writing.
12047
3f2e6a2d
CC
120482008-06-25 Cary Coutant <ccoutant@google.com>
12049
12050 * fileread.cc (File_read::make_view): Assert on zero-length view.
12051 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
12052 symbol table when there are no symbols to read.
12053
c43d3a48
CS
120542008-06-23 Craig Silverstein <csilvers@google.com>
12055
12056 * version.cc (version_string): Bump to 1.7
12057
5f494ea0
CS
120582008-06-18 Craig Silverstein <csilvers@google.com>
12059
12060 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
12061 constant 0xFFFF to type Valtype.
12062 (Powerpc_relocate_functions::rel16_ha): Likewise.
12063
c42e122e
ILT
120642008-06-17 Ian Lance Taylor <iant@google.com>
12065
f34787f8
ILT
12066 * output.h (Output_section::Input_section): Initialize p2align_ to
12067 zero for Output_section_data constructors.
12068 (Output_section::Input_section::addralign): If not an input
12069 section, return the alignment of the Output_section_data.
12070 * testsuite/copy_test.cc: New file.
12071 * testsuite/copy_test_1.cc: New file.
12072 * testsuite/copy_test_2.cc: New file.
12073 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
12074 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
12075 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
12076 (copy_test_1_pic.o, copy_test_1.so): New targets.
12077 (copy_test_2_pic.o, copy_test_2.so): New targets.
12078 * testsuite/Makefile.in: Rebuild.
12079
c42e122e
ILT
12080 * script-sections.cc (Script_sections::place_orphan): Initialize
12081 local variable exact.
12082
ce3ac18a
DE
120832008-06-13 David Edelsohn <edelsohn@gnu.org>
12084
12085 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
12086
42cacb20
DE
120872008-06-12 David Edelsohn <edelsohn@gnu.org>
12088 David S. Miller <davem@davemloft.net>
12089
12090 * powerpc.cc: New file.
12091 * Makefile.am (TARGETSOURCES): Add powerpc.cc
12092 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
12093 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
12094 * Makefile.in: Rebuild.
12095
7b308235
ILT
120962008-06-09 Ian Lance Taylor <iant@google.com>
12097
12098 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
12099 <exception>.
12100 (throwing, orig_terminate): New static variables.
12101 (terminate_handler): New static function.
12102 (t2): Set terminate handler.
12103
f0b886e3
ILT
121042008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
12105
12106 PR 6584
cd536b21 12107 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
12108 alignment.
12109
3e90f135
CC
121102008-05-30 Cary Coutant <ccoutant@google.com>
12111
12112 * archive.cc (Archive::include_all_members) Correct to step
12113 over symbol table and extended name table in thin archives.
12114
e09ad04a
ILT
121152008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
12116
12117 PR 6407
12118 * target-reloc.h (relocate_for_relocatable): Fix new_offset
12119 calculation.
12120
62b01cb5
ILT
121212008-05-28 Caleb Howe <cshowe@google.com>
12122
12123 * reduced_debug_output.cc: New file.
12124 * reduced_debug_output.h: New file.
92de84a6 12125 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
12126 * options.cc (General_options::finalize): Add strip_debug_non_line
12127 to the strip heirarchy.
12128 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
12129 fields.
12130 * layout.cc: Include "reduced_debug_output.h".
12131 (Layout::Layout): Initialize new fields.
12132 (line_only_debug_sections): New static array.
12133 (is_lines_only_debug_sections): New static inline function.
12134 (Layout::include_section): Handle --strip-debug-non-line.
12135 (Layout::make_output_section): If --strip-debug-non-line, build
12136 new output sections for .debug_abbrev and .debug_info.
12137 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
12138 gold. Warn about possible overflow.
12139 (read_signed_LEB_128): Likewise.
12140 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
12141 (read_signed_LEB_128): Declare.
12142 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
12143 (HFILES): Add reduced_debug_output.h.
12144 * Makefile.in: Rebuild.
12145
7d9e3d98
ILT
121462008-05-21 Ian Lance Taylor <iant@google.com>
12147
12148 * mapfile.cc: New file.
12149 * mapfile.h: New file.
12150 * options.h (class General_options): Add -M/--print-map and -Map.
12151 * options.cc (General_options::finalize): Make -M equivalent to
12152 -Map -.
12153 * main.cc: Include <cstdio> and "mapfile.h".
12154 (main): Open mapfile if requested.
12155 * gold.cc (class Middle_runner): Add mapfile_ field. Update
12156 constructor. Change caller.
12157 (queue_initial_tasks): Add mapfile parameter. Change caller.
12158 (queue_middle_tasks): Likewise.
12159 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
12160 declarations.
12161 * archive.cc: Include "mapfile.h".
12162 (Archive::add_symbols): Add mapfile parameter. Change all
12163 callers. Pass mapfile, symbol, and reason to include_member.
12164 (Archive::include_all_members): Add mapfile parameter. Change all
12165 callers.
12166 (Archive::include_member): Add mapfile, sym, and why parameters.
12167 Change all callers. Report inclusion to map file.
12168 * archive.h: Include "fileread.h".
12169 (class Archive): Update declarations.
12170 (Archive::file): New const method.
12171 (class Add_archive_symbols): Add mapfile_ field. Update
12172 constructor. Change all callers.
12173 * readsyms.h (class Read_symbols): Likewise.
12174 (class Finish_group): Likewise.
12175 (class Read_script): Likewise.
12176 * common.cc: Include "mapfile.h".
12177 (Symbol_table::allocate_commons): Add mapfile parameter. Change
12178 all callers.
12179 (Symbol_table::do_allocate_commons): Likewise.
12180 (Symbol_table::do_allocate_commons_list): Likewise. Report common
12181 symbol allocation to mapfile.
12182 * common.h (class Allocate_commons_task): Add mapfile_ field.
12183 Update constructor. Change all callers.
12184 * symtab.h (class Symbol_table): Update declarations.
12185 * layout.cc: Include "mapfile.h".
12186 (Layout_task_runner::run): Print information to mapfile.
12187 (Layout::create_gold_note): Change Output_data_fixed_space to
12188 Output_data_zero_fill.
12189 (Layout::create_build_id): Likewise.
12190 (Layout::print_to_mapfile): New function.
12191 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
12192 constructor. Change caller.
12193 (class Layout): Declare print_to_mapfile.
12194 * output.cc (Output_section::Input_section::print_to_mapfile): New
12195 function.
12196 (Output_section::add_input_section): If producing a map, always
12197 add to input_sections_ list.
12198 (Output_section::do_print_to_mapfile): New function.
12199 (Output_segment::print_sections_to_mapfile): New function.
12200 (Output_segment::print_section_list_to_mapfile): New function.
12201 * output.h: Include "mapfile.h".
12202 (Output_data::print_to_mapfile): New function.
12203 (Output_data::do_print_to_mapfile): New virtual function.
12204 (Output_segment_headers::do_print_to_mapfile): New function.
12205 (Output_file_header::do_print_to_mapfile): New function.
12206 (Output_data_const::do_print_to_mapfile): New function.
12207 (class Output_data_const_buffer): Add map_name_ field. Update
12208 constructor. Change all callers. Add do_print_to_mapfile
12209 function.
12210 (class Output_data_fixed_space): Likewise.
12211 (class Output_data_space): Likewise.
12212 (class Output_data_zero_fill): New class.
12213 (Output_data_strtab::do_print_to_mapfile): New function.
12214 (Output_data_reloc_base::do_print_to_mapfile): New function.
12215 (Output_relocatable_relocs::do_print_to_mapfile): New function.
12216 (Output_data_group::do_print_to_mapfile): New function.
12217 (Output_data_got::do_print_to_mapfile): New function.
12218 (Output_data_dynamic::do_print_to_mapfile): New function.
12219 (Output_symtab_xindex::do_print_to_mapfile): New function.
12220 (class Output_section): Declare do_print_to_mapflie. Declare
12221 print_to_mapfile in Input_section.
12222 (class Output_segment): Declare new functions.
12223 * object.h (Sized_relobj::symbol_count): New function.
12224 * script-sections.cc
12225 (Output_section_element_dot_assignment::set_section_addresses):
12226 Change Output_data_fixed_space to Output_data_zero_fill.
12227 (Output_data_expression::do_print_to_mapfile): New function.
12228 * script.cc (read_input_script): Add mapfile parameter. Change
12229 all callers.
12230 * script.h (read_input_script): Update declaration.
12231 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
12232 (Eh_frame::do_print_to_mapfile): New function.
12233 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
12234 (Output_merge_string::do_print_to_mapfile): New function.
12235 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
12236 function.
12237 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
12238 function.
12239 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
12240 function.
12241 * Makefile.am (CCFILES): Add mapfile.cc.
12242 (HFILES): Add mapfile.h.
12243 * Makefile.in: Rebuild.
12244
9f1d377b
ILT
122452008-05-19 Ian Lance Taylor <iant@google.com>
12246
12247 * options.h (class General_options): Add -z relro.
12248 * layout.cc (Layout::Layout): Initialize relro_segment_.
12249 (Layout::add_output_section_data): Return the output section.
12250 (Layout::make_output_section): Rcognize relro sections and mark
12251 them appropriately.
12252 (Layout::attach_allocated_section_to_segment): Put relro sections
12253 in a PT_GNU_RELRO segment.
12254 (Layout::create_initial_dynamic_sections): Mark the .dynamic
12255 section as relro.
12256 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
12257 PT_TLS segments.
12258 (Layout::linkonce_mapping): Map d.rel.ro.local to
12259 .data.rel.ro.local.
12260 (Layout::output_section_name): Us .data.rel.ro.local for any
12261 section which begins with that.
12262 * layout.h (class Layout): Update add_output_section_data
12263 declaration. Add relro_segment_ field.
12264 * output.cc (Output_section::Output_section): Initialize is_relro_
12265 and is_relro_local_ fields.
12266 (Output_segment::add_output_section): Group relro sections.
12267 (Output_segment::is_first_section_relro): New function.
12268 (Output_segment::maximum_alignment): If there is a relro section,
12269 align the segment to the common page size.
12270 (Output_segment::set_section_addresses): Track whether we are
12271 looking at relro sections. If the last section is a relro
12272 section, align to the common page size.
12273 (Output_segment::set_section_list_addresses): Add in_relro
12274 parameter. Change all callers. Align to the page size when
12275 moving from relro to non-relro section.
12276 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
12277 segment.
12278 * output.h (class Output_section): Add is_relro_ and
12279 is_relro_local_ fields.
12280 (Output_section::is_relro): New function.
12281 (Output_section::set_is_relro): New function.
12282 (Output_section::is_relro_local): New function.
12283 (Output_section::set_is_relro_local): New function.
12284 (class Output_segment): Update declarations.
12285 * i386.cc (Target_i386::got_section): Mark .got section as relro.
12286 * sparc.cc (Target_sparc::got_section): Likewise.
12287 * x86_64.cc (Target_x86_64::got_section): Likewise.
12288 * testsuite/relro_test_main.cc: New file.
12289 * testsuite/relro_test.cc: New file.
12290 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
12291 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
12292 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
12293 (relro_test.so, relro_test_pic.o): New targets.
12294 * testsuite/Makefile.in: Rebuild.
12295
a984ee1d
ILT
122962008-05-16 Ian Lance Taylor <iant@google.com>
12297
01676dcd
ILT
12298 * output.cc (Output_segment::add_output_section): Remove front
12299 parameter.
12300 * output.h (class Output_segment): Remove
12301 add_initial_output_section and overloaded add_output_section.
12302 Update declaration of remaining add_output_section.
12303 * layout.cc (Layout::create_interp): Call add_output_section
12304 rather than add_initial_output_section.
12305 (Layout::finish_dynamic_section): Likewise.
12306
497897f9
ILT
12307 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
12308 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
12309 know the dynamic type.
12310 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
12311 field. Initialize it in constructor.
12312 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
12313 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
12314 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
12315 reloc.
12316
a984ee1d
ILT
12317 * output.cc (Output_reloc::get_address): Change return type to
12318 Elf_Addr.
12319 * output.h (class Output_reloc): Update get_address declaration.
12320 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
12321 for section addresses.
12322
55ba0940
ILT
123232008-05-09 Ian Lance Taylor <iant@google.com>
12324
12325 PR 6493
12326 * gold.cc (gold_nomem): Use return value of write.
12327
75517b77
ILT
123282008-05-08 Ian Lance Taylor <iant@google.com>
12329
12330 * symtab.c (Symbol::init_base_output_data): Add version
12331 parameter. Change all callers.
12332 (Symbol::init_base_output_segment): Likewise.
12333 (Symbol::init_base_constant): Likewise.
12334 (Symbol::init_base_undefined): Likewise.
12335 (Sized_symbol::init_output_data): Likewise.
12336 (Sized_symbol::init_output_segment): Likewise.
12337 (Sized_symbol::init_constant): Likewise.
12338 (Sized_symbol::init_undefined): Likewise.
12339 (Symbol_table::do_define_in_output_data): If the new symbol has a
12340 version, mark it as the default.
12341 (Symbol_table::do_define_in_output_segment): Likewise.
12342 (Symbol_table::do_define_as_constant): Likewise.
12343 * symtab.h (class Symbol): Update declarations.
12344 (class Sized_symbol): Likewise.
12345 * resolve.cc (Symbol::override_version): New function.
c42e122e 12346 (Symbol::override_base): Call override_version.
75517b77
ILT
12347 (Symbol::override_base_with_special): Likewise.
12348 * testsuite/ver_script_8.script: New file.
12349 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
12350 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
12351 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12352 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12353
f1f70eae
ILT
123542008-05-06 Ian Lance Taylor <iant@google.com>
12355
f3e9c5c5
ILT
12356 PR 6049
12357 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12358 functions.
12359 (class General_options): Remove existing --undefined, and add
12360 --no-undefined instead. Add new --undefined as synonym for -u.
12361 * archive.cc (Archive::add_symbols): Check whether symbol was
12362 named with -u.
12363 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12364 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12365 all uses. Add IS_UNDEFINED. Update declarations to split
12366 different versions of init_base. Declare init_base_undefined.
12367 (Symbol::is_defined): Handle IS_UNDEFINED.
12368 (Symbol::is_undefined): Likewise.
12369 (Symbol::is_weak_undefined): Call is_undefined.
12370 (Symbol::is_absolute): Handle IS_CONSTANT.
12371 (class Sized_symbol): Update declarations to split different
12372 versions of init. Declare init_undefined.
12373 (class Symbol_table): Declare new functions.
12374 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12375 Change all callers.
12376 (Symbol::init_base_output_data): Likewise.
12377 (Symbol::init_base_output_segment): Likewise.
12378 (Symbol::init_base_constant): Likewise.
12379 (Symbol::init_base_undefined): New function.
12380 (Sized_symbol::init_object): Rename from init. Change all
12381 callers.
12382 (Sized_symbol::init_output_data): Likewise.
12383 (Sized_symbol::init_output_segment): Likewise.
12384 (Sized_symbol::init_constant): Likewise.
12385 (Sized_symbol::init_undefined): New function.
12386 (Symbol_table::add_undefined_symbols_from_command_line): New
12387 function.
12388 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12389 function.
12390 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12391 (Symbol::output_section): Likewise.
12392 (Symbol::set_output_section): Likewise.
12393 (Symbol_table::sized_finalize_symbol): Likewise.
12394 (Symbol_table::sized_write_globals): Likewise.
12395 * resolve.cc (Symbol_table::should_override): Likewise.
12396 (Symbol::override_base_with_special): Likewise.
12397
8bdcdf2c
ILT
12398 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12399 symbol, change it to have default visibility.
12400 * testsuite/protected_1.cc: New file.
12401 * testsuite/protected_2.cc: New file.
12402 * testsuite/protected_3.cc: New file.
12403 * testsuite/protected_main_1.cc: New file.
12404 * testsuite/protected_main_2.cc: New file.
12405 * testsuite/protected_main_3.cc: New file.
12406 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12407 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12408 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12409 (protected_1.so): New target.
12410 (protected_1_pic.o, protected_2_pic.o): New targets.
12411 (protected_3_pic.o): New target.
12412 (check_PROGRAMS): Add protected_2.
12413 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12414 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12415 * testsuite/Makefile.in: Rebuild.
12416
2b706932
ILT
12417 * options.h (DEFINE_var): Add set_user_set_##varname__.
12418 (DEFINE_bool_alias): New macro.
12419 (class General_options): Define -Bstatic using DEFINE_bool_alias
12420 rather than DEFINE_special. Add --undefined as an alias for -z
12421 defs.
12422 * options.cc (General_options::parse_Bstatic): Remove.
12423
d82a5bcc
ILT
12424 * options.h (class General_options): Add --fatal-warnings.
12425 * main.cc (main): Implement --fatal-warnings.
12426 * errors.h (Errors::warning_count): New function.
12427
f1f70eae
ILT
12428 * options.h (class General_options): Add -Bsymbolic-functions.
12429 * symtab.h (Symbol::is_preemptible): Check for
12430 -Bsymbolic-functions.
12431
8825ac63
ILT
124322008-05-05 Ian Lance Taylor <iant@google.com>
12433
d98bc257
ILT
12434 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12435 as noVARNAME rather than no-VARNAME.
12436 (class General_options): Add option -z combreloc.
12437 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12438 get_address.
12439 (Output_reloc::sort_before) [SHT_REL]: New function.
12440 (Output_reloc::sort_before) [SHT_RELA]: New function.
12441 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12442 Sort_relocs_comparison.
12443 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12444 parameter. Change all callers.
12445 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12446 sort_relocs parameter. Change all callers.
12447 * output.cc (Output_reloc::get_address): New function, broken out
12448 of write_rel.
12449 (Output_reloc::write_rel): Call it.
12450 (Output_reloc::compare): New function.
12451 (Output_data_reloc_base::do_write): Optionally sort relocs.
12452
60b2b4e7
ILT
12453 * configure.ac: If targ_extra_obj is set, link it in.
12454 * configure.tgt: Initialize all variables.
12455 (x86_64*): Set targ_extra_obj and targ_extra_size.
12456 * configure: Rebuild.
12457
8825ac63
ILT
12458 * object.cc (Sized_relobj::include_section_group): Adjust section
12459 indexes read from group data. Build vector to pass to
12460 layout_group.
12461 * layout.cc (Layout::layout_group): Add flags and shndxes
12462 parameters. Remove contents parameter. Change caller. Update
12463 explicit instantiations.
12464 * layout.h (class Layout): Update layout_group declaration.
12465 * output.cc (Output_data_group::Output_data_group): Add flags and
12466 input_shndxes parameters. Remove contents parameter. Change
12467 caller.
12468 (Output_data_group::do_write): Change input_sections_ to
12469 input_shndxes_.
12470 * output.h (class Output_data_group): Update constructor
12471 declaration. Rename input_sections_ to input_shndxes_.
12472 * testsuite/many_sections_test.cc: Add template.
12473
e94cf127
CC
124742008-04-30 Cary Coutant <ccoutant@google.com>
12475
4418b2d5
CC
12476 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12477
e94cf127
CC
12478 * layout.cc (Layout::include_section): Refactored check for debug
12479 info section.
12480 (Layout::add_comdat): Add new parameters. Change type
12481 of signature parameter. Add object and shndx to signatures table.
12482 (Layout::find_kept_object): New function.
12483 * layout.h: Include <cstring>.
12484 (Layout::is_debug_info_section): New function.
12485 (Layout::add_comdat): Add new parameters.
12486 (Layout::find_kept_object): New function.
12487 (Layout::Kept_section): New struct.
12488 (Layout::Signatures): Change type of map range.
12489 * object.cc (Relobj::output_section_address): New function.
12490 (Sized_relobj::include_section_group): Add new parameters. Change
12491 calls to Layout::add_comdat. Change to build table of kept comdat
12492 groups and table mapping discarded sections to kept sections.
12493 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12494 (Sized_relobj::do_layout): Change calls to include_section_group and
12495 include_linkonce_section.
12496 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12497 value to zero when section is discarded.
12498 (Sized_relobj::map_to_kept_section): New function.
12499 * object.h (Relobj::output_section_address): New function.
12500 (Relobj::Comdat_group): New type.
12501 (Relobj::find_comdat_group): New function.
12502 (Relobj::Comdat_group_table): New type.
12503 (Relobj::Kept_comdat_section): New type.
12504 (Relobj::Kept_comdat_section_table): New type.
12505 (Relobj::add_comdat_group): New function.
12506 (Relobj::set_kept_comdat_section): New function.
12507 (Relobj::get_kept_comdat_section): New function.
12508 (Relobj::comdat_groups_): New field.
12509 (Relobj::kept_comdat_sections_): New field.
12510 (Symbol_value::input_value): Update comment.
12511 (Sized_relobj::map_to_kept_section) New function.
12512 (Sized_relobj::include_linkonce_section): Add new parameter.
12513 * target-reloc.h (Comdat_behavior): New type.
12514 (get_comdat_behavior): New function.
12515 (relocate_section): Add code to map a discarded section to the
12516 corresponding kept section when applying a relocation.
12517
e4e5049b
CS
125182008-04-30 Craig Silverstein <csilvers@google.com>
12519
12520 * dwarf_reader.cc (next_generation_count): New static var.
12521 (Addr2line_cache_entry): New struct.
12522 (addr2line_cache): New static var.
12523 (Dwarf_line_info::one_addr2line): Added caching.
12524 (Dwarf_line_info::clear_addr2line_cache): New function.
12525 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12526 cache-size parameter.
12527 (Dwarf_line_info::one_addr2line_cache): New function.
12528 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12529 new cache-size argument to one_addr2line(), and clear cache.
12530
d09e9154
CC
125312008-04-28 Cary Coutant <ccoutant@google.com>
12532
12533 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12534 R_386_PC8 relocations.
12535
7ef73768
ILT
125362008-04-23 Ian Lance Taylor <iant@google.com>
12537
55438702
ILT
12538 * object.cc (Sized_relobj::include_section_group): Check for
12539 invalid section group.
12540
c165fb93
ILT
12541 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12542 header size.
12543
7ef73768
ILT
12544 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12545 than read for file header.
12546 * archive.cc (Archive::include_member): Likewise.
12547
6194aaab
L
125482008-04-23 Paolo Bonzini <bonzini@gnu.org>
12549
12550 * aclocal.m4: Regenerate.
12551 * configure: Regenerate.
12552
d491d34e
ILT
125532008-04-19 Ian Lance Taylor <iant@google.com>
12554
5ea2bac6
ILT
12555 * version.cc (version_string): Bump to 1.6.
12556
7bc3e21a
ILT
12557 * testsuite/Makefile.am (many_sections_r_test): New target.
12558 (many_sections_r_test_SOURCES): Remove.
12559 (many_sections_r_test_DEPENDENCIES): Remove.
12560 (many_sections_r_test_LDFLAGS): Remove.
12561 (many_sections_r_test_LDADD): Remove.
12562
7fcd3aa9
ILT
12563 * object.cc (Sized_relobj::do_add_symbols): Always pass
12564 local_symbol_count_ to add_from_relobj.
12565
4c94d6ae
ILT
12566 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12567 every thousand variables.
12568 * testsuite/Makefile.in: Rebuild.
12569
d491d34e
ILT
12570 * object.cc (Xindex::initialize_symtab_xindex): New function.
12571 (Xindex::read_symtab_xindex): New function.
12572 (Xindex::sym_xindex_to_shndx): New function.
12573 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12574 available.
12575 (Sized_relobj::do_initialize_xindex): New function.
12576 (Sized_relobj::do_read_symbols): Adjust section links.
12577 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12578 parameter. Change all callers.
12579 (Sized_relobj::include_section_group): Adjust section links and
12580 symbol section indexes.
12581 (Sized_relobj::do_layout): Adjust section links.
12582 (Sized_relobj::do_count_local_symbols): Adjust section links and
12583 symbol section indexes.
12584 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12585 ordinary and special symbols.
12586 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12587 dynsym_xindex parameters. Change all callers. Adjust section
12588 links. Use SHN_XINDEX when needed.
12589 (Sized_relobj::get_symbol_location_info): Adjust section links.
12590 Don't get fooled by special symbols.
12591 * object.h (class Xindex): Define.
12592 (class Object): Add xindex_ parameter. Declare virtual functoin
12593 do_initialize_xindex.
12594 (Object::adjust_sym_shndx): New function.
12595 (Object::set_xindex): New protected function.
12596 (class Symbol_value): Add is_ordinary_shndx_ field.
12597 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12598 (Symbol_value::value): Assert ordinary section.
12599 (Symbol_value::initialize_input_to_output_map): Likewise.
12600 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12601 Change all callers.
12602 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12603 all callers.
12604 (class Sized_relobj): Update declarations.
12605 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12606 parameter. Change all callers.
12607 (Sized_relobj::adjust_shndx): New function.
12608 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12609 field.
12610 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12611 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12612 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12613 (Sized_dynobj::read_dynsym_section): Adjust section links.
12614 (Sized_dynobj::read_dynamic): Likewise.
12615 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12616 section links.
12617 (Sized_dynobj::do_initialize_xindex): New function.
12618 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12619 do_initialize_xindex.
12620 (Sized_dynobj::adjust_shndx): New function.
12621 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12622 dynsym_xindex_ fields.
12623 (Layout::finalize): Add a call to set_section_indexes before
12624 creating the symtab sections.
12625 (Layout::set_section_indexes): Don't do anything if the section
12626 already has a section index.
12627 (Layout::create_symtab_sections): Add shnum parameter. Change
12628 caller. Create .symtab_shndx section if needed.
12629 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12630 caller.
12631 (Layout::allocated_output_section_count): New function.
12632 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12633 needed.
12634 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12635 fields. Update declarations.
12636 (Layout::symtab_xindex): New function.
12637 (Layout::dynsym_xindex): New function.
12638 (class Write_symbols_task): Add layout_ field.
12639 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12640 Change caller.
12641 * output.cc (Output_section_headers::Output_section_headers): Add
12642 shstrtab_section parameter. Change all callers.
12643 (Output_section_headers::do_sized_write): Store overflow values
12644 for section count and section string table section index in
12645 section header zero.
12646 (Output_file_header::do_sized_write): Check for overflow of
12647 section count and section string table section index.
12648 (Output_symtab_xindex::do_write): New function.
12649 (Output_symtab_xindex::endian_do_write): New function.
12650 * output.h (class Output_section_headers): Add shstrtab_section_.
12651 Update declarations.
12652 (class Output_symtab_xindex): Define.
12653 (Output_section::has_out_shndx): New function.
12654 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12655 field.
12656 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12657 Change all callers.
12658 (Sized_symbol::init): Likewise.
12659 (Symbol::output_section): Check for ordinary symbol.
12660 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12661 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12662 callers.
12663 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12664 Change all callers. Simplify handling of symbols from sections
12665 not included in the link.
12666 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12667 distinction.
12668 (Weak_alias_sorter::operator()): Assert that symbols are
12669 ordinary.
12670 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12671 distinction.
12672 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12673 parameters. Change all callers.
12674 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12675 symbol distinction. Use SHN_XINDEX when needed.
12676 (Symbol_table::write_section_symbol): Add symtab_xindex
12677 parameter. Change all callers.
12678 (Symbol_table::sized_write_section_symbol): Likewise. Use
12679 SHN_XINDEX when needed.
12680 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12681 declarations.
12682 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12683 (Symbol::is_defined): Check is_ordinary.
12684 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12685 (Symbol::is_absolute, Symbol::is_common): Likewise.
12686 (class Sized_symbol): Update declarations.
12687 (class Symbol_table): Update declarations.
12688 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12689 parameters. Change all callers.
12690 (Sized_symbol::override): Likewise.
12691 (Symbol_table::override): Likewise.
12692 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12693 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12694 is_ordinary, and orig_st_shndx parameters. Change all callers.
12695 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12696 to be in an ordinary section.
12697 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12698 object and is_ordinary parameters. Change all callers.
12699 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12700 Change all callers. Don't add undefined or non-ordinary symbols
12701 to reloc_map_.
12702 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12703 Change all callers.
12704 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12705 declarations.
12706 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12707 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12708 (Sized_relobj::relocate_sections): Likewise.
12709 * target-reloc.h (scan_relocs): Adjust section symbol index.
12710 (scan_relocatable_relocs): Likewise.
12711 * i386.cc (Scan::local): Check for ordinary symbols.
12712 * sparc.cc (Scan::local): Likewise.
12713 * x86_64.cc (Scan::local): Likewise.
12714 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12715 to symbol_section_and_value.
12716 * testsuite/many_sections_test.cc: New file.
12717 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12718 (check_PROGRAMS): Add many_sections_test.
12719 (many_sections_test_SOURCES): Define.
12720 (many_sections_test_DEPENDENCIES): Define.
12721 (many_sections_test_LDFLAGS): Define.
12722 (BUILT_SOURCES): Add many_sections_define.h.
12723 (many_sections_define.h): New target.
12724 (BUILT_SOURCES): Add many_sections_check.h.
12725 (many_sections_check.h): New target.
12726 (check_PROGRAMS): Add many_sections_r_test.
12727 (many_sections_r_test_SOURCES): Define.
12728 (many_sections_r_test_DEPENDENCIES): Define.
12729 (many_sections_r_test_LDFLAGS): Define.
12730 (many_sections_r_test_LDADD): Define.
12731 (many_sections_r_test.o): New target.
12732 * testsuite/Makefile.in: Rebuild.
12733
c5818ff1
CC
127342008-04-17 Cary Coutant <ccoutant@google.com>
12735
12736 * errors.cc (Errors::info): New function.
12737 (gold_info): New function.
12738 * errors.h (Errors::info): New function.
12739 * gold.h (gold_info): New function.
12740 * object.cc (Input_objects::add_object): Print trace output.
12741 * options.cc (options::parse_set): New function.
12742 (General_options::parse_wrap): Deleted.
12743 (General_options::General_options): Deleted initializer.
12744 * options.h (options::String_set): New typedef.
12745 (options::parse_set): New function.
12746 (DEFINE_set): New macro.
12747 (General_options::wrap): Changed to use DEFINE_set. Changed
12748 callers of any_wrap_symbols and is_wrap_symbol.
12749 (General_options::trace, General_options::trace_symbol):
12750 New options.
12751 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12752 (General_options::wrap_symbols_): Deleted.
12753 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12754
b5be4a7c
DM
127552008-04-17 David S. Miller <davem@davemloft.net>
12756
12757 * options.cc (General_options::parse_V): New function.
12758 * options.h: Add entries for -V and -Qy.
12759
155a0dd7
ILT
127602008-04-17 Ian Lance Taylor <iant@google.com>
12761
12762 * common.cc (Symbol_table::allocate_commons): Remove options
12763 parameter. Change caller.
12764 (Symbol_table::do_allocate_commons): Remove options parameter.
12765 Change caller. Just call do_allocate_commons_list twice.
12766 (Symbol_table::do_allocate_commons_list): New function, broken out
12767 of do_allocate_commons.
12768 * common.h (class Allocate_commons_task): Remove options_ field.
12769 Update constructor.
12770 * symtab.cc (Symbol_table::Symbol_table): Initialize
12771 tls_commons_.
12772 (Symbol_table::add_from_object): Put TLS common symbols on
12773 tls_commons_ list.
12774 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12775 which are IN_OUTPUT_DATA.
12776 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12777 allocate_commons and do_allocate_commons declarations. Declare
12778 do_allocate_commons_list.
12779 * gold.cc (queue_middle_tasks): Update creation of
12780 Allocate_commons_task to not pass options.
12781 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12782 (TLS_TEST_C_FLAGS): New variable.
12783 (tls_test_c_pic.o): New target.
12784 (tls_test_shared.so): Link in tls_test_c_pic.o.
12785 (tls_test_c_pic_ie.o): New target.
12786 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12787 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12788 (tls_test_c.o): New target.
12789 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12790 (tls_pic_test_LDADD): Likewise.
12791 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12792 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12793 (tls_test_c_gnu2.o): New target.
12794 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12795 tls_test_c_gnu2.o.
12796 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12797 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12798 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12799 * testsuite/tls_test.cc: Include "config.h".
12800 (t_last): Call t11_last.
12801 * testsuite/tls_test.h (t11, t11_last): Declare.
12802 * testsuite/tls_test_c.c: New file.
12803 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12804 * configure.ac: Check for OpenMP support.
12805 * configure, config.in, Makefile.in: Rebuild.
12806 * testsuite/Makefile.in: Rebuild.
12807
edfbb029
CC
128082008-04-16 Cary Coutant <ccoutant@google.com>
12809
12810 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12811 (Target_i386::tls_base_symbol_defined_): New field.
12812 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12813 (Target_i386::Scan::global): Likewise.
12814 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12815 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12816 (Target_x86_64::tls_base_symbol_defined_): New field.
12817 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12818 (Target_x86_64::Scan::global): Likewise.
12819
f3c69fca
CC
128202008-04-16 Cary Coutant <ccoutant@google.com>
12821
12822 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12823 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12824 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12825 building shared libraries.
12826 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12827 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12828 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12829 * testsuite/Makefile.in: Rebuild.
12830 * testsuite/weak_undef.h: New file.
12831 * testsuite/weak_undef_file1.cc: Add extra test cases.
12832 * testsuite/weak_undef_file2.cc: Likewise.
12833 * testsuite/weak_undef_test.cc: Likewise.
12834
7c414435
DM
128352008-04-16 David S. Miller <davem@davemloft.net>
12836
32b769e1
DM
12837 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12838 Add issued_non_pic_error_ field. Declare check_non_pic.
12839 (Target_sparc::Scan::check_non_pic): New function.
12840 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12841 (Target_sparc::Scan::global): Likewise.
12842
11936fb1
DM
12843 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12844 * configure: Rebuild.
12845
7c414435
DM
12846 * options.h (DEFINE_enable): New macro.
12847 (new_dtags): New enable option.
12848 (initfirst, interpose, loadfltr, nodefaultlib,
12849 nodelete, nodlopen, nodump): New -z options.
12850 * layout.cc (Layout:finish_dynamic_section): If new
12851 dtags enabled, emit DT_RUNPATH. Also, emit a
12852 DT_FLAGS_1 containing any specified -z flags.
12853
85c7bf8b
ILT
128542008-04-16 Ian Lance Taylor <iant@google.com>
12855
12c0daef
ILT
12856 * copy-relocs.cc: New file.
12857 * copy-relocs.h: New file.
12858 * reloc.cc: Remove Copy_relocs code.
12859 * reloc.h: Likewise.
12860 * reloc-types.h (struct Reloc_types) [both versions]: Add
12861 get_reloc_addend_noerror.
12862 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12863 variants of add_global which take an addend which must be zero.
12864 * i386.cc: Include "copy-relocs.h".
12865 (class Target_i386): Change type of copy_relocs_ to variable,
12866 update initializer.
12867 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12868 Change all callers.
12869 (Target_i386::do_finalize_sections): Change handling of
12870 copy_relocs_.
12871 * sparc.cc: Include "copy-relocs.h".
12872 (class Target_sparc): Change type of copy_relocs_ to variable,
12873 update initializer.
12874 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12875 Change all callers.
12876 (Target_sparc::do_finalize_sections): Change handling of
12877 copy_relocs_.
12878 * x86_64.cc: Include "copy-relocs.h".
12879 (class Target_x86_64): Change type of copy_relocs_ to variable,
12880 update initializer.
12881 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12882 class. Change all callers.
12883 (Target_x86_64::do_finalize_sections): Change handling of
12884 copy_relocs_.
12885 * Makefile.am (CCFILES): Add copy-relocs.cc.
12886 (HFILES): Add copy-relocs.h.
12887
4f4995b6
ILT
12888 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12889
85c7bf8b
ILT
12890 * testsuite/script_test_4.sh: Permit leading zeroes.
12891
4f2a9edd
ILT
128922008-04-15 Ian Lance Taylor <iant@google.com>
12893
e6188289
ILT
12894 * script-sections.cc (Script_sections::create_segments): Use
12895 header_size_adjustment even when there is enough room for the
12896 headers.
12897 * testsuite/script_test_4.sh: New file.
12898 * testsuite/script_test_4.t: New file.
12899 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12900 (check_DATA): Add script_test_4.stdout.
12901 (MOSTLYCLEANFILES): Likewise.
12902 (script_test_4): New target.
12903 (script_test_4.stdout): New target.
12904 * testsuite/Makefile.in: Rebuild.
12905
4f2a9edd
ILT
12906 * sparc.cc: Add definitions for Output_data_plt_sparc class
12907 constants.
12908
f5314dd5
DM
129092008-04-14 David S. Miller <davem@davemloft.net>
12910
12911 * sparc.cc: New file.
12912 * Makefile.am (TARGETSOURCES): Add sparc.cc
12913 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12914 * configure.tgt: Document targ_extra_size and
12915 targ_extra_big_endian. Add entries for sparc-* and
12916 sparc64-*.
12917 * configure.ac: Handle targ_extra_size and
12918 targ_extra_big_endian.
12919 * Makefile.in: Rebuild.
12920 * configure: Likewise.
12921 * po/POTFILES.in: Likewise.
12922 * po/gold.pot: Likewise.
12923
154e0e9a
ILT
129242008-04-14 Ian Lance Taylor <iant@google.com>
12925
12926 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12927 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12928 in the name/type/flags to section mapping. Don't call
12929 allocate_output_section.
12930 (Layout::choose_output_section): Change parameter from adjust_name
12931 to is_input_section. Don't permit input sections after sections
12932 are attached to segments. Don't call allocate_output_section.
12933 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12934 not write_enable_output_section.
12935 (Layout::make_output_section): Don't push to
12936 unattached_section_list_ nor call attach_to_segment. Call
12937 attach_section_to_segment if sections are attached.
12938 (Layout::attach_sections_to_segments): New function.
12939 (Layout::attach_section_to_segment): New function.
12940 (Layout::attach_allocated_section_to_segment): Rename from
12941 attach_to_segment. Remove flags parameter.
12942 (Layout::allocate_output_section): Remove function.
12943 (Layout::write_enable_output_section): Remove function.
12944 * layout.h (class Layout): Update for above changes. Add new
12945 field sections_are_attached_.
12946 * output.h (Output_section::update_flags_for_input_section): New
12947 function.
12948 * output.cc (Output_section::add_input_section): Call
12949 update_flags_for_input_section.
12950 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12951
009a67a2
CC
129522008-04-11 Cary Coutant <ccoutant@google.com>
12953
12954 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12955 thought unnecessary.
12956 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12957
759b1a24
ILT
129582008-04-11 Ian Lance Taylor <iant@google.com>
12959
12960 * output.h (class Output_section_data): Remove inline definition
12961 of set_addralign.
12962 * output.cc (Output_section_data::set_addralign): New function.
12963
c2b45e22
CC
129642008-04-11 Cary Coutant <ccoutant@google.com>
12965
12966 Add support for TLS descriptors for i386 and x86_64.
12967 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12968 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12969 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12970 GOT_TYPE_TLS_DESC.
12971 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12972 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12973 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12974 relocations.
12975 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12976 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12977 Fix problem with initial-exec relocations.
12978 (Target_i386::Relocate::relocate_tls): Likewise.
12979 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12980 relaxation.
12981 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12982 support for section-plus-offset dynamic table entries.
12983 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12984 (Output_data_dynamic::Dynamic_entry): Add support for
12985 section-plus-offset dynamic table entries.
12986 (Output_data_dynamic::Classification): Likewise.
12987 (Output_data_dynamic::classification_): Renamed offset_.
12988 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12989 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12990 (Target_x86_64::make_plt_section): New function.
12991 (Target_x86_64::reserve_tlsdesc_entries): New function.
12992 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12993 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12994 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12995 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12996 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12997 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12998 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12999 add extra PLT entry for TLS descriptors.
13000 (Output_data_plt_x86_64::got_): New field.
13001 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
13002 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
13003 fields.
13004 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
13005 descriptors.
13006 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
13007 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
13008 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
13009 R_386_TLS_DESC_CALL relocations.
13010 (Target_x86_64::Scan::global): Likewise.
13011 (Target_x86_64::do_finalize_sections): Add dynamic table entries
13012 for TLS descriptors.
13013 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
13014 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
13015 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
13016 GD-to-IE relaxation.
13017 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
13018 and TLS_DESCRIPTORS.
13019 * Makefile.in: Rebuild.
13020 * configure: Rebuild.
13021 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
13022 (tls_test_shared2.so): New target.
13023 (tls_shared_gd_to_ie_test_SOURCES): New variable.
13024 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
13025 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
13026 (tls_shared_gd_to_ie_test_LDADD): New variable.
13027 (tls_shared_gnu2_gd_to_ie_test): New target.
13028 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
13029 New targets.
13030 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
13031 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
13032 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
13033 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
13034 (tls_shared_gnu2_test): New target.
13035 (tls_test_gnu2_shared.so): New target.
13036 (tls_shared_gnu2_test_SOURCES): New variable.
13037 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
13038 (tls_shared_gnu2_test_LDFLAGS): New variable.
13039 (tls_shared_gnu2_test_LDADD): New variable.
13040 * testsuite/Makefile.in: Rebuild.
13041 * testsuite/Makefile.
13042
83bfb6b7
ILT
130432008-04-11 Ian Lance Taylor <iant@google.com>
13044
13045 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
13046 justsyms.t.
13047 * testsuite/Makefile.in: Rebuild.
13048
13049 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
13050 long.
13051 * testsuite/script_test_2.cc (main): Adjust test.
13052
706e1f5e
ILT
130532008-04-11 David S. Miller <davem@davemloft.net>
13054 Ian Lance Taylor <iant@google.com>
13055
13056 * options.h (General_options): Add entries for '-Y' and
13057 '-relax'.
13058 * options.cc (General_options:finalize): If -Y was used, add those
13059 entries to the library path instead of the default "/lib" and
13060 "/usr/lib".
13061
7c98e6bb
DM
130622008-04-11 David S. Miller <davem@davemloft.net>
13063
13064 * testsuite/justsyms.t: Start at 0x100.
13065 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
13066 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
13067 long.
13068 * testsuite/script_test_2.cc: Adjust string and section length
13069 checks.
7c98e6bb 13070
99a37bfd
ILT
130712008-04-09 Ian Lance Taylor <iant@google.com>
13072
2cefc357
ILT
13073 PR gold/5996
13074 * script-sections.cc (Sections_element::allocate_to_segment): Add
13075 orphan parameter.
13076 (Output_section_definition::allocate_to_segment): Likewise.
13077 (Orphan_output_section::allocate_to_segment): Likewise.
13078 (Script_sections::attach_sections_using_phdrs_clause): Don't
13079 propagate non-PT_LOAD segments to orphan sections.
13080 * testsuite/Makefile.am (script_test_3.stdout): Generate using
13081 readelf rather than objdump.
13082 * testsuite/script_test_3.sh: Adjust accordingly. Test that
13083 .interp section and PT_INTERP segment are the same size.
13084 * testsuite/Makefile.in: Rebuild.
13085
99a37bfd
ILT
13086 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
13087 aliases for symbols defined in the same object.
13088 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
13089 (weak_alias_test_SOURCES): New variable.
13090 (weak_alias_test_DEPENDENCIES): New variable.
13091 (weak_alias_test_LDFLAGS): New variable.
13092 (weak_alias_test_LDADD): New variable.
13093 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
13094 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
13095 (weak_alias_test_3.o): New target.
13096 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
13097 * testsuite/weak_alias_test_main.cc: New file.
13098 * testsuite/weak_alias_test_1.cc: New file.
13099 * testsuite/weak_alias_test_2.cc: New file.
13100 * testsuite/weak_alias_test_3.cc: New file.
13101
780e49c5
ILT
131022008-04-08 Ian Lance Taylor <iant@google.com>
13103
cdb0b8f5
ILT
13104 * options.h (class General_options): Add --noinhibit-exec option.
13105 * main.cc (main): Check --noinhibit-exec.
13106
0864d551
ILT
13107 * options.h (class General_options): Define --wrap as a special
13108 option. Add wrap_symbols_ field.
13109 (General_options::any_wrap_symbols): New function.
13110 (General_options::is_wrap_symbol): New function.
13111 * options.cc (General_options::parse_wrap): New function.
13112 (General_options::General_options): Initialize wrap_symbols_.
13113 * symtab.cc (Symbol_table::wrap_symbol): New function.
13114 (Symbol_table::add_from_object): Handle --wrap.
13115 * symtab.h (class Symbol_table): Declare wrap_symbol.
13116 * target.h (Target::wrap_char): New function.
13117 (Target::Target_info): Add wrap_char field.
13118 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
13119 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
13120 * testsuite/testfile.cc (Target_test::test_target_info):
13121 Likewise.
13122
789aa6de
ILT
13123 * errors.cc (Errors::undefined_symbol): Mention symbol version if
13124 there is one.
13125
2c38906f
ILT
13126 * layout.h (class Layout): Add added_eh_frame_data_ field.
13127 * layout.cc (Layout::Layout): Initialize new field.
13128 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
13129 output section until we find a section we merged successfully.
13130 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
13131 that the size be non-zero.
13132
780e49c5
ILT
13133 * merge.cc (Object_merge_map::get_output_offset): Remove inline
13134 qualifier.
13135
7fcd0256
ILT
131362008-04-08 Craig Silverstein <csilvers@google.com>
13137
13138 * configure.ac: Export new conditional variable HAVE_ZLIB.
13139 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
13140 on HAVE_ZLIB.
13141 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
13142 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13143
6835af53
ILT
131442008-04-07 Ian Lance Taylor <iant@google.com>
13145
e24f324c
ILT
13146 * version.cc (version_string): Set to "1.5".
13147
a036edd8
ILT
13148 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
13149 Add issued_non_pic_error_ field. Declare check_non_pic.
13150 (Target_x86_64::Scan::check_non_pic): New function.
13151 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
13152 (Target_x86_64::Scan::global): Likewise.
13153
624f8810
ILT
13154 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
13155 addend parameter. Change caller. Handle merge sections.
13156 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
13157 Address to Addend. Don't add in the result of
13158 local_section_offset, pass down the addend and use the returned
13159 value.
13160 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
13161 Update declarations of local_section_offset and symbol_value.
13162 * testsuite/two_file_test_1.cc (t18): New function.
13163 * testsuite/two_file_test_2.cc (f18): New function.
13164 * testsuite/two_file_test_main.cc (main): Call t18.
13165 * testsuite/two_file_test.h (t18, f18): Declare.
13166
6835af53
ILT
13167 * configure.ac: Don't test for objdump, c++filt, or readelf.
13168 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
13169 conditionals.
13170 (TEST_READELF): New variable.
13171 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
13172 (check_PROGRAMS): Add two_file_strip_test.
13173 (two_file_strip_test): New target.
13174 (check_PROGRAMS): Add two_file_same_shared_strip_test.
13175 (two_file_same_shared_strip_test_SOURCES): New variable.
13176 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
13177 (two_file_same_shared_strip_test_LDFLAGS): New variable.
13178 (two_file_same_shared_strip_test_LDADD): New variable.
13179 (two_file_shared_strip.so): New target.
13180 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
13181 (ver_test_5.syms, ver_test_7.syms): Likewise.
13182 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
13183 (strip_test_3.stdout): Use TEST_OBJDUMP.
13184 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13185
86925eef
CC
131862008-04-04 Cary Coutant <ccoutant@google.com>
13187
13188 * symtab.h (Symbol::is_weak_undefined): New function.
13189 (Symbol::is_strong_undefined): New function.
13190 (Symbol::is_absolute): New function.
13191 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
13192 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
13193 absolute symbols.
13194 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
13195 (weak_undef_test): New target.
13196 * testsuite/Makefile.in: Rebuild.
13197 * testsuite/weak_undef_file1.cc: New file.
13198 * testsuite/weak_undef_file2.cc: New file.
13199 * testsuite/weak_undef_test.cc: New file.
13200
126f3ece
ILT
132012008-04-03 Craig Silverstein <csilvers@google.com>
13202
13203 * compressed_output.h (class Output_compressed_section): Use
13204 unsigned buffer.
13205 * compressed_output.cc (zlib_compress): Use unsigned buffers,
13206 add zlib header.
13207 (zlib_compressed_suffix): Removed.
13208 (Output_compressed_section::set_final_data_size): Use unsigned
13209 buffers.
13210 * testsuite/Makefile.am (flagstest_compress_debug_sections):
13211 Fix linker invocation.
13212 (flagstest_o_specialfile_and_compress_debug_sections):
13213 Likewise.
13214 * testsuite/Makefile.in: Regenerated.
13215
deae2a14
DM
132162008-04-02 David S. Miller <davem@davemloft.net>
13217
13218 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
13219 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
13220
70752818
ILT
132212008-04-02 Craig Silverstein <csilvers@google.com>
13222
13223 * TODO: New file.
13224
39d0cb0e
ILT
132252008-04-02 Ian Lance Taylor <iant@google.com>
13226
13227 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13228 parameters. Update for new key type to views_. Change all
13229 callers.
13230 (File_read::read): Adjust for byteshift in returned view.
13231 (File_read::add_view): New function, broken out of
13232 find_and_make_view.
13233 (File_read::make_view): New function, broken out of
13234 find_and_make_view.
13235 (File_read::find_or_make_view): Add offset and aligned
13236 parameters. Rewrite accordingly. Change all callers.
13237 (File_read::get_view): Add offset and aligned parameters. Adjust
13238 for byteshift in return value.
13239 (File_read::get_lasting_view): Likewise.
13240 * fileread.h (class File_read): Update declarations.
13241 (class File_read::View): Add byteshift_ field. Add byteshift to
13242 constructor. Add byteshift method.
13243 * archive.h (Archive::clear_uncached_views): New function.
13244 (Archive::get_view): Add aligned parameter. Change all callers.
13245 * object.h (Object::get_view): Add aligned parameter. Change all
13246 callers.
13247 (Object::get_lasting_view): Likewise.
13248
13249 * fileread.cc (File_read::release): Don't call clear_views if
13250 there are multiple objects.
13251 * fileread.h (File_read::clear_uncached_views): New function.
13252 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
13253 on the archive.
13254
a1207466
CC
132552008-03-31 Cary Coutant <ccoutant@google.com>
13256
13257 Add thin archive support.
13258 * archive.cc (Archive::armagt): New const.
13259 (Archive::setup): Remove task parameter and calls to unlock.
13260 (Archive::unlock_nested_archives): New function.
13261 (Archive::read_header): Add nested_off parameter. Change
13262 all callers.
13263 (Archive::interpret_header): Likewise.
13264 (Archive::include_all_members): Change to handle thin
13265 archives.
13266 (Archive::include_member): Likewise.
13267 * archive.h (Archive::Archive): Add new parameters and
13268 initializers.
13269 (Archive::armagt): New const.
13270 (Archive::setup): Remove task parameter.
13271 (Archive::unlock_nested_archives): New function.
13272 (Archive::read_header): Add nested_off parameter.
13273 (Archive::interpret_header): Likewise.
13274 (Archive::Nested_archive_table): New typedef.
13275 (Archive::is_thin_archive_): New field.
13276 (Archive::nested_archives_): New field.
13277 (Archive::options_): New field.
13278 (Archive::dirpath_): New field.
13279 (Archive::task_): New field.
13280 * readsyms.cc (Read_symbols::do_read_symbols): Add check
13281 for thin archives. Pass additional parameters to
13282 Archive::Archive. Unlock the archive file after calling
13283 Archive::setup.
cd536b21 13284
479f6503
ILT
132852008-03-29 Ian Lance Taylor <iant@google.com>
13286
686c8caf
ILT
13287 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
13288 version symbol to be local.
13289 * testsuite/ver_test_4.sh: New file.
13290 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
13291 (check_DATA): Add ver_test_4.syms.
13292 (ver_test_4.syms): New target.
13293 * testsuite/Makefile.in: Rebuild.
13294
ab794b6b
ILT
13295 * output.cc
13296 (Output_section::Input_section_sort_entry::has_priority): New
13297 function.
13298 (Output_section::Input_section_sort_entry::match_file_name): New
13299 function.
13300 (Output_section::Input_section_sort_entry::match_section_name):
13301 Remove.
13302 (Output_section::Input_section_sort_entry::match_section_name_prefix):
13303 Remove.
13304 (Output_section::Input_section_sort_entry::match_section_file):
13305 Remove.
13306 (Output_section::Input_section_sort_compare::operator()): Rewrite
13307 using new Input_section_sort_entry functions. Sort crtbegin and
13308 crtend first. Sort sections with no priority before sections with
13309 a priority.
13310 * testsuite/initpri1.c (d3): Check j != 4.
13311 (cd5): New constructor/destructor function.
13312 (main): Check j != 2.
13313
479f6503
ILT
13314 * symtab.cc (Symbol_table::add_from_object): If we don't use the
13315 new symbol when resolving, don't call set_is_default.
13316 * testsuite/ver_test_7.cc: New file.
13317 * testsuite/ver_test_7.sh: New file.
13318 * testsuite/Makefile.am (ver_test_7.so): New target.
13319 (ver_test_7.o): New target.
13320 (check_SCRIPTS): Add ver_test_7.sh.
13321 (check_DATA): Add ver_test_7.syms.
13322 (ver_test_7.syms): New target.
13323
2fd32231
ILT
133242008-03-28 Ian Lance Taylor <iant@google.com>
13325
13326 * layout.cc (Layout::layout): If we see an input section with a
13327 name that needs sorting, set the must_sort flag for the output
13328 section.
13329 (Layout::make_output_section): If the name of the output section
13330 indicates that it might require sorting, set the may_sort flag.
13331 * output.h (Output_section::may_sort_attached_input_sections): New
13332 function.
13333 (Output_section::set_may_sort_attached_input_sections): New
13334 function.
13335 (Output_section::must_sort_attached_input_sections): New
13336 function.
13337 (Output_section::set_must_sort_attached_input_sections): New
13338 function.
13339 (class Output_section): Declare Input_section_sort_entry. Define
13340 Input_section_sort_compare. Declare
13341 sort_attached_input_sections. Add new fields:
13342 may_sort_attached_input_sections_,
13343 must_sort_attached_input_sections_,
13344 attached_input_sections_are_sorted_.
13345 * output.cc (Output_section::Output_section): Initialize new
13346 fields.
13347 (Output_section::add_input_section): Add an entry to
13348 input_sections_ if may_sort or must_sort are true.
13349 (Output_section::set_final_data_size): Call
13350 sort_attached_input_sections if necessary.
13351 (Output_section::Input_section_sort_entry): Define new class.
13352 (Output_section::Input_section_sort_compare::operator()): New
13353 function.
13354 (Output_section::sort_attached_input_sections): New function.
13355 * configure.ac: Check whether the compiler supports constructor
13356 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13357 * testsuite/initpri1.c: New file.
13358 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13359 CONSTRUCTOR_PRIORITY.
13360 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13361 (initpri1_LDFLAGS): New variable.
13362 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13363
18e6b24e
ILT
133642008-03-27 Ian Lance Taylor <iant@google.com>
13365
49bdd526
ILT
13366 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13367 * testsuite/common_test_1.c: New file.
13368 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13369 (common_test_1_SOURCES): New variable.
13370 (common_test_1_DEPENDENCIES): New variable.
13371 (common_test_1_LDFLAGS): New variable.
13372
18e6b24e
ILT
13373 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13374 and commons_ correctly when NAME/VERSION does not override
13375 NAME/NULL.
13376 * testsuite/ver_test_6.c: New file.
13377 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13378 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13379 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13380
04bf7072
ILT
133812008-03-26 Ian Lance Taylor <iant@google.com>
13382
5871526f
ILT
13383 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13384 of an undefined symbol from a version script.
13385 * testsuite/Makefile.am (ver_test_5.so): New target.
13386 (ver_test_5.o): New target.
13387 (check_SCRIPTS): Add ver_test_5.sh.
13388 (check_DATA): Add ver_test_5.syms.
13389 (ver_test_5.syms): New target.
13390 * testsuite/ver_test_5.cc: New file.
13391 * testsuite/ver_test_5.script: New file.
13392 * testsuite/ver_test_5.sh: New file.
13393 * Makefile.in, testsuite/Makefile.in: Rebuild.
13394
04bf7072
ILT
13395 PR gold/5986
13396 Fix problems building gold with gcc 4.3.0.
13397 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13398 (gold_error_at_location, gold_warning_at_location): Use it.
13399 * configure.ac: Check whether we can compile and use a template
13400 function with a printf attribute.
13401 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13402 when jumping over bytes.
13403 * object.cc: Instantiate Object::read_section_data.
13404 * debug.h: Include <cstring>
13405 * dwarf_reader.cc: Include <algorithm>
13406 * main.cc: Include <cstring>.
13407 * options.cc: Include <cstring>.
13408 * output.cc: Include <cstring>.
13409 * script.cc: Include <cstring>.
13410 * script.h: Include <string>.
13411 * symtab.cc: Include <cstring> and <algorithm>.
13412 * target-select.cc: Include <cstring>.
13413 * version.cc: Include <string>.
13414 * testsuite/testmain.cc: Include <cstdlib>.
13415 * configure, config.in: Rebuild.
13416
874c5b28
ILT
134172008-03-25 Ian Lance Taylor <iant@google.com>
13418
819d6c3a
ILT
13419 * options.cc: Include "../bfd/bfdver.h".
13420 (options::help): Print bug reporting address.
13421
f4b2c6f5
ILT
13422 * version.cc (print_version): Adjust output for current value of
13423 BFD_VERSION_STRING.
13424
13425 * NEWS: New file.
13426
e96caa79
ILT
13427 * options.cc (options::help): Print list of supported targets.
13428 * target-select.h: Include <vector>.
13429 (class Target_selector): Make machine_, size_, and is_big_endian_
13430 fields const. Add bfd_name_ and instantiated_target_ fields.
13431 (Target_selector::Target_selector): Add bfd_name parameter.
13432 (Target_selector::recognize): Make non-virtual, call
13433 do_recognize.
13434 (Target_selector::recognize_by_name): Make non-virtual, call
13435 do_recognize_by_name.
13436 (Target_selector::supported_names): New function.
13437 (Target_selector::bfd_name): New function.
13438 (Target_selector::do_instantiate_target): New pure virtual
13439 function.
13440 (Target_selector::do_recognize): New virtual function.
13441 (Target_selector::do_recognize_by_name): New virtual function.
13442 (Target_selector::instantiate_target): New private function.
13443 (supported_target_names): Declare.
13444 * target-select.cc (Target_selector::Target_selector): Update for
13445 new parameter and fields.
13446 (select_target_by_name): Check that the name matches before
13447 calling recognize_by_name.
13448 (supported_target_names): New function.
13449 * i386.cc (class Target_selector_i386): Update Target_selector
13450 constructor call. Remove recognize and recognize_by_name. Add
13451 do_instantiate_target.
13452 * x86_64.cc (class Target_selector_x86_64): Likewise.
13453 * testsuite/testfile.cc (class Target_selector_test): Update for
13454 changes to Target_selector.
13455
874c5b28
ILT
13456 * README: Rewrite, with some notes on unsupported features.
13457
0a65a3a7
CC
134582008-03-24 Cary Coutant <ccoutant@google.com>
13459
13460 * i386.cc (Target_i386::Got_type): New enum declaration.
13461 (Target_i386::Scan::local): Updated callers of Output_data_got
13462 member functions.
13463 (Target_i386::Scan::global): Likewise.
13464 (Target_i386::Relocate::relocate): Likewise.
13465 (Target_i386::Relocate::relocate_tls): Likewise.
13466 * object.h (Got_offset_list): New class.
13467 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13468 (Sized_relobj::local_got_offset): Likewise.
13469 (Sized_relobj::set_local_got_offset): Likewise.
13470 (Sized_relobj::local_has_tls_got_offset): Removed.
13471 (Sized_relobj::local_tls_got_offset): Removed.
13472 (Sized_relobj::set_local_tls_got_offset): Removed.
13473 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13474 * output.cc (Output_data_got::add_global): Added got_type parameter.
13475 (Output_data_got::add_global_with_rel): Likewise.
13476 (Output_data_got::add_global_with_rela): Likewise.
13477 (Output_data_got::add_global_pair_with_rel): New function.
13478 (Output_data_got::add_global_pair_with_rela): New function.
13479 (Output_data_got::add_local): Added got_type parameter.
13480 (Output_data_got::add_local_with_rel): Likewise.
13481 (Output_data_got::add_local_with_rela): Likewise.
13482 (Output_data_got::add_local_pair_with_rel): New function.
13483 (Output_data_got::add_local_pair_with_rela): New function.
13484 (Output_data_got::add_global_tls): Removed.
13485 (Output_data_got::add_global_tls_with_rel): Removed.
13486 (Output_data_got::add_global_tls_with_rela): Removed.
13487 (Output_data_got::add_local_tls): Removed.
13488 (Output_data_got::add_local_tls_with_rel): Removed.
13489 (Output_data_got::add_local_tls_with_rela): Removed.
13490 * output.h (Output_data_got::add_global): Added got_type parameter.
13491 (Output_data_got::add_global_with_rel): Likewise.
13492 (Output_data_got::add_global_with_rela): Likewise.
13493 (Output_data_got::add_global_pair_with_rel): New function.
13494 (Output_data_got::add_global_pair_with_rela): New function.
13495 (Output_data_got::add_local): Added got_type parameter.
13496 (Output_data_got::add_local_with_rel): Likewise.
13497 (Output_data_got::add_local_with_rela): Likewise.
13498 (Output_data_got::add_local_pair_with_rel): New function.
13499 (Output_data_got::add_local_pair_with_rela): New function.
13500 (Output_data_got::add_global_tls): Removed.
13501 (Output_data_got::add_global_tls_with_rel): Removed.
13502 (Output_data_got::add_global_tls_with_rela): Removed.
13503 (Output_data_got::add_local_tls): Removed.
13504 (Output_data_got::add_local_tls_with_rel): Removed.
13505 (Output_data_got::add_local_tls_with_rela): Removed.
13506 * resolve.cc (Symbol::override_base_with_special): Removed
13507 reference to has_got_offset_ field.
13508 * symtab.cc (Symbol::init_fields): Replaced initialization
13509 of got_offset_ with got_offsets_. Removed initialization
13510 of has_got_offset_
53fcba31 13511 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13512 (Symbol::got_offset): Likewise.
13513 (Symbol::set_got_offset): Likewise.
13514 (Symbol::has_tls_got_offset): Removed.
13515 (Symbol::tls_got_offset): Removed.
13516 (Symbol::set_tls_got_offset): Removed.
13517 (Symbol::got_offset_): Removed.
13518 (Symbol::tls_mod_got_offset_): Removed.
13519 (Symbol::tls_pair_got_offset_): Removed.
13520 (Symbol::got_offsets_): New field.
13521 (Symbol::has_got_offset): Removed.
13522 (Symbol::has_tls_mod_got_offset): Removed.
13523 (Symbol::has_tls_pair_got_offset): Removed.
13524 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13525 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13526 member functions.
13527 (Target_x86_64::Scan::global): Likewise.
13528 (Target_x86_64::Relocate::relocate): Likewise.
13529 (Target_x86_64::Relocate::relocate_tls): Likewise.
13530
bd52eafb
BE
135312008-03-25 Ben Elliston <bje@au.ibm.com>
13532
13533 * yyscript.y: Fix spelling error in comment.
13534
8b105e34
ILT
135352008-03-24 Ian Lance Taylor <iant@google.com>
13536
8ed814a9
ILT
13537 * options.h (class General_options): Define build_id option.
13538 * layout.h (class Layout): Declare write_build_id, create_note,
13539 create_build_id. Add build_id_note_ member.
13540 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13541 "libiberty.h", "md5.h", "sha1.h".
13542 (Layout::Layout): Initialize eh_frame_data_,
13543 eh_frame_hdr_section_, and build_id_note_.
13544 (Layout::finalize): Call create_build_id.
13545 (Layout::create_note): New function, broken out of
13546 Layout::create_gold_note.
13547 (Layout::create_gold_note): Call create_note.
13548 (Layout::create_build_id): New function.
13549 (Layout::write_build_id): New function.
13550 (Close_task_runner::run): Call write_build_id.
13551
8b105e34
ILT
13552 * x86_64.cc: Correct license to GPLv3.
13553
086a1841
ILT
135542008-03-23 Ian Lance Taylor <iant@google.com>
13555
13556 * options.cc: Include "demangle.h".
13557 (parse_optional_string): New function.
13558 (parse_long_option): Handle takes_optional_argument.
13559 (parse_short_option): Update dash_z initializer. Handle
13560 takes_optional_argument.
13561 (General_options::General_options): Initialize do_demangle_.
13562 (General_options::finalize): Set do_demangle_. Handle demangling
13563 style.
13564 * options.h (parse_optional_string): Declare.
13565 (struct One_option): Add optional_arg field. Update constructor.
13566 Update call constructor calls. Add takes_optional_argument
13567 function.
13568 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13569 (DEFINE_optional_string): Define.
13570 (General_options::demangle): Change from DEFINE_bool to
13571 DEFINE_optional_string.
13572 (General_options::no_demangle): New function.
13573 (General_options::do_demangle): New function.
13574 (General_options::set_do_demangle): New function.
13575 (General_options::execstack_status_): Move definition to end of
13576 class definition.
13577 (General_options::static_): Likewise.
13578 (General_options::do_demangle_): New field.
13579 * object.cc (big_endian>::get_symbol_location_info): Call
13580 Options::do_demangle, not Options::demangle.
13581 * symtab.cc (demangle): Likewise.
13582
cbb93e63
ILT
135832008-03-22 Ian Lance Taylor <iant@google.com>
13584
13585 * gold.h: Include <cstddef> and <sys/types.h>
13586 * options.h: Include <cstring>.
13587
ec531623
ILT
135882008-03-21 Ian Lance Taylor <iant@google.com>
13589
13590 * Added source code to GNU binutils.
This page took 0.813173 seconds and 4 git commands to generate.