[aarch64] use aarch64_decode_insn to decode instructions in GDB
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
9eacb935
CC
12015-10-06 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/18855
4 * sparc.cc (Sparc_relocate_functions::gdop_hix22): Remove addend
5 parameter.
6 (Sparc_relocate_functions::gdop_lox10): Likewise.
7 (Target_sparc::Relocate::relocate): Use addend when computing
8 symbol value for R_SPARC_GOTDATA_OP*.
9
3d4fde69
CC
102015-09-07 Cary Coutant <ccoutant@gmail.com>
11
12 PR gold/18930
13 PR gold/18886
14 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
15 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
16
358de988
L
172015-09-02 H.J. Lu <hongjiu.lu@intel.com>
18
19 PR gold/18886
20 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
21 shared libraries into normal FUNC symbols.
22 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
23 symbols aren't from shared libraries.
24
d49044c7
AM
252015-09-02 Alan Modra <amodra@gmail.com>
26
27 PR 18878
28 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
29 (Target_powerpc::Branch_info::make_stub): Determine whether long
30 branch stub is for save/restore function.
31 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
32 (Stub_table): Add need_save_res_.
33 (Stub_table:clear_stubs): Clear need_save_res_.
34 (Stub_table:set_address_and_size): Add save/restore section size.
35 (Stub_table::add_long_branch_entry): Add save_res param. Set
36 need_save_res_, but don't add space for save/restore stubs.
37 (Stub_table::find_long_branch_entry): Return offset to local copy
38 of save/restore func.
39 (Stub_table::do_write): Don't output save/restore stubs. Instead
40 copy the save/restore functions.
41 (Output_data_save_res:contents): New accessor.
42 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
43
7c61d651
CC
442015-08-25 Cary Coutant <ccoutant@gmail.com>
45
46 PR gold/18847
47 * script-sections.cc (Memory_region::set_address): New method.
48 (Script_sections::find_memory_region): Add explicit_only parameter.
49 (Output_section_definition::set_section_addresses): Handle case where
50 script specifies both address and vma region.
51 * script-sections.h (Script_sections::find_memory_region): Add
52 explicit_only parameter.
53
4bfacfd3
CC
542015-08-25 Cary Coutant <ccoutant@gmail.com>
55
56 PR gold/18859
57 * object.cc (Input_objects::add_object): Store objects in a map,
58 indexed by soname; update as-needed flag when necessary.
59 * object.h (Object::clear_as_needed): New method.
60 (Input_objects::so_names_): Change from set to map.
61
1757d35c
CC
622015-08-25 Cary Coutant <ccoutant@gmail.com>
63
64 PR gold/14746
65 * expression.cc (Expression::Expression_eval_info): Add
66 is_valid_pointer field.
67 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
68 Adjust all callers.
69 (Addr_expression::value_from_output_section): Check whether address
70 is valid.
71 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
72 if evaluation failed due to address that is not yet valid.
73 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
74 parameter.
75
3ac0a36c
CC
762015-08-25 Cary Coutant <ccoutant@gmail.com>
77
78 PR gold/18866
79 PR gold/18703
80 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
81
9215b98b
AM
822015-08-20 Alan Modra <amodra@gmail.com>
83
84 PR gold/18846
85 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
86 Subtract os->address() from addend.
87 * powerpc.cc (relocate_relocs): Likewise.
88
40fc1451
SD
892015-08-12 Simon Dardis <simon.dardis@imgtec.com>
90
91 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
92 lazy_stub_normal_1, lazy_stub_normal_1_n64,
93 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
94 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
95 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
96 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
97 of 'addu/daddu'.
98
37a42ee9
L
992015-07-27 H.J. Lu <hongjiu.lu@intel.com>
100
101 * configure: Regenerated.
102
ab3b14b0
DK
1032015-07-26 Doug Kwan <dougkwan@google.com>
104
105 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
106 disassembler output format.
107
cdb06167
HS
1082015-07-23 Ian Coolidge <icoolidge@google.com>
109 Plumb --pic-veneer option for gold.
110
111 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
112 generation.
113 * options.h (General_options): Add --pic-veneer option.
114
5b2af7dd
L
1152015-07-22 H.J. Lu <hongjiu.lu@intel.com>
116
117 PR gold/18663
118 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
119 script_test_1a.cc script_test_1b.cc.
120 (script_test_11_r.o): Replace script_test_11.o with
121 script_test_11a.o script_test_11b.o.
122 (script_test_11.o): Removed.
123 (script_test_11a.o): New.
124 (script_test_11b.o): Likewise.
125 * testsuite/Makefile.in: Regenerated.
126 * testsuite/script_test_1.h: New file.
127 * testsuite/script_test_1b.cc: Likewise.
128 * testsuite/script_test_11.h: Likewise.
129 * testsuite/script_test_11b.c: Likewise.
130 * testsuite/script_test_1.cc: Renamed to ...
131 * testsuite/script_test_1a.cc: This.
132 Include "script_test_1.h".
133 (main): Call check_int and check_ptr.
134 * testsuite/script_test_11.c: Renamed to ...
135 * testsuite/script_test_11a.c: This.
136 Include "script_test_11.h".
137 (main): Call ptr_equal.
138
cd78ea77
L
1392015-07-22 H.J. Lu <hongjiu.lu@intel.com>
140
141 PR gold/18628
142 * testsuite/ifuncdep2.c (global): Change protected to hidden.
143 * testsuite/ifuncmod1.c (global): Likewise.
144 * testsuite/ifuncmod5.c (global): Likewise.
145
f945ba50
AM
1462015-07-22 Alan Modra <amodra@gmail.com>
147
148 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
149
5417c94d
CC
1502015-07-21 Cary Coutant <ccoutant@gmail.com>
151
152 PR gold/18548
153 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
154 forced local symbol even when oldsym != NULL.
155 (Symbol_table::do_define_in_output_segment): Likewise.
156 (Symbol_table::do_define_as_constant): Likewise.
157
cb5cf5e2
CC
1582015-07-21 Cary Coutant <ccoutant@gmail.com>
159
b8c6c5ef 160 PR gold/18698
cb5cf5e2
CC
161 * archive.cc (Library_base::should_include_member): Don't use entry
162 point for relocatable links, or if target is not yet valid.
163 * parameters.cc (Parameters::entry): Check target_valid().
164
0ef3814f
HS
1652015-07-20 Han Shen <shenhan@google.com>
166
167 Optimize erratum 843419 fix.
168
169 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
170 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
171 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
172 (E843419_stub): New sub-class of Erratum_stub.
173 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
174 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
175 (AArch64_relobj::create_erratum_stub): Add 1 argument.
176 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
177
2bca0377
HS
1782015-07-20 Han Shen <shenhan@google.com>
179
180 Fix arm elf header flags wrt hardfp bit.
181
182 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
183
f54f5e31
L
1842015-07-20 H.J. Lu <hongjiu.lu@intel.com>
185
186 PR gold/18689
187 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
188 from input group section for relocatable link.
189 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
190 (check_DATA): Add pr18689.stdout.
191 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
192 (pr18689.stdout): New rule.
193 (pr18689a.o): Likewise.
194 (pr18689b.o): Likewise.
195 (pr18689.o): Likewise.
196 * testsuite/pr18689.c: New file.
197 * testsuite/pr18689.sh: Likewise.
198 * testsuite/Makefile.in: Regenerated.
199
c20ceeb2
YW
2002015-07-20 Yiran Wang <yiran@google.com>
201 Cary Coutant <ccoutant@gmail.com>
202
203 PR gold/15574
204 * resolve.cc (Symbol_table): Remove warning about references
205 from shared objects to hidden symbols.
206 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
207 * testsuite/Makefile.in: Regenerate.
208 * testsuite/hidden_test.sh: Check dynamic symbol table; update
209 expected error messages.
210
19a7fe52
L
2112015-07-14 H.J. Lu <hongjiu.lu@intel.com>
212
213 * compressed_output.cc (Output_compressed_section::set_final_data_size):
214 Make --compress-debug-sections=zlib the same as
215 --compress-debug-sections=zlib-gabi.
216 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
217 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
218 ".zdebug_".
219 * testsuite/Makefile.in: Regenerated.
220
fb8b9dbc
L
2212015-07-12 H.J. Lu <hongjiu.lu@intel.com>
222
223 PR gold/18322
224 * compressed_output.cc (zlib_compress): Add argument for
225 compression header size. Set header size to compression header
226 size if it isn't 0. Don't write out the zlib header here.
227 (Output_compressed_section::set_final_data_size): Support
228 zlib-gnu and zlib-gabi compressions. Pass compression header
229 size to zlib_compress and write out compression header. Set
230 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
231 clear the SHF_COMPRESSED bit
232 * options.h (compress_debug_sections): Add zlib-gnu and
233 zlib-gabi.
234 * output.h (Output_section::set_flags): New.
235 * testsuite/Makefile.am (check_PROGRAMS): Add
236 flagstest_compress_debug_sections_none,
237 flagstest_compress_debug_sections_gnu and
238 flagstest_compress_debug_sections_gabi.
239 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
240 flagstest_compress_debug_sections.stdout,
241 flagstest_compress_debug_sections.cmp,
242 flagstest_compress_debug_sections.check,
243 flagstest_compress_debug_sections_gnu.stdout,
244 flagstest_compress_debug_sections_gnu.cmp,
245 flagstest_compress_debug_sections_gnu.check,
246 flagstest_compress_debug_sections_gabi.stdout,
247 flagstest_compress_debug_sections_gabi.cmp and
248 flagstest_compress_debug_sections_gabi.check.
249 (flagstest_compress_debug_sections_none): New.
250 (flagstest_compress_debug_sections_none.stdout): Likewise.
251 (flagstest_compress_debug_sections.stdout): Likewise.
252 (flagstest_compress_debug_sections.check): Likewise.
253 (flagstest_compress_debug_sections.cmp): Likewise.
254 (flagstest_compress_debug_sections_gnu): Likewise.
255 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
256 (flagstest_compress_debug_sections_gnu.check): Likewise.
257 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
258 (flagstest_compress_debug_sections_gabi): Likewise.
259 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
260 (flagstest_compress_debug_sections_gnu.check): Likewise.
261 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
262 * testsuite/Makefile.in: Regenerated.
263
48058663
L
2642015-07-12 H.J. Lu <hongjiu.lu@intel.com>
265
266 PR gold/18321
267 * compressed_output.h (decompress_input_section): Add arguments
268 for ELF class, big endian and sh_flags.
269 * compressed_output.cc (decompress_input_section): Likewise.
270 Support the SHF_COMPRESSED section.
271 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
272 functions.
273 * plugin.h (Pluginobj): Likewise.
274 * layout.cc (Layout::get_output_section_flags): Also clear the
275 SHF_COMPRESSED bit.
276 * object.h (Compressed_section_info): Add flag to store sh_flags.
277 (Object): Add pure virtual elfsize and is_big_endian member
278 functions.
279 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
280 prefix here.
281 (build_compressed_section_map): Check SHF_COMPRESSED for
282 uncompressed size. Store sh_flags in Compressed_section_info.
283 Pass size, big_endian and sh_flags to decompress_input_section.
284 Skip the ".debug"/".zdebug" prefix when passing section name to
285 need_decompressed_section.
286 (Sized_relobj_file<size, big_endian>::do_find_special_section):
287 Don't check ".zdebug_*" sections.
288 (Object::decompressed_section_contents): Pass ELF class, big
289 endian and sh_flags to decompress_input_section.
290 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
291 Likewise.
292 * testsuite/Makefile.am (check_DATA): Add
293 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
294 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
295 gdb_index_test_2_gabi.stdout.
296 (debug_msg_cdebug_gabi.o): New.
297 (odr_violation1_cdebug_gabi.o): Likewise.
298 (odr_violation2_cdebug_gabi.o): Likewise.
299 (debug_msg_cdebug_gabi.err): Likewise.
300 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
301 (gdb_index_test_cdebug_gabi.o): Likewise.
302 (gdb_index_test_2_gabi): Likewise.
303 (gdb_index_test_2_gabi.stdout): Likewise.
304 * testsuite/gdb_index_test_2_gabi.sh: New file.
305 * testsuite/Makefile.in: Regenerated.
306
73854cdd
HS
3072015-07-09 Han Shen <shenhan@google.com>
308
309 Use "gold_info" instead of "gold_warning" for erratum fix.
310
311 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
312 'gold_info'.
313 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
314
61163dfa
HS
3152015-07-09 Han Shen <shenhan@google.com>
316
317 Drop missing symbol warning for arm/aarch64.
318
319 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
320 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
321 symbol warning.
322
b91deca9
HS
3232015-07-07 Han Shen <shenhan@google.com>
324
325 Make gold aarch64 accept long form of mapping symbols.
326
327 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
328 of mapping symbols.
329
15162bef
DK
3302015-06-29 Doug Kwan <dougkwan@google.com>
331
332 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
333 at address expected by test.
334 * testsuite/arm_cortex_a8_b.s: Ditto.
335 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
336 * testsuite/arm_cortex_a8_bl.s: Ditto.
337 * testsuite/arm_cortex_a8_blx.s: Ditto.
338 * testsuite/arm_cortex_a8_local.s: Ditto.
339 * testsuite/arm_fix_v4bx.s: Ditto.
340 * testsuite/arm_unaligned_reloc.s: Ditto.
341 * testsuite/thumb_bl_out_of_range.s: Ditto.
342 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
343 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 344
56b06706
HS
3452015-06-29 Han Shen <shenhan@google.com>
346
347 Patch for erratum 843419 internal error.
348
72f4393d
L
349 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
350 (Erratum_stub::update_erratum_insn): New method.
351 (Stub_table::relocate_stubs): Modified to place relocated insn.
352 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 353
2f0c79aa
HS
3542015-06-12 Han Shen <shenhan@google.com>
355
356 Fix erratum 835769.
357
72f4393d
L
358 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
359 defintion outside class definition.
360 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
361 (AArch64_insn_utilities::aarch64_op31): New member.
362 (AArch64_insn_utilities::aarch64_ra): New member.
363 (AArch64_insn_utilities::aarch64_mac): New member.
364 (AArch64_insn_utilities::aarch64_mlxl): New member.
365 (ST_E_835769): New global enum member.
366 (Stub_table::relocate_stubs): Add 835769 handler.
367 (Stub_template_repertoire::Stub_template_repertoire): Install new
368 stub type.
369 (AArch64_relobj::scan_errata): This func is renamed from
370 scan_erratum_843419.
371 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
372 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
373 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
374 (Target_aarch64::scan_erratum_835769_span): New method.
375 (Target_aarch64::create_erratum_stub): New method.
376 (Target_aarch64::is_erratum_835769_sequence): New method.
377 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
378 code into create_erratum_stub.
379 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 380
5d7908e0
CC
3812015-06-11 Cary Coutant <ccoutant@gmail.com>
382
383 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
384 outside class body.
385 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
386
dd68f8fa
CC
3872015-06-11 Cary Coutant <ccoutant@gmail.com>
388
389 PR gold/17731
390 * layout.cc (corresponding_uncompressed_section_name): New function.
391 (Layout::choose_output_section): Call it.
392 * layout.h (corresponding_uncompressed_section_name): New function.
393 * script-sections.cc (Input_section_info::set_section_name): Check
394 for compressed debug section (.zdebug style).
395
a3a0c391
JY
3962015-06-11 Jing Yu <jingyu@google.com>
397
398 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
399 * testsuite/Makefile.in: Regenerate.
400
970cdef2
DI
4012015-06-11 Davide Italiano <dccitaliano@gmail.com>
402
403 * gold.h (is_cident): Correct typo.
404
a48d0c12
HS
4052015-06-10 Han Shen <shenhan@google.com>
406 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
407
408 Now fixing for 843419 is fully functional.
409
410 The first part of the erratum fix CL is here -
411 https://sourceware.org/ml/binutils/2015-04/msg00229.html
412
413 * aarch64.cc(global enum): New constants representing stub types.
414 (Stub_template): New POD struct.
415 (Stub_template_repertoire): New class.
416 (Stub_base): New class.
417 (Erratum_stub): New class.
418 (Reloc_stub): Refactored to be a subclass of Stub_base.
419 (Reloc_stub::Stub_type): Removed.
420 (Reloc_stub::offset): Moved to Stub_base.
421 (Reloc_stub::set_offset): Moved to Stub_base.
422 (Reloc_stub::destination_address): Moved to Stub_base.
423 (Reloc_stub::set_destination_address): Moved to Stub_base.
424 (Reloc_stub::reset_destination_address): Moved to Stub_base.
425 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
426 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
427 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
428 (Reloc_stub::write): Moved to Stub_base.
429 (Reloc_stub::invalid_offset): Moved to Stub_base.
430 (Reloc_stub::invalid_address): Moved to Stub_base.
431 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
432 (Reloc_stub::stub_insns_): Moved to Stub_base.
433 (Reloc_stub::offset_): Moved to Stub_base.
434 (Reloc_stub::destination_address_): Moved to Stub_base.
435 (Stub_table::The_aarch64_relobj): New typedef.
436 (Stub_table::The_erratum_stub): New typedef.
437 (Stub_table::The_erratum_stub_less): New typedef.
438 (Stub_table::The_erratum_stub_set): New typedef.
439 (Stub_table::The_erratum_stub_set_iter): New typedef.
440 (Stub_table::empty): Added emptiness testing for erratum stubs.
441 (Stub_table::add_erratum_stub): New method to add an erratum stub.
442 (Stub_table::find_erratum_stub): New method.
443 (Stub_table::find_erratum_stubs_for_input_section): New method.
444 (Stub_table::erratum_stub_address): New method.
445 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
446 (Stub_table::do_addralign): Modified to handle erratum stubs.
447 (Stub_table::erratum_stubs_): New member.
448 (Stub_table::erratum_stub_size_): New member.
449 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
450 (Stub_table::do_write): Modified to handle erratum stubs.
451 (AArch64_relobj::The_erratum_stub): New typedef.
452 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
453 (AArch64_relobj::fix_errata): New method.
454 (Target_aarch64::The_reloc_stub_type): Removed.
455 (Target_aarch64::The_erratum_stub): New typede.
456 (AArch64_relocate_functions::construct_b): New method.
457
1e1b2efc
NC
4582015-06-08 Nick Clifton <nickc@redhat.com>
459
460 * po/fr.po: New French Translation.
461
b8cf5075
CC
4622015-06-07 Cary Coutant <ccoutant@gmail.com>
463
464 PR gold/18288
465 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
466 callers. Don't use STT_COMMON to check for common symbols.
467 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
468 symbol that's not in a common section.
469 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
470 common symbols.
471
bdd2d2b7
CC
4722015-06-04 Cary Coutant <ccoutant@gmail.com>
473
474 PR gold/18200
475 * Makefile.am (diststuff): Add target.
476 * Makefile.in: Regenerate.
477
cd3c333f
CC
4782015-06-04 Cary Coutant <ccoutant@gmail.com>
479
480 PR gold/17498
481 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
482 temporary locals in merge sections.
483 * options.cc (General_options::parse_discard_all): New method.
484 (General_options::parse_discard_locals): New method.
485 (General_options::parse_discard_none): New method.
486 (General_options::General_options): Initialize discard_locals_.
487 * options.h (--discard-all): Convert to special option.
488 (--discard-locals): Likewise.
489 (--discard-none): New option.
490 (General_options::discard_all): New method.
491 (General_options::discard_locals): New method.
492 (General_options::discard_sec_merge): New method.
493 (General_options::Discard_locals): New enum.
494 (General_options::discard_locals_): New data member.
495
8086551f
CC
4962015-06-03 Cary Coutant <cary@google.com>
497
498 * script-sections.cc (Script_sections::Script_sections): Initialize
499 segments_created_.
500 (Script_sections::create_note_and_tls_segments): Set flag when
501 segments are created.
502 (Script_sections::expected_segment_count): Count PT_INTERP.
503 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
504 segments are created.
505 * script-sections.h (Script_sections::segments_created_): New data
506 member.
507
374082df
CC
5082015-06-03 Cary Coutant <ccoutant@gmail.com>
509
510 PR gold/15370
511 * script-sections.cc
512 (Output_section_element_input::set_section_addresses): When there
513 are several patterns with no sort spec, put all sections in the same
514 bin.
515 * testsuite/Makefile.am (script_test_12): New testcase.
516 (script_test_12i): New testcase.
517 * testsuite/Makefile.in: Regenerate.
518 * testsuite/script_test_12.t: New test linker script.
519 * testsuite/script_test_12i.t: New test linker script.
520 * testsuite/script_test_12a.c: New test source file.
521 * testsuite/script_test_12b.c: New test source file.
522
775ed62e
CC
5232015-06-02 Cary Coutant <ccoutant@gmail.com>
524
525 * nacl.h (Sniff_file): Switch parameters to get_view to get an
526 aligned view.
527
9c7fe3c5
CC
5282015-06-03 Cary Coutant <ccoutant@gmail.com>
529
72f4393d
L
530 PR gold/17819
531 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
532 separate task to schedule the build id computation.
533 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
534 add Output_file and offset.
535 (Hash_task::run): Get and release the input views.
536 (Hash_task::is_runnable): Always return NULL (always runnable).
537 (Layout::queue_build_id_tasks): Remove.
538 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
539 parameters; use them instead of class members.
540 (Build_id_task_runner::run): New function.
541 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
542 to write_build_id.
543 * layout.h (Layout::queue_build_id_tasks): Remove.
544 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
545 parameters.
546 (Layout::array_of_hashes_): Remove.
547 (Layout::size_of_array_of_hashes_): Remove.
548 (Layout::input_view_): Remove.
549 (Build_id_task_runner): New class.
550 (Close_task_runner::Close_task_runner): Add array_of_hashes and
551 size_of_hashes parameters.
552 (Close_task_runner::array_of_hashes_): New data member.
553 (Close_task_runner::size_of_hashes_): New data member.
554 * testsuite/Makefile.am
555 (flagstest_compress_debug_sections_and_build_id_tree): New test.
556 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 557
400f8944
RÁE
5582015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
559
560 * merge.cc (get_input_merge_map): Update for data structure change.
561 (get_or_make_input_merge_map): Update for data structure change.
562 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
563 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
564
bbec1a5d
AM
5652015-05-16 Alan Modra <amodra@gmail.com>
566
567 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
568 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
569 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
570 (lis_0): Rename from lis_0_0.
571
efc6fa12
CC
5722015-04-29 Cary Coutant <cary@google.com>
573 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
574
575 * gc.h (Garbage_collection::is_section_garbage): Change Object*
576 to Relobj*.
577 (Garbage_collection::add_reference): Likewise.
578 (Garbage_collection::gc_process_relocs): Likewise. Don't push
579 object/shndx pair onto *secvec for dynamic objects. Don't follow
580 relocations pointing to dynamic objects for GC.
581 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
582 (Icf::unfold_section): Likewise.
583 (Icf::is_section_folded): Likewise.
584 (Icf::get_folded_section): Likewise.
585 * icf.h: (Icf::get_folded_section): Likewise.
586 (Icf::unfold_section): Likewise.
587 (Icf::is_section_folded): Likewise.
588 (Icf::section_has_function_pointers): Likewise.
589 (Icf::set_section_has_function_pointers): Likewise.
590 * object.h (Section_id): Likewise.
591 (Const_section_id): Likewise.
592 * output.cc (Output_section::update_section_layout): Likewise.
593 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
594 Likewise.
595 * plugin.cc (update_section_order): Likewise.
596 (unique_segment_for_sections): Likewise.
597 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
598 (Target_powerpc::do_gc_add_reference): Likewise.
599 (Target_powerpc::gc_process_relocs): Likewise.
600 (Target_powerpc::do_gc_add_reference): Likewise.
601 * symtab.cc (Symbol_table::is_section_folded): Likewise.
602 (Symbol_table::gc_mark_symbol): Likewise.
603 * symtab.h: (Symbol_table::is_section_folded): Likewise.
604 * target.h: (Sized_target::gc_add_reference): Likewise.
605 (Sized_target::do_gc_add_reference): Likewise.
606
f9d3ecaa
NC
6072015-04-29 Nick Clifton <nickc@redhat.com>
608
609 * po/fi.po: Updated Finnish translation.
610
faa2211d
AM
6112015-04-28 Alan Modra <amodra@gmail.com>
612
613 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
614 than unsigned int for find_global_entry result temp. Compare
615 against invalid_address.
616 (Target_powerpc::do_plt_address_for_global): Likewise.
617 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
618 on plt call stub existence for debug info. Do assert for plt
619 and global entry stub existence if an alloc section.
620
6ec65f28
AM
6212015-04-28 Alan Modra <amodra@gmail.com>
622
623 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
624 on missing global entry stub due to bogus debug info.
625
7a2a1c79
HS
6262015-04-27 Han Shen <shenhan@google.com>
627
628 * options.h (--fix-cortex-a53-843419): Rename option.
629 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
630 option.
631 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
632
cfbf0e3c
RÁE
6332015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
634
635 PR gold/18327
636 * output.cc (Output_section::is_input_address_mapped): Assume a missing
637 entry is mapped.
638 * testsuite/Makefile.am: Add the eh_test test.
639 * testsuite/Makefile.in: Regenerate.
640 * testsuite/eh_test_a.cc: New test.
641 * testsuite/eh_test_b.cc: New test.
642
6ec65f28
AM
6432015-04-23 Sriraman Tallam <tmsriram@google.com>
644
a100d66f
ST
645 * options.h (--weak-unresolved-symbols): New option.
646 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
647 binding to weak with new option.
648 * symtab.h (is_weak_undefined): Check for new option.
649 (is_strong_undefined): Check for new option.
650 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
651 * testsuite/Makefile.in: Regenerate.
652 * testsuite/weak_unresolved_symbols_test.cc: New file.
653
4b889c30
IC
6542015-04-20 Ian Coolidge <icoolidge@google.com>
655
656 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
657 GNU_UNIQUE.
658
4277535c
RÁE
6592015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
660
661 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
662 push_back.
663 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
664 * object.cc (Sized_relobj_file::do_layout): Use push_back.
665 * powerpc.cc (process_gc_mark): Use push_back.
666 (Target_powerpc::do_gc_mark_symbol): Use push_back.
667 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
668
7a2a1c79 6692015-04-16 Han Shen <shenhan@google.com>
5019d64a 670
6ec65f28
AM
671 * aarch64.cc (AArch64_insn_utilities): New utility class.
672 (AArch64_relobj::Mapping_symbol_position): New struct.
673 (AArch64_relobj::Mapping_symbol_info): New typedef.
674 (AArch64_relobj::do_count_local_symbols): New function overriding
675 parent's implementation.
676 (AArch64_relobj::mapping_symbol_info_): New member
677 (AArch64_relobj::scan_erratum_843419): New method.
678 (Target_aarch64::scan_erratum_843419_span): New method.
679 (Target_aarch64::is_erratum_843419_sequence): New method.
680 * options.h (fix_cortex_a53): New option.
5019d64a 681
a6a17750
CC
6822015-04-09 Cary Coutant <ccoutant@google.com>
683
684 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
685 in a PIE link.
686 * testsuite/Makefile.am (tls_pie_test.sh): New test.
687 * testsuite/Makefile.in: Regenerate.
688 * testsuite/tls_pie_test.sh: New.
689
437ddf0c
CC
6902015-04-09 Cary Coutant <ccoutant@google.com>
691
692 * debug.h (DEBUG_LOCATION): New.
693 (DEBUG_ALL): Include DEBUG_LOCATION.
694 (debug_string_to_enum): Add DEBUG_LOCATION.
695 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
696 output to print correct context.
697 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
698 up to 4 more locations at the beginning of the function.
699 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
700 result before sorting list of line numbers.
701 * testsuite/debug_msg.sh: Allow range of line numbers for
702 canonical results on optimized code.
703
24491327
HS
7042015-04-07 HC Yen <hc.yen@mediatek.com>
705
706 Add AArch32 support for gold linker.
707 gold/
708 * arm.cc: Add V8 arch combine table.
709
7fa5525f
RÁE
7102015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
711
712 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
713
5368dcf2
RÁE
7142015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
715
716 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
717 to find by using the return value of insert.
718
9dbb4b02
RÁE
7192015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
720
721 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
722 constructor call.
723
1fa29f10
IT
7242015-04-06 Ilya Tocar <ilya.tocar@intel.com>
725
726 PR gold/17641
727 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
728 (Target_x86_64::Scan::local): Don't create GOT entry, when we
729 can convert mov to lea.
730 (Target_x86_64::Scan::global): Ditto.
731 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
732 %reg to lea foo(%rip), %reg if possible.
733 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
734 * testsuite/x86_64_mov_to_lea1.s: New.
735 * testsuite/x86_64_mov_to_lea2.s: Ditto.
736 * testsuite/x86_64_mov_to_lea3.s: Ditto.
737 * testsuite/x86_64_mov_to_lea4.s: Ditto.
738 * testsuite/x86_64_mov_to_lea.sh: Ditto.
739
39f3de7c
L
7402015-04-02 H.J. Lu <hongjiu.lu@intel.com>
741
742 * configure: Regenerated.
743
c4fc4724
IT
7442015-04-01 Ilya Tocar <ilya.tocar@intel.com>
745
746 PR gold/17640
747 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
748 (Target_i386::Scan::local): Don't create GOT entry, when we
749 can convert GOT to GOTOFF.
750 (Target_i386::Scan::global): Ditto.
751 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
752 lea foo@GOTOFF(%reg), %reg if possible.
753 * testsuite/Makefile.am (i386_mov_to_lea): New test.
754 * testsuite/i386_mov_to_lea1.s: New.
755 * testsuite/i386_mov_to_lea2.s: Ditto.
756 * testsuite/i386_mov_to_lea3.s: Ditto.
757 * testsuite/i386_mov_to_lea4.s: Ditto.
758 * testsuite/i386_mov_to_lea5.s: Ditto.
759 * testsuite/i386_mov_to_lea.sh: Ditto.
760
918357b9
L
7612015-04-01 H.J. Lu <hongjiu.lu@intel.com>
762
763 * Makefile.am (ZLIB): New.
764 (ZLIBINC): Likewise.
765 (AM_CFLAGS): Add $(ZLIBINC).
766 (AM_CXXFLAGS): Likewise.
767 (ldadd_varldadd_var): Add $(ZLIB).
768 (incremental_dump_LDADD): Likewise.
769 (dwp_LDADD): Likewise.
770 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
771 <zlib.h>.
772 (zlib_compress): Don't check HAVE_ZLIB_H.
773 (zlib_decompress): Likewise.
774 * options.h (compress_debug_sections): Likewise.
775 * configure.ac (AM_CONDITIONAL): Removed.
776 * testsuite/Makefile.am (ZLIB): New.
777 (LDADD): Add $(ZLIB).
778 Don't check HAVE_ZLIB.
779 * Makefile.in: Regenerated.
780 * config.in: Likewise.
781 * configure: Likewise.
782 * testsuite/Makefile.in: Likewise.
783
6b0ad2eb
JY
7842015-03-30 Jing Yu <jingyu@google.com>
785
786 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
787 TLSLD_ADD_DTPREL_LO12_NC.
788 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
789 _TLS_MODULE_BASE_ point to the start of tls segment.
790 (Target_aarch64::optimize_tls_reloc): Add cases for
791 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
792 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
793 (Target_aarch64::Scan::local): Likewise.
794 (Target_aarch64::Scan::global): Likewise.
795 (Target_aarch64::Relocate::relocate): Likewise.
796 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
797 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
798 relocations.
799
0916f9e7
RÁE
8002015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
801
802 * merge.cc (Object_merge_map::add_mapping): call
803 Object_merge_map::Input_merge_map::add_mapping.
804 (Object_merge_map::Input_merge_map::add_mapping): New.
805 (Output_merge_data::do_add_input_section): Call
806 get_or_make_input_merge_map before a loop.
807 (Output_merge_string<Char_type>::finalize_merged_data): Call
808 get_or_make_input_merge_map before a loop.
809 * merge.h (Object_merge_map): Make Input_merge_map public.
810 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
811 (Relobj::get_or_create_merge_map): New.
812 * object.h (Relobj::get_or_create_merge_map): New.
813
282c9750
AM
8142015-03-24 Alan Modra <amodra@gmail.com>
815
816 PR 18147
817 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
818 relocation errors for branches to strong undefined symbols.
819
67f95b96
RÁE
8202015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
821
822 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
823 (Object_merge_map::is_merge_section_for): Remove.
824 (Object_merge_map::find_merge_section): New.
825 * merge.h (Object_merge_map::is_merge_section_for): Remove.
826 (Object_merge_map::find_merge_section): New.
827 (Object_merge_map::get_input_merge_map): Add a const version.
828 * object.cc (Relobj::is_merge_section_for): Remove.
829 (Relobj::find_merge_section): New.
830 * object.h (Relobj::is_merge_section_for): Remove.
831 (Relobj::find_merge_section): New.
832 * output.cc
833 (Output_section::Input_section::is_merge_section_for): Remove.
834 (Output_section::add_merge_input_section): Don't call
835 add_merge_input_section.
836 (Output_section::find_merge_section): Return const. Use
837 object->find_merge_section.
838 (Output_section::build_lookup_maps): Don't build a map for
839 merge sections.
840 (Output_section::is_input_address_mapped): Return false if
841 section is not found.
842 (Output_section::find_starting_output_address): Use
843 find_merge_section instead of is_merge_section_for.
844 (Output_section::add_script_input_section): Don't build a map for
845 merge sections.
846 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
847 (Output_section_lookup_maps::find_merge_section): Remove.
848 (Output_section_lookup_maps::add_merge_input_section) Remove.
849 (Output_section::find_merge_section): Return const.
850
152f7024
CC
8512015-03-22 Cary Coutant <cary@google.com>
852
853 PR gold/18106
854 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
855 non-SIB form of lea, with nop after the call.
856
bccffdfd
CC
8572015-03-21 Cary Coutant <cary@google.com>
858
859 PR gold/14217
860 * output.cc (Output_segment::is_first_section_relro): Don't ignore
861 .tdata section.
862 (Output_segment::set_section_addresses): Don't align size of relro
863 segment for .tbss.
864
1c582fe7
CC
8652015-03-21 Cary Coutant <cary@google.com>
866
867 PR gold/18010
868 * stringpool.cc (Stringpool_template): Don't optimize if section
869 alignment is greater than sizeof(char).
870
410da591
CC
8712015-03-21 Cary Coutant <cary@google.com>
872
873 PR gold/18048
874 * script-c.h (script_include_directive): Add first_token parameter.
875 * script.cc (script_include_directive): Add first_token parameter, and
876 pass it to read_script_file.
877 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
878 (PARSING_MEMORY_DEF): New tokens.
879 (top): Add new productions for INCLUDE files.
880 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
881 Pass PARSING_LINKER_SCRIPT to script_include_directive.
882 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
883 (section_cmd): Pass PARSING_SECTION_CMDS.
884 (file_or_sections_cmd): Remove.
885 (memory_def): Pass PARSING_MEMORY_DEF.
886 * testsuite/Makefile.am (memory_test_2): New test.
887 * testsuite/Makefile.in: Regenerate.
888 * testsuite/memory_test_inc.t: New script file.
889 * testsuite/memory_test_inc_1.t.src: New script file.
890 * testsuite/memory_test_inc_2.t.src: New script file.
891 * testsuite/memory_test_inc_3.t.src: New script file.
892
0d5bbdb0
CC
8932015-03-21 Cary Coutant <cary@google.com>
894
895 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
896 (Sized_relobj_dwo::setup): Build compressed section map.
897 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
898 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
899 section map.
900 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
901 compressed_sections_ field.
902 (build_compressed_section_map): Take Object instead of
903 Sized_relobj_file parameter; add decompress_if_needed parameter.
904 (Sized_relobj_file::do_find_special_sections): Store compressed
905 section map in parent Object.
906 (Sized_relobj_file::do_decompressed_section_contents): Move
907 implementation to Object::decompressed_section_contents.
908 (Sized_relobj_file::do_discard_decompressed_sections): Move
909 implementation to Object::discard_decompressed_sections.
910 * object.h (build_compressed_section_map): Declare.
911 (Object::Object): Add compressed_sections_ field.
912 (Object::section_is_compressed): Move implementation here.
913 (Object::decompressed_section_contents): De-virtualize.
914 (Object::discard_decompressed_sections): De-virtualize.
915 (Object::do_section_is_compressed): Delete.
916 (Object::do_decompressed_section_contents): Delete.
917 (Object::set_compressed_sections): New method.
918 (Object::compressed_sections): New method.
919 (Object::compressed_sections_): New data member.
920 (Compressed_section_info, Compressed_section_map): Move to top of file.
921 (Sized_relobj_file::do_section_is_compressed): Delete.
922 (Sized_relobj_file::do_decompressed_section_contents): Delete.
923 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
924 (Sized_relobj_file::compressed_sections_): Move to Object class.
925
bd9e0d46
CC
9262015-03-21 Cary Coutant <ccoutant@google.com>
927
928 PR gold/18152
929 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
930 deferred objects.
931
943c8b43
CC
9322015-03-11 Cary Coutant <ccoutant@google.com>
933
934 * options.cc (General_options::finalize): Don't allow -z relro
935 with incremental linking.
936 * testsuite/Makefile.am (incremental_test): Add -z norelro.
937 (incremental_test_2): Likewise.
938 (incremental_test_3): Likewise.
939 (incremental_test_4): Likewise.
940 (incremental_test_5): Likewise.
941 (incremental_test_6): Likewise.
942 (incremental_copy_test): Likewise.
943 (incremental_common_test_1): Likewise.
944 (incremental_comdat_test_1): Likewise.
945 * testsuite/Makefile.in: Regenerate.
946
e1663197
CC
9472015-03-09 Cary Coutant <ccoutant@google.com>
948
949 PR gold/14675
950 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
951 return enum indicating whether .eh_frame section is empty, optimizable,
952 unrecognized, or an end marker. Adjust explicit instantiations.
953 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
954 (Eh_frame::add_ehframe_input_section): Change return type.
955 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
956 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
957 to the .eh_frame output section until we see the end marker.
958 (Layout::finalize_eh_frame_section): New.
959 * layout.h: (Layout::finalize_eh_frame_section): New.
960
beb8418f
L
9612015-03-05 H.J. Lu <hongjiu.lu@intel.com>
962
963 * output.cc (Relobj::initialize_input_to_output_map<size>):
964 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
965
48c73428
CC
9662015-03-04 Cary Coutant <ccoutant@google.com>
967
968 * parameters.cc (Parameters::set_target_once): Call
969 Target::select_as_default_target just once from here...
970 (set_parameters_target): ...instead of from here.
971
9722015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
973
974 * ehframe.cc (Cie::set_output_offset): Pass in and use a
975 Output_section_data instead of a Merge_map.
976 (Eh_frame::Eh_frame): Don't initialize merge_map_.
977 (Eh_frame::read_cie): Use add_merge_mapping instead of
978 Merge_map::add_mapping.
979 (Eh_frame::read_fde): Ditto.
980 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
981 (Eh_frame::do_output_offset): Use merge_output_offset istead of
982 merge_map_->get_output_offset.
983 (Eh_frame::do_is_merge_section_for): Delete.
984 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
985 instead of a Merge_map.
986 (Cie::set_output_offset): Pass in a Output_section_data instead of a
987 Merge_map.
988 (Eh_frame::do_is_merge_section_for): Delete.
989 (Eh_frame::merge_map_): Delete.
990 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
991 and use a Output_section_data instead of a Merge_map.
992 (Object_merge_map::add_mapping): Ditto.
993 (Object_merge_map::get_output_offset): Remove the merge_map argument.
994 (Object_merge_map::is_merge_section_for): Pass in and use a
995 Output_section_data instead of a Merge_map.
996 (Merge_map): Delete.
997 (Output_merge_base::do_output_offset): Use merge_output_offset instead
998 of merge_map_.get_output_offset.
999 (Output_merge_base::do_is_merge_section_for): Delete.
1000 (Output_merge_data::do_add_input_section): Use
1001 object->add_merge_mapping instead of add_mapping.
1002 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
1003 * merge.h (Merge_map): Delete forward declaration.
1004 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
1005 instead of a Merge_map.
1006 (Object_merge_map::get_output_offset): Remove the merge_map argument.
1007 (Object_merge_map::is_merge_section_for): Pass in and use a
1008 Output_section_data instead of a Merge_map.
1009 (Input_merge_map::Object_merge_map::merge_map): Replace with
1010 output_data.
1011 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1012 Output_section_data instead of a Merge_map.
1013 (Merge_map): Delete.
1014 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1015 (Output_merge_base::do_is_merge_section_for): Delete.
1016 (Output_merge_base::add_mapping): Delete.
1017 (Output_merge_base::merge_map_): Delete.
1018 * object.cc (Relobj::initialize_input_to_output_map): New.
1019 (Relobj::initialize_input_to_output_map): New.
1020 (Relobj::merge_output_offset): New.
1021 (Relobj::is_merge_section_for): New.
1022 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1023 bits.
1024 * object.h (Relobj::merge_map): Delete.
1025 (initialize_input_to_output_map): New.
1026 (set_merge_map): Delete.
1027 (add_merge_mapping): New.
1028 (merge_output_offset): New.
1029 (is_merge_section_for): New.
1030 * output.cc (Output_section::Input_section::is_merge_section_for):
1031 Use object->is_merge_section_for.
1032 * output.h (Output_section_data::is_merge_section_for): Delete.
1033 (Output_section_data::do_is_merge_section_for): Delete.
1034 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1035 Use object->initialize_input_to_output_map.
1036 (Merged_symbol_value<size>::value_from_output_section): Use
1037 object->merge_output_offset.
1038
48c73428 10392015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1040 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1041
1042 * output.cc (Output_section::add_merge_input_section): Do not
1043 attempt to merge sections with an entsize of 0.
1044
48c73428 10452015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1046
1047 * attributes.h (class Output_attributes_section_data ): Add
1048 do_print_to_mapfile function.
1049
ec86f434
AM
10502015-02-24 Alan Modra <amodra@gmail.com>
1051
1052 PR 18010
1053 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1054 complain if value is not a multiple of four.
1055 (Target_powerpc::Relocate::relocate): Correct handling of
1056 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1057
be66981e
L
10582015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1059
1060 * configure.ac (default_size): Set to 32 for x32.
1061 * configure: Regenerated.
1062
e3ee8ed4
AM
10632015-02-18 Alan Modra <amodra@gmail.com>
1064
1065 PR 17954
1066 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1067 visibility.
1068
3a935c6c
RÁE
10692015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1070
1071 * gc.h (Garbage_collection::add_reference): Don't use find.
1072
e0a1e121
RÁE
10732015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1074
1075 * object.cc (write_local_symbols): avoid std::vector copy.
1076
45a4fb1a
RÁE
10772015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1078
1079 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1080
2d9afefe
MW
10812015-02-09 Mark Wielaard <mjw@redhat.com>
1082
1083 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1084 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1085
e9c1bdad
CC
10862015-02-16 Cary Coutant <ccoutant@google.com>
1087
1088 PR gold/13577
1089 PR gold/16992
1090 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1091 DF_SYMBOLIC if --dynamic-list option is used.
1092 * options.cc (General_options::finalize): --dynamic-list is not
1093 mutually exclusive with -Bsymbolic.
1094 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1095 listed in --dynamic-list.
1096 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1097 -Bsymbolic-functions.
1098 * testsuite/Makefile.in: Regenerate.
1099
0ed4b0bf
CC
11002015-02-16 Cary Coutant <ccoutant@google.com>
1101
1102 PR gold/17971
1103 * incremental.cc: Remove redundant include of "output.h".
1104
1a920511
JY
11052015-02-12 Jing Yu <jingyu@google.com>
1106
1107 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1108 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1109 New relocation.
1110 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1111 TLSLE_MOVW_* relocations.
1112 (Target_aarch64::Scan::global): Likewise.
1113 (Target_aarch64::Relocate::relocate): Likewise.
1114 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1115 for new TLSLE_MOVW_* relocations.
1116
07f107f3
WN
11172015-02-11 Will Newton <will.newton@linaro.org>
1118
1119 PR gold/13321
1120 * arm.cc (Target_arm::make_plt_section): Create an ARM
1121 state mapping symbol at the start of the PLT.
1122
e051a5b5
L
11232015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1124
1125 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1126 Replace two_file_shared_2.so with two_file_shared_1.so.
1127 * testsuite/Makefile.in: Regenerated.
1128
dddcc5b9
AM
11292015-02-09 Alan Modra <amodra@gmail.com>
1130
1131 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1132 plugin_test_thin.a and defsym_test.
1133 * testsuite/Makefile.in: Regenerate.
1134
b39b8b9d
RÁE
11352015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1136
1137 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1138 body.
1139
b66d1c52
CC
11402015-02-04 Peter Collingbourne <pcc@google.com>
1141
1142 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1143 forwarding symbols when computing symbol resolution info for plugins.
1144 * plugin.h (Plugin_manager::symtab): New method.
1145 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1146
23081de0
CC
11472015-02-03 Cary Coutant <ccoutant@google.com>
1148 Peter Collingbourne <pcc@google.com>
1149
1150 PR gold/15660
1151 * archive.cc (Thin_archive_object_unlocker): New class.
1152 (Archive::include_member): Unlock external members of thin archives.
1153 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1154 (plugin_test_2): Likewise.
1155 (plugin_test_3): Likewise.
1156 (plugin_test_4): Likewise.
1157 (plugin_test_5): Likewise.
1158 (plugin_test_6): Likewise.
1159 (plugin_test_7): Likewise.
1160 (plugin_test_8): Likewise.
1161 (plugin_test_9): Likewise.
1162 (plugin_test_10): Likewise.
1163 (plugin_test_11): New test case.
1164 * testsuite/Makefile.in: Regenerate.
1165 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1166 file to decide whether to claim file.
1167 (all_symbols_read_hook): Likewise.
1168 * testsuite/plugin_test_1.sh: Adjust expected output.
1169 * testsuite/plugin_test_2.sh: Likewise.
1170 * testsuite/plugin_test_3.sh: Likewise.
1171 * testsuite/plugin_test_6.sh: Likewise.
1172 * testsuite/plugin_test_tls.sh: Likewise.
1173 * testsuite/plugin_test_11.sh: New testcase.
1174
11752015-02-03 Cary Coutant <ccoutant@google.com>
1176
1177 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1178 file descriptors when debugging enabled. Add debug output.
1179 (Descriptors::release): Add debug output.
1180 (Descriptors::close_some_descriptor): Likewise.
1181 (Descriptors::close_all): Likewise.
1182 * fileread.cc (File_read::lock): Likewise.
1183 (File_read::unlock): Likewise.
1184
24dd5808
CC
11852015-02-02 Cary Coutant <ccoutant@google.com>
1186
1187 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1188 executable output file.
1189
fa89cc82
HS
11902015-01-22 Han Shen <shenhan@google.com>
1191
1192 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1193 (Target_arm::do_plt_address_for_global): New method.
1194 (Target_arm::do_plt_address_for_local): New method.
1195 (Target_arm::rel_irelative_section): New method.
1196 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1197 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1198 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1199 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1200 (Target_arm::Scan::check_non_pic): Add ifunc support.
1201 (Target_arm::Scan::local): Add ifunc support.
1202 (Target_arm::Scan::global): Add ifunc support.
1203 (Target_arm::make_plt_section): New method.
1204 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1205 (Target_arm::make_local_ifunc_plt_entry): New method.
1206 (Target_arm::got_irelative_): New member.
1207 (Target_arm::rel_irelative_): New member.
1208 (Target_arm::got_section): Add creation for got_irelative_.
1209 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1210 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1211 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1212 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1213 (Output_data_plt_arm::IRelative_data): New type.
1214 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1215 (Output_data_plt_arm::add_entry): Add more parameters.
1216 (Output_data_plt_arm::add_relocation): New method.
1217 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1218 (Output_data_plt_arm::rel_irelative): New method.
1219 (Output_data_plt_arm::entry_count): Modified.
1220 (Output_data_plt_arm::address_for_global): New method.
1221 (Output_data_plt_arm::address_for_local): New method.
23081de0 1222gold/
fa89cc82
HS
1223 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1224 (Output_data_plt_arm::insert_irelative_data): New method.
1225 (Output_data_plt_arm::irelative_rel_): New member.
1226 (Output_data_plt_arm::got_): New member.
1227 (Output_data_plt_arm::got_irelative_): New member.
1228 (Output_data_plt_arm::irelative_count_): New member.
1229 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1230 (Output_data_plt_arm::irelative_data_vec_): New member.
1231 (Output_data_plt_arm::do_write): Write out irelative entries.
1232 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1233 more parameters to ctor.
1234 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1235 more parameters to ctor.
1236 * output.h (Output_data_reloc::add_local_relative): New method.
1237 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1238
0f81d3f0
AM
12392015-01-29 Alan Modra <amodra@gmail.com>
1240
1241 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1242 and GOT_TLSGD to LE optimization.
1243
65d92137
CC
12442015-01-28 Cary Coutant <ccoutant@google.com>
1245
1246 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1247 for undef TLS symbols.
1248 (Target_x86_64::Relocate::relocate_tls): Likewise.
1249 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1250
5485698a
CC
12512015-01-25 Cary Coutant <ccoutant@google.com>
1252
1253 * output.cc (Output_segment::set_section_addresses): Fix calculation
1254 of size of relro segment.
1255
b01a4b04
AM
12562015-01-22 Alan Modra <amodra@gmail.com>
1257
1258 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1259 condition for need of ifunc plt entry.
1260 (Target_powerpc::Scan::global <got relocs>): Likewise.
1261
3d0064a9
CC
12622015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1263
1264 * mips.cc (reloc_high): Add r_sym.
1265 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1266 reloc_high constructor.
1267 (Mips_relocate_functions::relgot16_local): Likewise.
1268 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1269 r_type to decide whether LO16 matches HI16.
1270 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1271 rello16 and relgot16_local.
1272
a5cd8f05
CC
12732015-01-09 Cary Coutant <ccoutant@google.com>
1274
1275 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1276 unless alignment is larger than page size.
1277
4fc1b9d4
L
12782015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1279 Cary Coutant <ccoutant@google.com>
1280
1281 PR gold/17729
1282 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1283 (DEFAULT_TARGET_X32): Set for x32.
1284 * x86_64.cc (cmp_insn_32): New.
1285 (lea_r10_insn_32): Likewise.
1286 (lea_r11_insn_32): Likewise.
1287 (cmp_insn_64): Likewise.
1288 (lea_r10_insn_64): Likewise.
1289 (lea_r11_insn_64): Likewise.
1290 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1291 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1292 (check_DATA): Add split_x32 files.
1293 (split_x32_[1234n].o): New targets.
1294 (split_x32_[124]): New targets.
1295 (split_x32_[1234r].stdout): New targets.
1296 * testsuite/split_x32.sh: New file.
1297 * testsuite/split_x32_1.s: Likewise.
1298 * testsuite/split_x32_2.s: Likewise.
1299 * testsuite/split_x32_3.s: Likewise.
1300 * testsuite/split_x32_4.s: Likewise.
1301 * testsuite/split_x32_n.s: Likewise.
1302 * configure: Regenerated.
1303 * testsuite/Makefile.in: Likewise.
1304
e749cab8
L
13052015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1306
1307 PR gold/17809
1308 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1309 x32.
1310
af759df0
AM
13112015-01-02 Alan Modra <amodra@gmail.com>
1312
1313 * version.cc (print_version): Just print current year.
1314 * dwp.cc (print_version): Likewise.
1315
b90efa5b
AM
13162015-01-01 Alan Modra <amodra@gmail.com>
1317
1318 Update year range in copyright notice of all files.
1319
f12d1e8a
AM
13202014-12-25 Alan Modra <amodra@gmail.com>
1321
1322 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1323 new enums.
1324 (Target_arm::merge_object_attributes, ): Likewise.
1325
5c294fee
TG
13262014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1327
1328 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1329 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1330 AEABI_VFP_args_vfp to check that.
1331 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1332 value and replace hardcoded values by enum values.
1333
e30880c2
CC
13342014-12-22 Cary Coutant <ccoutant@google.com>
1335
1336 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1337
bd040da1
L
13382014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1339
1340 PR gold/14608
1341 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1342 to "return i * i * 3;".
1343
e02a4046
CC
13442014-12-16 Cary Coutant <ccoutant@google.com>
1345
1346 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1347 (Mapfile::print_output_data): Use current_data_size() to avoid
1348 assert for sections requiring postprocessing; if address is not valid,
1349 print 0.
1350 (Mapfile::print_output_section): Use current_data_size(); print note
1351 that addresses and sizes are before compression.
1352
add6016b
L
13532014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1354
1355 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1356 Cast current_group_size to unsigned long when reporting error.
1357
0bf32ea9
JY
13582014-12-10 Jing Yu <jingyu@google.com>
1359
1360 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1361 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1362 Update error message.
1363 (Target_aarch64::do_relax): Use absolute value of option
1364 stub_group_size. Replace local variable with class member
1365 stub_group_size_.
1366
cbcb23fa
AM
13672014-12-04 Alan Modra <amodra@gmail.com>
1368
1369 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1370 addend of PLTREL24 reloc when not generating a plt stub. Make
1371 max_branch_offset an "Address".
fbad6518 1372 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1373 (Target_powerpc::Relocate::relocate): Likewise.
1374
1611bc4a
AM
13752014-12-04 Alan Modra <amodra@gmail.com>
1376
1377 PR 17670
1378 * symtab.cc (Symbol::set_undefined): Remove assertion.
1379 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1380 on symbols defined in discarded sections, instead return false.
1381 Rearrange params, update all callers.
1382 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1383 branches to syms in discarded sections.
1384 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1385 undefined and flag as discarded.
1386 (Target_powerpc::Relocate::relocate): Localize variable.
1387
4759c34e
L
13882014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1389
1390 PR gold/17675
1391 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1392 * testsuite/Makefile.in: Regenerated.
1393
1f98a074
AM
13942014-12-03 Alan Modra <amodra@gmail.com>
1395
1396 PR 17566
1397 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1398 when adding dynamic relocations against section symbols.
1399
fb257835
DI
14002014-12-01 Dimitry Ivanov <dimitry@google.com>
1401
1402 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1403 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1404 * options.h (General_options): New -z option (global).
1405
d8e60314
CC
14062014-12-01 Cary Coutant <ccoutant@google.com>
1407
1408 PR gold/17578
1409 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1410 is given.
1411 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1412 given but some inputs require executable stack.
1413
982bbd97
CC
14142014-11-26 Cary Coutant <ccoutant@google.com>
1415
1416 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1417 .debug_str_offsets; strip .debug_gnu_pubnames and
1418 .debug_gnu_pubtypes.
1419 (lines_only_debug_sections): Strip all four new sections.
1420
bb779192
HS
14212014-11-26 Jing Yu <jingyu@google.com>
1422
1423 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1424 register to be x0 when to relax TLSDESC_LD64_LO12.
1425
a3e60ddb
AM
14262014-11-26 Alan Modra <amodra@gmail.com>
1427
1428 * powerpc.cc (struct Stub_table_owner): New.
1429 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1430 unsigned int vector. Update all references.
1431 (powerpc_relobj::set_stub_table): Take an unsigned int param
1432 rather than a Stub_table. Update callers.
1433 (Powerpc_relobj::clear_stub_table): New function.
1434 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1435 stub_group_size_ vars.
1436 (Target_powerpc::new_stub_table): Delete.
1437 (max_branch_delta): New function, extracted from..
1438 (Target_powerpc::Relocate::relocate): ..here..
1439 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1440 status on whether stub created successfully.
1441 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1442 default sizing to..
1443 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1444 reduce on relax failure.
1445 (Target_powerpc::group_sections): Add "no_size_errors" param.
1446 Use stub_group_size_. Set up group info in a temp vector,
1447 before building Stub_table vector. Account for input sections
1448 possibly already converted to relaxed sections.
1449 (Stub_table::init): Delete. Merge into..
1450 (Stub_table::Stub_table): ..here.
1451 (Stub_table::can_reach_stub): New function.
1452 (Stub_table::add_plt_call_entry): Add "from" parameter and
1453 return true iff stub could be reached.
1454 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1455 param too.
1456 (Stub_table::clear_stubs): Add "all" param.
1457
a20605cf
AM
14582014-11-26 Alan Modra <amodra@gmail.com>
1459
1460 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1461 (Target_powerpc::group_sections): Use it.
1462
43b64deb
CC
14632014-11-25 Cary Coutant <ccoutant@google.com>
1464
1465 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1466 (Binary_to_elf::write_symbol): Add st_size parameter.
1467 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1468
c924eb67
CC
14692014-11-25 Cary Coutant <ccoutant@google.com>
1470
1471 PR gold/17639
1472 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1473 (Sized_relobj_file::do_layout): Handle deferred sections properly
1474 during GC pass 1. Don't add reloc sections to deferred list twice.
1475 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1476 (Sized_relobj_file::is_deferred_layout_): New data member.
1477
9d585188
L
14782014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1479
1480 PR gold/17619
1481 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1482 Check PC-relative offset overflow in PLT entry.
1483
3ffaac20
AM
14842014-11-21 Alan Modra <amodra@gmail.com>
1485
1486 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1487 for undefined weaks.
1488
0cfb0717
AM
14892014-11-20 Alan Modra <amodra@gmail.com>
1490
1491 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1492 from --stub-group-size parameter divided by 1024.
1493 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1494 template parameter. Update all uses.
1495 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1496 has_stub_value. Set for long branches. Don't report overflow for
1497 branch to undefined weak symbols. Print info message on
1498 overflowing branch to stub.
1499
f9dffbf0
AM
15002014-11-20 Alan Modra <amodra@gmail.com>
1501
1502 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1503
e88ba8d5
L
15042014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1505
1506 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1507 entry for R_X86_64_GOTPLT64.
1508 (Target_x86_64<size>::Relocate::relocate): Update comments for
1509 R_X86_64_GOTPLT64.
1510
d37ffe25
ED
15112014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1512
1513 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1514 * plugin.h: add lock definition
1515
9726c3c1
HS
15162014-10-29 Han Shen <shenhan@google.com>
1517 Jing Yu <jingyu@google.com>
1518
1519 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1520 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1521 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1522 Symbol::TLS_REF.
1523 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1524 method.
1525 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1526 (Target_aarch64::tls_ld_to_le): New method.
1527 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1528 for 64bit targets.
1529 (Output_data_plt_aarch64::irelative_rel_): New data member.
1530 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1531 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1532 (Output_data_plt_aarch64::add_relocation): New method.
1533 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1534 offset. Add got_irelative size to got size.
1535 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1536 type string with the new typename.
1537 (AArch64_relocate_functions::update_adr): Replace parameter x with
1538 immed.
1539 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1540 (AArch64_relocate_functions::reloc_common): New method.
1541 (AArch64_relocate_funcsions::rela_general): Extract common part out
1542 into reloc_common method.
1543 (AArch64_relocate_functions::rela_general): Likewise.
1544 (AArch64_relocate_functions::pcrela_general): Likewise.
1545 (AArch64_relocate_functions::adr): New method.
1546 (AArch64_relocate_functions::adrp): Calculate immed before calling
1547 update_adr.
1548 (AArch64_relocate_functions::adrp): Likewise.
1549 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1550 comparing x to 0. Calculate immed from ~x when x < 0.
1551 (Target_aarch64::optimize_tls_reloc): Add new cases for
1552 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1553 TLSLD_MOVW_DTPREL_G0_NC.
1554 (Target_aarch64::possible_function_pointer_reloc): Implement this
1555 method.
1556 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1557 comment.
1558 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1559 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1560 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1561 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1562 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1563 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1564 (Target_aarch64::make_plt_entry): Call add_entry with two more
1565 parameters.
1566 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1567 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1568 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1569 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1570 (Target_aarch64::Relocate::relocate_tls): Add cases for
1571 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1572 TLSLD_MOVW_DTPREL_G0_NC.
1573 * testsuite/icf_safe_so_test.cc: Correct test comment.
1574 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1575
80272b8c
AM
15762014-10-22 Alan Modra <amodra@gmail.com>
1577
1578 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1579 thread_starter.
1580
998a69f4
AS
15812014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1582
1583 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1584
aed56ec5
CC
15852014-10-17 Cary Coutant <ccoutant@google.com>
1586
1587 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1588 Add "typename" keyword.
1589
bb779192 15902014-10-15 Han Shen <shenhan@google.com>
72f4393d 1591 Jing Yu <jingyu@google.com>
83a01957
HS
1592
1593 Patch for gold aarch64 backend to support relaxation.
1594 * aarch64-reloc.def: Change format.
1595 * aarch64.cc (class Reloc_stub): New class.
1596 (class Stub_table): New class.
1597 (class AArch64_relobj): New class.
1598 (class AArch64_input_section): New class.
1599 (class AArch64_output_section): New class.
1600 (Target_aarch64::new_stub_table): New method.
1601 (Target_aarch64::new_aarch64_input_section): New method.
1602 (Target_aarch64::find_aarch64_input_section): New method.
1603 (Target_aarch64::scan_section_for_stubs): New method.
1604 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1605 (Target_aarch64::relocate_stub): New method.
1606 (Target_aarch64::current_target): New method.
1607 (Target_aarch64::do_make_elf_object): New method.
1608 (Target_aarch64::do_may_relax): New method.
1609 (Target_aarch64::do_relax): New method.
1610 (Target_aarch64::group_sections): New method.
1611 (Target_aarch64::scan_reloc_for_stub): New method.
1612 (Target_aarch64::do_make_output_section): New method.
1613 (Target_aarch64::stub_tables_): New data member.
1614 (Target_aarch64::aarch64_input_section_map_): New data member.
1615 (AArch64_relocate_functions::maybe_apply_stub): New method.
1616
db4c9594
CC
16172014-09-30 Cary Coutant <ccoutant@google.com>
1618
1619 PR gold/17432
1620 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1621
cd6da036
KC
16222014-09-30 Kito Cheng <kito@0xlab.org>
1623
1624 PR gold/13597
1625 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1626 hash table before sysv-style hash table.
1627
5f772412
ST
16282014-09-29 Sriraman Tallam <tmsriram@google.com>
1629
1630 * options.h (--pic-executable): Add negative to alias to -no-pie.
1631
5efeedf6
CC
16322014-09-26 Cary Coutant <ccoutant@google.com>
1633
1634 PR gold/16773
1635 * object.cc (Sized_relobj_file): Compute value of section symbols
1636 for TLS sections the same as TLS symbols.
1637
1707f183
CC
16382014-09-25 Cary Coutant <ccoutant@google.com>
1639
1640 PR gold/17432
1641 * resolve.cc (Symbol_table::resolve): Override common placeholder
1642 symbols, but adjust sizes.
1643 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1644 symbols to common lists.
1645
00cac886
AM
16462014-09-24 Alan Modra <amodra@gmail.com>
1647
1648 * po/POTFILES.in: Regenerate.
1649
635aa30e 16502014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1651 Cary Coutant <ccoutant@google.com>
635aa30e 1652
71b9b91b 1653 PR gold/14860
635aa30e
CC
1654 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1655 on input_sections_blocker.
1656 * layout.cc (Write_sections_task::locks): Unblock
1657 input_sections_blocker_.
1658 * layout.h (Write_sections_task::Write_sections_task): Add
1659 input_sections_blocker.
1660 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1661 to DEPENDENCIES.
1662 * testsuite/Makefile.in: Regenerate.
1663
c0c71592
RÁE
16642014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1665
1666 * testsuite/Makefile.am (plugin_test_10): New test.
1667 * testsuite/Makefile.in: Regenerate
1668 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1669 * testsuite/plugin_test_10.sh: New file.
1670
6168c2a1
RÁE
16712014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1672
1673 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1674 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1675 during the replacement phase.
1676
3a531937
JY
16772014-09-17 Han Shen <shenhan@google.com>
1678 Jing Yu <jingyu@google.com>
1679
1680 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1681 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1682 * aarch64.cc (Target_aarch64): Add data members
1683 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1684 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1685 constructor.
1686 (Target_aarch64::do_reloc_symbol_index): New method.
1687 (Target_aarch64::do_reloc_addend): New method.
1688 (Target_aarch64::add_tlsdesc_info): New method.
1689 (Target_aarch64::do_dynsym_value): New method.
1690 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1691 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1692 (Target_aarch64::make_data_plt): Add new parameters: got,
1693 got_irelative. Pass them to do_make_data_plt.
1694 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1695 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1696 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1697 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1698 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1699 (Target_aarch64::got_tlsdesc_section): New method.
1700 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1701 (Target_aarch64::define_tls_base_symbol): New method.
1702 (Target_aarch64::reserve_tlsdesc_entries): New method.
1703 (Target_aarch64::got_mod_index_entry): New method.
1704 (Target_aarch64::rela_tlsdesc_section): New method.
1705 (Target_aarch64::rela_irelative_section): New method.
1706 (Target_aarch64::Tlsdesc_info): New struct.
1707 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1708 relocations and tlsdesc relocations.
1709 (Target_aarch64::optimize_tls_reloc): Implement method.
1710 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1711 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1712 in constructor.
1713 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1714 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1715 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1716 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1717 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1718 (Output_data_plt_aarch64::rela_irelative): New method.
1719 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1720 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1721 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1722 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1723 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1724 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1725 (Output_data_plt_aarch64_standard): New member variables:
1726 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1727 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1728 New parameter: got, got_irelative.
1729 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1730 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1731 (Output_data_plt_aarch64::do_write): Replace got_address with
1732 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1733 (AArch64_relocate_functions::update_movnz): New method.
1734 (AArch64_relocate_functions): Correct format.
1735 (AArch64_relocate_functions::movnz): New method.
1736 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1737 before the switch. Add new cases to switch.
00cac886 1738 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1739 tlsgd tlsdesc cases.
1740 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1741 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1742 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1743 Call reloc_name_in_error_message to print unsupported reloc.
1744 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1745 make_data_plt.
1746 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1747 relocs. Fill in some more dynamic tags.
1748 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1749 Skip call tls_get_addr when tlsgd is relaxed.
1750 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1751 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1752 tlsdesc->ie relaxation.
1753
62661c93
SS
17542014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1755
1756 * mips.cc (Target_mips_nacl): New class.
1757 (Target_selector_mips_nacl): New class.
1758 (target_selector_mips32): Rename from target_selector_mips32be and use
1759 Target_selector_mips_nacl instead of Target_selector_mips.
1760 (target_selector_mips32el): Rename from target_selector_mips32 and use
1761 Target_selector_mips_nacl instead of Target_selector_mips.
1762 (target_selector_mips64): Rename from target_selector_mips64be and use
1763 Target_selector_mips_nacl instead of Target_selector_mips.
1764 (target_selector_mips64el): Rename from target_selector_mips64 and use
1765 Target_selector_mips_nacl instead of Target_selector_mips.
1766 (Target_mips::mips_info): Add const attribute.
1767
54674d38
CC
17682014-09-02 Cary Coutant <ccoutant@google.com>
1769
1770 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1771 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1772 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1773 (Sized_incr_dynobj::do_section_name): Likewise.
1774 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1775 (Sized_incr_dynobj::do_section_name): Likewise.
1776 * object.h (Object::section_name): Likewise.
1777 (Object::do_section_name): Likewise.
1778 (Sized_relobj_file::do_section_name): Likewise.
1779 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1780 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1781
9860cbcf
CC
17822014-09-02 Cary Coutant <ccoutant@google.com>
1783
1784 PR gold/17005
1785 * ehframe.cc (Fde::write): Add output_offset parameter.
1786 (Cie::write): Likewise.
1787 (Eh_frame::set_final_data_size): Account for offset within output
1788 section.
1789 (Eh_frame::do_sized_write): Likewise.
1790 * ehframe.h (Fde::write): Add output_offset parameter.
1791 (Cie::write): Likewise.
1792 * output.cc (Output_section::Input_section_sort_entry): Remove
1793 section_has_name_; add output_section_name parameter. Use
1794 output section name for non-input sections.
1795 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1796 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1797 (Output_section::Input_section_sort_compare): Remove logic for
1798 sections without names.
1799 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1800 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1801 Likewise.
1802 (Output_section::Input_section_sort_section_name_compare): Likewise.
1803
8e33481e
HS
18042014-08-29 Han Shen <shenhan@google.com>
1805 Jing Yu <jingyu@google.com>
1806
1807 * aarch64-reloc-property.cc
1808 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1809 reference reloc property in the table.
1810 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1811 3 other entries.
1812 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1813 2 new overloaded methods.
1814 (Output_data_got_aarch64::do_write): Add code to write out
1815 static relocs.
1816 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1817 static relocs.
1818 (Output_data_got_aarch64::static_relocs): New vector to
1819 hold static relocs.
1820 (Target_aarch64::TCB_SIZE): New const static memeber.
1821 (Target_aarch64::tcb_size): New method.
1822 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1823 (Target_aarch64::Relocate::relocate_tls): New method.
1824 (Target_aarch64::Scan::local): Add code handling new reloc types.
1825 (Target_aarch64::Scan::global): Add code handling new reloc types.
1826
81233653
ST
18272014-08-13 Sriraman Tallam <tmsriram@google.com>
1828
1829 * options.h (-no-pie): Add option.
1830
9363c7c3
JY
18312014-08-08 Jing Yu <jingyu@google.com>
1832 Han Shen <shenhan@google.com>
1833
1834 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1835 (DEFFILES): add aarch64-reloc.def.
1836 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1837 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1838 * Makefile.in: Regenerate.
1839 * aarch64-reloc-property.cc: New file.
1840 * aarch64-reloc-property.h: New file.
1841 * aarch64-reloc.def: New file.
1842 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1843 with tab to make the format consistent.
1844 (Output_data_got_aarch64::symbol_table_): New method.
1845 (Target_aarch64::do_plt_address_for_global): New method.
1846 (Target_aarch64::do_plt_address_for_local): New method.
1847 (Target_aarch64::do_select_as_default_target): New method.
1848 (Target_aarch64::do_make_data_plt): New method.
1849 (Target_aarch64::make_data_plt): New method.
1850 (Output_data_plt_aarch64::has_irelative_section): New method.
1851 (Output_data_plt_aarch64::address_for_global): New method.
1852 (Output_data_plt_aarch64::address_for_local): New method.
1853 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1854 (Output_data_plt_aarch64::add_entry): Implement contents.
1855 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1856 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1857 the got_pov entry to plt0.
1858 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1859 Implement contents.
1860 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1861 (AArch64_howto): New struct.
1862 (aarch64_howto[]): New static const array.
1863 (AArch64_relocate_functions): New class.
1864 (Target_aarch64::Scan::get_reference_flags): Remove method.
1865 (Target_aarch64::Scan::local): Implement to support a few relocations.
1866 (Target_aarch64::Scan::global): Implement to support a few relocations.
1867 (Target_aarch64::make_plt_section): Implement contents.
1868 (Target_aarch64::make_plt_entry): Implement contents.
1869 (Target_aarch64::do_finalize_sections): Implement contents.
1870 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1871 (Target_aarch64::relocate_section): Implement contents.
1872
ad9fe6c1
AM
18732014-08-06 Alan Modra <amodra@gmail.com>
1874
1875 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1876
7cd4e5b7
AM
18772014-08-06 Alan Modra <amodra@gmail.com>
1878
1879 PR 13227
1880 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1881
5ad9b0a7
ST
18822014-07-21 Sriraman Tallam <tmsriram@google.com>
1883
1884 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1885 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1886
e051745c
CC
18872014-07-08 Cary Coutant <ccoutant@google.com>
1888
1889 * expression.cc (struct Expression::Expression_eval_info): Add
1890 new fields type_pointer, vis_pointer, and nonvis_pointer.
1891 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1892 nonvis_pointer parameters. Adjust all calls.
1893 (Symbol_expression::value): Update type, visibility, and nonvis bits
1894 in caller.
1895 * script.cc (Symbol_assignment::sized_finalize): Update type,
1896 visibility, and remaining st_other bits for new symbol.
1897 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1898 vis_pointer, and nonvis_pointer parameters.
1899 * symtab.h (Symbol::set_type): New method.
1900
1901 * testsuite/Makefile.am (defsym_test): New test.
1902 * testsuite/Makefile.in: Regenerate.
1903 * testsuite/defsym_test.c: New file.
1904 * testsuite/defsym_test.sh: New file.
1905
f35c4853
CC
19062014-07-08 Cary Coutant <ccoutant@google.com>
1907
1908 PR gold/15639
1909 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1910 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1911 (Sized_dynobj::base_read_symbols): ...new method.
1912 * object.h (Sized_relobj_file::base_read_symbols): New method.
1913 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1914 (Sized_relobj_file::base_read_symbols): ...new method.
1915 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1916 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1917 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1918
2900af2d
AM
19192014-07-04 Alan Modra <amodra@gmail.com>
1920
1921 * po/POTFILES.in: Regenerate.
1922
053a4d68
JY
19232014-07-02 Jing Yu <jingyu@google.com>
1924
1925 * aarch64.cc: New file
1926 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1927 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1928 * Makefile.in: Regenerate.
1929 * configure.tgt: Add entries for aarch64*.
1930 * configure.ac: Likewise.
1931 * configure: Likewise.
1932
7b549045
AM
19332014-06-27 Alan Modra <amodra@gmail.com>
1934
1935 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1936
cb818dbf
CC
19372014-06-24 Cary Coutant <ccoutant@google.com>
1938
1939 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1940 sections.
1941 (Dwo_file::sized_read_unit_index): Likewise.
1942
9810d34d
SS
19432014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1944
1945 * mips.cc: New file.
1946 * Makefile.am (TARGETSOURCES): Add mips.cc
1947 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1948 * configure.tgt: Add entries for mips*.
1949 * configure.ac: Likewise.
1950 * Makefile.in: Regenerate.
1951 * configure: Likewise.
1952
9baa787b
CC
19532014-06-09 Cary Coutant <ccoutant@google.com>
1954
1955 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1956 unit_length is within section bounds.
1957
8f89af0a
CC
19582014-06-09 Cary Coutant <ccoutant@google.com>
1959
1960 PR gold/16980
1961 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1962 map.
1963
a47622ac
AM
19642014-06-07 Alan Modra <amodra@gmail.com>
1965
1966 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1967
4320c691
CC
19682014-06-06 Cary Coutant <ccoutant@google.com>
1969
1970 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1971 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1972 (Dwarf_pubnames_table::read_header): Likewise.
1973 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1974 .debug_gnu_pubtypes.
1975
270c9937
JB
19762014-06-05 Joel Brobecker <brobecker@adacore.com>
1977
1978 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1979 * Makefile.in, configure: Regenerate.
1980
397998fc
AM
19812014-06-03 Alan Modra <amodra@gmail.com>
1982
1983 * powerpc.cc (addis_12_2): Define.
1984 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1985
61f5c66f
AM
19862014-06-03 Alan Modra <amodra@gmail.com>
1987
1988 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1989 st_other output.
1990
f6971787
AM
19912014-06-02 Alan Modra <amodra@gmail.com>
1992
1993 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1994 Only ignore relocs on ELFv1.
1995 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1996
f6fb8322
CC
19972014-05-30 Cary Coutant <ccoutant@google.com>
1998
1999 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
2000 * testsuite/Makefile.in: Regenerate.
2001 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
2002
c23dd342
L
20032014-05-27 H.J. Lu <hongjiu.lu@intel.com>
2004
2005 PR gold/16945
2006 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
2007 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
2008
5fe7ffdc
AM
20092014-05-15 Alan Modra <amodra@gmail.com>
2010
2011 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2012 Compare FDE contents with DW_CFA_nop rather than 0.
2013
a82bef93
ST
20142014-05-13 Sriraman Tallam <tmsriram@google.com>
2015
2016 * symtab.h (may_need_copy_reloc): Remove check for position independent
2017 code.
2018 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2019 position independence before pc absolute may_need_copy_reloc call.
2020 Add check for executable output befor pc relative may_need_copy_reloc
2021 call.
2022 * i386.cc: Ditto.
2023 * arm.cc: Ditto.
2024 * sparc.cc: Ditto.
2025 * tilegx.cc: Ditto.
2026 * powerpc.cc: Add check for no position independence before
2027 may_need_copy_reloc calls.
2028 * testsuite/pie_copyrelocs_test.cc: New file.
2029 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2030 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2031 * Makefile.in: Regenerate.
a82bef93 2032
53c66605
ML
20332014-05-08 Martin Liška <mliska@suse.cz>
2034
2035 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2036
57b2284c
CC
20372014-05-06 Cary Coutant <ccoutant@google.com>
2038
2039 PR gold/16900
2040 * i386.cc (Output_data_got_plt_i386): New class.
2041 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2042 parameter. Change all callers.
2043 (Output_data_plt_i386::layout_): Remove.
2044 (Output_data_plt_i386::got_plt_): Change type.
2045 (Target_i386::got_plt_): Change type. Change all references.
2046 (Target_i386::got_section): Create instance of new class.
2047 (Output_data_got_plt_i386::do_write): New function.
2048 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2049 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2050 parameter. Change all callers.
2051 (Output_data_plt_x86_64::layout_): Remove.
2052 (Output_data_plt_x86_64::got_plt_): Change type.
2053 (Target_x86_64::got_plt_): Change type. Change all references.
2054 (Target_x86_64::got_section): Create instance of new class.
2055 (Output_data_got_plt_x86_64::do_write): New function.
2056 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2057 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2058 class.
2059
6b97515d 20602014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2061
6b97515d
CC
2062 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2063 if we have pubnames/pubtypes.
2064
d1bddd3c
CC
20652014-05-02 Cary Coutant <ccoutant@google.com>
2066
5fe7ffdc
AM
2067 * defstd.cc (in_segment): Define __ehdr_start here...
2068 * layout.cc (Layout::finalize): ...Instead of here. Set the
2069 output segment when known.
2070 * resolve.cc (Symbol::override_base_with_special): Remember
2071 the original binding.
2072 * symtab.cc (Symbol::set_output_segment): New function.
2073 (Symbol::set_undefined): New function.
2074 * symtab.h (Symbol::is_weak_undefined): Check original undef
2075 binding.
2076 (Symbol::is_strong_undefined): New function.
2077 (Symbol::set_output_segment): New function.
2078 (Symbol::set_undefined): New function.
2079 * target-reloc.h (is_strong_undefined): Remove.
2080 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2081 Check for hidden undefs.
2082 (relocate_section): Call Symbol::is_strong_undefined.
2083
2084 * testsuite/Makefile.am (ehdr_start_test_1)
2085 (ehdr_start_test_2, ehdr_start_test_3)
2086 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2087 * testsuite/Makefile.in: Regenerate.
2088 * testsuite/ehdr_start_def.cc: New source file.
2089 * testsuite/ehdr_start_test.cc: New source file.
2090 * testsuite/ehdr_start_test.t: New linker script.
2091 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2092
7849f6d8
CC
20932014-04-23 Cary Coutant <ccoutant@google.com>
2094
bf2cc635 2095 PR gold/16870
7849f6d8
CC
2096 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2097
99fd8cff
CC
20982014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2099
2100 * layout.cc (Layout::include_section): Allow a target to decide
2101 whether to include a section.
2102 * target.h (Target::should_include_section): New function.
2103 (Target::do_should_include_section): New function.
2104
91f43acd
CC
21052014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2106
2107 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2108 inline into ...
2109 (Copy_relocs::emit): ... here.
2110 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2111 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2112 (Copy_reloc_entry::entries_): Change from private to protected.
2113
c4eb27e1
ST
21142014-04-02 Sriraman Tallam <tmsriram@google.com>
2115
2116 * icf.cc (get_section_contents): Replace copies of reloc
2117 vectors with const references.
2118
ae447ddd
CC
21192014-04-02 Cary Coutant <ccoutant@google.com>
2120
2121 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2122 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2123 * configure: Regenerate.
2124 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2125 -fno-use-linker-plugin.
2126 (LINK1, CXXLINK1): Add it to the link command.
2127 * testsuite/Makefile.in: Regenerate.
2128
fa47fa92
AM
21292014-03-12 Alan Modra <amodra@gmail.com>
2130
2131 * Makefile.in: Regenerate.
2132
9b12c500
CC
21332014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2134
2135 * symtab.h (Symbol::set_nonvis): New function.
2136
beacaa96
CC
21372014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2138
2139 * symtab.cc (Sized_symbol<32>::init_output_data):
2140 Instantiate the template.
2141 (Sized_symbol<64>::init_output_data): Likewise.
2142
800d9823
CC
21432014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2144
2145 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2146 adjust dynamic symbol value.
2147 * target.h (Target::adjust_dyn_symbol): New function.
2148 (Target::do_adjust_dyn_symbol): New function.
2149
918fc1f8 21502014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2151
918fc1f8
CC
2152 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2153 Get the value of DYNAMIC_CUSTOM dynamic entry.
2154 * output.h (Output_data_dynamic::add_custom): New function.
2155 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2156 dynamic entry.
2157 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2158 * target.h (Target::dynamic_tag_custom_value): New function.
2159 (Target::do_dynamic_tag_custom_value): New function.
2160
98ff9231
CC
21612014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2162
2163 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2164 dynsym indexes.
2165 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2166 (Target::do_has_custom_set_dynsym_indexes): New function.
2167 (Target::set_dynsym_indexes): New function.
2168 (Target::do_set_dynsym_indexes): New function.
2169
b80eed39
AM
21702014-03-07 Alan Modra <amodra@gmail.com>
2171
2172 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2173 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2174 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2175 (Powerpc_relocate_functions::has_overflow_bitfield,
2176 overflowed): Use the above.
2177 (Target_powerpc::Relocate::relocate): Correct overflow checking
2178 for a number of relocations. Modify overflow test for 16-bit
2179 fields in instructions to signed/unsigned according to whether
2180 the field takes a signed or unsigned value.
2181
4b95cf5c
AM
21822014-03-05 Alan Modra <amodra@gmail.com>
2183
2184 Update copyright years.
2185
45965137
AM
21862014-03-05 Alan Modra <amodra@gmail.com>
2187
2188 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2189 R_PPC64_ADDR64_LOCAL.
2190 (Target_powerpc::Relocate::relocate): Likewise.
2191
2c80b753
AM
21922014-03-03 Alan Modra <amodra@gmail.com>
2193
2194 * dwp.cc (print_version): Update copyright year to current.
2195
c1c69e83
AM
21962014-02-10 Alan Modra <amodra@gmail.com>
2197
2198 * po/gold.pot: Regenerate.
2199
dd0c4e70
CC
22002014-02-06 Cary Coutant <ccoutant@google.com>
2201
2202 Fix problem where -u is ignored when a weak undef is seen.
2203
2204 * archive.cc (Library_base::should_include_member): Reorder
2205 code to check for -u option if a weak undef has already been seen.
2206 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2207 * testsuite/Makefile.in: Regenerate.
2208 * testsuite/weak_undef_file3.cc: New file.
2209 * testsuite/weak_undef_file4.cc: New file.
2210 * testsuite/weak_undef_test_2.cc: New file.
2211
1a221d3d
CC
22122014-02-05 Cary Coutant <ccoutant@google.com>
2213
2214 Fix issues with gold undefined symbol diagnostics.
2215
2216 PR binutils/15435
2217 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2218 check to here.
2219 * target-reloc.h (is_strong_undefined): New function.
2220 (relocate_section): Move undef vtable symbol check from here.
2221 Check for is_strong_undefined.
2222
e889f0a4 22232014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2224
e889f0a4
CC
2225 Fix problems with the --dynamic-list option.
2226
2227 PR gold/13577
2228 * options.cc (General_options::parse_dynamic_list):
2229 Set have_dynamic_list_.
2230 (General_options::General_options): Initialize have_dynamic_list_.
2231 (General_options::finalize): Turn off -Bsymbolic and
2232 -Bsymbolic-functions if --dynamic-list provided.
2233 * options.h (General_options::have_dynamic_list): New function.
2234 (General_options::have_dynamic_list_): New data member.
2235 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2236 correctly.
5fe7ffdc 2237
e889f0a4
CC
2238 PR gold/16530
2239 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2240 in --dynamic-list, mark it.
5fe7ffdc 2241
e889f0a4
CC
2242 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2243 (dynamic_list_2): New test case.
2244 * testsuite/Makefile.in: Regenerate.
2245 * testsuite/dynamic_list_2.cc: New file.
2246 * testsuite/dynamic_list_2.t: New file.
2247 * testsuite/dynamic_list_lib1.cc: New file.
2248 * testsuite/dynamic_list_lib2.cc: New file.
2249 * testsuite/gc_dynamic_list_test.c: New file.
2250 * testsuite/gc_dynamic_list_test.sh: New file.
2251 * testsuite/gc_dynamic_list_test.t: New file.
2252
ec673e64
CC
22532014-01-28 Cary Coutant <ccoutant@google.com>
2254
2255 Add .gdb_index version 7 support.
2256
2257 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2258 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2259 debug sections.
2260 (Dwarf_ranges_table::read_ranges_table): Likewise.
2261 (Dwarf_pubnames_table::read_section): Check for GNU-style
2262 sections, and for compressed debug sections.
2263 (Dwarf_pubnames_table::read_header): Compute end address of table.
2264 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2265 for end of list by offset, not by offset == 0.
2266 (Dwarf_info_reader::do_read_string_table): Check for compressed
2267 debug sections.
2268 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2269 Initialize new data members.
2270 (Dwarf_pubnames_table::next_name): return flag_byte.
2271 (Dwarf_pubnames_table::end_of_table_): New data member.
2272 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2273 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2274 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2275 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2276 read skeleton type unit DIEs.
2277 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2278 (Gdb_index::do_write): Write flag_byte.
2279 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2280 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2281 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2282 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2283
221fd5d5
L
22842014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2285
2286 * version.cc (print_version): Update copyright year to 2014.
2287
6c09fb0b
ILT
22882013-12-19 Dimitry Andric <dimitry@andric.com>
2289
2290 * stringpool.cc (Stringpool_template::reserve): Add
2291 HAVE_UNORDERED_MAP case.
2292 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2293
8356f2d0
CC
22942013-12-18 Cary Coutant <ccoutant@google.com>
2295
2296 * configure.ac: Check for <unordered_set> and <unordered_map>.
2297 * config.in: Regenerate.
2298 * configure: Regenerate.
2299 * system.h: Use <unordered_set> and <unordered_map> if available.
2300
f2c7d7ee
RM
23012013-12-10 Roland McGrath <mcgrathr@google.com>
2302
2303 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2304 with $(INSTALL_PROGRAM_ENV).
2305 * Makefile.in: Regenerate.
2306
6632e8cc
CC
23072013-11-22 Cary Coutant <ccoutant@google.com>
2308
2309 * configure.ac: Add check for which library is needed for
2310 dlopen.
2311 * configure: Regenerate.
2312
0c075858
CC
23132013-11-22 Cary Coutant <ccoutant@google.com>
2314
2315 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2316 assembler.
2317 * testsuite/Makefile.in: Regenerate.
2318
f49fe902
L
23192013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2320
2321 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2322 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2323 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2324 (Target_x86_64<size>::Scan::local): Likewise.
2325 (Target_x86_64<size>::Scan::global): Likewise.
2326 (Target_x86_64<size>::Relocate::relocate): Likewise.
2327 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2328 Likewise.
2329 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2330 R_X86_64_PC32_BND.
2331
2332 * testsuite/Makefile.am (check_PROGRAMS): Add
2333 exception_x86_64_bnd_test.
2334 (exception_x86_64_bnd_test_SOURCES): New macro.
2335 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2336 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2337 (exception_x86_64_bnd_test_LDADD): Likewise.
2338 (exception_x86_64_bnd_1.o): New rule.
2339 (exception_x86_64_bnd_2.o): Likewise.
2340 * testsuite/Makefile.in: Regenerated.
2341
9055360d
AM
23422013-11-15 Alan Modra <amodra@gmail.com>
2343
2344 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2345 accessor.
2346 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2347 Only call ppc64_local_entry_offset for 64-bit. Restrict
2348 symval_for_branch lookup to ELFv1.
2349 (Stub_table::add_plt_call_entry): Use unsigned int off.
2350 (Output_data_glink::Address, invalid_address): New.
2351 (Output_data_glink::add_eh_frame): Move out of line. Add
2352 support for ELFv2.
2353 (Output_data_glink::add_global_entry, find_global_entry,
2354 global_entry_address): New functions.
2355 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2356 ge_size): New variables.
2357 (Output_data_glink::set_final_data_size): Add global entry
2358 stub sizing.
2359 (Output_data_glink::do_write): Write global entry stubs.
2360 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2361 parameter. Return true for ELFv2. Adjust callers.
2362 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2363 ELFv1. Similarly for ifunc and dynamic relocation processing
2364 specific to ELFv1. Recognize that symbols are defined on
2365 their plt entries for ELFv2.
2366 (Target_powerpc::symval_for_branch): Assert if called for
2367 ELFv2 or ppc32.
2368 (Target_powerpc::Relocate::relocate): Use global entry plt
2369 stub for symbol value if such exists on ELFv2.
2370 (Target_powerpc::Relocate::relocate): Don't call
2371 symval_for_branch when ELFv2. Do adjust for local entry
2372 offset when ELFv2.
2373 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2374 plt stub for ELFv2.
2375 (Target_powerpc::do_plt_address_for_global): Similarly.
2376
cafdd569
CC
23772013-11-14 Cary Coutant <ccoutant@google.com>
2378
2379 Revert patch -- this did not fix the problem, and there is
2380 no race there.
2381
2382 2013-11-14 Cary Coutant <ccoutant@google.com>
2383
2384 PR gold/14860
2385 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2386 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2387 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2388 updating fde_offsets_.
2389 (Eh_frame_hdr::lock_): New data member.
2390
94e49e16
CC
23912013-11-14 Cary Coutant <ccoutant@google.com>
2392
2393 * dwp.cc (Dwo_file_entry): New type.
2394 (File_list): Use Dwo_file_entry.
2395 (Dwo_file::verify): New function.
2396 (Dwo_file::verify_dwo_list): New function.
2397 (Dwo_file::sized_verify_dwo_list): New function.
2398 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2399 list.
2400 (Dwp_options): New enum type.
2401 (dwp_options): Add --verify-only.
2402 (usage): Likewise.
2403 (main): Likewise.
2404 * dwp.h (gold_info): Add declaration.
2405
7cdd7d57
CC
24062013-11-14 Cary Coutant <ccoutant@google.com>
2407
2408 PR gold/14860
2409 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2410 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2411 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2412 updating fde_offsets_.
2413 (Eh_frame_hdr::lock_): New data member.
2414
1d946cb3
CC
24152013-11-06 Cary Coutant <ccoutant@google.com>
2416
2417 PR gold/15758
2418 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2419 before reloc sections.
2420
4f65b40e
AM
24212013-11-04 Alan Modra <amodra@gmail.com>
2422
2423 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2424 (Symbol::needs_dynamic_reloc): Test new flag.
2425 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2426 (Target_powerpc::Scan::get_reference_flags): Add target param.
2427 Return FUNC_DESC_ABI for 64-bit ELFv1.
2428 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2429 call.
2430 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2431 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2432
908794a9
CC
24332013-10-31 Cary Coutant <ccoutant@google.com>
2434
2435 Restore support for dwp v2 DWARF package file format.
2436
2437 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2438 tu_length parameter. Adjust all callers.
2439 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2440 * dwp.cc: Include dwarf.h.
2441 (Section_bounds): New struct type.
2442 (Unit_set): New struct type.
2443 (Dwo_file::Dwo_file): Initialize new data member.
2444 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2445 Combine and rename to...
2446 (Dwo_file::read_unit_index): ...this.
2447 (Dwo_file::sized_read_compunit_index)
2448 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2449 (Dwo_file::sized_read_unit_index): ...this.
2450 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2451 parameters; add section_id parameter.
2452 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2453 (Dwo_file::add_unit_set): ...this.
2454 (Dwo_file::shndx_map_): Remove.
2455 (Dwo_file::sect_offsets_): New data member.
2456 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2457 (Dwp_output_file::add_section): Rename to...
2458 (Dwp_output_file::add_contribution): ...this.
2459 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2460 (Dwp_output_file::add_tu_set): Likewise.
2461 (Dwp_output_file::Contribution): New type.
2462 (Dwp_output_file::Section::contributions): New data member.
2463 (Dwp_output_file::Cu_or_tu_set): Remove.
2464 (Dwp_output_file::Section::Section): New ctor.
2465 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2466 (Dwp_output_file::Dwp_index::Section_table): New type.
2467 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2468 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2469 parameter.
2470 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2471 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2472 (Dwp_output_file::Dwp_index::section_table): New member function.
2473 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2474 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2475 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2476 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2477 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2478 (Dwp_output_file::Dwp_index::section_table_): New data member.
2479 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2480 (Dwp_output_file::add_output_section): New member function.
2481 (Dwp_output_file::write_new_section): New member function.
2482 (Dwp_output_file::write_contributions): New member function.
2483 (Dwp_output_file::section_id_map_): New data member.
2484 (class Dwo_id_info_reader): Remove.
2485 (class Unit_reader): New class.
2486 (get_dwarf_section_name): New function.
2487 (Dwo_file::read_executable): Adjust initializations of class data.
2488 (Dwo_file::read): Add support for v2 package file format.
2489 (Dwo_file::read_unit_index): Likewise.
2490 (Dwo_file::sized_read_unit_index): Likewise.
2491 (Dwo_file::copy_section): Likewise.
2492 (Dwo_file::add_unit_set): Likewise.
2493 (Dwp_output_file::add_output_section): Likewise.
2494 (Dwp_output_file::add_contribution): Likewise.
2495 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2496 for empty slot.
2497 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2498 file format.
2499 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2500 slot.
2501 (Dwp_output_file::initialize): Remove unused function.
2502 (Dwp_output_file::finalize): Add support for v2 package file format.
2503 (Dwp_output_file::write_index): Likewise.
2504 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2505 function prototype.
2506
2500c017
CC
25072013-10-31 Cary Coutant <ccoutant@google.com>
2508
2509 * configure.ac: Fix check for -fmerge-constants.
2510 * configure.ac: Regenerate.
2511
dd0845d7
RM
25122013-10-30 Roland McGrath <mcgrathr@google.com>
2513
2514 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2515 Correct 9-byte nop sequence to match what the assembler generates.
2516
b4f7960d
AM
25172013-10-30 Alan Modra <amodra@gmail.com>
2518
2519 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2520 ppc64_local_entry_offset, ppc64_local_entry_offset,
2521 do_read_symbols): New functions.
2522 (Powerpc_relobj::e_flags_, st_other_): New vars.
2523 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2524 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2525 (Powerpc_relobj::e_flags_): New var.
2526 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2527 and adjust for ELFv2.
2528 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2529 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2530 (Powerpc_dynobj::do_find_special_sections): Likewise.
2531 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2532 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2533 to ELFv2 local entry.
2534 (Target_powerpc::do_relax): No thread safe barriers needed for
2535 ELFv2.
2536 (Output_data_plt_powerpc::initial_plt_entry_size_,
2537 plt_entry_size): Delete. Replace all uses with
2538 first_plt_entry_offset() and plt_entry_size().
2539 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2540 reserved_size parm. Update callers.
2541 (Output_data_plt_powerpc::entry_count): Update.
2542 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2543 and use Target_powerpc::first_plt_entry_offset().
2544 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2545 rename to plt_entry_size.
2546 (Output_data_plt_powerpc::add_ifunc_entry,
2547 add_local_ifunc_entry): Adjust reloc for ELFv2.
2548 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2549 (glink_eh_frame_fde_64v2): New.
2550 (Stub_table::plt_call_size): Support ELFv2 sizing.
2551 (Output_data_glink::add_eh_frame): Use the new FDE.
2552 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2553 (Stub_table::do_write): Write ELFv2 stubs and glink.
2554 (Target_powerpc::Relocate::relocate): Replaces nop after call
2555 with ld 2,24(1) and adjust local offset destination for ELFv2.
2556
f9c6b907
AM
25572013-10-30 Alan Modra <amodra@gmail.com>
2558
2559 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2560 (Target_powerpc::Scan::global, local): Likewise.
2561 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2562 on all ppc64 @h and @ha relocs.
2563
e84fe78f
AM
25642013-10-14 Alan Modra <amodra@gmail.com>
2565
2566 * output.h (Output_data_got::add_constant): Tidy.
2567 (Output_data_got::add_constant_pair): New function.
2568 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2569 methods used so as to first call reserve_ent().
2570
679e4abf
RM
25712013-10-11 Roland McGrath <mcgrathr@google.com>
2572
44dcb735
RM
2573 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2574 add_got_entry and add_got_entry_pair.
2575
13323c49
RM
2576 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2577 (HAVE_PUBNAMES): Likewise.
2578 * configure: Regenerate.
2579
1496b446
RM
2580 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2581 * testsuite/Makefile.in: Regenerate.
2582
cc84c10b
RM
2583 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2584 Remove const from declaration.
2585 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2586 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2587 * output.h (Output_file_header): Remove const from member target_
2588 and corresponding constructor argument.
2589 * output.cc (Output_file_header::Output_file_header): Update prototype.
2590 (Output_file_header::do_sized_write): Use this->target_ in place
2591 of parameters()->target().
2592
52f66a2c
RM
2593 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2594
2b64b551
RM
2595 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2596 * configure: Regenerate.
2597 * Makefile.in: Regenerate.
2598 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2599 * testsuite/merge_string_literals_2.c: Likewise.
2600 * testsuite/Makefile.am
2601 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2602 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2603 literal -fmerge-constants.
2604 * testsuite/Makefile.in: Regenerate.
2605
43819297
RM
2606 * i386.cc (Target_i386): Remove unused member dynbss_.
2607 * arm.cc (Target_arm): Likewise.
2608 * powerpc.cc (Target_powerpc): Likewise.
2609 * sparc.cc (Target_sparc): Likewise.
2610 * tilegx.cc (Target_tilegx): Likewise.
2611 * x86_64.cc (Target_x86_64): Likewise.
2612 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2613 type_signature_, type_offset_.
2614 * plugin.h (Plugin_hook): Remove unused member layout_.
2615 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2616 mapfile_.
2617 (Read_member): Remove unused members input_objects_, symtab_,
2618 mapfile_, layout_.
2619 (Check_library): Remove unused member symtab_.
2620 * archive.h (Lib_group): Remove unused member lib_.
2621 * archive.cc (Lib_group::Lib_group): Update initializer.
2622 * incremental.h (Incremental_binary): Remove unused member target_.
2623 (Incremental_script_entry): Removed unused member script_.
2624 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2625 * icf.h (Icf): Remove unused member num_tracked_relocs.
2626
39d9ead7
RM
2627 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2628 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2629 its only use.
2630 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2631
679e4abf
RM
2632 * archive.h: Use struct rather than class for forward declaration
2633 of Read_symbols_data.
2634
54de2ea6
CC
26352013-10-07 Cary Coutant <ccoutant@google.com>
2636
2637 PR gold/16010
2638 * testsuite/Makefile.am (icf_test): Fix dependencies.
2639 (icf_safe_test): Likewise.
2640 (icf_safe_so_test): Likewise.
2641 (large_symbol_alignment): Add empty _LDADD rule.
2642 * testsuite/Makefile.in: Regenerate.
2643
b14016f0
L
26442013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2645
2646 PR gold/15927
2647 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2648 relocation for R_X86_64_32 on x32.
2649
eb426534
RM
26502013-08-27 Roland McGrath <mcgrathr@google.com>
2651
2652 * output.cc (Output_segment::set_section_addresses): Take new
2653 Target* argument. If target->isolate_execinstr() and the segment
2654 is executable and starts at a target->abi_pagesize() boundary,
2655 pad its end out to a target->abi_pagesize() boundary with code fill.
2656 * output.h (Output_segment::set_section_addresses): Update decl.
2657 * layout.h (Layout::check_output_data_for_reset_values): Take new
2658 argument RELAX_OUTPUTS.
2659 (Layout): New member relax_output_list_.
2660 (Layout::add_relax_output): New method.
2661 * layout.cc (Layout::Layout): Update constructor.
2662 (Layout::reset_relax_output): New method.
2663 (Layout::clean_up_after_relaxation): Call it.
2664 (Layout::prepare_for_relaxation): Update caller.
2665 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2666 Call reset_relax_output before re-processing segments for
2667 isolate_execinstr case.
2668 (Layout::write_data): Handle relax_output_list_.
2669 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2670 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2671
9aff4b7a
NC
26722013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2673
2674 PR binutils/15834
2675 * object.h: Fix typos.
2676
93f8221c
RM
26772013-08-16 Roland McGrath <mcgrathr@google.com>
2678
2679 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2680 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2681
e44c3715
CC
26822013-08-07 Cary Coutant <ccoutant@google.com>
2683
2684 Revert support for v2 DWP files:
2685
2686 2013-03-01 Cary Coutant <ccoutant@google.com>
2687
2688 Add dwp support for v2 DWARF package file format.
2689 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2690 tu_length parameter. Adjust all callers.
2691 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2692 * dwp.cc: Include dwarf.h.
2693 (Section_bounds): New struct type.
2694 (Unit_set): New struct type.
2695 (Dwo_file::Dwo_file): Initialize new data member.
2696 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2697 Combine and rename to...
2698 (Dwo_file::read_unit_index): ...this.
2699 (Dwo_file::sized_read_compunit_index)
2700 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2701 (Dwo_file::sized_read_unit_index): ...this.
2702 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2703 parameters; add section_id parameter.
2704 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2705 (Dwo_file::add_unit_set): ...this.
2706 (Dwo_file::shndx_map_): Remove.
2707 (Dwo_file::sect_offsets_): New data member.
2708 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2709 (Dwp_output_file::add_section): Rename to...
2710 (Dwp_output_file::add_contribution): ...this.
2711 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2712 (Dwp_output_file::add_tu_set): Likewise.
2713 (Dwp_output_file::Contribution): New type.
2714 (Dwp_output_file::Section::contributions): New data member.
2715 (Dwp_output_file::Cu_or_tu_set): Remove.
2716 (Dwp_output_file::Section::Section): New ctor.
2717 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2718 (Dwp_output_file::Dwp_index::Section_table): New type.
2719 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2720 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2721 parameter.
2722 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2723 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2724 (Dwp_output_file::Dwp_index::section_table): New member function.
2725 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2726 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2727 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2728 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2729 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2730 (Dwp_output_file::Dwp_index::section_table_): New data member.
2731 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2732 (Dwp_output_file::add_output_section): New member function.
2733 (Dwp_output_file::write_new_section): New member function.
2734 (Dwp_output_file::write_contributions): New member function.
2735 (Dwp_output_file::section_id_map_): New data member.
2736 (class Dwo_id_info_reader): Remove.
2737 (class Unit_reader): New class.
2738 (get_dwarf_section_name): New function.
2739 (Dwo_file::read_executable): Adjust initializations of class data.
2740 (Dwo_file::read): Add support for v2 package file format.
2741 (Dwo_file::read_unit_index): Likewise.
2742 (Dwo_file::sized_read_unit_index): Likewise.
2743 (Dwo_file::copy_section): Likewise.
2744 (Dwo_file::add_unit_set): Likewise.
2745 (Dwp_output_file::add_output_section): Likewise.
2746 (Dwp_output_file::add_contribution): Likewise.
2747 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2748 for empty slot.
2749 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2750 file format.
2751 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2752 slot.
2753 (Dwp_output_file::initialize): Remove unused function.
2754 (Dwp_output_file::finalize): Add support for v2 package file format.
2755 (Dwp_output_file::write_index): Likewise.
2756 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2757 function prototype.
2758
c6905c28
CC
27592013-07-31 Cary Coutant <ccoutant@google.com>
2760
2761 * object.cc (Sized_relobj::do_output_section_address): New function.
2762 (Sized_relobj): Instantiate explicitly.
2763 * object.h (Object::output_section_address): New function.
2764 (Object::do_output_section_address): New function.
2765 (Sized_relobj::do_output_section_address): New function.
2766 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2767
27682013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2769 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2770
2771 * parameters.cc (Parameters::entry): Return target-specific entry
2772 symbol name.
2773 * target.h (Target::entry_symbol_name): New function.
2774 (Target_info::entry_symbol_name): New data member.
2775
2776 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2777 * i386.cc (Target_i386::i386_info): Likewise.
2778 (Target_i386_nacl::i386_nacl_info): Likewise.
2779 * sparc.cc (Target_sparc::sparc_info): Likewise.
2780 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2781 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2782 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2783 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2784
234d4ab8
SA
27852013-07-22 Sterling Augustine <saugustine@google.com>
2786
2787 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2788 Convert parameter shndx to local variable. Add parameters symtab
2789 and symtab_size. Scan over section names. Find relocation
2790 section corresponding to current section. Create and initialize
2791 reloc_mapper_ and reloc_type_.
2792 (Dwarf_pubnames_table::read_header): Add assertion. Change
2793 unit_length to off_t. Initialize member unit_length_. Fill in field
2794 cu_offset_.
2795 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2796 Initialize new fields unit_length_ and cu_offset_.
2797 (Dwarf_pubnames_table::read_section): Update prototype.
2798 (Dwarf_pubnames_table::cu_offset): New member function.
2799 (Dwarf_pubnames_table::subsection_size): Likewise.
2800 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2801 New fields.
2802 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2803 member functions public.
2804 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2805 Update comment. Rework logic. Move repeated parts to...
2806 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2807 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2808 pubtypes_table_, and stmt_list_offset.
2809 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2810 Gdb_index::find_pubtype_offset,
2811 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2812 (Gdb_index::pubnames_read): Update prototype and rework logic.
2813 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2814 Forward declare.
2815 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2816 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2817 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2818 Gdb_index::map_pubtable_to_dies):
2819 Declare functions.
2820 (Gdb_index::pubnames_read): Update declaration.
2821 (Gdb_index::Pubname_offset_map): New type.
2822 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2823 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2824 Gdb_index::stmt_list_offset): Declare.
2825 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2826 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2827 Gdb_index::pubtypes_offset_): Remove.
2828
a3ed37d8
RM
28292013-07-19 Roland McGrath <mcgrathr@google.com>
2830
2831 * options.h (General_options): Add -Trodata-segment option.
2832 * parameters.cc (Parameters::check_rodata_segment): New function.
2833 (Parameters::set_target_once): Call it.
2834 * parameters.h (Parameters): Declare it (private member function).
2835 * layout.cc (load_seg_unusable_for_headers): New function, broken
2836 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2837 then validate rodata segment rather than text segment.
2838 (relaxation_loop_body): Call that.
2839 (is_text_segment): New function. Don't admit a non-executable
2840 segment if TARGET->isolate_execinstr().
2841 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2842
eb5b4ded
CC
28432013-07-15 Shawn Landden <shawnlandden@gmail.com>
2844
2845 PR gold/15070
2846 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2847 * nacl.h (Sniff_file::View::View): Request aligned view.
2848
4d5effb9
CC
28492013-07-11 Cary Coutant <ccoutant@google.com>
2850
2851 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2852 correct BRLT entry size.
2853
ba8ca3e7
AM
28542013-07-03 Alan Modra <amodra@gmail.com>
2855
2856 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2857 comment.
2858
267257d2
CC
28592013-07-01 Cary Coutant <ccoutant@google.com>
2860
2861 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2862 reloc_type_.
2863 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2864 (Dwarf_ranges_table::lookup_reloc): New function.
2865 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2866 reloc_type_.
2867 (Dwarf_ranges_table::lookup_reloc): New function.
2868 (Dwarf_ranges_table::reloc_type_): New data member.
2869
06f30c9d
CC
28702013-06-27 Jing Yu <jingyu@google.com>
2871
2872 PR gold/15662
2873 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2874 function.
2875 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2876 (Target_powerpc::do_relax): Call the above.
2877
a2d7bf59
AM
28782013-06-27 Cary Coutant <ccoutant@google.com>
2879
2880 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2881 on garbage collected .opd section.
2882
28832013-06-27 Alan Modra <amodra@gmail.com>
2884
2885 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2886 is non-zero.
2887 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2888 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2889
32364e50
CC
28902013-06-14 Cary Coutant <ccoutant@google.com>
2891
2892 * resolve.cc (Symbol::override_base): Don't override st_type
2893 from plugin placeholder symbols.
2894 (Symbol_table::resolve): Likewise.
2895 (Symbol_table::should_override): Don't complain about TLS mismatch
2896 if the TO symbol is a plugin placeholder.
2897 * testsuite/Makefile.am (plugin_test_tls): New test.
2898 * testsuite/Makefile.in: Regenerate.
2899 * testsuite/plugin_test_tls.sh: New test script.
2900 * testsuite/two_file_test_2_tls.cc: New test source.
2901 * testsuite/two_file_test_tls.cc: New test source.
2902
7fb47cc9
CC
29032013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2904
2905 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2906 the maximum segment alignment is larger than the page size.
2907 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2908 correctly aligns the symbols with large alignemnt.
2909 * testsuite/Makefile.in: Regenerate.
2910 * testsuite/large_symbol_alignment.cc: New file.
2911
6934001a
CC
29122013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2913 Sriraman Tallam <tmsriram@google.com>
2914
2915 * options.h (sort_section): New option.
2916 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2917 Rename from Input_section_sort_section_name_special_ordering_compare.
2918 (Input_section_sort_section_name_compare): New struct.
2919 * output.cc (Output_section::Input_section_sort_section_name_compare::
2920 operator()): New function.
2921 (Output_section::sort_attached_input_sections): Use new sort function
2922 for .text if --sort-section=name is specified.
2923 * layout.cc (Layout::make_output_section):
2924 Add sorting by name when --sort-section=name is specified.
2925 * testsuite/Makefile.am (text_section_grouping): Test option
2926 --sort-section=name.
2927 * testsuite/Makefile.in: Regenerate.
2928 * testsuite/section_sorting_name.cc: New file.
2929 * testsuite/section_sorting_name.sh: New file.
2930
93acabad
CC
29312013-05-21 Cary Coutant <ccoutant@google.com>
2932
2933 * symtab.h (Symbol::is_cxx_vtable): New function.
2934 * target-reloc.h (relocate_section): Check for vtable symbol.
2935 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2936 * testsuite/Makefile.in: Regenerate.
2937 * testsuite/missing_key_func.cc: New test source.
2938 * testsuite/missing_key_func.sh: New test script.
2939
60e8b3fc
CC
29402013-05-21 Cary Coutant <ccoutant@google.com>
2941
2b64b551
RM
2942 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2943 type of enclosing symbol.
2944 (Relocate_info::location): Check symbol type when describing symbol.
2945 * object.h (Symbol_location_info): Remove unused line_number;
2946 add enclosing_symbol_type.
2947 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2948
9df9de2c
CC
29492013-05-13 Cary Coutant <ccoutant@google.com>
2950
2b64b551
RM
2951 * configure.ac: Export DEFAULT_TARGET.
2952 * configure: Regenerate.
2953 * Makefile.in: Regenerate.
2954 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2955 * testsuite/Makefile.in: Regenerate.
2956 * testsuite/debug_msg.sh: Delete duplicate tests.
2957 Don't check undef_int error message match for powerpc where the
2958 source file and line number aren't available.
9df9de2c 2959
bbc5ae17
RM
29602013-05-10 Roland McGrath <mcgrathr@google.com>
2961
2962 * options.h (General_options): Add --rosegment-gap option.
2963 * options.cc (finalize): --rosegment-gap implies --rosegment.
2964 * layout.cc (set_segment_offsets): Let user option override
2965 target->rosegment_gap().
2966
0c6e6c39
RM
29672013-05-10 Roland McGrath <mcgrathr@google.com>
2968
2969 * options.h (General_options): Remove leading space from help
2970 messages for -nostdlib and --rosegment.
2971
cde7cb01
MR
29722013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2973
2974 PR ld/15365
2975 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2976
f31ae5b8
AM
29772013-05-03 Alan Modra <amodra@gmail.com>
2978
2979 * merge.cc (Output_merge_string::do_add_input_section): Correct
2980 scan for number of strings. Rename vars to avoid shadowing.
2981 Include missing terminator in input_size_.
2982
d3a7cd45
L
29832013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2984
2985 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2986 Restore empty string handling.
2987
6ad3daba
CC
29882013-05-01 Cary Coutant <ccoutant@google.com>
2989
2990 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2991 uninitialized warning.
2992
e31908b6
CC
29932013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2994
2995 * output.cc (Output_section::add_merge_input_section): Allow
2996 to merge sections if the alignment is more than character size.
2997 * merge.h (Output_merge_string::Output_merge_string): Remove
2998 assert.
2999 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
3000 only not-null strings. Check the alignment of strings.
3001 * stringpool.h
3002 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
3003 alignment as the argument.
3004 (Stringpool_template<Stringpool_char>::addralign_): New class member.
3005 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
3006 Align non-zero length strings according to the addralign_.
3007 (Stringpool_template<Stringpool_char>::set_string_offsets):
3008 Updating offsets according to the given alignment.
3009 * testsuite/Makefile.am (text_section_grouping): Test if string
3010 literals are getting merged.
3011 * testsuite/Makefile.in: Regenerate.
3012 * testsuite/merge_string_literals_1.c: New file.
3013 * testsuite/merge_string_literals_2.c: Ditto.
3014 * testsuite/merge_string_literals.sh: Ditto.
3015
0e804863
ILT
30162013-04-26 Ian Lance Taylor <iant@google.com>
3017
3018 * target-reloc.h (relocate_section): If the reloc offset is out of
3019 range, pass VIEW as NULL to relocate.relocate.
3020 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3021 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3022 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3023 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3024 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3025 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3026
e7c5ea40
CC
30272013-04-26 Geoff Pike <gpike@chromium.org>
3028
3029 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3030 * layout.cc (Hash_task): New class.
3031 (Layout::queue_build_id_tasks): New function.
3032 (Layout::write_build_id): Handle single-thread portion of build ID
3033 computation. (In some cases, all of it is single-threaded.) Replace
3034 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3035 functionality in fewer lines of code.
3036 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3037 * options.h (General_options): make "--build-id" default to tree
3038 rather than sha1. Add two new options related to --build-id=tree:
3039 --build-id-chunk-size-for-treehash and
3040 --build-id-min-file-size-for-treehash.
3041 * Makefile.am: add testing of --build-id=tree and related new options
3042 (these tests will be invoked by "make check").
3043 * Makefile.in: Regenerate.
3044
49926cd0
AM
30452013-04-25 Alan Modra <amodra@gmail.com>
3046
3047 * configure.tgt: Add powerpcle and powerpc64le.
3048
a4034750
AM
30492013-04-22 Alan Modra <amodra@gmail.com>
3050
3051 PR gold/15355
3052 * layout.cc (Layout::segment_precedes): Allow more than one
3053 segment with the same type and flags.
3054
e79c84aa
CC
30552013-04-15 Cary Coutant <ccoutant@google.com>
3056
3057 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3058 allocate space in file for BSS sections.
3059
2199fbe7
CC
30602013-04-15 Cary Coutant <ccoutant@google.com>
3061
3062 * script-sections.cc (Orphan_output_section): Reset address
3063 to zero after each orphaned section for relocatable links.
3064
502e8a84
CC
30652013-04-15 Cary Coutant <ccoutant@google.com>
3066
a4034750
AM
3067 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3068 section starting address for relocatable link.
3069 * testsuite/Makefile.am (script_test_11): New test.
3070 * testsuite/Makefile.in: Regenerate.
3071 * testsuite/script_test_11.c: New source file.
3072 * testsuite/script_test_11.t: New linker script.
502e8a84 3073
0cfdc767
AM
30742013-04-13 Alan Modra <amodra@gmail.com>
3075
3076 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3077 owner when sections are not adjacent and exceed group size.
3078 (Target_powerpc::group_sections): Handle corner case.
3079 (Target_powerpc::Branch_info::make_stub): Handle case where
3080 stub table doesn't exist due to branches in non-exec sections.
3081 (Target_powerpc::Relocate::relocate): Likewise.
3082
6830ee24
AM
30832013-04-11 Alan Modra <amodra@gmail.com>
3084
3085 PR gold/15354
3086 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3087 .branch_lt to match bfd ld. Adjust comments throughout file.
3088
54a3d865
ILT
30892013-04-04 Ian Lance Taylor <iant@google.com>
3090
3091 GCC PR c++/56840
3092 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3093 sections before checking whether they are included in the link.
3094
9993ba11
ST
30952013-03-29 Sriraman Tallam <tmsriram@google.com>
3096
3097 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3098 object before calling the plugin claim_file handler. Pass the elf
3099 object of the archive to the plugin. Delete the elf object if the
3100 plugin claims the file.
3101
ebacd51e
AM
31022013-03-21 Alan Modra <amodra@gmail.com>
3103
3104 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3105 segment when omagic.
3106
117be58f
AM
31072013-03-21 Alan Modra <amodra@gmail.com>
3108
3109 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3110 comparison warning.
3111 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3112 uninitialized" warning.
3113
32e2b61d
AM
31142013-03-20 Alan Modra <amodra@gmail.com>
3115
3116 * symtab.h (Symbol::clear_version): New function.
3117 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3118 is_needed by weak references. Clear version for symbols defined
3119 in as-needed objects that are not needed.
3120
b3ccdeb5
AM
31212013-03-15 Alan Modra <amodra@gmail.com>
3122
3123 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3124 static and public. Add report_err param. Return false for data refs.
3125 (Target_powerpc::rela_dyn_section): New overloaded function.
3126 (Target_powerpc::plt_, iplt_): Elucidate.
3127 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3128 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3129 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3130 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3131 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3132 push_branch and make_plt_entry for ifunc syms when
3133 reloc_needs_plt_for_ifunc.
3134 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3135 for ifunc unless reloc_needs_plt_for_ifunc.
3136
ad3d8a2f
AM
31372013-03-15 Alan Modra <amodra@gmail.com>
3138
3139 * gc.h (gc_process_relocs): Don't look through function descriptors.
3140 * icf.cc (get_section_contents): Do so here instead.
3141
4d9aa155
AM
31422013-03-13 Alan Modra <amodra@gmail.com>
3143
3144 * powerpc.cc (is_branch_reloc): Forward declare.
3145 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3146 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3147 false for 64-bit, true for 32-bit non-branch relocs.
3148 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3149 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3150 nm output.
3151 (icf_safe_test): Generate linker map file as well as nm output.
3152 (icf_safe_so_test): Likewise.
3153 * testsuite/Makefile.in: Regenerate.
3154 * testsuite/icf_test.sh: Parse linker map file to determine
3155 section folding.
3156 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3157 * testsuite/icf_safe_so_test.sh: Likewise.
3158 (X86_32_or_ARM_specific_safe_fold): Merge into..
3159 (arch_specific_safe_fold): ..this.
3160 (X86_64_specific_safe_fold): Delete unused function.
3161
57420c20
AM
31622013-03-12 Alan Modra <amodra@gmail.com>
3163
3164 * gc.h (gc_process_relocs): Look through function descriptors
3165 to determine shndx, symvalue and addend used by ICF. Tidy
3166 variable duplication.
3167
dc3714f3
AM
31682013-03-11 Alan Modra <amodra@gmail.com>
3169
3170 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3171 * layout.cc (Layout_task_runner::run): ..to here.
3172 * symtab.h (struct Symbol_location): Extract from..
3173 (class Symbol_table): ..here.
3174 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3175 * target.h (class Target): Add function_location and
3176 do_function_location functions.
3177 (class Sized_target): Add do_function_location.
3178 * object.h (class Sized_relobj_file): Move find_shdr..
3179 (class Object): ..to here.
3180 * object.cc: Likewise. Update to suit. Instantiate.
3181 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3182 * powerpc.cc (class Powerpc_dynobj): New.
3183 (Target_powerpc::do_function_location): New function.
3184 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3185 (Powerpc_dynobj::do_read_symbols): New function.
3186 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3187
956b03bb
ILT
31882013-03-08 Ian Lance Taylor <iant@google.com>
3189
3190 * options.cc (General_options::string_to_object_format): Accept
3191 "default".
3192
4bead2d5
AM
31932013-03-08 Alan Modra <amodra@gmail.com>
3194
3195 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3196 pointer to Post_fde.
3197 (struct Post_fde): Move definition to here..
3198 * ehframe.cc (struct Post_fde): ..from here.
3199 (Cie::write): Don't alloc Post_fde.
3200 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3201
02e60bf7
AM
32022013-03-07 Alan Modra <amodra@gmail.com>
3203
3204 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3205 relocation referencing .LC0.
3206 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3207
8343f03a
AM
32082013-03-07 Alan Modra <amodra@gmail.com>
3209
3210 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3211 always_inline. Add assembly for powerpc to avoid GOT.
3212
3366d57c
AM
32132013-03-07 Alan Modra <amodra@gmail.com>
3214
3215 * testsuite/script_test_10.sh: Don't test .bss section
3216 header number.
3217
6c77229c
AM
32182013-03-06 Alan Modra <amodra@gmail.com>
3219
3220 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3221 (Target_powerpc::symval_for_branch): Add symtab param. Update
3222 all callers. Handle folded sections.
3223 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3224 to Powerpc_relobj.
3225 (Global_symbol_visitor_opd::operator()): Likewise.
3226
a39e4af6
AM
32272013-03-04 Alan Modra <amodra@gmail.com>
3228
3229 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3230 * testsuite/Makefile.in: Regenerate.
3231
d5834edb
CC
32322013-03-01 Cary Coutant <ccoutant@google.com>
3233
3234 Add dwp support for v2 DWARF package file format.
3235 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3236 tu_length parameter. Adjust all callers.
3237 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3238 * dwp.cc: Include dwarf.h.
3239 (Section_bounds): New struct type.
3240 (Unit_set): New struct type.
3241 (Dwo_file::Dwo_file): Initialize new data member.
3242 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3243 Combine and rename to...
3244 (Dwo_file::read_unit_index): ...this.
3245 (Dwo_file::sized_read_compunit_index)
3246 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3247 (Dwo_file::sized_read_unit_index): ...this.
3248 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3249 parameters; add section_id parameter.
3250 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3251 (Dwo_file::add_unit_set): ...this.
3252 (Dwo_file::shndx_map_): Remove.
3253 (Dwo_file::sect_offsets_): New data member.
3254 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3255 (Dwp_output_file::add_section): Rename to...
3256 (Dwp_output_file::add_contribution): ...this.
3257 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3258 (Dwp_output_file::add_tu_set): Likewise.
3259 (Dwp_output_file::Contribution): New type.
3260 (Dwp_output_file::Section::contributions): New data member.
3261 (Dwp_output_file::Cu_or_tu_set): Remove.
3262 (Dwp_output_file::Section::Section): New ctor.
3263 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3264 (Dwp_output_file::Dwp_index::Section_table): New type.
3265 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3266 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3267 parameter.
3268 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3269 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3270 (Dwp_output_file::Dwp_index::section_table): New member function.
3271 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3272 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3273 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3274 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3275 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3276 (Dwp_output_file::Dwp_index::section_table_): New data member.
3277 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3278 (Dwp_output_file::add_output_section): New member function.
3279 (Dwp_output_file::write_new_section): New member function.
3280 (Dwp_output_file::write_contributions): New member function.
3281 (Dwp_output_file::section_id_map_): New data member.
3282 (class Dwo_id_info_reader): Remove.
3283 (class Unit_reader): New class.
3284 (get_dwarf_section_name): New function.
3285 (Dwo_file::read_executable): Adjust initializations of class data.
3286 (Dwo_file::read): Add support for v2 package file format.
3287 (Dwo_file::read_unit_index): Likewise.
3288 (Dwo_file::sized_read_unit_index): Likewise.
3289 (Dwo_file::copy_section): Likewise.
3290 (Dwo_file::add_unit_set): Likewise.
3291 (Dwp_output_file::add_output_section): Likewise.
3292 (Dwp_output_file::add_contribution): Likewise.
3293 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3294 for empty slot.
3295 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3296 file format.
3297 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3298 slot.
3299 (Dwp_output_file::initialize): Remove unused function.
3300 (Dwp_output_file::finalize): Add support for v2 package file format.
3301 (Dwp_output_file::write_index): Likewise.
3302 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3303 function prototype.
3304
a68a081d
CC
33052013-03-01 Cary Coutant <ccoutant@google.com>
3306
3307 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3308 function into class definition in header file.
3309 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3310 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3311 New function.
3312 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3313
9d5781f8
AM
33142013-02-28 Alan Modra <amodra@gmail.com>
3315
3316 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3317 * target.cc (Target::do_plt_fde_location): New function.
3318 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3319 accessor function, and constructor param.
3320 (struct Post_fde, Post_fdes): Declare.
3321 (Cie::write): Add post_fdes param.
3322 * ehframe.cc (Fde::write): Use plt_fde_location.
3323 (struct Post_fde): Define.
3324 (Cie::write): Stash FDEs added post merge mapping.
3325 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3326 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3327 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3328 other FDEs.
3329 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3330 (Target_powerpc::has_glink): New function.
3331 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3332 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3333 glink_eh_frame_fde_32, default_fde): New data.
3334 (Stub_table::eh_frame_added_): New var.
3335 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3336 Make const.
3337 (Stub_table::add_eh_frame): New function.
3338 (Output_data_glink::add_eh_frame): New function.
3339 (Target_powerpc::make_glink_section): Call add_eh_frame.
3340
214383dd
ILT
33412013-02-15 Ian Lance Taylor <iant@google.com>
3342
3343 * options.h (DEFINE_uint64_alias): Define.
3344 (class General_options): Add -Ttext-segment as an alias for
3345 -Ttext.
3346
91c2b899
AM
33472013-02-15 Alan Modra <amodra@gmail.com>
3348
3349 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3350 (Stub_table::do_write): ..here, two places.
3351 (Stub_table::plt_call_size): Use it here too.
3352
20e2a8aa
ILT
33532013-02-11 Ian Lance Taylor <iant@google.com>
3354
3355 * descriptors.cc (Descriptors::close_all): New function.
3356 * descriptors.h (class Descriptors): Declare close_all.
3357 (close_all_descriptors): New inline function.
3358 * plugin.cc: Include "descriptors.h".
3359 (Plugin_manager::cleanup): Call close_all_descriptors.
3360
8952bc69
AM
33612013-02-06 Alan Modra <amodra@gmail.com>
3362
3363 * README: Update coding style link.
3364
29bd8b6b
CC
33652013-01-28 Cary Coutant <ccoutant@google.com>
3366
a4034750
AM
3367 * dwp.cc (File_list): New typedef.
3368 (Dwo_name_info_reader): New class.
3369 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3370 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3371 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3372 (Dwo_file::read_executable): New function.
3373 (Dwo_file::read): Move common setup code to ...
3374 (Dwo_file::make_object): ... here.
3375 (dwp_options): Add --exec/-e.
3376 (usage): Likewise.
3377 (main): Likewise.
29bd8b6b 3378
c6ac678d
ST
33792013-01-24 Sriraman Tallam <tmsriram@google.com>
3380
3381 * layout.cc (Layout::layout): Check for option text_reorder.
3382 (Layout::make_output_section): Ditto.
3383 * options.h (text_reorder): New option.
3384 * output.cc (Input_section_sort_compare): Remove special ordering
3385 of section names.
3386 (Output_section::
3387 Input_section_sort_section_name_special_ordering_compare::
3388 operator()): New function.
3389 (Output_section::sort_attached_input_sections): Use new sort function
3390 for .text.
3391 * output.h (Input_section_sort_section_name_special_ordering_compare):
3392 New struct.
3393 * testsuite/Makefile.am (text_section_grouping): Test option
3394 --no-text-reorder
3395 * testsuite/Makefile.in: Regenerate.
3396 * testsuite/text_section_grouping.sh: Check order of functions without
3397 default text reordering.
3398
50701cc1
MF
33992013-01-18 Mike Frysinger <vapier@gentoo.org>
3400
3401 * options.h (General_options): Change default to true for new_dtags.
3402
b1b00fcc
MF
34032013-01-18 Mike Frysinger <vapier@gentoo.org>
3404
3405 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3406 when enable_new_dtags is false. Only add DT_RUNPATH when
3407 enable_new_dtags is true.
3408
ec5b8187
AM
34092013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3410
3411 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3412 used in declaration and definition consistent.
3413 (Target_powerpc::symval_for_branch): Ditto.
3414
a880d4c4
ST
34152013-01-16 Sriraman Tallam <tmsriram@google.com>
3416
3417 * testsuite/plugin_final_layout.cc: Fix comment.
3418
7c381248
ST
34192013-01-16 Sriraman Tallam <tmsriram@google.com>
3420
3421 * layout.cc (Layout::layout): Do not do default sorting for
3422 text sections when section ordering is specified.
3423 (make_output_section): Ditto.
3424 * testsuite/plugin_final_layout.cc: Name the function sections
3425 to catch reordering issues.
3426
e2458743
AM
34272013-01-15 Alan Modra <amodra@gmail.com>
3428
3429 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3430 plt-thread-safe.
3431
431ed302
AM
34322013-01-15 Alan Modra <amodra@gmail.com>
3433
3434 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3435 * testsuite/Makefile.in: Regenerate.
3436
0ec6429b
AM
34372013-01-14 Alan Modra <amodra@gmail.com>
3438
3439 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3440 * testsuite/Makefile.in: Regenerate.
3441
0bf402d5
ILT
34422013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3443
36af3926 3444 PR bfd/14430
0bf402d5
ILT
3445 Fix mingw gold build with plugins enabled
3446 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3447 * configure.ac: Export DLOPEN_LIBS and add headers check.
3448 * plugin.cc: Handle non-dlfcn case.
3449 * Makefile.in: Regenerate.
3450 * config.in: Regenerate.
3451 * configure: Regenerate.
3452 * testsuite/Makefile.in: Regenerate.
3453
9e9143bc
ST
34542013-01-09 Sriraman Tallam <tmsriram@google.com>
3455
3456 * output.h (sort_attached_input_sections): Change to be public.
3457 * script-sections.cc
3458 (Output_section_definition::set_section_addresses): Sort
3459 attached input sections according to section order before linker
3460 script assigns section addresses.
3461 (Orphan_output_section::set_section_addresses): Sort
3462 attached input sections according to section order before linker
3463 script assigns section addresses.
3464 * Makefile.am (final_layout.sh): Use a simple linker script to
3465 check if section ordering still works.
3466 * Makefile.in: Regenerate.
3467
679af368
ILT
34682013-01-09 Ben Cheng <bccheng@google.com>
3469
3470 * arm.cc (Target_arm::attributes_accept_div): New function.
3471 (Target_arm::attributes_forbid_div): New function.
3472 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3473 attribute using the same new functions as what bfd/elf32_arm.c
3474 does.
3475
3136a00e
CC
34762013-01-07 Cary Coutant <ccoutant@google.com>
3477
3478 PR gold/14993
3479 * output.cc (Output_section::add_input_section): For incremental
3480 updates, don't track input sections that are allocated from patch
3481 space.
3482
f2a6224b
L
34832013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3484 Ian Lance Taylor <iant@google.com>
3485
3486 PR gold/14897
3487 * configure.ac (--enable-ld): Removed.
3488 (install_as_default): Set to yes only for --enable-gold=default
3489 or --disable-ld.
3490 * configure: Regenerated.
3491
4f46f626
L
34922013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3493
3494 * options.h (General_options): Add -fuse-ld= for GCC linker
3495 option compatibility.
3496
26e4ef59
CC
34972013-01-04 Cary Coutant <ccoutant@google.com>
3498
3499 * configure.ac: Fix typo restoring CXXFLAGS.
3500 * configure: Regenerate.
3501
3d587466
CC
35022013-01-04 Cary Coutant <ccoutant@google.com>
3503
4f46f626
L
3504 * testsuite/Makefile.am (CXXLINK_S): New macro.
3505 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3506 * testsuite/Makefile.in: Regenerate.
3d587466 3507
44db6695
L
35082013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3509
3510 * version.cc (print_version): Update copyright year to 2013.
3511
edcac0c1
ILT
35122012-12-20 Ian Lance Taylor <iant@google.com>
3513
3514 * layout.cc (Layout::special_ordering_of_input_section): New
3515 function.
3516 (Layout::layout): If input section requires special ordering, must
3517 sort input sections.
3518 (Layout::make_output_section): May sort .text input sections.
3519 (Layout::is_section_name_prefix_grouped): Remove.
3520 * layout.h (class Layout): Declare
3521 special_ordering_of_input_section. Don't declare
3522 is_section_name_prefix_grouped.
3523 * output.cc (Output_section::add_input_section): Revert last
3524 change.
3525 (Output_section::Input_section_sort::match_file_name): Don't crash
3526 if called on output section data.
3527 (Output_section::Input_section_sort_compare): Sort based on
3528 special ordering.
3529 (Output_section::Input_section_sort_section_order_index_compare):
3530 Revert last patch.
3531 (Output_section::sort_attached_input_sections): Likewise.
3532
28f2a4ac
ST
35332012-12-18 Sriraman Tallam <tmsriram@google.com>
3534
edcac0c1 3535 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3536 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3537 * output.cc (Output_section::add_input_section): Check if section
3538 name contains special prefix. Keep input sections to sort such
3539 sections.
3540 (Output_section::Input_section_sort_section_order_index_compare
3541 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3542 (Output_section::sort_attached_input_sections): Add condition to
3543 Input_section_entry constructor call.
28f2a4ac
ST
3544 * testsuite/Makefile.am (text_section_grouping): New test.
3545 * testsuite/Makefile.in: Regenerate.
3546 * testsuite/text_section_grouping.cc: New file.
3547 * testsuite/text_section_grouping.sh: New file.
3548
5bf135a7
NC
35492012-12-17 Nick Clifton <nickc@redhat.com>
3550
3551 * Makefile.am: Add copyright notice.
3552 * NEWS: Likewise.
3553 * README: Likewise.
3554 * configure.ac: Likewise.
3555 * ftruncate.c: Likewise.
3556 * Makefile.in: Regenerate.
3557
59965708
CC
35582012-12-14 Cary Coutant <ccoutant@google.com>
3559
a4034750
AM
3560 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3561 --no-as-needed flag.
3562 (exception_separate_shared_12_test): Likewise.
3563 (incremental_copy_test): Likewise.
3564 * testsuite/Makefile.in: Regenerate.
59965708 3565
2a77e2ab
CC
35662012-12-14 Cary Coutant <ccoutant@google.com>
3567
3568 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3569 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3570
e3deeb9c
AM
35712012-12-12 Alan Modra <amodra@gmail.com>
3572
3573 * powerpc.cc (class Track_tls): New.
3574 (class Relocate, class Scan): Inherit Track_tls.
3575 (Target_powerpc::Scan::local, global): Track tls optimization
3576 and avoid creating plt entry for __tls_get_addr if all uses
3577 are optimized away.
3578 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3579
d8f5a274
AM
35802012-12-12 Alan Modra <amodra@gmail.com>
3581
3582 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3583 Replace no_toc_optimize with toc_optimize.
3584 * output.h (Output_section::input_sections): Provide non-const variant.
3585 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3586 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3587 accessors.
3588 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3589 (class Sort_toc_sections): New.
3590 (Target_powerpc::do_finalize_sections): Sort toc sections.
3591 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3592
4c8a1de1
RM
35932012-12-10 Roland McGrath <mcgrathr@google.com>
3594
3595 * testsuite/binary_unittest.cc (read_all): New function.
3596 (Sized_binary_test): Use it instead of ::read.
3597 * fileread.cc (do_read): Don't assume pread always reads the whole
3598 amount in a single call.
3599
edc27beb
AM
36002012-12-10 Alan Modra <amodra@gmail.com>
3601
3602 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3603 Set EM_PPC64 or EM_PPC here.
3604 (Target_selector_powerpc::do_recognize): Delete.
3605
906b9150
AM
36062012-12-10 Alan Modra <amodra@gmail.com>
3607
3608 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3609 stub_table_.
3610 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3611
418c15ae
RM
36122012-12-07 Roland McGrath <mcgrathr@google.com>
3613
3614 * testsuite/binary_unittest.cc (Sized_binary_test):
3615 Use open_descriptor rather than ::open.
3616
decdd3bc
AM
36172012-12-07 Alan Modra <amodra@gmail.com>
3618
3619 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3620 typedef and invalid_address constant.
3621 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3622 instantiate constants.
3623
db399005
ILT
36242012-12-06 Roland McGrath <mcgrathr@google.com>
3625
3626 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3627 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3628 * aclocal.m4: Regenerate.
3629 * configure: Regenerate.
3630 * Makefile.in: Regenerate.
3631 * testsuite/Makefile.in: Regenerate.
3632
aba6bc71
AM
36332012-12-07 Alan Modra <amodra@gmail.com>
3634
3635 * options.h (General_options): Add no_toc_optimize.
3636 * powerpc.cc (ok_lo_toc_insn): New function.
3637 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3638
9e69ed50
AM
36392012-12-06 Alan Modra <amodra@gmail.com>
3640
3641 * options.h (General_options): Add plt_align, plt_static_chain,
3642 plt_thread_safe. Update stub_group_size help text.
3643 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3644 for new plt_thread_safe_ var.
3645 (use_plt_offset): Correct comments.
3646 (Target_powerpc::do_relax): Look for thread creation symbols to
3647 determine default plt_thread_safe value. Clear plt call stubs
3648 as well as branch stubs each iteration.
3649 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3650 insn constants.
3651 (l, hi, ha, write_insn): Move earlier.
3652 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3653 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3654 plt stubs too.
3655 (Stub_table::update_size): Adjust.
3656 (Stub_table::prev_size, set_prev_size): Delete.
3657 (Stub_table::stub_align): Let --plt-align affect result.
3658 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3659 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3660 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3661 (Stub_table::do_write): Support more stub variants.
3662
f43ba157
AM
36632012-12-04 Alan Modra <amodra@gmail.com>
3664
3665 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3666 (Target_powerpc::do_define_standard_symbols): New function.
3667
34171bc5
AM
36682012-12-03 Alan Modra <amodra@gmail.com>
3669
3670 * output.h: Formatting, whitespace.
3671
dc9589e9 36722012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3673
3674 * layout.h (Layout::get_executable_sections): Declare.
3675 * layout.cc (Layout::get_executable_sections): New function.
3676 * arm.cc (Target_arm::group_sections): Use it.
3677 (Arm_output_section::group_sections): Delete now redundant test.
3678 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3679 param to handle relative relocs.
3680 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3681 (Output_data_reloc::add_absolute): Adjust.
3682 (Output_data_reloc::add_relative): New function.
3683 (Output_data::reset_data_size): New function.
3684 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3685 (Output_section::set_addralign): New function.
3686 (Output_section::checkpoint_set_addralign): New function.
3687 (Output_section::clear_section_offsets_need_adjustment): New function.
3688 (Output_section::input_sections): Make public.
3689 * powerpc.cc (class Output_data_brlt_powerpc): New.
3690 (class Stub_table, class Stub_control): New.
3691 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3692 stub_table_, set_stub_table, stub_table): New vectors and accessor
3693 functions.
3694 (Target_powerpc::do_may_relax, do_relax, push_branch,
3695 new_stub_table, stub_tables, brlt_section, group_sections,
3696 add_branch_lookup_table, find_branch_lookup_table,
3697 write_branch_lookup_table, make_brlt_section): New functions.
3698 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3699 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3700 branch_info_): New vars.
3701 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3702 make call stubs here.
3703 (Output_data_glink): Remove all call stub handling from this class.
3704 (Target_powerpc::Scan::local, global): Save interesting branch
3705 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3706 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3707 functions on final link.
3708 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3709 Handle long branch destinations too.
3710 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3711 do_plt_address_for_local): Adjust lookup of plt call stubs.
3712
627b30b7
AM
37132012-11-30 Alan Modra <amodra@gmail.com>
3714
3715 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3716 relocs against protected symbols when building 32-bit shared libs.
3717
40b469d7
AM
37182012-11-30 Alan Modra <amodra@gmail.com>
3719
3720 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3721 param. Call got_section() to make .got. Update all callers
3722 and their callers and so on.
3723
bb66a627
AM
37242012-11-30 Alan Modra <amodra@gmail.com>
3725
3726 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3727 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3728 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3729 value if it already exists.
3730
d2cf1c6c
L
37312012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3732
3733 PR gold/14858
3734 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3735
edccdf7c
RM
37362012-11-14 Roland McGrath <mcgrathr@google.com>
3737
3738 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3739 than bfc instruction for data sandboxing.
3740
6febeb74
AM
37412012-11-08 Alan Modra <amodra@gmail.com>
3742
3743 * po/POTFILES.in: Regenerate.
3744
0a6f1bf2
AM
37452012-11-05 Alan Modra <amodra@gmail.com>
3746
3747 * configure.ac: Apply 2012-09-10 change to config.in here.
3748 * configure: Regenerate.
3749
26a4e9cb
AM
37502012-11-05 Alan Modra <amodra@gmail.com>
3751
3752 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3753 (struct Opd_ent): Use "Address" rather than "Offset".
3754 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3755 (Target_powerpc::got_section): Make public.
3756 (Target_powerpc::scan_relocs): Move code setting symbols..
3757 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3758 Create _SDA_BASE_ only when referenced.
3759
cc928013
RM
37602012-11-02 Roland McGrath <mcgrathr@google.com>
3761
3762 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3763 from last change.
3764
50ed5eb1
RM
37652012-11-01 Roland McGrath <mcgrathr@google.com>
3766
62fe925a
RM
3767 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3768 for offset_in_output_section parameter.
3769 (Sized_target::relocate_special_relocatable): Likewise.
3770 * arm.cc (Target_arm::relocate_relocs): Likewise.
3771 (Target_arm::relocate_special_relocatable): Likewise.
3772 * i386.cc (Target_i386::relocate_relocs): Likewise.
3773 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3774 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3775 * target-reloc.h (relocate_relocs): Likewise.
3776 * testsuite/testfile.cc (Target_test): Likewise.
3777 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3778 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3779
3780 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3781 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3782
3783 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3784 parameter, which is unused in the [!F_SETFD] case.
3785
50ed5eb1
RM
3786 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3787 SYMNDX to off_t before comparing it to this->data_size().
3788 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3789 * incremental.cc (Output_section_incremental_inputs::do_write):
3790 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3791
2cadc0bf
RM
3792 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3793
3bfcb652
NC
37942012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3795
3796 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3797 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3798 in EABI_VER5.
3799
c1a8d56e
CC
38002012-10-29 Cary Coutant <ccoutant@google.com>
3801
3802 * dwp.cc (usage): Add file and exit status parameters;
3803 add --help and --version options.
3804 (print_version): New function.
3805 (main): Add --help and --version options.
3806
b2490a7b
L
38072012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3808
3809 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3810 final_layout_sequence.txt.
3811 * testsuite/Makefile.in: Regenerated.
3812
aa543512
L
38132012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3814
3815 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3816 COMPILE generated by automake.
3817 (LINK1): Likewise.
3818 (CXXCOMPILE1): Likewise.
3819 (CXXLINK1): Likewise.
3820 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3821 (LINK): Likewise.
3822 (CXXCOMPILE): Likewise.
3823 (CXXLINK): Likewise.
3824 * testsuite/Makefile.in: Regenerated.
3825
d361fafb
L
38262012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3827
3828 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3829 on bad fwrite return.
3830
598c7410
L
38312012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3832
3833 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3834 on val.
3835
35c813e2
CC
38362012-10-23 Cary Coutant <ccoutant@google.com>
3837
3838 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3839 * testsuite/Makefile.in: Regenerate.
3840 * testsuite/dwp_test.h: New source file.
3841 * testsuite/dwp_test_1.cc: New source file.
3842 * testsuite/dwp_test_1.s: New source file.
3843 * testsuite/dwp_test_1.sh: New source file.
3844 * testsuite/dwp_test_1b.cc: New source file.
3845 * testsuite/dwp_test_1b.s: New source file.
3846 * testsuite/dwp_test_2.cc: New source file.
3847 * testsuite/dwp_test_2.s: New source file.
3848 * testsuite/dwp_test_2.sh: New source file.
3849 * testsuite/dwp_test_main.cc: New source file.
3850 * testsuite/dwp_test_main.s: New source file.
3851
77429909
CC
38522012-10-23 Cary Coutant <ccoutant@google.com>
3853
3854 * dwp.h: New header file.
3855 * dwp.cc: New source file.
3856 * gold.h: Move shared declarations to system.h.
3857 * system.h: New header file.
3858 * Makefile.am: Add dwp.
3859 * Makefile.in: Regenerate.
3860
ed5d6712
CC
38612012-10-23 Cary Coutant <ccoutant@google.com>
3862
3863 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3864 Dwarf_info_reader::read_from_pointer.
3865 (Dwarf_pubnames_table::read_header): Likewise.
3866 (Dwarf_pubnames_table::next_name): Likewise.
3867 (Dwarf_die::read_attributes): Likewise.
3868 (Dwarf_die::skip_attributes): Likewise.
3869 (Dwarf_info_reader::read_from_pointer): New function template.
3870 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3871 (Dwarf_pubnames_table): Likewise.
3872 (Dwarf_info_reader::read_from_pointer): New function template.
3873 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3874 Dwarf_pubnames_table ctor.
3875
8787852d
CC
38762012-10-23 Cary Coutant <ccoutant@google.com>
3877
3878 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3879 abbrev_shndx.
3880 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3881 abbrev_shndx_.
3882 (Dwarf_info_reader::set_abbrev_shndx): New method.
3883 (Dwarf_info_reader::abbrev_shndx_): New data member.
3884
9fc236f3
CC
38852012-10-23 Cary Coutant <ccoutant@google.com>
3886
3887 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3888 from object, not parameters.
3889 (Dwarf_info_reader::parse): Likewise.
3890 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3891 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3892 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3893 methods.
3894
effe8365
CC
38952012-10-23 Cary Coutant <ccoutant@google.com>
3896
3897 * fileread.cc (Input_file::Input_file): New constructor.
3898 * fileread.h (class Input_file): Add new constructor.
3899
1698990d
AM
39002012-10-18 Alan Modra <amodra@gmail.com>
3901
3902 PR gold/14727
3903 * object.cc (Relobj::is_section_name_included): Also match
3904 .sdata personality section.
3905
168a4726
AM
39062012-10-18 Alan Modra <amodra@gmail.com>
3907
3908 * target-reloc.h (class Default_comdat_behavior): New, package up..
3909 (get_comdat_behaviour): ..this.
3910 (relocate_section): Add Relocate_comdat_behavior template arg,
3911 adjust code to suit.
3912 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3913 (Target_arm::scan_reloc_section): Likewise.
3914 * i386.cc (Target_i386::relocate_section): Likewise.
3915 * sparc.cc (Target_sparc::relocate_section): Likewise.
3916 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3917 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3918 * powerpc.cc (class Relocate_comdat_behavior): New.
3919 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3920 gold::relocate_section with new template arg.
3921
acc276d8
AM
39222012-10-18 Alan Modra <amodra@gmail.com>
3923
3924 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3925 dynamic relocs for GOT_TPREL got entries, without symbol if
3926 resolving locally.
3927 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3928 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3929 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3930
e10f9870
AM
39312012-10-17 Alan Modra <amodra@gmail.com>
3932
3933 PR gold/14726
3934 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3935
ae034989
ST
39362012-10-16 Sriraman Tallam <tmsriram@google.com>
3937
3938 * layout.cc (Layout::include_section): Keep sections marked
3939 SHF_EXCLUDE when doing relocatable links.
3940
f3a0ed29
AM
39412012-10-16 Alan Modra <amodra@gmail.com>
3942
3943 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3944 (Target_powerpc::do_finalize_sections): Call it.
3945 (Output_data_save_res): New class and supporting functions.
3946 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3947 normal symbols defined in object files.
3948
c6de8ed4
AM
39492012-10-12 Alan Modra <amodra@gmail.com>
3950
3951 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3952 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3953 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3954 section if scan_opd_relocs not yet called.
3955 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3956
03e25981
AM
39572012-10-12 Alan Modra <amodra@gmail.com>
3958
3959 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3960 add_local_ifunc_entry): Revert last change.
3961 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3962
c9824451
AM
39632012-10-05 Alan Modra <amodra@gmail.com>
3964
3965 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3966 do_plt_address_for_global): New functions.
3967 (Output_data_got_powerpc::do_write): Don't segfault when linking
3968 statically.
3969 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3970 add_local_ifunc_entry): Return true on adding entry..
3971 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3972 glink->add_entry call. Remove unused symtab param. Adjust calls.
3973 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3974 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3975 set up symbols here.
3976 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3977 syms here. Do so even when no .iplt. Don't segfault when linking
3978 statically.
3979 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3980 new variants without reloc param.
3981 (Glink_sym_ent::Glink_sym_ent): Likewise.
3982 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3983 reloc when refs will resolve to plt call stub.
3984 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3985 R_PPC_PLTREL24 to resolve locally.
3986 (Target_powerpc::Scan::global): Correct ifunc handling.
3987 (Target_powerpc::Relocate::relocate): Correct local sym glink
3988 lookup. Don't destroy "value" when we have a plt call stub,
3989 and when checking plt call validity.
3990 (Target_powerpc::do_dynsym_value): Simplify.
3991
19fec8c1
AM
39922012-10-05 Alan Modra <amodra@gmail.com>
3993
3994 * i386.cc (Output_data_plt_i386::address_for_global,
3995 address_for_local): Add plt offset to returned value. Adjust uses.
3996 * sparc.cc (Output_data_plt_sparc::address_for_global,
3997 address_for_local): Likewise.
3998 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3999 address_for_local): Likewise.
4000 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
4001 address_for_local): Likewise.
4002 * target.h (Target::plt_address_for_global, plt_address_for_local):
4003 Update comment.
4004 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
4005 (Output_data_got::Got_entry::write): Nor here.
4006 * output.h: Comment fix.
4007
e867b647
WL
40082012-10-02 Jiong Wang <jiwang@tilera.com>
4009
4010 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4011 global_offset_table_ value for larget got.
4012 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4013
e5d5f5ed
AM
40142012-09-29 Alan Modra <amodra@gmail.com>
4015
4016 * powerpc.cc (Target_powerpc::iplt_): New output section.
4017 (Target_powerpc::iplt_section, make_iplt_section,
4018 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4019 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4020 Target_powerpc::plt_entry_count): Count iplt entries too.
4021 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4022 reloc section in constructor. New params.
4023 (Target_powerpc::make_plt_section): Create reloc section here instead.
4024 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4025 functions.
4026 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4027 (Output_data_glink::add_entry, find_entry): New functions to
4028 deal with local syms.
4029 (Glink_sym_ent): Add support for local syms.
4030 (Output_data_glink::do_write): Handle ifunc plt entries.
4031 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4032 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4033 (Target_powerpc::Relocate::relocate): Likewise.
4034 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4035
ec4dbad3
AM
40362012-09-25 Alan Modra <amodra@gmail.com>
4037
4038 * object.h (Sized_relobj_file::adjust_local_symbol,
4039 do_adjust_local_symbol): New functions.
4040 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4041 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4042 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4043 and irregular opd entry spacing.
4044 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4045 (Global_symbol_visitor_opd): New functor.
4046 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4047 on deleted opd entries.
4048
5c0b3823
WL
40492012-09-15 Jiong Wang <jiwang@tilera.com>
4050
4051 * tilegx.cc: New file.
4052 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4053 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4054 * configure.tgt: Add entries for tilegx*.
4055 * configure.ac: Likewise.
4056 * Makefile.in: Rebuild.
4057 * configure: Likewise.
4058 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4059 tilegx.
4060
bfdfa4cd
AM
40612012-09-13 Alan Modra <amodra@gmail.com>
4062
4063 * target-reloc.h (scan_relocs): Call scan.local for relocs
4064 against symbols in discarded sections. Pass is_discarded
4065 param.
4066 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4067 Add is_discarded param.
4068 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4069 is_discarded to flag opd entry as discarded. Don't emit dyn
4070 relocs on such entries.
4071 (Target_powerpc::Scan::global): Similarly detect and handle
4072 such opd entries.
4073 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4074 opd_ent_. Update all uses.
4075 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4076 (Target_powerpc::relocate_section): Zero out discarded opd
4077 entry relocs.
4078
d77a0555
ILT
40792012-09-12 Ian Lance Taylor <iant@google.com>
4080
4081 PR gold/14570
4082 * output.cc: Rename Output_data_got template parameter from size
4083 to got_size for all functions. Compile all variants of
4084 Output_data_got.
4085 (Output_data_got::Got_entry::write): Correct use of size for
4086 symbol value. Use local_is_tls rather than casting to
4087 Sized_relobj_file.
4088 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4089 (class Sized_relobj_file): Add do_local_is_tls.
4090 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4091
815a1205
AM
40922012-09-11 Alan Modra <amodra@gmail.com>
4093
4094 PR gold/14566
4095 * layout.cc (Layout::set_segment_offsets): When using
4096 common-page-size alignment, ensure we are on a new max-page-size
4097 page.
4098 * output.cc (Output_segment::set_section_addresses): Use
4099 abi_pagesize, not common_pagesize for relro boundary.
4100 (Output_segment::set_offset): Likewise.
4101
bd73a62d
AM
41022012-09-11 Alan Modra <amodra@gmail.com>
4103
4104 * output.h (Output_data_got::add_global_tls, add_local_tls,
4105 add_local_tls_pair): New functions.
4106 (Output_data_got::add_local_pair_with_rel): Remove second
4107 reloc param. Expand comment.
4108 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4109 use_plt_or_tls_offset_, similarly for constructor param.
4110 (Output_data_got::Got_entry::write): Add got_index param.
4111 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4112 add_local_tls_pair): New functions.
4113 (Output_data_got::Got_entry::write): Handle tls symbols
4114 with use_plt_or_tls_offset_ set specially.
4115 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4116 (Output_data_got::do_write): Replace iterator with index, pass
4117 index to entry write function.
4118 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4119 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4120 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4121 call.
4122 * i386.cc (Target_i386::Scan::local): Likewise.
4123 * sparc.cc (Target_sparc::Scan::local): Likewise.
4124 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4125 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4126 do_tls_offset_for_global): New functions.
4127 (Target_powerpc::Scan::local): Correct TLS relocations and got
4128 entry values.
4129 (Target_powerpc::Scan::global): Don't emit unnecessary
4130 dynamic relocations on TLS GOT entries.
4131
00716ab1
AM
41322012-09-10 Matthias Klose <doko@ubuntu.com>
4133
4134 * config.in: Disable sanity check for kfreebsd.
4135
c891b3f9
SA
41362012-09-10 Sterling Augustine <saugustine@google.com>
4137
4138 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4139 (Gdb_index::pubtypes_read): New parameter.
4140 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4141 to calls.
4142 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4143 pubtypes_object_.
4144
e81fea4d
AM
41452012-09-09 Alan Modra <amodra@gmail.com>
4146
4147 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4148 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4149 * gc.h (gc_process_relocs): Call target gc_add_reference.
4150 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4151 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4152 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4153 unnecessary cast.
4154 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4155 to cater for when we don't need code offset. Update use.
4156 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4157 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4158 set_opd_valid): New functions.
4159 (Target_powerpc::do_gc_add_reference): New function.
4160 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4161 stashed refs.
4162 (Target_powerpc::do_gc_mark_symbol): New function.
4163
d2d60eef
CC
41642012-09-06 Cary Coutant <ccoutant@google.com>
4165
4166 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4167 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4168 (Dwarf_die::skip_attributes): Likewise.
4169 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4170 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4171 (main): Call it.
4172 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4173
32ed4573
L
41742012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4175
4176 * testsuite/script_test_3.t: Add .got.plt output section
4177 statement.
4178 * testsuite/script_test_4.t: Likewise.
4179
f4baf0d4
AM
41802012-09-05 Alan Modra <amodra@gmail.com>
4181
4182 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4183 update all uses and lose "enum" when using type.
4184
864a1b56
AM
41852012-09-05 Alan Modra <amodra@gmail.com>
4186
4187 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4188 * configure: Regenerate.
4189 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4190 (plugin_final_layout.stdout): Likewise.
4191 (memory_test): Set page sizes to 0x1000.
4192 * testsuite/Makefile.in: Regenerate.
4193 * testsuite/discard_locals_test.sh: Add FIXME comment.
4194 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4195 * testsuite/pr14265.t: Add .got output section statement.
4196 * testsuite/script_test_2.t: Likewise.
4197 * testsuite/script_test_3.t: Likewise.
4198 * testsuite/script_test_4.t: Likewise.
4199 * testsuite/script_test_5.t: Likewise.
4200 * testsuite/script_test_6.t: Likewise.
4201 * testsuite/script_test_7.t: Likewise.
4202 * testsuite/script_test_9.t: Likewise.
4203
3ea0a085
AM
42042012-09-05 Alan Modra <amodra@gmail.com>
4205
4206 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4207 (Powerpc_relocate_functions::Status): New typedef.
4208 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4209 (Target_powerpc::Scan::local): Handle REL64.
4210 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4211 for REL32 and REL64.
4212 (Target_powerpc::symval_for_branch): New function, extracted from..
4213 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4214 checks. Report overflow errors.
4215
7404fe1b
AM
42162012-09-05 Alan Modra <amodra@gmail.com>
4217
4218 * object.h (Sized_relobj_file::emit_relocs): Delete.
4219 (Sized_relobj_file::emit_relocs_reltype): Delete.
4220 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4221 relocate_relocs for --emit-relocs.
4222 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4223 * output.h: Update comment.
4224 (Output_segment::first_section): New function.
4225 (Output_segment::first_section_load_address): Use first_section.
4226 * output.cc (Output_segment::first_section): New function extracted..
4227 (Output_segment::first_section_load_address): ..from here. Delete.
4228 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4229 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4230 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4231 adjust call to target.h function.
4232 * i386.cc (Target_i386): Likewise.
4233 * sparc.cc (Target_sparc): Likewise.
4234 * x86_64.cc (Target_x86_64): Likewise.
4235 * powerpc.cc (Target_powerpc): Likewise.
4236 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4237 first tls section has section symbol for optimised local dynamic
4238 output relocs.
4239 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4240 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4241 optimised tls code.
4242 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4243 Rename to relocate_relocs. Update error message.
4244
957564c9
AS
42452012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4246
4247 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4248 --just-symbols.
4249
dd93cd0a
AM
42502012-08-31 Alan Modra <amodra@gmail.com>
4251
4252 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4253 (Powerpc_relobj::toc_base_offset): New stub function.
4254 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4255 got_mod_index_offset to tlsld_got_offset. Update all refs.
4256 (Target_powerpc::Relocate::enum skip_tls): New.
4257 (Target_powerpc::call_tls_get_addr_): New var.
4258 (Target_powerpc::is_branch_reloc): Move to file scope.
4259 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4260 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4261 New functions.
4262 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4263 (powerpc_info): Correct common_pagesize for ppc64.
4264 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4265 (Powerpc_relocate_functions): Add overflow check enums and functions.
4266 Add non-shift version of rela, rela_ua. Delete all rel public
4267 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4268 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4269 addr16_ha3, addr14 functions.
4270 (Output_data_got_powerpc::add_constant_pair): New function.
4271 (Output_data_got_powerpc::got_base_offset): Likewise.
4272 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4273 (instruction constants): Sort, add some more.
4274 (Output_data_glink::do_write): Add and use Address typedef. Use
4275 object->toc_base_offset() stub for 64-bit.
4276 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4277 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4278 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4279 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4280 Always treat .opd relocs as against locally defined symbol.
4281 Correct condition for RELATIVE relocs.
4282 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4283 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4284 for 32-bit syms with a plt entry. Correct ppc64 toc base
4285 calculations. Handle TLS relocs, and more. Add overflow
4286 checking and adjust for Powerpc_relocate_functions changes.
4287 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4288 Reinstate --emit-relocs code with FIXME.
4289
a1373b60
AM
42902012-08-30 Alan Modra <amodra@gmail.com>
4291
4292 * layout.cc (Layout::set_segment_offsets): Set p_align to
4293 abi_pagesize, not common_pagesize.
4294 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4295 to determine whether file header can go in segment.
4296
703d02da
AM
42972012-08-30 Alan Modra <amodra@gmail.com>
4298
4299 * output.h (Output_reloc::Output_reloc <output section>): Add
4300 is_relative param. Adjust calls.
4301 (Output_reloc::add_output_section_relative): New functions.
4302 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4303 is_relative.
4304 (Output_reloc::symbol_value): Handle SECTION_CODE.
4305
16164a6b
ST
43062012-08-24 Sriraman Tallam <tmsriram@google.com>
4307
4308 * gold.cc (queue_middle_tasks): Call layout again when unique
4309 segments for sections is desired.
4310 * layout.cc (Layout::Layout): Initialize new members.
4311 (Layout::get_output_section_flags): New function.
4312 (Layout::choose_output_section): Call get_output_section_flags.
4313 (Layout::layout): Make output section for mapping to a unique segment.
4314 (Layout::insert_section_segment_map): New function.
4315 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4316 output sections marked so.
16164a6b
ST
4317 (Layout::segment_precedes): Check for unique segments when sorting.
4318 * layout.h (Layout::Unique_segment_info): New struct.
4319 (Layout::Section_segment_map): New typedef.
4320 (Layout::insert_section_segment_map): New function.
4321 (Layout::get_output_section_flags): New function.
4322 (Layout::is_unique_segment_for_sections_specified): New function.
4323 (Layout::set_unique_segment_for_sections_specified): New function.
4324 (Layout::unique_segment_for_sections_specified_): New member.
4325 (Layout::section_segment_map_): New member.
4326 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4327 Rename is_gc_pass_one to is_pass_one.
4328 Rename is_gc_pass_two to is_pass_two.
4329 Rename is_gc_or_icf to is_two_pass.
4330 Check for which pass based on whether symbols data is present.
4331 Make it two pass when unique segments for sections is desired.
4332 * output.cc (Output_section::Output_section): Initialize new
4333 members.
4334 * output.h (Output_section::is_unique_segment): New function.
4335 (Output_section::set_is_unique_segment): New function.
4336 (Output_section::is_unique_segment_): New member.
4337 (Output_section::extra_segment_flags): New function.
4338 (Output_section::set_extra_segment_flags): New function.
4339 (Output_section::extra_segment_flags_): New member.
4340 (Output_section::segment_alignment): New function.
4341 (Output_section::set_segment_alignment): New function.
4342 (Output_section::segment_alignment_): New member.
4343 (Output_segment::Output_segment): Initialize is_unique_segment_.
4344 (Output_segment::is_unique_segment): New function.
4345 (Output_segment::set_is_unique_segment): New function.
4346 (Output_segment::is_unique_segment_): New member.
4347 * plugin.cc (allow_unique_segment_for_sections): New function.
4348 (unique_segment_for_sections): New function.
4349 (Plugin::load): Add new functions to transfer vector.
4350 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4351 * Makefile.in: Regenerate.
4352 * testsuite/plugin_final_layout.sh: Check if unique segment
4353 functionality works.
4354 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4355 are available.
4356 (allow_unique_segment_for_sections): New global.
4357 (unique_segment_for_sections): New global.
4358 (claim_file_hook): Call allow_unique_segment_for_sections.
4359 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4360
1e2bee4f
CC
43612012-08-22 Cary Coutant <ccoutant@google.com>
4362
4363 * layout.cc (Layout::include_section): Don't assert on GROUP
4364 sections with --emit-relocs.
4365
1d5dfe78
CC
43662012-08-21 Cary Coutant <ccoutant@google.com>
4367
4368 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4369 if --export-dynamic-symbol names an undef symbol.
4370
c9269dff
AM
43712012-08-18 Alan Modra <amodra@gmail.com>
4372
4373 * powerpc.cc: Formatting and white space.
4374 (Powerpc_relobj): Rename got2_section_ to special_.
4375 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4376 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4377 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4378 (Target_powerpc): Add Address typedef and invalid_address. Use
4379 throughout.
4380 (Target_powerpc::is_branch_reloc): New function.
4381 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4382 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4383 for dst_mask, value and addend.
4384 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4385 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4386 (Output_data_glink::do_write): Correct toc base. Don't try to use
4387 uint16_t for 24-bit offset. Use get_output_section_offset and
4388 check return.
4389 (Target_powerpc::Scan::local): Handle more relocs.
4390 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4391 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4392 Plug in toc restoring insn after plt calls. Translate branches
4393 to function descriptor symbols to corresponding entry point.
4394 (Target_powerpc::relocate_for_relocatable): Check return from
4395 get_output_section_offset.
4396 * symtab.h: Comment typo.
4397
b1759dce
ILT
43982012-08-14 Ian Lance Taylor <iant@google.com>
4399
4400 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4401 unsupported_relocal_local to call unsupported_reloc_global.
4402
b9b2ae8b
NC
44032012-08-14 Nick Clifton <nickc@redhat.com>
4404
4405 PR ld/14265
4406 * script-sections.cc (Sections_element::output_section_name): Add
4407 keep return parameter.
4408 (Output_section_element::match_name): Add keep return parameter.
4409 Return the value of the keep_ member.
4410 * script-sections.h (class Output_section): Update
4411 output_section_name prototype.
4412 * layout.cc (Layout::keep_input_section): New public member
4413 function.
4414 (Layout::choose_output_section): Pass keep parameter to
4415 output_section_name.
4416 * layout.h (class Layout): Add keep_input_section.
4417 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4418 sections.
4419 * testsuite/Makefile.am: Add a test.
4420 * testsuite/Makefile.in: Regenerate.
4421 * testsuite/pr14265.c: Source file for the test.
4422 * testsuite/pr14265.t: Linker script for the test.
4423 * testsuite/pr14265.sh: Shell script for the test.
4424
921b5322
AM
44252012-08-14 Alan Modra <amodra@gmail.com>
4426
4427 * target.h (Target::output_section_name): New function.
4428 (Target::do_output_section_name): New function.
4429 * layout.cc (Layout::choose_output_section): Call the above.
4430 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4431
6ce78956
AM
44322012-08-14 Alan Modra <amodra@gmail.com>
4433
4434 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4435 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4436 for replace_constant call.
4437 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4438 (Output_data_glink::do_print_to_mapfile): New function.
4439 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4440 (Target_powerpc::Relocate::relocate): Likewise.
4441
d1a8cabd
AM
44422012-08-14 Alan Modra <amodra@gmail.com>
4443
4444 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4445 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4446 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4447 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4448 all references to shndx_. Handle special case for R_PPC_PLTREL24
4449 here.
4450 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4451 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4452 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4453 here.
4454 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4455 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4456
d83ce4e3
AM
44572012-08-12 Alan Modra <amodra@gmail.com>
4458
4459 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4460 (glink insn constants): Use uint32_t.
4461 (Output_data_glink::add_entry): Use insert, not [] operator.
4462
cf43a2fe
AM
44632012-08-11 Alan Modra <amodra@gmail.com>
4464
4465 * object.h (Sized_relobj_file::find_shdr): New function.
4466 (Sized_relobj_file::find_special_sections): New function.
4467 * object.cc (Sized_relobj_file::find_shdr): New function.
4468 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4469 (Sized_relobj_file::find_special_sections): New function, split out..
4470 (Sized_relobj_file::do_read_symbols): ..from here.
4471 * output.h (Output_data_got::replace_constant): New function.
4472 (Output_data_got::num_entries): New function.
4473 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4474 (Output_data_got::got_offset): Protected rather than private.
4475 (Output_data_got::replace_got_entry): New function.
4476 * output.cc (Output_data_got::replace_got_entry): New function.
4477 * powerpc.cc (class Powerpc_relobj): New.
4478 (class Powerpc_relocate_functions): Delete all psymval variants or
4479 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4480 Implement _ha functions using corresponding _hi function.
4481 (Powerpc_relobj::find_special_sections): New function.
4482 (Target_powerpc::do_make_elf_object): New function.
4483 (class Output_data_got_powerpc): New.
4484 (class Output_data_glink): New.
4485 (class Powerpc_scan_relocatable_reloc): New.
4486 Many more changes througout file.
4487
3c892704
NC
44882012-08-09 Nick Clifton <nickc@redhat.com>
4489
4490 * po/vi.po: Updated Vietnamese translation.
4491
82435b3b
ILT
44922012-08-07 Ian Lance Taylor <iant@google.com>
4493
4494 * layout.cc (Layout::add_target_dynamic_tags): If
4495 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4496 plt_rel.
4497
a6dc81d2
NC
44982012-07-30 Nick Clifton <nickc@redhat.com>
4499
4500 * po/gold.pot: Updated template.
4501 * po/es.po: Updated Spanish translation.
4502
f1415016
CC
45032012-07-18 Cary Coutant <ccoutant@google.com>
4504
4505 PR gold/14344
4506 * configure.ac: Add check for -gpubnames support.
4507 * configure: Regenerate.
4508 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4509 support; force -gno-pubnames.
4510 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4511 support.
4512 (gdb_index_test_4): New test.
4513 * testsuite/Makefile.in: Regenerate.
4514 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4515 * testsuite/gdb_index_test_2.sh: Likewise.
4516 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4517 * testsuite/gdb_index_test_4.sh: New script.
4518 * testsuite/gdb_index_test_comm.sh: New script with common code;
4519 don't look for space after colon.
4520
b7fd7c37
ST
45212012-07-16 Sriraman Tallam <tmsriram@google.com>
4522
4523 * gold.cc (queue_middle_tasks): Update function order only after
4524 deferred objects due to plugins are processed.
4525
1f3212db
ILT
45262012-07-11 Ian Lance Taylor <iant@google.com>
4527
4528 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4529 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4530 (Target_arm::scan_reloc_for_stub): Likewise.
4531 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4532 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4533 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4534 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4535 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4536
81c82a68
ILT
45372012-07-10 Dodji Seketeli <dodji@redhat.com>
4538 Ian Lance Taylor <iant@google.com>
4539
4540 PR gold/14309
4541 * configure.ac: Test whether std::tr1::hash<off_t> works.
4542 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4543 needed.
4544 * output.h (class Output_fill): Add virtual destructor.
4545 * configure, config.in: Rebuild.
4546
eabc84f4
RM
45472012-06-22 Roland McGrath <mcgrathr@google.com>
4548
4549 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4550
370e30b6
RÁE
45512012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4552
4553 * plugin.cc (Plugin::load): Handle position independent executables.
4554
fb1b895d
CC
45552012-06-06 Cary Coutant <ccoutant@google.com>
4556
4557 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4558 add .debug_macro.
4559 (lines_only_debug_sections): Likewise.
4560 (gdb_fast_lookup_sections): New static array.
4561 (is_gdb_debug_section): Rename formal parameter.
4562 (is_lines_only_debug_section): Likewise.
4563 (is_gdb_fast_lookup_section): New function.
4564 (Layout::include_section): Check for ".zdebug_" prefix; pass
4565 section name suffix to is_gdb_debug_section, et al.; check for
4566 fast-lookup sections when building .gdb_index.
4567 * options.h (--strip-debug-gdb): Update GDB version number.
4568
7c0640fa
CC
45692012-06-06 Cary Coutant <ccoutant@google.com>
4570
4571 * configure.ac: Add check for fallocate.
4572 * configure: Regenerate.
4573 * config.in: Regenerate.
4574
4575 * options.h (class General_options): Add --mmap-output-file and
4576 --posix-fallocate options.
4577 * output.cc: (posix_fallocate): Remove; replace with...
4578 (gold_fallocate): New function.
4579 (Output_file::map_no_anonymous): Call gold_fallocate.
4580 (Output_file::map): Check --mmap-output-file option.
4581
2a49eb69
DK
45822012-06-05 Jing Yu <jingyu@google.com>
4583
4584 * gold.h (textdomain): Add do {} to empty while(0).
4585 (bindtextdomain): Likewise.
4586
fad072ac
CC
45872012-06-04 Cary Coutant <ccoutant@google.com>
4588
4589 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4590 has_dynsym_index.
4591
8cc69fb6
ST
45922012-05-25 Sriraman Tallam <tmsriram@google.com>
4593
4594 * symtab.cc (Symbol_table::define_special_symbol):
4595 Initialize *poldsym to prevent uninitialized variable errors.
4596
1be75daa
CC
45972012-05-23 Cary Coutant <ccoutant@google.com>
4598
4599 * layout.cc (Layout::section_name_mapping): Add rules to handle
4600 exact match on .data.rel.ro.local or .data.rel.ro.
4601 (Layout::output_section_name): Check for exact matches.
4602
9b689de0
CC
46032012-05-23 Cary Coutant <ccoutant@google.com>
4604
4605 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4606 more carefully.
4607
b24fdbf5
CC
46082012-05-22 Cary Coutant <ccoutant@google.com>
4609
4610 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4611 object before exporting symbol.
4612
e550e1a2
L
46132012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4614
4615 * testsuite/tls_test.cc: Include "config.h" first.
4616 * testsuite/tls_test_c.c: Likewise.
4617
df7b86aa
NC
46182012-05-17 Daniel Richard G. <skunk@iskunk.org>
4619 Nick Clifton <nickc@redhat.com>
4620
4621 PR 14072
4622 * configure.in: Add check that sysdep.h has been included before
4623 any system header files.
4624 * configure: Regenerate.
4625 * config.in: Regenerate.
4626
1007b503
CC
46272012-05-14 Cary Coutant <ccoutant@google.com>
4628
4629 * layout.cc (Layout::make_output_section): Mark .tdata section
4630 as RELRO.
4631 * testsuite/relro_test.cc: Add a TLS variable.
4632
fd885f3a
L
46332012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4634
4635 PR gold/14091
4636 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4637 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4638 R_X86_64_64.
4639
80f5885c
CC
46402012-05-08 Cary Coutant <ccoutant@google.com>
4641
4642 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4643 (lines_only_debug_sections): Likewise.
4644
2e702c99
RM
46452012-05-02 Roland McGrath <mcgrathr@google.com>
4646
4647 * nacl.cc: New file.
4648 * nacl.h: New file.
4649 * Makefile.am (CCFILES, HFILES): Add them.
4650 * Makefile.in: Regenerate.
4651 * i386.cc (Output_data_plt_i386_nacl): New class.
4652 (Output_data_plt_i386_nacl_exec): New class.
4653 (Output_data_plt_i386_nacl_dyn): New class.
4654 (Target_i386_nacl): New class.
4655 (Target_selector_i386_nacl): New class.
4656 (target_selector_i386): Use it instead of Target_selector_i386.
4657 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4658 (Target_x86_64_nacl): New class.
4659 (Target_selector_x86_64_nacl): New class.
4660 (target_selector_x86_64, target_selector_x32): Use it instead of
4661 Target_selector_x86_64.
4662 * arm.cc (Output_data_plt_arm_nacl): New class.
4663 (Target_arm_nacl): New class.
4664 (Target_selector_arm_nacl): New class.
4665 (target_selector_arm, target_selector_armbe): Use it instead of
4666 Target_selector_arm.
4667
4668 * target-select.cc (select_target): Take new Input_file* and off_t
4669 arguments, pass them on to recognize method of selector.
4670 * object.cc (make_elf_sized_object): Update caller.
4671 * parameters.cc (parameters_force_valid_target): Likewise.
4672 * incremental.cc (make_sized_incremental_binary): Likewise.
4673 * target-select.h: Update decl.
4674 (Target_selector::recognize): Take new Input_file* argument,
4675 pass it on to do_recognize.
4676 (Target_selector::do_recognize): Take new Input_file* argument.
4677 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4678 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4679 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4680 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4681
4682 * target.h (Target::Target_info): New members isolate_execinstr
4683 and rosegment_gap.
4684 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4685 * arm.cc (Target_arm::arm_info): Update initializer.
4686 * i386.cc (Target_i386::i386_info): Likewise.
4687 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4688 * sparc.cc (Target_sparc::sparc_info): Likewise.
4689 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4690 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4691 * layout.cc (Layout::attach_allocated_section_to_segment):
4692 Take new const Target* argument. If target->isolate_execinstr(), act
4693 like --rosegment.
4694 (Layout::find_first_load_seg): Take new const Target* argument;
4695 if target->isolate_execinstr(), reject PF_X segments.
4696 (Layout::relaxation_loop_body): Update caller.
4697 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4698 reset file offset to zero when we hit LOAD_SEG, and then do a second
4699 loop over the segments before LOAD_SEG to reassign offsets after
4700 addresses have been determined. Handle target->rosegment_gap().
4701 (Layout::attach_section_to_segment): Take new const Target* argument;
4702 pass it to attach_allocated_section_to_segment.
4703 (Layout::make_output_section): Update caller.
4704 (Layout::attach_sections_to_segments): Take new const Target* argument;
4705 pass it to attach_section_to_segment.
4706 * gold.cc (queue_middle_tasks): Update caller.
4707 * layout.h (Layout): Update method decls with new arguments.
4708
4709 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4710 Target_info pointer to use.
4711 (Target_arm::do_make_data_plt): New virtual method.
4712 (Target_arm::make_data_plt): New method that calls it.
4713 (Target_arm::make_plt_entry): Use it.
4714 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4715 for the section alignment.
4716 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4717 method.
4718 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4719 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4720 method.
4721 (Output_data_plt_arm::get_plt_entry_size): Call it.
4722 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4723 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4724 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4725 method.
4726 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4727 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4728 method instead of sizeof(plt_entry).
4729 (Output_data_plt_arm::add_entry): Likewise.
4730 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4731 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4732 than static method.
4733 (Target_arm::plt_entry_size): Likewise.
4734 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4735 Move to ...
4736 (Output_data_plt_arm_standard): ... here, new class.
4737 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4738 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4739 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4740
4741 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4742 Take additional argument for the PLT entry size.
4743 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4744 Use get_plt_entry_size method rather than plt_entry_size variable.
4745 (Output_data_plt_x86_64::reserve_slot): Likewise.
4746 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4747 (Output_data_plt_x86_64::add_entry): Likewise.
4748 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4749 (Output_data_plt_x86_64::address_for_global): Likewise.
4750 (Output_data_plt_x86_64::address_for_local): Likewise.
4751 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4752 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4753 Make method non-static.
4754 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4755 method.
4756 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4757 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4758 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4759 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4760 virtual method.
4761 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4762 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4763 virtual method.
4764 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4765 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4766 virtual method.
4767 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4768 (Output_data_plt_x86_64::plt_entry_size)
4769 (Output_data_plt_x86_64::first_plt_entry)
4770 (Output_data_plt_x86_64::plt_entry)
4771 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4772 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4773 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4774 (Output_data_plt_x86_64_standard): ... here, new class.
4775 (Target_x86_64::Target_x86_64): Take optional argument for the
4776 Target_info pointer to use.
4777 (Target_x86_64::do_make_data_plt): New virtual method.
4778 (Target_x86_64::make_data_plt): New method to call it.
4779 (Target_x86_64::init_got_plt_for_update): Use that.
4780 Call this->plt_->add_eh_frame method here.
4781 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4782 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4783 rather than static method.
4784 (Target_x86_64::plt_entry_size): Likewise.
4785 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4786 rather than plt_entry_size variable. Move guts of PLT filling to...
4787 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4788 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4789 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4790
4791 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4792 additional argument for the section alignment.
4793 Don't do add_eh_frame_for_plt here.
4794 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4795 non-static. Use get_plt_entry_size method rather than plt_entry_size
4796 variable.
4797 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4798 method.
4799 (Output_data_plt_i386::get_plt_entry_size): Call it.
4800 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4801 (Output_data_plt_i386::add_eh_frame): New method to call it.
4802 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4803 method.
4804 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4805 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4806 method.
4807 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4808 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4809 method instead of plt_entry_size.
4810 (Output_data_plt_i386::plt_entry_size)
4811 (Output_data_plt_i386::plt_eh_frame_fde_size)
4812 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4813 (Output_data_plt_i386_standard): ... here, new class.
4814 (Output_data_plt_i386_exec): New class.
4815 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4816 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4817 (Output_data_plt_i386::exec_plt_entry): Move to ...
4818 (Output_data_plt_i386_exec::plt_entry): ... here.
4819 (Output_data_plt_i386_dyn): New class.
4820 (Output_data_plt_i386::first_plt_entry): Move to ...
4821 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4822 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4823 (Output_data_plt_i386_dyn::plt_entry): ... here.
4824 (Target_i386::Target_i386): Take optional argument for the Target_info
4825 pointer to use.
4826 (Target_i386::do_make_data_plt): New virtual method.
4827 (Target_i386::make_data_plt): New method to call it.
4828 (Target_i386::make_plt_section): Use that.
4829 Call this->plt_->add_eh_frame method here.
4830 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4831 rather than plt_entry_size variable.
4832 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4833 (Output_data_plt_i386::address_for_local): Likewise.
4834 (Output_data_plt_i386::do_write): Likewise.
4835 Move guts of PLT filling to...
4836 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4837 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4838 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4839 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4840
b9b9f2ee
CC
48412012-05-01 Cary Coutant <ccoutant@google.com>
4842
4843 * dwarf_reader.cc (Dwarf_die::read_attributes)
4844 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4845 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4846 * reduced_debug_output.cc
4847 (Output_reduced_debug_info_section::get_die_end): Remove
4848 DW_FORM_GNU_ref_index. Add default case.
4849
57923f48
MW
48502012-04-26 Mark Wielaard <mjw@redhat.com>
4851
4852 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4853 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4854 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4855 DW_AT_high_pc as offset from DW_AT_low_pc.
4856
4857 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4858 * testsuite/Makefile.in: Regenerate.
4859 * testsuite/gdb_index_test_3.c: New test source file.
4860 * testsuite/gdb_index_test_3.sh: New test source file.
4861
2c54b4f4
ILT
48622012-04-25 Ian Lance Taylor <iant@google.com>
4863
4864 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4865 pointer.
4866 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4867 as a class, not a struct.
4868 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4869 (Target_arm::apply_cortex_a8_workaround): Likewise.
4870 * gc.h: Declare Reloc_types as a struct, not a class.
4871 * object.h: Declare Symbols_data as a struct.
4872 * reloc.h: Declare Read_relocs_data as a struct.
4873 * target.h: Declare Relocate_info as a struct.
4874
a5a5f7a3
DM
48752012-04-24 David S. Miller <davem@davemloft.net>
4876
4877 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4878 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4879 and R_SPARC_WPLT30.
4880
f038d496
CC
48812012-04-24 Cary Coutant <ccoutant@google.com>
4882
4883 * incremental-dump.cc (find_input_containing_global): Replace
4884 magic number with symbolic constant.
4885 (dump_incremental_inputs): Update version number.
4886 * incremental.cc (Output_section_incremental_inputs): Update version
4887 number; import symbolic constants from Incremental_inputs_reader.
4888 (Incremental_inputs::create_data_sections): Align relocations
4889 section correctly for 64-bit targets.
4890 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4891 constants; add padding.
4892 (Output_section_incremental_inputs::write_header): Add assert for
4893 header_size.
4894 (Output_section_incremental_inputs::write_input_files): Add assert
4895 for input_entry_size.
4896 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4897 add assert for object_info_size, input_section_entry_size,
4898 global_sym_entry_size.
4899 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4900 for data structure sizes; use them.
4901 (Incremental_input_entry_reader): Import symbolic constants from
4902 Incremental_inputs_reader; use them.
4903
a4d85145
DM
49042012-04-23 David S. Miller <davem@davemloft.net>
4905
4906 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4907 and elf_flags_set_.
4908 (Target_sparc::Target_sparc): Initialize new fields.
4909 (Target_sparc::do_make_elf_object): New function.
4910 (Target_sparc::do_adjust_elf_header): New function.
4911
1d509098
CC
49122012-04-23 Cary Coutant <ccoutant@google.com>
4913
4914 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4915 CU range table of gdb index.
4916
7ebeff7f
DM
49172012-04-20 David S. Miller <davem@davemloft.net>
4918
4919 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4920 instead of false.
4921
13cf9988
DM
49222012-04-16 David S. Miller <davem@davemloft.net>
4923
2a1079e8
DM
4924 * sparc.cc (Target_sparc::got_address): New function.
4925 (Sparc_relocate_functions::gdop_hix22): New function.
4926 (Sparc_relocate_functions::gdop_lox10): New function.
4927 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4928 relocs.
4929 (Target_sparc::Scan::local): Likewise if the global symbol is not
4930 preemptible and is not IFUNC.
4931 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4932 transformations for local and non-preemptible non-IFUNC global
4933 symbols.
4934
0bc964fc
DM
4935 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4936 writing out 64-bit part of ranges.
4937
661d7a80
DM
4938 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4939 -fpic and -fpie respectively.
4940 * Makefile.in: Regenerate.
4941
8c2bf391
DM
4942 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4943 (Target_sparc::Target_sparc): Initialize new field.
4944 (Target_sparc::do_plt_section_for_global): New function.
4945 (Target_sparc::do_plt_section_for_local): New function.
4946 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4947 (Target_sparc::make_plt_section): New function, broken out of
4948 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4949 (Target_sparc::make_plt_entry): Call make_plt_section.
4950 (Target_sparc::make_local_ifunc_plt_entry): New function.
4951 (Target_sparc::rela_ifunc_section): New function.
4952 (Target_sparc::plt_section): Remove const.
4953 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4954 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4955 and ifunc_count_ fields.
4956 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4957 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4958 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4959 (Output_data_plt_sparc::rela_ifunc): New function.
4960 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4961 (Output_data_plt_sparc::has_ifunc_section): New function.
4962 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4963 (Output_data_plt_sparc::address_for_global): New function.
4964 (Output_data_plt_sparc::address_for_local): New function.
4965 (Output_data_plt_sparc::plt_index_to_offset): New function.
4966 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4967 and entry_count.
4968 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4969 entry_count.
4970 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4971 R_SPARC_JMP_IREL to switch.
4972 (Target_sparc::Scan::check_non_pic): Likewise.
4973 (Target_sparc::Scan::local): Handle IFUNC symbols.
4974 (Target_sparc::Scan::local): Likewise.
4975 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4976 and plt_address_for_local.
4977 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4978 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4979
13cf9988
DM
4980 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4981 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4982 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4983 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4984 global relocs too.
4985 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4986 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4987 calls.
4988 * sparc.cc (Target_sparc::Scan::global): Likewise.
4989 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4990
31821be0
CC
49912012-04-16 Cary Coutant <ccoutant@google.com>
4992
4993 * archive.cc (Library_base::should_include_member): Check for
4994 --export-dynamic-symbol.
4995 * options.h (class General_options): Add --export-dynamic-symbol.
4996 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4997 --export-dynamic-symbol.
4998 (Symbol_table::gc_mark_undef_symbols): Likewise.
4999 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
5000
2615994e
DM
50012012-04-12 David S. Miller <davem@davemloft.net>
5002
5003 * sparc.cc (Reloc::wdisp10): New relocation method.
5004 (Reloc::h34): Likewise.
5005 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
5006 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
5007 R_SPARC_WDISP10.
5008 (Target_sparc::Scan::local): Likewise.
5009 (Target_sparc::Scan::global): Likewise.
5010 (Target_sparc::Relocate::relocate): Likewise.
5011
6782735d
CC
50122012-04-09 Cary Coutant <ccoutant@google.com>
5013
5014 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5015 low_pc == 0.
5016
8c7a0b00
ILT
50172012-04-06 Ian Lance Taylor <iant@google.com>
5018
5019 * timer.cc: #include <unistd.h>.
5020
58797674
RM
50212012-04-06 Roland McGrath <mcgrathr@google.com>
5022
5023 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5024 * config.in: Regenerate.
5025 * configure: Regenerate.
5026
44350750
NC
50272012-04-05 Nick Clifton <nickc@redhat.com>
5028
5029 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5030 (AM_LC_MESSAGES): Add.
5031 * aclocal.m4: Regenerate.
5032 * config.in: Regenerate.
5033 * configure: Regenerate.
5034
c1027032
CC
50352012-03-21 Cary Coutant <ccoutant@google.com>
5036
5037 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5038 * Makefile.in: Regenerate.
5039 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5040 (Sized_elf_reloc_mapper::symbol_section): New function.
5041 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5042 (make_elf_reloc_mapper): New function.
5043 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5044 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5045 (Dwarf_abbrev_table::do_get_abbrev): New function.
5046 (Dwarf_ranges_table::read_ranges_table): New function.
5047 (Dwarf_ranges_table::read_range_list): New function.
5048 (Dwarf_pubnames_table::read_section): New function.
5049 (Dwarf_pubnames_table::read_header): New function.
5050 (Dwarf_pubnames_table::next_name): New function.
5051 (Dwarf_die::Dwarf_die): New function.
5052 (Dwarf_die::read_attributes): New function.
5053 (Dwarf_die::skip_attributes): New function.
5054 (Dwarf_die::set_name): New function.
5055 (Dwarf_die::set_linkage_name): New function.
5056 (Dwarf_die::attribute): New function.
5057 (Dwarf_die::string_attribute): New function.
5058 (Dwarf_die::int_attribute): New function.
5059 (Dwarf_die::uint_attribute): New function.
5060 (Dwarf_die::ref_attribute): New function.
5061 (Dwarf_die::child_offset): New function.
5062 (Dwarf_die::sibling_offset): New function.
5063 (Dwarf_info_reader::check_buffer): New function.
5064 (Dwarf_info_reader::parse): New function.
5065 (Dwarf_info_reader::do_parse): New function.
5066 (Dwarf_info_reader::do_read_string_table): New function.
5067 (Dwarf_info_reader::lookup_reloc): New function.
5068 (Dwarf_info_reader::get_string): New function.
5069 (Dwarf_info_reader::visit_compilation_unit): New function.
5070 (Dwarf_info_reader::visit_type_unit): New function.
5071 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5072 Sized_elf_reloc_mapper.
5073 (Sized_dwarf_line_info::symbol_section): Remove function.
5074 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5075 (Sized_dwarf_line_info::read_line_mappings): Remove object
5076 parameter, adjust callers.
5077 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5078 * dwarf_reader.h: Include <sys/types.h>.
5079 (class Track_relocs): Remove forward declaration.
5080 (class Elf_reloc_mapper): New class.
5081 (class Sized_elf_reloc_mapper): New class.
5082 (class Dwarf_abbrev_table): New class.
5083 (class Dwarf_range_list): New class.
5084 (class Dwarf_ranges_table): New class.
5085 (class Dwarf_pubnames_table): New class.
5086 (class Dwarf_die): New class.
5087 (class Dwarf_info_reader): New class.
5088 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5089 (Sized_dwarf_line_info::symbol_section): Remove member function.
5090 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5091 base class.
5092 * gdb-index.cc: New source file.
5093 * gdb-index.h: New source file.
5094 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5095 and .debug_types sections, call Layout::add_to_gdb_index.
5096 (Sized_relobj_incr::do_section_name): Implement.
5097 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5098 return type; Implement.
5099 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5100 return type.
5101 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5102 parameter list and return type.
5103 (Sized_incr_dynobj::do_section_contents): Likewise.
5104 * layout.cc: Include gdb-index.h.
5105 (Layout::Layout): Initialize gdb_index_data_.
5106 (Layout::init_fixed_output_section): Check for .gdb_index section.
5107 (Layout::add_to_gdb_index): New function. Instantiate.
5108 * layout.h: Add forward declaration for class Gdb_index.
5109 (Layout::add_to_gdb_index): New member function.
5110 (Layout::gdb_index_data_): New data member.
5111 * main.cc: Include gdb-index.h.
5112 (main): Print statistics for gdb index.
5113 * object.cc (Object::section_contents): Move code into
5114 do_section_contents.
5115 (need_decompressed_section): Check for sections needed when building
5116 gdb index.
5117 (build_compressed_section_map): Likewise.
5118 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5119 gdb index.
5120 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5121 sections; call Layout::add_to_gdb_index.
5122 (Sized_relobj_file::do_decompressed_section_contents): Call
5123 do_section_contents directly.
5124 * object.h (Object::do_section_contents): Adjust parameter list and
5125 return type.
5126 (Object::do_decompressed_section_contents): Call do_section_contents
5127 directly.
5128 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5129 return type.
5130 * options.h (class General_options): Add --gdb-index option.
5131 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5132 list and return type.
5133 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5134 * reloc.h (Track_relocs::checkpoint): New function.
5135 (Track_relocs::reset): New function.
5136
5137 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5138 New test cases.
5139 * testsuite/Makefile.in: Regenerate.
5140 * testsuite/gdb_index_test.cc: New test source file.
5141 * testsuite/gdb_index_test_1.sh: New test source file.
5142 * testsuite/gdb_index_test_2.sh: New test source file.
5143
647f1574
DK
51442012-03-19 Doug Kwan <dougkwan@google.com>
5145
5146 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5147 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5148 __exidx_start and __exidx_end. Make symbol table parameter
5149 anonymous as it is not used.
5150 * gold.cc (queue_middle_tasks): Call target hook to define any
5151 target-specific symbols.
5152 * target.h (Target::define_standard_symbols): New method.
5153 (Target::do_define_standard_symbols): Same.
5154 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5155 * testsuite/Makefile.in: Regenerate.
5156 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5157 and __exidx_end.
5158 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5159 relocations are generated for __exidx_start and __exidx_end.
5160
7c6109da
DK
51612012-03-16 Doug Kwan <dougkwan@google.com>
5162
5163 * testsuite/Makefile.am: Disable test initpri3b.
5164 * testsuite/Makefile.in: Regenerate.
5165
7b8957f8
DK
51662012-03-15 Doug Kwan <dougkwan@google.com>
5167
5168 * arm.cc (Target_arm::got_section): Make .got section read-only
5169 if -z now is given.
5170
14dc9ef7
ILT
51712012-03-15 Ian Lance Taylor <iant@google.com>
5172
5173 PR gold/13850
5174 * layout.cc (Layout::make_output_section): Correctly mark
5175 SHT_INIT_ARRAY, et. al., as relro.
5176
fa40b62a
DK
51772012-03-14 Doug Kwan <dougkwan@google.com>
5178
5179 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5180 dynamic relocations for protected symbols in shared objects.
5181
fd325007
ILT
51822012-03-13 Ian Lance Taylor <iant@google.com>
5183
5184 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5185 keep the larger alignment.
5186
e8dd54e1
CC
51872012-03-12 Cary Coutant <ccoutant@google.com>
5188
5189 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5190 handling of DW_LNE_define_file.
5191
feb5f3b0
CC
51922012-03-12 Cary Coutant <ccoutant@google.com>
5193
5194 * reduced_debug_output.cc
5195 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5196 codes to switch.
5197
a1fb4256
CC
51982012-02-29 Cary Coutant <ccoutant@google.com>
5199
5200 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5201
5dd8762a
CC
52022012-02-29 Cary Coutant <ccoutant@google.com>
5203
5204 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5205 Call Object::decompressed_section_contents.
5206 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5207 New dtor.
5208 (Sized_dwarf_line_info::buffer_start_): New data member.
5209 * merge.cc (Output_merge_data::do_add_input_section): Call
5210 Object::decompressed_section_contents.
5211 (Output_merge_string::do_add_input_section): Likewise.
5212 * object.cc (need_decompressed_section): New function.
5213 (build_compressed_section_map): Decompress sections needed later.
5214 (Sized_relobj_file::do_decompressed_section_contents): New function.
5215 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5216 * object.h (Object::decompressed_section_contents): New function.
5217 (Object::discard_decompressed_sections): New function.
5218 (Object::do_decompressed_section_contents): New function.
5219 (Object::do_discard_decompressed_sections): New function.
5220 (Compressed_section_info): New type.
5221 (Compressed_section_map): Include decompressed section contents.
5222 (Sized_relobj_file::do_decompressed_section_contents): New function.
5223 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5224
7b5de7ee
CC
52252012-02-16 Cary Coutant <ccoutant@google.com>
5226
5227 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5228 * testsuite/Makefile.in: Regenerate.
5229
f9fa4a63
CC
52302012-02-14 Cary Coutant <ccoutant@google.com>
5231
5232 * options.cc (General_options::finalize): Disallow -pie and -static.
5233
2c175ebc
DK
52342012-02-03 Doug Kwan <dougkwan@google.com>
5235
5236 * arm.cc (Arm_relocate_functions::abs8,
5237 Arm_relocate_functions::abs16): Use
5238 Bits::has_signed_unsigned_overflow32.
5239 (Arm_relocate_functions::thm_abs8): Correct range of
5240 overflow check.
5241 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5242 in assertions.
5243
90cff06f
DK
52442012-02-02 Doug Kwan <dougkwan@google.com>
5245
5246 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5247 position independent outputs, not just shared objects.
5248
63887f3d
L
52492012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5250
5251 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5252 * configure: Regenerated.
5253
bef2b434
ILT
52542012-01-27 Ian Lance Taylor <iant@google.com>
5255
5256 * reloc.h (Bits): New class with static functions, copied from
5257 namespace utils in arm.cc.
5258 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5259 instead.
5260
c335b55d
L
52612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5262
5263 * incremental.cc (write_info_blocks): Correct relocation offset.
5264
41194d9f
L
52652012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5266
5267 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5268 (Relocate::tls_gd_to_le): Likewise.
5269
1bae613c
L
52702012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5271
5272 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5273
24482ca0
L
52742012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5275
5276 * configure.ac: Check if -mcmodel=medium works.
5277 * configure: Regenerated.
5278
c2c7840a
CC
52792012-01-24 Cary Coutant <ccoutant@google.com>
5280
5281 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5282 definition and ...
5283 (read_unsigned_LEB_128_x): ... this new function.
5284 (read_signed_LEB_128): Replaced with inline definition and ...
5285 (read_signed_LEB_128_x): ... this new function.
5286 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5287 (read_unsigned_LEB_128): Add inline definition.
5288 (read_signed_LEB_128_x): New function.
5289 (read_signed_LEB_128): Add inline definition.
5290 * testsuite/Makefile.am (leb128_unittest): New unit test.
5291 * testsuite/Makefile.in: Regenerate.
5292 * testsuite/leb128_unittest.cc: New unit test.
5293
833de760 52942012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5295
5296 PR gold/13617
5297 * i386.cc (Target_i386::do_code_fill): When using a jmp
5298 instruction, pad with nop instructions.
5299 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5300
618d6666
L
53012012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5302
5303 * x86_64.cc (gc_process_relocs): Add typename on types used in
5304 template.
5305 (scan_relocs): Likewise.
5306 (relocate_section): Likewise.
5307 (apply_relocation): Likewise.
5308
3660ff06
L
53092012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5310
5311 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5312 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5313 under x32.
5314
fc51264f
L
53152012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5316
5317 * x86_64.cc: Initial support for x32.
5318
dd74ae06
CC
53192012-01-03 Cary Coutant <ccoutant@google.com>
5320
5321 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5322 Use abstract base class for GOT.
5323 * gold/output.h (class Output_data_got_base): New abstract base class.
5324 (class Output_data_got): Derive from new base class, adjust ctors.
5325 (Output_data_got::reserve_slot): Make virtual; rename to
5326 do_reserve_slot; Adjust callers.
5327 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5328 pointer to abstract base class.
5329 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5330
83896202
ILT
53312011-12-18 Ian Lance Taylor <iant@google.com>
5332
5333 * object.h (Relobj::local_symbol_value): New function.
5334 (Relobj::local_plt_offset): New function.
5335 (Relobj::local_has_got_offset): New function.
5336 (Relobj::local_got_offset): New function.
5337 (Relobj::set_local_got_offset): New function.
5338 (Relobj::do_local_symbol_value): New pure virtual function.
5339 (Relobj::do_local_plt_offset): Likewise.
5340 (Relobj::do_local_has_got_offset): Likewise.
5341 (Relobj::do_local_got_offset): Likewise.
5342 (Relobj::do_set_local_got_offset): Likewise.
5343 (Sized_relobj::do_local_has_got_offset): Rename from
5344 local_has_got_offset.
5345 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5346 (Sized_relobj::do_set_local_got_offset): Rename from
5347 set_local_got_offset.
5348 (Sized_relobj_file::do_local_plt_offset): Rename from
5349 local_plt_offset.
5350 (Sized_relobj_file::do_local_symbol_value): New function.
5351 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5352 local_plt_offset.
5353 * output.cc (Output_data_got::Got_entry::write): Change object to
5354 Relobj. Use local_symbol_value.
5355 (Output_data_got::add_global_with_rel): Change rel_dyn to
5356 Output_data_reloc_generic*. Use add_global_generic.
5357 (Output_data_got::add_global_with_rela): Remove. Change all
5358 callers to use add_global_with_rel.
5359 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5360 Output_data_reloc_generic*. Use add_global_generic.
5361 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5362 callers to use add_global_pair_with_rel.
5363 (Output_data_got::add_local): Change object to Relobj*.
5364 (Output_data_got::add_local_plt): Likewise.
5365 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5366 change rel_dyn to Output_data_reloc_generic*. Use
5367 add_local_generic.
5368 (Output_data_got::add_local_with_rela): Remove. Change all
5369 callers to use all_local_with_rel.
5370 (Output_data_got::add_local_pair_with_rel): Change object to
5371 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5372 add_output_section_generic.
5373 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5374 callers to use add_local_pair_with_rel.
5375 (Output_data_got::reserve_local): Change object to Relobj*.
5376 * output.h: (class Output_data_reloc_generic): Add pure virtual
5377 declarations for add_global_generic, add_local_generic,
5378 add_output_section_generic.
5379 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5380 functions for Output_data_reloc_generic. Update declarations for
5381 changes listed in output.cc.
5382 (class Output_data_got): Change template parameter to got_size.
5383 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5384 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5385 function.
5386 (Sized_relobj_incr::do_local_plt_offset): New function.
5387 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5388 add_global_generic.
5389
76677ad0
CC
53902011-12-17 Cary Coutant <ccoutant@google.com>
5391
5392 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5393 * resolve.cc (Symbol_table::resolve): Likewise.
5394 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5395 arrays.
5396 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5397
8b8dd8d5
ILT
53982011-12-16 Ian Lance Taylor <iant@google.com>
5399
5400 * output.h (Output_data_reloc_generic::add): Only call
5401 add_dynamic_reloc if this is a dynamic reloc section.
5402
d55525b9
L
54032011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5404
5405 PR gold/13505
5406 * target-reloc.h (apply_relocation): Replace <64, false> with
5407 <size, big_endian>.
5408
ff81c7c1
NC
54092011-11-25 Nick Clifton <nickc@redhat.com>
5410
5411 * po/it.po: New Italian translation.
5412
628f39be
SA
54132011-11-17 Sterling Augustine <saugustine@google.com>
5414
5415 * script.cc (script_include_directive): Implement.
5416 (read_script_file): New local variables name and search_path. Update
5417 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5418 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5419 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5420
98ef3ea4
SA
54212011-11-11 Sterling Augustine <saugustine@google.com>
5422
5423 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5424 (file_or_sections_cmd): Likewise.
5425
f4a8b6d7
DK
54262011-11-11 Doug Kwan <dougkwan@google.com>
5427
5428 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5429 if --just-symbols is given.
5430
29ab395d
DK
54312011-11-10 Doug Kwan <dougkwan@google.com>
5432
5433 PR gold/13362
5434 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5435 when processing data relocs.
5436 * reloc.h (Relocate_functions::rel_unaligned): New method.
5437 (Relocate_functions::pcrel_unaligned): Ditto.
5438 (Relocate_functions::rel32_unaligned): Ditto.
5439 (Relocate_functions::pcrel32_unaligned): Ditto.
5440
2c339f71
DK
54412011-11-09 Doug Kwan <dougkwan@google.com>
5442
5443 PR gold/13362
5444 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5445 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5446 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5447 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5448 (Relocate_functions::rel_unaligned): New.
5449 (Relocate_functions::rel32_unaligned): New.
5450 * target-reloc.h (relocate_for_relocatable): Add code to handle
5451 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5452 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5453 arm_unaligned_reloc_r): New targets.
5454 * testsuite/Makefile.in: Regenerate.
5455 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5456 linking.
5457
3f3cddf1
ILT
54582011-11-02 Ian Lance Taylor <iant@google.com>
5459
5460 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5461 NATIVE_LINKER.
5462 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5463 * options.cc (General_options::finalize): Use library search path
5464 from configure script if specified. If not native and no sysroot,
5465 only search TOOLLIBDIR.
5466 * options.h (Search_directory::Search_directory): Change name to
5467 const std::string&.
5468 (General_options::add_to_library_path_with_sysroot): Change arg to
5469 const std::string&.
5470 * configure, Makefile.in, config.in: Rebuild.
5471
a8e2273b
ILT
54722011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5473
5474 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5475 we are working around the ARM1176 Erratum.
5476 * options.h (General_options::fix_arm1176): Add option.
5477 * testsuite/Makefile.am: Add testcases, and keep current ones
5478 working.
5479 * testsuite/Makefile.in: Regenerate.
5480 * testsuite/arm_fix_1176.s: New file.
5481 * testsuite/arm_fix_1176.sh: Likewise.
5482
cd6eab1c
ILT
54832011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5484
5485 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5486 may_use_blx_.
5487 (Target_arm::may_use_blx): Remove method.
5488 (Target_arm::set_may_use_blx): Likewise.
5489 (Target_arm::may_use_v4t_interworking): New method.
5490 (Target_arm::may_use_v5t_interworking): Likewise.
5491 (Target_arm::may_use_blx_): Remove member variable.
5492 (Arm_relocate_functions::arm_branch_common): Check for v5T
5493 interworking.
5494 (Arm_relocate_functions::thumb_branch_common): Likewise.
5495 (Reloc_stub::stub_type_for_reloc): Likewise.
5496 (Target_arm::do_finalize_sections): Correct interworking checks.
5497 * testsuite/Makefile.am: Add new tests.
5498 * testsuite/Makefile.in: Regenerate.
5499 * testsuite/arm_farcall_arm_arm.s: New test.
5500 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5501 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5502 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5503 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5504 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5505 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5506 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5507
286adcf4
CC
55082011-10-31 Cary Coutant <ccoutant@google.com>
5509
5510 PR gold/13023
5511 * expression.cc (Expression::eval_with_dot): Add
5512 is_section_dot_assignment parameter.
5513 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5514 absolute and assigning to dot within a section.
5515 * script-sections.cc
5516 (Output_section_element_assignment::set_section_addresses): Pass
5517 dot_section to set_if_absolute.
5518 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5519 as is_section_dot_assignment flag to eval_with_dot.
5520 (Output_section_element_dot_assignment::set_section_addresses):
5521 Likewise.
5522 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5523 parameter. Also set value if relative to dot_section; set the
5524 symbol's output_section.
5525 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5526 parameter. Adjust all callers.
5527 (Expression::eval_maybe_dot): Likewise.
5528 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5529 Adjust all callers.
5530 * testsuite/script_test_2.t: Test assignment of an absolute value
5531 to dot within an output section element.
5532
9634ed06
CC
55332011-10-31 Cary Coutant <ccoutant@google.com>
5534
5535 * options.h (class General_options): Add --[no-]gnu-unique options.
5536 * symtab.cc (Symbol_table::sized_write_globals): Convert
5537 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5538
de4101c7
CC
55392011-10-31 Cary Coutant <ccoutant@google.com>
5540
5541 PR gold/13359
5542 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5543 unnecessary assertion.
5544 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5545
7257cc92
ST
55462011-10-31 Sriraman Tallam <tmsriram@google.com>
5547
5548 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5549 gc_mark_symbol.
5550 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5551 gc_mark_symbol.
5552 Change to just keep the section associated with symbol.
5553 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5554 they are externally visible and --export-dynamic is turned on.
5555 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5556
bfc34b3f
ILT
55572011-10-19 Ian Lance Taylor <iant@google.com>
5558
5559 PR gold/13163
5560 * script-sections.cc
5561 (Output_section_element_dot_assignment::needs_output_section): New
5562 function.
5563
ea0d8c47
ILT
55642011-10-19 Ian Lance Taylor <iant@google.com>
5565
5566 PR gold/13204
5567 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5568 --section-start option was seen.
5569 * options.h (General_options::any_section_start): New function.
5570
abd242a9
DM
55712011-10-18 David S. Miller <davem@davemloft.net>
5572
5573 PR binutils/13301
5574 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5575 member to track relocation locations that have moved during TLS
5576 reloc optimizations.
5577 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5578 (Target_sparc::Relocate::relocate): Adjust view down by 4
5579 bytes if it matches reloc_adjust_addr_.
5580 (Target_sparc::Relocate::relocate_tls): Always move the
5581 __tls_get_addr call delay slot instruction forward 4 bytes when
5582 performing relaxation.
5583
bab9090f
CC
55842011-10-18 Cary Coutant <ccoutant@google.com>
5585
5586 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5587 (Output_file::map_no_anonymous): Check for non-zero
5588 return code from posix_fallocate.
5589
f7c5b166
CC
55902011-10-17 Cary Coutant <ccoutant@google.com>
5591
5592 PR gold/13245
5593 * plugin.cc (is_visible_from_outside): Check for symbols
5594 referenced from dynamic objects.
5595 * resolve.cc (Symbol_table::resolve): Don't count references
5596 from dynamic objects as references from real ELF files.
5597 * testsuite/plugin_test_2.sh: Adjust expected result.
5598
b490c0bb
CC
55992011-10-17 Cary Coutant <ccoutant@google.com>
5600
5601 * gold.cc: Include timer.h.
5602 (queue_middle_tasks): Stamp time.
5603 (queue_final_tasks): Likewise.
5604 * main.cc (main): Store timer in parameters. Print timers
5605 for each pass.
5606 * parameters.cc (Parameters::Parameters): Initialize timer_.
5607 (Parameters::set_timer): New function.
5608 (set_parameters_timer): New function.
5609 * parameters.h (Parameters::set_timer): New function.
5610 (Parameters::timer): New function.
5611 (Parameters::timer_): New data member.
5612 (set_parameters_timer): New function.
5613 * timer.cc (Timer::stamp): New function.
5614 (Timer::get_pass_time): New function.
5615 * timer.h (Timer::stamp): New function.
5616 (Timer::get_pass_time): New function.
5617 (Timer::pass_times_): New data member.
5618
f475cf7b
CC
56192011-10-17 Cary Coutant <ccoutant@google.com>
5620
5621 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5622 task for members of lib groups.
5623
cdd7e244
CC
56242011-10-17 Cary Coutant <ccoutant@google.com>
5625
5626 PR gold/13288
4f95c8b4 5627 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5628 (File_read::make_view): Move bounds check (replace with assert)...
5629 (File_read::find_or_make_view): ... to here.
5630
dfb45471
CC
56312011-10-12 Cary Coutant <ccoutant@google.com>
5632
4f95c8b4 5633 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5634 ::read returns less than requested size.
5635
53bbcc1b
CC
56362011-10-10 Cary Coutant <ccoutant@google.com>
5637
4f95c8b4 5638 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5639 Initialize defined_count_.
5640 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5641 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5642 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5643 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5644 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5645 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5646 member.
5647 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5648 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5649 Return zeroes instead of internal error.
5650
397b129b
CC
56512011-10-10 Cary Coutant <ccoutant@google.com>
5652
5653 PR gold/13249
4f95c8b4 5654 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5655 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5656 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5657 (Output_reloc::type_): Adjust size of bit field.
5658 (Output_reloc::use_plt_offset_): New bit field.
5659 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5660 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5661 flag. Adjust all callers.
4f95c8b4 5662 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5663 creating RELATIVE relocations.
5664
d5698657
NC
56652011-10-10 Nick Clifton <nickc@redhat.com>
5666
5667 * po/es.po: Updated Spanish translation.
5668 * po/fi.po: Updated Finnish translation.
5669
6a59a5c2
DN
56702011-10-03 Diego Novillo <dnovillo@google.com>
5671
5672 * options.cc (parse_uint): Fix dereference of RETVAL.
5673
f0558624
ST
56742011-09-29 Sriraman Tallam <tmsriram@google.com>
5675
5676 * layout.h (section_order_map_): New member.
5677 (get_section_order_map): New member function.
5678 * output.cc (Output_section::add_input_section): Check for patterns
5679 only when --section-ordering-file is specified.
5680 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5681 output_sections have been formed.
5682 * layout.cc (Layout_Layout): Initialize section_order_map_.
5683 * plugin.cc (update_section_order): Store order in order_map. Do not
5684 update the order.
5685 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5686 * testsuite/Makefile.in: Regenerate.
5687 * testsuite/plugin_section_order.c: New file.
5688 * testsuite/plugin_final_layout.cc: New file.
5689 * testsuite/plugin_final_layout.sh: New file.
5690
a7dac153
CC
56912011-09-29 Cary Coutant <ccoutant@google.com>
5692
4f95c8b4 5693 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5694 Check for NULL.
4f95c8b4 5695 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5696 symbols during incremental update.
5697 (Symbol_table::add_from_dynobj): Likewise.
5698
eebd87a5
ILT
56992011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5700 Ian Lance Taylor <iant@google.com>
5701
5702 * symtab.cc (Symbol_table::define_special_symbol): Always
5703 canonicalize version string.
5704
403a3331
CC
57052011-09-26 Cary Coutant <ccoutant@google.com>
5706
4f95c8b4
CC
5707 * gold.cc (queue_initial_tasks): Move option checks ...
5708 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5709 some options; make others fatal.
5710
235061c2
CC
57112011-09-26 Cary Coutant <ccoutant@google.com>
5712
5713 gcc PR lto/47247
5714 * plugin.cc (get_symbols_v2): New function.
5715 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5716 (is_referenced_from_outside): New function.
5717 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5718 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5719 (get_symbols): Pass version parameter.
5720 (get_symbols_v2): New function.
5721 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5722 parameter.
5723 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5724 (onload): Add LDPT_GET_SYMBOLS_V2.
5725 (all_symbols_read_hook): Use get_symbols_v2; check for
5726 LDPR_PREVAILING_DEF_IRONLY_EXP.
5727 * testsuite/plugin_test_3.sh: Update expected results.
5728
dc87f620
ILT
57292011-09-23 Simon Baldwin <simonb@google.com>
5730
5731 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5732 configuration options.
5733 * configure: Regenerate.
5734 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5735 * Makefile.in: Regenerate.
5736 * testsuite/Makefile.in: Regenerate.
5737
a8279f82
ST
57382011-09-19 Sriraman Tallam <tmsriram@google.com>
5739
5740 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5741
0c9350c8
CC
57422011-09-19 Cary Coutant <ccoutant@google.com>
5743
5744 * incremental.cc (can_incremental_update): Fix typo in comment.
5745 * incremental.h (can_incremental_update): Likewise.
5746
aa06ae28
CC
57472011-09-18 Cary Coutant <ccoutant@google.com>
5748
5749 * incremental.cc (can_incremental_update): New function.
5750 * incremental.h (can_incremental_update): New function.
5751 * layout.cc (Layout::init_fixed_output_section): Call it.
5752 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5753 * object.cc (Sized_relobj_file::do_layout): Call
5754 can_incremental_update.
5755
ebb300b2
CC
57562011-09-13 Cary Coutant <ccoutant@google.com>
5757
5758 * configure.ac: Check for glibc support for gnu_indirect_function
5759 support with static linking, setting automake conditional
5760 IFUNC_STATIC.
5761 * Makefile.in: Regenerate.
5762 * configure: Regenerate.
5763
5764 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5765 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5766 for IFUNC_STATIC.
5767 * testsuite/Makefile.in: Regenerate.
5768
1206d0d5
CC
57692011-09-13 Cary Coutant <ccoutant@google.com>
5770
5771 * incremental.cc (Sized_relobj_incr::do_layout): Call
5772 report_comdat_group for kept comdat sections.
5773 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5774 * testsuite/Makefile.in: Regenerate.
5775 * testsuite/incr_comdat_test_1.cc: New source file.
5776 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5777 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5778 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5779
40b29874
ILT
57802011-09-13 Ian Lance Taylor <iant@google.com>
5781
5782 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5783 variable external_symbols_offset.
5784
1b045aac
ILT
57852011-09-12 Ian Lance Taylor <iant@google.com>
5786
5787 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5788 triggered if object has no symbols.
5789
24c6c55a
DM
57902011-09-09 David S. Miller <davem@davemloft.net>
5791
5792 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5793 (Output_fill_debug_line::do_write): Likewise.
5794
66570254
CC
57952011-08-29 Cary Coutant <ccoutant@google.com>
5796
5797 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5798 casts to match formatting specs.
5799 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5800
8ea8cd50
CC
58012011-08-26 Cary Coutant <ccoutant@google.com>
5802
5803 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5804 remaining hole size when allocating.
5805 (Layout::make_output_section): Set fill methods for debug sections.
5806 * layout.h (Free_list::Free_list_node): Move from private to
5807 public.
5808 (Free_list::set_min_hole_size): New function.
5809 (Free_list::begin, Free_list::end): New functions.
5810 (Free_list::min_hole_): New data member.
5811 * output.cc: Include dwarf.h.
5812 (Output_fill_debug_info::do_minimum_hole_size): New function.
5813 (Output_fill_debug_info::do_write): New function.
5814 (Output_fill_debug_line::do_minimum_hole_size): New function.
5815 (Output_fill_debug_line::do_write): New function.
5816 (Output_section::Output_section): Initialize new data member.
5817 (Output_section::set_final_data_size): Ensure patch space is larger
5818 than minimum hole size.
5819 (Output_section::do_write): Fill holes in debug sections.
5820 * output.h (Output_fill): New class.
5821 (Output_fill_debug_info): New class.
5822 (Output_fill_debug_line): New class.
5823 (Output_section::set_free_space_fill): New function.
5824 (Output_section::free_space_fill_): New data member.
5825 * testsuite/Makefile.am (incremental_test_3): Add
5826 --incremental-patch option.
5827 (incremental_test_4): Likewise.
5828 (incremental_test_5): Likewise.
5829 (incremental_test_6): Likewise.
5830 (incremental_copy_test): Likewise.
5831 (incremental_common_test_1): Likewise.
5832 * testsuite/Makefile.in: Regenerate.
5833
7cf80422
NC
58342011-08-26 Nick Clifton <nickc@redhat.com>
5835
5836 * po/es.po: Updated Spanish translation.
5837
c3f7b0e5
CC
58382011-08-01 Cary Coutant <ccoutant@google.com>
5839
5840 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5841 * gold/testsuite/Makefile.in: Regenerate.
5842 * gold/testsuite/justsyms_exec.c: New source file.
5843 * gold/testsuite/justsyms_lib.c: New source file.
5844
9590bf25
CC
58452011-08-01 Cary Coutant <ccoutant@google.com>
5846
5847 * layout.cc (Layout::set_segment_offsets): Don't realign text
5848 segment if -Ttext was specified.
5849 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5850 file type.
5851 * object.h (Sized_relobj_file::e_type): New function.
5852 (Sized_relobj_file::e_type_): New data member.
5853 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5854 base address for ET_EXEC files.
5855 * target.cc (Target::do_make_elf_object_implementation): Allow
5856 ET_EXEC files with --just-symbols option.
5857
dcd8d12e
CC
58582011-07-28 Cary Coutant <ccoutant@google.com>
5859
5860 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5861 Add thread_number parameter.
5862 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5863 * workqueue-threads.cc
5864 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5865 current thread if its thread number is greater than desired thread
5866 count.
5867 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5868 Add thread_number parameter.
5869 (Workqueue::should_cancel_thread): Likewise.
5870 (Workqueue::find_runnable_or_wait): Pass thread_number to
5871 should_cancel_thread.
5872 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5873 parameter.
5874
804eb480
ST
58752011-07-22 Sriraman Tallam <tmsriram@google.com>
5876
5877 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5878 only after checking if it cannot be forced local.
5879 * symtab.h (is_externally_visible): Check if the symbol is not forced
5880 local.
5881
f1ddb600
ILT
58822011-07-15 Ian Lance Taylor <iant@google.com>
5883
5884 * options.h (class General_options): Add --print-output-format.
5885 Move -EL next to -EB, for better --help output.
5886 * target-select.cc: Include <cstdio>, "options.h", and
5887 "parameters.h".
5888 (Target_selector::do_target_bfd_name): New function.
5889 (print_output_format): New function.
5890 * target-select.h (class Target_selector): Update declarations.
5891 (Target_selector::target_bfd_name): New function.
5892 (print_output_format): Declare.
5893 * main.cc: Include "target-select.h".
5894 (main): Handle --print-output-format.
5895 * gold.cc: Include "target-select.h".
5896 (queue_initial_tasks): Handle --print-output-format when there are
5897 no input files.
5898 * parameters.cc (parameters_force_valid_target): Give a better
5899 error message if -EB/-EL does not match target.
5900 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5901 function.
5902
7d172687
ILT
59032011-07-15 Ian Lance Taylor <iant@google.com>
5904
5905 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5906 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5907 (Output_data_plt_i386::do_write): Write address of .dynamic
5908 section to first entry in .got.plt section.
5909 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5910 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5911 Initialize layout_.
5912 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5913 section to first entry in .got.plt section.
5914 * layout.h (Layout::dynamic_section): New function.
5915
e9552f7e
ST
59162011-07-13 Sriraman Tallam <tmsriram@google.com>
5917
5918 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5919 to claim_file call.
5920 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5921 input_section_position_, and input_section_glob_.
5922 (read_layout_from_file): Call function section_ordering_specified.
5923 * layout.h (is_section_ordering_specified): New function.
5924 (section_ordering_specified): New function.
5925 (section_ordering_specified_): New boolean member.
5926 * main.cc(main): Call load_plugins after layout object is defined.
5927 * output.cc (Output_section::add_input_section): Use
5928 function section_ordering_specified to check if section ordering is
5929 needed.
5930 * output.cc (Output_section::add_relaxed_input_section): Use
5931 function section_ordering_specified to check if section ordering is
5932 needed.
5933 (Output_section::update_section_layout): New function.
5934 (Output_section::sort_attached_input_sections): Check if input section
5935 must be reordered.
5936 * output.h (Output_section::update_section_layout): New function.
5937 * plugin.cc (get_section_count): New function.
5938 (get_section_type): New function.
5939 (get_section_name): New function.
5940 (get_section_contents): New function.
5941 (update_section_order): New function.
58797674 5942 (allow_section_ordering): New function.
e9552f7e
ST
5943 (Plugin::load): Add the new interfaces to the transfer vector.
5944 (Plugin_manager::load_plugins): New parameter.
5945 (Plugin_manager::all_symbols_read): New parameter.
5946 (Plugin_manager::claim_file): New parameter. Save the elf object for
5947 unclaimed objects.
5948 (Plugin_manager::get_elf_object): New function.
5949 (Plugin_manager::get_view): Change to directly use the bool to check
5950 if get_view is called from claim_file_hook.
5951 * plugin.h (input_objects): New function
5952 (Plugin__manager::load_plugins): New parameter.
5953 (Plugin_manager::claim_file): New parameter.
5954 (Plugin_manager::get_elf_object): New function.
5955 (Plugin_manager::in_claim_file_handler): New function.
5956 (Plugin_manager::in_claim_file_handler_): New member.
5957 (layout): New function.
5958 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5959 handler with an extra parameter. Make the elf object before calling
5960 claim_file handler.
5961 * testsuite/plugin_test.c (get_section_count): New function pointer.
5962 (get_section_type): New function pointer.
5963 (get_section_name): New function pointer.
5964 (get_section_contents): New function pointer.
5965 (update_section_order): New function pointer.
5966 (allow_section_ordering): New function pointer.
5967 (onload): Check if the new interfaces exist.
5968
9446efde
ILT
59692011-07-13 Ian Lance Taylor <iant@google.com>
5970
5971 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5972 relro section.
5973 * x86_64.cc (Target_x86_64::got_section): Likewise.
5974 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5975 (relro_now_test_SOURCES): New variable.
5976 (relro_now_test_DEPENDENCIES): New variable.
5977 (relro_now_test_LDFLAGS): New variable.
5978 (relro_now_test_LDADD): New variable.
5979 (relro_now_test.so): New target.
5980 * testsuite/Makefile.in: Rebuild.
5981
07aa62f2
ILT
59822011-07-12 Ian Lance Taylor <iant@google.com>
5983
5984 PR gold/12980
5985 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5986 GLOB_DAT relocation rather than a RELATIVE relocation for a
5987 protected symbol when creating a shared library.
5988 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5989 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5990 * testsuite/protected_main_1.cc (main): Test that protected
5991 function has same address.
5992
e2153196
ILT
59932011-07-11 Ian Lance Taylor <iant@google.com>
5994
5995 PR gold/12979
5996 * options.h (class General_options): Add -Bgroup.
5997 * options.cc (General_options::finalize): If -Bgroup is set,
5998 default to --unresolved-symbols=report-all.
5999 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
6000 * target-reloc.h (issue_undefined_symbol_error): Handle
6001 --unresolved-symbols=report-all.
6002
6daf5215
ILT
60032011-07-08 Ian Lance Taylor <iant@google.com>
6004
6005 PR gold/11985
6006 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
6007 if linker script discards key sections.
6008 (Layout::create_dynamic_symtab): Likewise.
6009 (Layout::assign_local_dynsym_offsets): Likewise.
6010 (Layout::sized_create_version_sections): Likewise.
6011 (Layout::create_interp): Likewise.
6012 (Layout::finish_dynamic_section): Likewise.
6013 (Layout::set_dynamic_symbol_size): Likewise.
6014
beabb2c6
ILT
60152011-07-08 Ian Lance Taylor <iant@google.com>
6016
6017 PR gold/12386
6018 * options.h (class General_options): Add --unresolved-symbols.
6019 * target-reloc.h (issue_undefined_symbol_error): Check
6020 --unresolved-symbols. Add comments.
6021
9c16daf1
ILT
60222011-07-08 Ian Lance Taylor <iant@google.com>
6023
6024 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6025 expression more complex.
6026
191f1a2d
ILT
60272011-07-08 Ian Lance Taylor <iant@google.com>
6028
6029 PR gold/11317
6030 * target-reloc.h (issue_undefined_symbol_error): New inline
6031 function, broken out of relocate_section.
6032 (relocate_section): Call issue_undefined_symbol_error.
6033 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6034 there is no TLS segment if we are about to issue an undefined
6035 symbol error.
6036 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6037
62855347
ILT
60382011-07-08 Ian Lance Taylor <iant@google.com>
6039
6040 PR gold/12279
6041 * resolve.cc (Symbol_table::should_override): Add fromtype
6042 parameter. Change all callers. Give error when linking together
6043 TLS and non-TLS symbol.
6044 (Symbol_table::should_override_with_special): Add fromtype
6045 parameter. Change all callers.
6046 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6047 there is no TLS segment if we have reported some errors.
6048 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6049
67181c72
ILT
60502011-07-08 Ian Lance Taylor <iant@google.com>
6051
6052 PR gold/12372
6053 * target.h (Target::plt_address_for_global): New function.
6054 (Target::plt_address_for_local): New function.
6055 (Target::plt_section_for_global): Remove.
6056 (Target::plt_section_for_local): Remove.
6057 (Target::do_plt_address_for_global): New virtual function.
6058 (Target::do_plt_address_for_local): New virtual function.
6059 (Target::do_plt_section_for_global): Remove.
6060 (Target::do_plt_section_for_local): Remove.
6061 (Target::register_global_plt_entry): Add Symbol_table and Layout
6062 parameters.
6063 * output.cc (Output_data_got::Got_entry::write): Use
6064 plt_address_for_global and plt_address_for_local.
6065 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6066 address of output section.
6067 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6068 got_irelative_, and irelative_count_ fields. Update
6069 declarations.
6070 (Output_data_plt_i386::has_irelative_section): New function.
6071 (Output_data_plt_i386::entry_count): Add irelative_count_.
6072 (Output_data_plt_i386::set_final_data_size): Likewise.
6073 (class Target_i386): Add got_irelative_ and rel_irelative_
6074 fields. Update declarations.
6075 (Target_i386::Target_i386): Initialize new fields.
6076 (Target_i386::do_plt_address_for_global): New function replacing
6077 do_plt_section_for_global.
6078 (Target_i386::do_plt_address_for_local): New function replacing
6079 do_plt_section_for_local.
6080 (Target_i386::got_section): Create got_irelative_.
6081 (Target_i386::rel_irelative_section): New function.
6082 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6083 fields. Don't define __rel_iplt_{start,end}.
6084 (Output_data_plt_i386::add_entry): Add symtab and layout
6085 parameters. Change all callers. Use different PLT and GOT for
6086 IFUNC symbols.
6087 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6088 layout parameters. Change all callers. Use different PLT and
6089 GOT.
6090 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6091 (Output_data_plt_i386::rel_irelative): New function.
6092 (Output_data_plt_i386::address_for_global): New function.
6093 (Output_data_plt_i386::address_for_local): New function.
6094 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6095 IRELATIVE GOT when changing IFUNC GOT entries.
6096 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6097 reloc.
6098 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6099 if we didn't create an IRELATIVE GOT.
6100 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6101 plt_address_for_local.
6102 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6103 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6104 got_irelative_, and irelative_count_ fields. Update
6105 declarations.
6106 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6107 Initialize new fields. Remove symtab parameter. Change all
6108 callers.
6109 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6110 irelative_count_.
6111 (Output_data_plt_x86_64::has_irelative_section): New function.
6112 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6113 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6114 fields. Update declarations.
6115 (Target_x86_64::Target_x86_64): Initialize new fields.
6116 (Target_x86_64::do_plt_address_for_global): New function replacing
6117 do_plt_section_for_global.
6118 (Target_x86_64::do_plt_address_for_local): New function replacing
6119 do_plt_section_for_local.
6120 (Target_x86_64::got_section): Create got_irelative_.
6121 (Target_x86_64::rela_irelative_section): New function.
6122 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6123 all callers. Don't create __rel_iplt_{start,end}.
6124 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6125 parameters. Change all callers. Use different PLT and GOT for
6126 IFUNC symbols.
6127 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6128 layout parameters. Change all callers. Use different PLT and
6129 GOT.
6130 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6131 parameters. Change all callers. Use different PLT and GOT for
6132 IFUNC symbols.
6133 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6134 (Output_data_plt_x86_64::rela_irelative): New function.
6135 (Output_data_plt_x86_64::address_for_global): New function.
6136 (Output_data_plt_x86_64::address_for_local): New function.
6137 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6138 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6139 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6140 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6141 parameters.
6142 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6143 reloc.
6144 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6145 symbols if we didn't create an IRELATIVE GOT.
6146 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6147 plt_address_for_local.
6148 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6149 * testsuite/ifuncvar1.c: New test file.
6150 * testsuite/ifuncvar2.c: New test file.
6151 * testsuite/ifuncvar3.c: New test file.
6152 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6153 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6154 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6155 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6156 * testsuite/Makefile.in: Rebuild.
6157
33c15b45
CC
61582011-07-07 Cary Coutant <ccoutant@google.com>
6159
6160 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6161 (two_file_test_1_ndebug.o): Likewise.
6162 (two_file_test_1b_ndebug.o): Likewise.
6163 (two_file_test_2_ndebug.o): Likewise.
6164 (two_file_test_main_ndebug.o): Likewise.
6165 (incremental_test_2): Link with no-debug versions.
6166
f48b5fb7
CC
61672011-07-06 Cary Coutant <ccoutant@google.com>
6168
6169 * gold/incremental.cc
6170 (Output_section_incremental_inputs::write_info_blocks): Check for
6171 hidden and internal symbols.
6172
221597a5
CC
61732011-07-06 Cary Coutant <ccoutant@google.com>
6174
6175 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6176 Check disposition for startup file.
6177 (Incremental_inputs::report_command_line): Ignore
6178 --incremental-startup-unchanged option.
6179 * options.cc (General_options::parse_incremental_startup_unchanged):
6180 New function.
6181 (General_options::General_options): Initialize new data member.
6182 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6183 (General_options): Add --incremental-startup-unchanged option.
6184 (General_options::incremental_startup_disposition): New function.
6185 (General_options::incremental_startup_disposition_): New data member.
6186
e24719f6
CC
61872011-07-06 Cary Coutant <ccoutant@google.com>
6188
6189 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6190 input file index to Script_info ctor.
6191 (Sized_incremental_binary::do_file_has_changed): Find the
6192 command-line argument for files named in scripts.
6193 * incremental.h (Script_info::Script_info): New ctor
6194 with input file index.
6195 (Script_info::input_file_index): New function.
6196 (Script_info::input_file_index_): New data member.
6197 (Incremental_binary::get_library): Add const.
6198 (Incremental_binary::get_script_info): Add const.
6199 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6200 * testsuite/Makefile.am (incremental_test_5): New test case.
6201 (incremental_test_6): New test case.
6202 * testsuite/Makefile.in: Regenerate.
6203
8f7c81e8
CC
62042011-07-06 Cary Coutant <ccoutant@google.com>
6205
6206 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6207 debug output when command lines differ.
6208
9fbd3822
CC
62092011-07-06 Cary Coutant <ccoutant@google.com>
6210
6211 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6212 --incremental-patch option.
6213 * layout.cc (Free_list::allocate): Extend allocation beyond original
6214 end if enabled.
6215 (Layout::make_output_section): Mark sections that should get
6216 patch space.
6217 * options.cc (parse_percent): New function.
6218 * options.h (parse_percent): New function.
6219 (DEFINE_percent): New macro.
6220 (General_options): Add --incremental-patch option.
6221 * output.cc (Output_section::Output_section): Initialize new data
6222 members.
6223 (Output_section::add_input_section): Print section name when out
6224 of patch space.
6225 (Output_section::add_output_section_data): Likewise.
6226 (Output_section::set_final_data_size): Add patch space when
6227 doing --incremental-full.
6228 (Output_section::do_reset_address_and_file_offset): Remove patch
6229 space.
6230 (Output_segment::set_section_list_addresses): Print debug output
6231 only if --incremental-update.
6232 * output.h (Output_section::set_is_patch_space_allowed): New function.
6233 (Output_section::is_patch_space_allowed_): New data member.
6234 (Output_section::patch_space_): New data member.
6235 * parameters.cc (Parameters::incremental_full): New function.
6236 * parameters.h (Parameters::incremental_full): New function
6237 * testsuite/Makefile.am (incremental_test_2): Add test for
6238 --incremental-patch option.
6239 * testsuite/Makefile.in: Regenerate.
6240 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6241 (t18): Remove function body.
6242
f6cccc2c
DK
62432011-07-05 Doug Kwan <dougkwan@google.com>
6244
6245 PR gold/12771
6246 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6247 Arm_Address type for relocation result.
6248 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6249 overflow check.
6250 (Arm_relocate_functions::abs32): Use unaligned access.
6251 (Arm_relocate_functions::rel32): Ditto.
6252 (Arm_relocate_functions::prel31): Ditto.
6253 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6254 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6255 static data relocations.
6256 * testsuite/Makefile.in: Regnerate.
6257 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6258
28a13fec
ILT
62592011-07-05 Ian Lance Taylor <iant@google.com>
6260
6261 PR gold/12392
6262 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6263 symbols if necessary.
6264 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6265
24d47b34
ILT
62662011-07-05 Ian Lance Taylor <iant@google.com>
6267
6268 PR gold/12952
6269 * resolve.cc (Symbol::override_base_with_special): Simply override
6270 version with special symbol version, ignoring previous version.
6271
41f9cbbe
ILT
62722011-07-05 Ian Lance Taylor <iant@google.com>
6273
6274 * object.cc (Sized_relobj_file::include_section_group): Add
6275 information to comment about signature location.
6276
886288f1
ILT
62772011-07-02 Ian Lance Taylor <iant@google.com>
6278
6279 PR gold/12957
6280 * options.h (class General_options): Add -f and -F.
6281 * options.cc (General_options::finalize): Fatal error if -f/-F
6282 are used without -shared.
6283 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6284
ae3a6d4f
ILT
62852011-07-02 Ian Lance Taylor <iant@google.com>
6286
6287 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6288
21131061
ILT
62892011-07-01 Ian Lance Taylor <iant@google.com>
6290
6291 PR gold/12525
6292 PR gold/12952
6293 * resolve.cc (Symbol::override_base_with_special): Don't override
6294 the version if the overriding symbol has a different name.
6295 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6296 all callers. If we give an error about an undefined version,
6297 define the base version if necessary.
6298 * dynobj.h (class Versions): Update declaration.
6299 * testsuite/weak_alias_test_5.cc: New file.
6300 * testsuite/weak_alias_test.script: New file.
6301 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6302 and versioned_alias have the right value, and call t2.
6303 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6304 weak_alias_test_5.so.
6305 (weak_alias_test_LDADD): Likewise.
6306 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6307 * testsuite/Makefile.in: Rebuild.
6308
611062c0
ILT
63092011-07-01 Ian Lance Taylor <iant@google.com>
6310
6311 PR gold/12525
6312 * options.h (class General_options): Support -z notext.
6313 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6314 -Wl,-z,notext.
6315 (two_file_shared_nonpic.so): Likewise.
6316 (two_file_shared_mixed.so): Likewise.
6317 (two_file_shared_mixed_1.so): Likewise.
6318 (weak_undef_lib_nonpic.so): Likewise.
6319 (alt/weak_undef_lib_nonpic.so): Likewise.
6320 (tls_test_shared_nonpic.so): Likewise.
6321 * testsuite/Makefile.in: Rebuild.
6322
328c7c2f
ILT
63232011-07-01 Ian Lance Taylor <iant@google.com>
6324
6325 PR gold/12525
6326 * configure.ac: Test whether static linking works, setting
6327 the automake conditional HAVE_STATIC.
6328 * testsuite/Makefile.am: Disable tests using -static if
6329 HAVE_STATIC is not true.
6330 * configure, testsuite/Makefile.in: Rebuild.
6331
02d7cd44
ILT
63322011-07-01 Ian Lance Taylor <iant@google.com>
6333
6334 PR gold/12525
6335 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6336 Assert if we see DW_EH_PE_indirect.
6337 * target.h (Target::ehframe_datarel_base): New function.
6338 (Target::do_ehframe_datarel_base): New target function.
6339 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6340 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6341 function.
6342
07a60597
ILT
63432011-07-01 Ian Lance Taylor <iant@google.com>
6344
6345 PR gold/12571
6346 * options.h (class General_options): Add
6347 --ld-generated-unwind-info.
6348 * ehframe.cc (Fde::write): Add address parameter. Change all
6349 callers. If associated with PLT, fill in address and size.
6350 (Cie::set_output_offset): Only add merge mapping if there is an
6351 object.
6352 (Cie::write): Add address parameter. Change all callers.
6353 (Eh_frame::add_ehframe_for_plt): New function.
6354 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6355 input_offset_ fields into union u_, with new plt field.
6356 (Fde::Fde): Adjust for new union field.
6357 (Fde::Fde) [Output_data version]: New constructor.
6358 (Fde::add_mapping): Only add merge mapping if there is an object.
6359 (class Cie): Update declarations.
6360 (class Eh_frame): Declare add_ehframe_for_plt.
6361 * layout.cc (Layout::layout_eh_frame): Break out code into
6362 make_eh_frame_section, and call it.
6363 (Layout::make_eh_frame_section): New function.
6364 (Layout::add_eh_frame_for_plt): New function.
6365 * layout.h (class Layout): Update declarations.
6366 * merge.cc (Merge_map::add_mapping): Add assertion.
6367 * i386.cc: Include "dwarf.h".
6368 (class Output_data_plt_i386): Make first_plt_entry,
6369 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6370 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6371 and plt_eh_frame_fde.
6372 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6373 boundary. Call add_eh_frame_for_plt if appropriate.
6374 * x86_64.cc: Include "dwarf.h".
6375 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6376 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6377 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6378 and plt_eh_frame_fde.
6379 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6380 appropriate.
6381
14788a3f
ILT
63822011-06-29 Ian Lance Taylor <iant@google.com>
6383
6384 PR gold/12629
6385 * object.cc (Sized_relobj_file::layout_section): Change shdr
6386 parameter to be const.
6387 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6388 out of do_layout.
6389 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6390 appropriate. Call layout_eh_frame_section.
6391 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6392 sections.
6393 * object.h (class Sized_relobj_file): Update declarations.
6394
6c21fce1
ILT
63952011-06-29 Ian Lance Taylor <iant@google.com>
6396
37e41b03 6397 PR gold/12652
6c21fce1
ILT
6398 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6399 modifier.
6400 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6401
4d5e4e62
ILT
64022011-06-29 Ian Lance Taylor <iant@google.com>
6403
6404 PR gold/12675
6405 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6406 SHT_X86_64_UNWIND.
6407 * layout.cc (Layout::layout_eh_frame): Likewise.
6408
886f533a
ILT
64092011-06-29 Ian Lance Taylor <iant@google.com>
6410
6411 PR gold/12695
6412 * layout.cc (Layout::symtab_section_shndx): New function.
6413 * layout.h (class Layout): Declare symtab_section_shndx.
6414 * output.cc (Output_section::write_header): Call it.
6415
f3ae1b28
ILT
64162011-06-29 Ian Lance Taylor <iant@google.com>
6417
6418 PR gold/12818
6419 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6420 symbols which are not used in a relocation.
6421
aecf301f
ILT
64222011-06-28 Ian Lance Taylor <iant@google.com>
6423
6424 PR gold/12898
6425 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6426 script create indistinguishable segments.
6427 (Layout::set_segment_offsets): Use stable_sort when sorting
6428 segments. Pass this to Compare_segments constructor.
6429 * layout.h (class Layout): Make segment_precedes non-static.
6430 (class Compare_segments): Change from struct to class. Add
6431 layout_ field. Add constructor.
6432 * script-sections.cc
6433 (Script_sections::attach_sections_using_phdrs_clause): Rename
6434 local orphan to is_orphan. Don't report failure to put empty
6435 section in segment. On attachment failure, report name of
6436 section, and attach to first PT_LOAD segment.
6437
03ef7571
ILT
64382011-06-28 Ian Lance Taylor <iant@google.com>
6439
6440 PR gold/12934
6441 * target-select.cc (Target_selector::Target_selector): Add
6442 emulation parameter. Change all callers.
6443 (select_target_by_bfd_name): Rename from select_target_by_name.
6444 Change all callers.
6445 (select_target_by_emulation): New function.
6446 (supported_emulation_names): New function.
6447 * target-select.h (class Target_selector): Add emulation_ field.
6448 Update declarations.
6449 (Target_selector::recognize_by_bfd_name): Rename from
6450 recognize_by_name. Change all callers.
6451 (Target_selector::supported_bfd_names): Rename from
6452 supported_names. Change all callers.
6453 (Target_selector::recognize_by_emulation): New function.
6454 (Target_selector::supported_emulations): New function.
6455 (Target_selector::emulation): New function.
6456 (Target_selector::do_recognize_by_bfd_name): Rename from
6457 do_recognize_by_name. Change all callers.
6458 (Target_selector::do_supported_bfd_names): Rename from
6459 do_supported_names. Change all callers.
6460 (Target_selector::do_recognize_by_emulation): New function.
6461 (Target_selector::do_supported_emulations): New function.
6462 (select_target_by_bfd_name): Change name in declaration.
6463 (select_target_by_emulation): Declare.
6464 (supported_emulation_names): Declare.
6465 * parameters.cc (parameters_force_valid_target): Try to find
6466 target based on emulation from -m option.
6467 * options.h (class General_options): Change doc string for -m.
6468 * options.cc (help): Print emulations.
6469 (General_options::parse_V): Likewise.
6470 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6471 Add emulation parameter. Change all callers.
6472
200b2bb9
ILT
64732011-06-28 Ian Lance Taylor <iant@google.com>
6474
6475 * target.h (class Target): Add osabi_ field.
6476 (Target::osabi): New function.
6477 (Target::set_osabi): New function.
6478 (Target::Target): Initialize osabi_.
6479 (Target::do_adjust_elf_header): Make pure virtual.
6480 (Sized_target::do_adjust_elf_header): Declare.
6481 * target.cc (Sized_target::do_adjust_elf_header): New function.
6482 (class Sized_target): Instantiate all versions.
6483 * freebsd.h (class Target_freebsd): Remove.
6484 (Target_selector_freebsd::do_recognize): Call set_osabi on
6485 Target.
6486 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6487 (Target_selector_freebsd::set_osabi): Remove.
6488 * i386.cc (class Target_i386): Inherit from Sized_target rather
6489 than Target_freebsd.
6490 * x86_64.cc (class Target_x86_64): Likewise.
6491
b3ce541e
ILT
64922011-06-28 Ian Lance Taylor <iant@google.com>
6493
6494 * target.h (Target::can_check_for_function_pointers): Rewrite.
6495 Make non-virtual.
6496 (Target::can_icf_inline_merge_sections): Likewise.
6497 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6498 (Target::Target_info): Add can_icf_inline_merge_sections field.
6499 (Target::do_can_check_for_function_pointers): New virtual
6500 function.
6501 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6502 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6503 from can_check_for_function_pointers, move in file.
6504 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6505 section_may_have_icf_unsafe_poineters, move in file.
6506 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6507 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6508 Rename from can_check_for_function_pointers, move in file.
6509 (Target_i386::can_icf_inline_merge_sections): Remove.
6510 (Target_i386::i386_info): Initialize
6511 can_icf_inline_merge_sections.
6512 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6513 Initialize can_icf_inline_merge_sections.
6514 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6515 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6516 Rename from can_check_for_function_pointers, move in file.
6517 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6518 (Target_x86_64::x86_64_info): Initialize
6519 can_icf_inline_merge_sections.
6520 * testsuite/testfile.cc (Target_test::test_target_info):
6521 Likewise.
6522 * icf.cc (get_section_contents): Correct formatting.
6523
6d1c4efb
ILT
65242011-06-27 Ian Lance Taylor <iant@google.com>
6525
6526 * symtab.cc (Symbol::versioned_name): New function.
6527 (Symbol_table::add_to_final_symtab): Use versioned_name when
6528 appropriate.
6529 (Symbol_table::sized_write_symbol): Likewise.
6530 * symtab.h (class Symbol): Declare versioned_name.
6531 * stringpool.h (class Stringpool_template): Add variant of add
6532 which takes a std::basic_string.
6533 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6534 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6535 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6536 (ver_test_12.o): New target.
6537 * testsuite/Makefile.in: Rebuild.
6538
57eb9b50
DK
65392011-06-27 Doug Kwan <dougkwan@google.com>
6540
6541 * arm.cc (Arm_relocate_functions::thm_jump8,
6542 Arm_relocate_functions::thm_jump11): Use a wider signed
6543 type to compute offset.
6544 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6545 arm_thm_jump8.
6546 * testsuite/Makefile.in: Regenerate.
6547 * testsuite/arm_branch_in_range.sh: Check test results of
6548 arm_thm_jump11 and arm_thm_jump8.
6549 * testsuite/arm_thm_jump11.s: New test source file.
6550 * testsuite/arm_thm_jump11.t: New linker script.
6551 * testsuite/arm_thm_jump8.s: New test source file.
6552 * testsuite/arm_thm_jump8.t: New linker script.
6553
487b39df
ILT
65542011-06-24 Ian Lance Taylor <iant@google.com>
6555
6556 * layout.cc: Include "object.h".
6557 (ctors_sections_in_init_array): New static variable.
6558 (Layout::is_ctors_in_init_array): New function.
6559 (Layout::layout): Add entry to ctors_sections_in_init_array if
6560 appropriate.
6561 * layout.h (class Layout): Declare is_ctors_in_init_array.
6562 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6563 is_ctors_reverse_view is set.
6564 (Sized_relobj_file::write_sections): Add layout parameter. Change
6565 all callers. Set is_ctors_reverse_view field of View_size.
6566 (Sized_relobj_file::reverse_words): New function.
6567 * object.h (Sized_relobj_file::View_size): Add
6568 is_ctors_reverse_view field.
6569 (class Sized_relobj_file): Update declarations.
6570 * testsuite/initpri3.c: New test.
6571 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6572 initpri3b.
6573 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6574 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6575 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6576 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6577 * testsuite/Makefile.in: Rebuild.
6578
472076e4
CC
65792011-06-24 Cary Coutant <ccoutant@google.com>
6580
6581 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6582 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6583 (debug_msg_cdebug.err): New targets.
6584 * testsuite/Makefile.in: Regenerate.
6585 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6586 Fix checks for link with shared library.
6587
a60af0db
DK
65882011-06-24 Doug Kwan <dougkwan@google.com>
6589
6590 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6591 skip empty text sections.
6592 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6593
5393d741
ILT
65942011-06-22 Ian Lance Taylor <iant@google.com>
6595
6596 PR gold/12910
6597 * options.h (class General_options): Add --ctors-in-init-array.
6598 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6599 friends as SHT_PROGBITS for merging sections.
6600 (Layout::layout): Remove special handling of .init_array and
6601 friends. Don't sort if doing relocatable link. Sort for .ctors
6602 and .dtors if ctors_in_init_array.
6603 (Layout::make_output_section): Force correct section types for
6604 .init_array and friends. Don't sort if doing relocatable link,
6605 Don't sort .ctors and .dtors if ctors_in_init_array.
6606 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6607 (Layout::output_section_name): Add relobj parameter. Change all
6608 callers. Handle .ctors. and .dtors. in code rather than table.
6609 Handle .ctors and .dtors if ctors_in_init_array.
6610 (Layout::match_file_name): New function, moved from output.cc.
6611 * layout.h (class Layout): Update declarations.
6612 * output.cc: Include "layout.h".
6613 (Input_section_sort_entry::get_priority): New function.
6614 (Input_section_sort_entry::match_file_name): Just call
6615 Layout::match_file_name.
6616 (Output_section::Input_section_sort_init_fini_compare::operator()):
6617 Handle .ctors and .dtors. Sort by explicit priority rather than
6618 by name.
6619 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6620 * testsuite/initpri2.c: New test.
6621 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6622 (check_PROGRAMS): Add initpri2.
6623 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6624 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6625 * configure, testsuite/Makefile.in: Rebuild.
6626
e1f74f98
ILT
66272011-06-19 Ian Lance Taylor <iant@google.com>
6628
6629 PR gold/12880
6630 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6631 .interp section to a PT_INTERP segment even if we have seen a
6632 --dynamic-linker option. Don't do it if we have seen a PHDRS
6633 clause in a linker script.
6634 (Layout::finalize): Don't create a .interp section if we've
6635 already create a PT_INTERP segment.
6636 (Layout::create_interp): Always call choose_output_section (revert
6637 patch of 2011-06-17). Don't create PT_INTERP segment.
6638 * script-sections.cc
6639 (Script_sections::create_note_and_tls_segments): Add a .interp
6640 section to a PT_INTERP segment even if we have seen a
6641 --dynamic-linker option.
6642
766f91bb
ILT
66432011-06-18 Ian Lance Taylor <iant@google.com>
6644
6645 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6646 merely because a non-PT_LOAD segment has a dynamic reloc.
6647
0d212c3a
ILT
66482011-06-18 Ian Lance Taylor <iant@google.com>
6649
6650 * layout.cc (Layout::finish_dynamic_section): Don't create
6651 DT_FLAGS entry if not needed.
6652
911a5072
ILT
66532011-06-18 Ian Lance Taylor <iant@google.com>
6654
6655 PR gold/12745
6656 * layout.cc (Layout::layout_eh_frame): Correct handling of
6657 writable .eh_frame section.
6658
534b4e5f
ILT
66592011-06-17 Ian Lance Taylor <iant@google.com>
6660
6661 PR gold/12893
6662 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6663 symbol is redefined with the exact same object and value.
6664
10b4f102
ILT
66652011-06-17 Ian Lance Taylor <iant@google.com>
6666
6667 PR gold/12880
6668 * layout.h (class Layout): Add interp_segment_ field.
6669 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6670 (Layout::attach_allocated_section_to_segment): If making shared
6671 library, put .interp section in PT_INTERP segment.
6672 (Layout::finalize): Also call create_interp if -dynamic-linker
6673 option was used.
6674 (Layout::create_interp): Assert that there is no PT_INTERP
6675 segment. If not using a SECTIONS clause, use make_output_section.
6676 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6677 * script-sections.cc
6678 (Script_sections::create_note_and_tls_segments): If making shared
6679 library, put .interp section in PT_INTERP segment.
6680
a29b0dad
ILT
66812011-06-17 Ian Lance Taylor <iant@google.com>
6682
e588ea8d
ILT
6683 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6684 when making a shared library.
6685
66862011-06-17 Ian Lance Taylor <iant@google.com>
6687
6688 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6689 parameter. Change all callers. Don't issue warning about PC32
6690 against locally defined symbol.
a29b0dad 6691
9d3b0698
ILT
66922011-06-16 Ian Lance Taylor <iant@google.com>
6693
6694 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6695 occurs in same object.
6696
85b0f90c
AM
66972011-06-14 Alan Modra <amodra@gmail.com>
6698
6699 * po/POTFILES.in: Regenerate.
6700
a94907d9
ILT
67012011-06-09 Ian Lance Taylor <iant@google.com>
6702
6703 * script-sections.cc
6704 (Orphan_output_section::set_section_addresses): For a relocatable
6705 link set address to 0.
6706
4fb3a1c3
CC
67072011-06-09 Cary Coutant <ccoutant@google.com>
6708
6709 PR gold/12804
6710 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6711 used with --compress-debug-sections.
6712 * gold/object.cc (Sized_relobj_file::do_layout): Report
6713 uncompressed size of compressed input sections.
6714
61220854
CC
67152011-06-08 Cary Coutant <ccoutant@google.com>
6716
6717 PR gold/12804
6718 * testsuite/two_file_test_2_v1.cc: Change initialization of
6719 v2 to keep it in .data.
6720
e6455dfb
CC
67212011-06-07 Cary Coutant <ccoutant@google.com>
6722
6723 * common.cc (Symbol_table::do_allocate_commons_list): Call
6724 gold_fallback.
6725 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6726 (Errors::fallback): New function.
6727 (gold_fallback): New function.
6728 * errors.h (Errors::fallback): New function.
6729 * gold.cc (gold_exit): Change status parameter to enum; adjust
6730 all callers.
6731 (queue_initial_tasks): Call gold_fallback.
6732 * gold.h: Include cstdlib.
6733 (Exit_status): New enum type.
6734 (gold_exit): Change status parameter to enum.
6735 (gold_fallback): New function.
6736 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6737 (Layout::create_symtab_sections): Likewise.
6738 (Layout::create_shdrs): Likewise.
6739 * main.cc (main): Adjust call to gold_exit.
6740 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6741 (Output_data_got::add_got_entry_pair): Likewise.
6742 (Output_section::add_input_section): Likewise.
6743 (Output_section::add_output_section_data): Likewise.
6744 (Output_segment::set_section_list_addresses): Likewise.
6745 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6746
fb0e076f
CC
67472011-06-07 Cary Coutant <ccoutant@google.com>
6748
6749 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6750 for incremental links.
6751 * output.cc (Output_segment::set_section_list_addresses): Remove
6752 FIXME and test for TLS or BSS.
6753
a5ee4d5d
CC
67542011-06-07 Cary Coutant <ccoutant@google.com>
6755
6756 * testsuite/Makefile.am: Add incremental_copy_test,
6757 incremental_common_test_1.
6758 * testsuite/Makefile.in: Regenerate.
6759 * testsuite/common_test_1_v1.c: New source file.
6760 * testsuite/common_test_1_v2.c: New source file.
6761 * testsuite/copy_test_v1.cc: New source file.
6762
5146f448
CC
67632011-06-07 Cary Coutant <ccoutant@google.com>
6764
6765 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6766 update, allocate common from bss section's free list.
6767 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6768 linker-defined symbols.
6769 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6770 Skip GOT and PLT entries that are no longer referenced.
6771 (Output_section_incremental_inputs::write_info_blocks): Mark
6772 linker-defined symbols.
6773 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6774 * output.cc (Output_section::allocate): New function.
6775 * output.h (Output_section::allocate): New function.
6776 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6777 linker-defined symbols.
6778 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6779 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6780 (Symbol::init_base_output_data): Likewise.
6781 (Symbol::init_base_output_segment): Likewise.
6782 (Symbol::init_base_constant): Likewise.
6783 (Sized_symbol::init_output_data): Likewise.
6784 (Sized_symbol::init_output_segment): Likewise.
6785 (Sized_symbol::init_constant): Likewise.
6786 (Symbol_table::do_define_in_output_data): Likewise.
6787 (Symbol_table::do_define_in_output_segment): Likewise.
6788 (Symbol_table::do_define_as_constant): Likewise.
6789 * symtab.h (Symbol::is_predefined): New function.
6790 (Symbol::init_base_output_data): Add is_predefined parameter.
6791 (Symbol::init_base_output_segment): Likewise.
6792 (Symbol::init_base_constant): Likewise.
6793 (Symbol::is_predefined_): New data member.
6794 (Sized_symbol::init_output_data): Add is_predefined parameter.
6795 (Sized_symbol::init_output_segment): Likewise.
6796 (Sized_symbol::init_constant): Likewise.
6797 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6798
26d3c67d
CC
67992011-06-07 Cary Coutant <ccoutant@google.com>
6800
6801 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6802 instead of emit_copy_reloc.
6803 (Copy_relocs::emit_copy_reloc): Refactor.
6804 (Copy_relocs::make_copy_reloc): New function.
6805 (Copy_relocs::add_copy_reloc): Remove.
6806 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6807 section.
6808 (Copy_relocs::make_copy_reloc): New function.
6809 (Copy_relocs::add_copy_reloc): Remove.
6810 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6811 unchanged input files.
6812 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6813 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6814 Reserve BSS space for COPY relocations.
6815 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6816 (Output_section_incremental_inputs::write_info_blocks): Record
6817 whether a symbol is copied from a shared object.
6818 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6819 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6820 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6821 (Incremental_input_entry_reader::get_output_symbol_index): Add
6822 is_copy parameter.
6823 (Incremental_binary::emit_copy_relocs): New function.
6824 (Incremental_binary::do_emit_copy_relocs): New function.
6825 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6826 new data member.
6827 (Sized_incremental_binary::add_copy_reloc): New function.
6828 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6829 (Sized_incremental_binary::Copy_reloc): New struct.
6830 (Sized_incremental_binary::Copy_relocs): New typedef.
6831 (Sized_incremental_binary::copy_relocs_): New data member.
6832 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6833 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6834 * target.h (Sized_target::emit_copy_reloc): New function.
6835 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6836
7cdb37d9
CC
68372011-06-02 Cary Coutant <ccoutant@google.com>
6838
6839 PR gold/12163
6840 * gold/archive.cc (Archive::Archive): Initialize new data member.
6841 (Archive::include_all_members): Return if archive has already been
6842 included.
6843 * gold/archive.h (Archive::include_all_members_): New data member.
6844
cc643b88
NC
68452011-06-02 Nick Clifton <nickc@redhat.com>
6846
6847 * dynobj.h: Fix spelling mistake in comment.
6848 * output.cc: Likewise.
6849
f62a3ca7 68502011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6851 Asier Llano
f62a3ca7
DK
6852
6853 PR gold/12826
cc643b88 6854 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6855 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6856 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6857 redundant arm_exidx_test.so.
6858 * testsuite/Makefile.in: Regenerate.
6859 (check_SCRIPTS): Add pr12826.sh
6860 (check_DATA): Add pr12826.stdout
6861 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6862 * testsuite/pr12826.sh: New file.
6863 * testsuite/pr12826_1.s: Ditto.
6864 * testsuite/pr12826_1.s: Ditto.
6865
8dbe1edc
ILT
68662011-05-30 Ian Lance Taylor <iant@google.com>
6867
6868 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6869 sections.
6870
c49875be
ILT
68712011-05-29 Ian Lance Taylor <iant@google.com>
6872
6873 PR gold/12804
6874 * testsuite/Makefile.am: Use different file name for two_file_test
6875 temporary file for each incremental test.
6876 * testsuite/Makefile.in: Rebuild.
6877
69d53f7a
ILT
68782011-05-29 Ian Lance Taylor <iant@google.com>
6879
6880 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6881 binary input file is empty.
6882
41d0ab5f
ILT
68832011-05-27 Ian Lance Taylor <iant@google.com>
6884
6885 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6886 (ver_test_9.so): Likewise.
6887 * testsuite/Makefile.in: Rebuild.
6888
89d8a36b
CC
68892011-05-26 Cary Coutant <ccoutant@google.com>
6890
6891 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6892 * incremental.cc (Incremental_inputs::report_input_section): Fix
6893 comment, indentation.
6894 (Incremental_inputs::report_comdat_group): New function.
6895 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6896 of data for incremental input file entry.
6897 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6898 group count, COMDAT group signatures.
6899 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6900 an unchanged input file.
6901 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6902 Initialize new data member.
6903 (Incremental_object_entry::add_comdat_group): New function.
6904 (Incremental_object_entry::get_comdat_group_count): New function.
6905 (Incremental_object_entry::get_comdat_signature_key): New function.
6906 (Incremental_object_entry::groups_): New data member.
6907 (Incremental_inputs::report_comdat_group): New function.
6908 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6909 data for incremental input file entry.
6910 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6911 (Incremental_input_entry_reader::get_input_section): Adjust size of
6912 data for incremental input file entry.
6913 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6914 (Incremental_input_entry_reader::get_comdat_group_signature): New
6915 function.
6916 * object.cc (Sized_relobj::include_section_group): Report kept
6917 COMDAT groups for incremental links.
6918
1706a06f
ILT
69192011-05-24 David Meyer <pdox@google.com>
6920
6921 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6922 with name parameter. Add found_name parameter.
6923 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6924 * dirsearch.h (class Dirsearch): Update declaration.
6925
a10ae760
ILT
69262011-05-24 Ian Lance Taylor <iant@google.com>
6927
6928 * archive.cc (Library_base::should_include_member): Pull in object
6929 from archive if it defines the entry symbol.
6930 * parameters.cc (Parameters::entry): New function.
6931 * parameters.h (class Parameters): Declare entry.
6932 * output.h (class Output_file_header): Remove entry_ field.
6933 * output.cc (Output_file_header::Output_file_header): Remove entry
6934 parameter. Change all callers.
6935 (Output_file_header::entry): Use parameters->entry.
6936 * gold.cc (queue_middle_tasks): Likewise.
6937 * plugin.cc (Plugin_hook::run): Likewise.
6938
aa92d6ed
CC
69392011-05-24 Cary Coutant <ccoutant@google.com>
6940
6941 * gold.cc (queue_initial_tasks): Pass incremental base filename
6942 to Output_file::open_base_file; don't print error message.
6943 * incremental-dump.cc (main): Adjust call to
6944 Output_file::open_for_modification.
6945 * incremental-dump.cc (main): Likewise.
6946 * incremental.cc (Incremental_inputs::report_command_line):
6947 Ignore --incremental-base option when comparing command lines.
6948 Ignore parameter when given as separate argument.
6949 * options.h (class General_options): Add --incremental-base.
6950 * output.cc (Output_file::Output_file):
6951 (Output_file::open_base_file): Add base_name and writable parameters;
6952 read base file into new file; print error message here.
6953 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6954 callers.
6955 * output.h (Output_file::open_for_modification): Rename to...
6956 (Output_file::open_base_file): ...this; add base_name and
6957 writable parameters; adjust all callers.
6958 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6959 callers.
6960 * testsuite/Makefile.am (incremental_test_4): Test
6961 --incremental-base.
6962 * testsuite/Makefile.in: Regenerate.
6963
2eedd706
CC
69642011-05-24 Cary Coutant <ccoutant@google.com>
6965
6966 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6967 incremental_test_4.
6968 * testsuite/Makefile.in: Regenerate.
6969 * testsuite/two_file_test_1_v1.cc: New test source file.
6970 * testsuite/two_file_test_1b_v1.cc: New test source file.
6971 * testsuite/two_file_test_2_v1.cc: New test source file.
6972
0f1c85a6
CC
69732011-05-24 Cary Coutant <ccoutant@google.com>
6974
6975 * dynobj.h (Dynobj::do_dynobj): New function.
6976 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6977 flag and soname for shared objects.
6978 * incremental.cc (Incremental_inputs::report_object): Make
6979 either Incremental_object_entry or Incremental_dynobj_entry; add
6980 soname to string table.
6981 (Incremental_inputs::report_input_section): Add assertion.
6982 (Output_section_incremental_inputs::set_final_data_size): Adjust
6983 type of input file entry for shared libraries; adjust size of
6984 shared library info entry.
6985 (Output_section_incremental_inputs::write_input_files): Write
6986 as_needed flag for shared libraries.
6987 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6988 of input file entry for shared libraries; write soname.
6989 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6990 soname from incremental info.
6991 * incremental.h (enum Incremental_input_flags): Add
6992 INCREMENTAL_INPUT_AS_NEEDED.
6993 (Incremental_input_entry::Incremental_input_entry): Initialize new
6994 data member.
6995 (Incremental_input_entry::set_as_needed): New function.
6996 (Incremental_input_entry::as_needed): New function.
6997 (Incremental_input_entry::do_dynobj_entry): New function.
6998 (Incremental_input_entry::as_needed_): New data member.
6999 (Incremental_object_entry::Incremental_object_entry): Don't check
7000 for shared library.
7001 (Incremental_object_entry::do_type): Likewise.
7002 (class Incremental_dynobj_entry): New class.
7003 (Incremental_input_entry_reader::as_needed): New function.
7004 (Incremental_input_entry_reader::get_soname): New function.
7005 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
7006 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
7007 size of shared library info entry.
58797674 7008 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7009 incremental link when adding DT_NEEDED entries.
7010 * object.h (Object::Object): Initialize new data member.
7011 (Object::dynobj): New function.
7012 (Object::set_as_needed): New function.
7013 (Object::as_needed): New function.
7014 (Object::do_dynobj): New function.
7015 (Object::as_needed_): New data member.
7016
6fa2a40b
CC
70172011-05-24 Cary Coutant <ccoutant@google.com>
7018
7019 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7020 info; adjust display of GOT entries.
7021 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7022 vector of input objects; remove file_status_.
7023 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7024 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7025 got_plt reader; call target hooks to reserve GOT entries.
7026 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7027 of input file info header and GOT info entry.
7028 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7029 relocation info.
7030 (Got_plt_view_info::got_descriptor): Remove.
7031 (Got_plt_view_info::sym_index): New data member.
7032 (Got_plt_view_info::input_index): New data member.
7033 (Local_got_offset_visitor::visit): Write input file index.
7034 (Global_got_offset_visitor::visit): Write 0 for input file index.
7035 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7036 with sym_index and input_index.
7037 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7038 incremental info GOT entry; replace got_descriptor with input_index.
7039 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7040 map from input file index to object.
7041 (Sized_relobj_incr::do_layout): Replace direct data member reference
7042 with accessor function.
7043 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7044 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7045 Adjust size of input file info header.
7046 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7047 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7048 (Incremental_input_entry_reader::get_input_section): Adjust size of
7049 input file info header.
7050 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7051 of incremental info GOT entry.
7052 (Incremental_got_plt_reader::get_got_desc): Remove.
7053 (Incremental_got_plt_reader::get_got_symndx): New function.
7054 (Incremental_got_plt_reader::get_got_input_index): New function.
7055 (Sized_incremental_binary::Sized_incremental_binary): Remove
7056 file_status_; add input_objects_.
7057 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7058 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7059 (Sized_incremental_binary::file_is_unchanged): Remove.
7060 (Sized_incremental_binary::set_input_object): New function.
7061 (Sized_incremental_binary::input_object): New function.
7062 (Sized_incremental_binary::file_status_): Remove.
7063 (Sized_incremental_binary::input_objects_): New data member.
7064 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7065 references.
7066 (Sized_relobj_incr::invalid_address): Move to base class.
7067 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7068 class.
7069 (Sized_relobj_incr::do_output_section_offset): Likewise.
7070 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7071 (Sized_relobj_incr::section_offsets_): Likewise.
7072 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7073 function.
7074 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7075 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7076 with accessor function.
7077 (Sized_relobj_file::do_layout): Likewise.
7078 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7079 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7080 (Sized_relobj_file::compute_final_local_value): Replace refs to
7081 section_offsets_ with accessor function.
7082 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7083 * object.h (Relobj::Relobj): Initialize new data members.
7084 (Relobj::add_dyn_reloc): New function.
7085 (Relobj::first_dyn_reloc): New function.
7086 (Relobj::dyn_reloc_count): New function.
7087 (Relobj::first_dyn_reloc_): New data member.
7088 (Relobj::dyn_reloc_count_): New data member.
7089 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7090 references.
7091 (Sized_relobj::Address): New typedef.
7092 (Sized_relobj::invalid_address): Move here from child class.
7093 (Sized_relobj::Sized_relobj): Initialize new data members.
7094 (Sized_relobj::sized_relobj): New function.
7095 (Sized_relobj::is_output_section_offset_invalid): Move here from
7096 child class.
7097 (Sized_relobj::get_output_section_offset): Likewise.
7098 (Sized_relobj::local_has_got_offset): Likewise.
7099 (Sized_relobj::local_got_offset): Likewise.
7100 (Sized_relobj::set_local_got_offset): Likewise.
7101 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7102 (Sized_relobj::clear_got_offsets): New function.
7103 (Sized_relobj::section_offsets): Move here from child class.
7104 (Sized_relobj::do_output_section_offset): Likewise.
7105 (Sized_relobj::do_set_section_offset): Likewise.
7106 (Sized_relobj::Local_got_offsets): Likewise.
7107 (Sized_relobj::local_got_offsets_): Likewise.
7108 (Sized_relobj::section_offsets_): Likewise.
7109 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7110 references.
7111 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7112 class.
7113 (Sized_relobj_file::sized_relobj): New function
7114 (Sized_relobj_file::local_has_got_offset): Move to base class.
7115 (Sized_relobj_file::local_got_offset): Likewise.
7116 (Sized_relobj_file::set_local_got_offset): Likewise.
7117 (Sized_relobj_file::get_output_section_offset): Likewise.
7118 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7119 (Sized_relobj_file::do_output_section_offset): Likewise.
7120 (Sized_relobj_file::do_set_section_offset): Likewise.
7121 (Sized_relobj_file::Local_got_offsets): Likewise.
7122 (Sized_relobj_file::local_got_offsets_): Likewise.
7123 (Sized_relobj_file::section_offsets_): Likewise.
7124 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7125 (all constructors).
7126 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7127 (Output_reloc::get_symbol_index): Likewise.
7128 (Output_reloc::local_section_offset): Likewise.
7129 (Output_reloc::get_address): Likewise.
7130 (Output_reloc::symbol_value): Likewise.
7131 (Output_data_got::reserve_slot): Move to class definition.
7132 (Output_data_got::reserve_local): New function.
7133 (Output_data_got::reserve_slot_for_global): Remove.
7134 (Output_data_got::reserve_global): New function.
7135 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7136 (all constructors, two instantiations).
7137 (Output_reloc::get_relobj): New function (two instantiations).
7138 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7139 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7140 (Output_data_reloc::add_global): Adjust type of relobj.
7141 (Output_data_reloc::add_global_relative): Likewise.
7142 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7143 (Output_data_reloc::add_local): Likewise.
7144 (Output_data_reloc::add_local_relative): Likewise.
7145 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7146 (Output_data_reloc::add_local_section): Likewise.
7147 (Output_data_reloc::add_output_section): Likewise.
7148 (Output_data_reloc::add_absolute): Likewise.
7149 (Output_data_reloc::add_target_specific): Likewise.
7150 (Output_data_got::reserve_slot): Move definition here.
7151 (Output_data_got::reserve_local): New function.
7152 (Output_data_got::reserve_global): New function.
7153 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7154 section_offsets_ with accessor function.
7155 (Sized_relobj_file::write_sections): Likewise.
7156 (Sized_relobj_file::do_relocate_sections): Likewise.
7157 * target.h (Sized_target::reserve_local_got_entry): New function.
7158 (Sized_target::reserve_global_got_entry): New function.
7159 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7160 (Target_x86_64::reserve_global_got_entry): New function.
7161 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7162
4829d394
CC
71632011-05-23 Cary Coutant <ccoutant@google.com>
7164
7165 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7166 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7167 bit when checking got_type.
7168 * incremental.cc (Sized_incremental_binary::setup_readers):
7169 Store symbol table and string table locations; initialize bit vector
7170 of file status flags.
7171 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7172 unchanged files.
7173 (Sized_incremental_binary::do_process_got_plt): New function.
7174 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7175 (Output_section_incremental_inputs::set_final_data_size): Record
7176 file index for each input file.
7177 (Output_section_incremental_inputs::write_got_plt): Store file index
7178 instead of input entry offset for each GOT entry.
7179 * incremental.h
7180 (Incremental_input_entry::Incremental_input_entry): Initialize new
7181 data member.
7182 (Incremental_input_entry::set_offset): Store file index.
7183 (Incremental_input_entry::get_file_index): New function.
7184 (Incremental_input_entry::file_index_): New data member.
7185 (Incremental_binary::process_got_plt): New function.
7186 (Incremental_binary::do_process_got_plt): New function.
7187 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7188 data members.
7189 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7190 (Sized_incremental_binary::set_file_is_unchanged): New function.
7191 (Sized_incremental_binary::file_is_unchanged): New function.
7192 (Sized_incremental_binary::do_process_got_plt): New function.
7193 (Sized_incremental_binary::file_status_): New data member.
7194 (Sized_incremental_binary::main_symtab_loc_): New data member.
7195 (Sized_incremental_binary::main_strtab_loc_): New data member.
7196 * output.cc (Output_data_got::Got_entry::write): Add case
7197 RESERVED_CODE.
7198 (Output_data_got::add_global): Call add_got_entry.
7199 (Output_data_got::add_global_plt): Likewise.
7200 (Output_data_got::add_global_with_rel): Likewise.
7201 (Output_data_got::add_global_with_rela): Likewise.
7202 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7203 (Output_data_got::add_global_pair_with_rela): Likewise.
7204 (Output_data_got::add_local): Call add_got_entry.
7205 (Output_data_got::add_local_plt): Likewise.
7206 (Output_data_got::add_local_with_rel): Likewise.
7207 (Output_data_got::add_local_with_rela): Likewise.
7208 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7209 (Output_data_got::add_local_pair_with_rela): Likewise.
7210 (Output_data_got::reserve_slot): New function.
7211 (Output_data_got::reserve_slot_for_global): New function.
7212 (Output_data_got::add_got_entry): New function.
7213 (Output_data_got::add_got_entry_pair): New function.
7214 (Output_section::add_output_section_data): Edit FIXME.
7215 * output.h
7216 (Output_section_data_build::Output_section_data_build): New
7217 constructor with size parameter.
7218 (Output_data_space::Output_data_space): Likewise.
7219 (Output_data_got::Output_data_got): Initialize new data member; new
7220 constructor with size parameter.
7221 (Output_data_got::add_constant): Call add_got_entry.
7222 (Output_data_got::reserve_slot): New function.
7223 (Output_data_got::reserve_slot_for_global): New function.
7224 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7225 (Output_data_got::add_got_entry): New function.
7226 (Output_data_got::add_got_entry_pair): New function.
7227 (Output_data_got::free_list_): New data member.
7228 * target.h (Sized_target::init_got_plt_for_update): New function.
7229 (Sized_target::register_global_plt_entry): New function.
7230 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7231 Initialize new data member; call init; add constructor with PLT count.
7232 (Output_data_plt_x86_64::init): New function.
7233 (Output_data_plt_x86_64::add_relocation): New function.
7234 (Output_data_plt_x86_64::reserve_slot): New function.
7235 (Output_data_plt_x86_64::free_list_): New data member.
7236 (Target_x86_64::init_got_plt_for_update): New function.
7237 (Target_x86_64::register_global_plt_entry): New function.
7238 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7239 incremental updates.
7240 (Output_data_plt_x86_64::add_relocation): New function.
7241 * testsuite/object_unittest.cc (Object_test): Set default options.
7242
ec69d6da
ILT
72432011-05-16 Ian Lance Taylor <iant@google.com>
7244
7245 * options.h (class General_options): Make -i a synonym for -r.
7246
732e31de
ILT
72472011-05-16 Ian Lance Taylor <iant@google.com>
7248
7249 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7250
403676b5
CC
72512011-05-10 Cary Coutant <ccoutant@google.com>
7252
7253 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7254 strip_all (-s).
7255
5b7b7d6e
ILT
72562011-05-06 Ian Lance Taylor <iant@google.com>
7257
7258 * layout.cc (Layout::layout): If the output section flags change,
7259 update the ordering.
7260
f0f9babf
CC
72612011-04-25 Cary Coutant <ccoutant@google.com>
7262
7263 * incremental-dump.cc (dump_incremental_inputs): Print local
7264 symbol info for each input file.
7265 * incremental.cc
7266 (Output_section_incremental_inputs::set_final_data_size): Add local
7267 symbol info to input file entries in incremental info.
7268 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7269 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7270 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7271 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7272 implementation.
7273 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7274 (Sized_incr_relobj::do_relocate): Write the local symbols.
7275 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7276 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7277 Adjust size of input file header.
7278 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7279 (Incremental_inputs_reader::get_local_symbol_count): New function.
7280 (Incremental_inputs_reader::get_input_section): Adjust size of input
7281 file header.
7282 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7283 (Sized_incr_relobj::This): New typedef.
7284 (Sized_incr_relobj::sym_size): New const data member.
7285 (Sized_incr_relobj::Local_symbol): New struct.
7286 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7287 (Sized_incr_relobj::do_local_symbol_offset): New function.
7288 (Sized_incr_relobj::local_symbol_count_): New data member.
7289 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7290 (Sized_incr_relobj::local_symbol_index_): New data member.
7291 (Sized_incr_relobj::local_symbol_offset_): New data member.
7292 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7293 (Sized_incr_relobj::local_symbols_): New data member.
7294 * object.h (Relobj::output_local_symbol_count): New function.
7295 (Relobj::local_symbol_offset): New function.
7296 (Relobj::do_output_local_symbol_count): New function.
7297 (Relobj::do_local_symbol_offset): New function.
7298 (Sized_relobj::do_output_local_symbol_count): New function.
7299 (Sized_relobj::do_local_symbol_offset): New function.
7300
d0a9ace3
ILT
73012011-04-22 Vladimir Simonov <sv@sw.ru>
7302
7303 * descriptors.cc (set_close_on_exec): New function.
7304 (Descriptors::open): Use set_close_on_exec.
7305 * output.cc (S_ISLNK): Define if not defined.
7306
94a3fc8b
CC
73072011-04-22 Cary Coutant <ccoutant@google.com>
7308
7309 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7310 global symbol map.
7311 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7312 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7313 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7314 relocations.
7315 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7316 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7317 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7318 * incremental.h
7319 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7320 function.
7321 (Incremental_binary::apply_incremental_relocs): New function.
7322 (Incremental_binary::do_apply_incremental_relocs): New function.
7323 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7324 data member.
7325 (Sized_incremental_binary::add_global_symbol): New function.
7326 (Sized_incremental_binary::global_symbol): New function.
7327 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7328 (Sized_incremental_binary::symbol_map_): New data member.
7329 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7330 * target.h (Sized_target::apply_relocation): New function.
7331 * target-reloc.h (apply_relocation): New function.
7332 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7333
c87e4302
DK
73342011-04-22 Doug Kwan <dougkwan@google.com>
7335
7336 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7337 flag of a SHT_ARM_EXIDX section.
2e702c99 7338 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7339 * testsuite/Makefile.in: Regenerate.
7340 * testsuite/arm_exidx_test.s: New file.
7341 * testsuite/arm_exidx_test.sh: Same.
7342
e7782cf6
CC
73432011-04-20 Cary Coutant <ccoutant@google.com>
7344
7345 PR gold/12689
7346 * archive.h (Incremental_archive_entry::Archive_member):
7347 Initialize arg_serial_ (second constructor).
7348
308ecdc7
ILT
73492011-04-17 Ian Lance Taylor <iant@google.com>
7350
7351 * object.cc (Relocate_info::location): Simplify location string.
7352 * errors.cc (Errors::error_at_location): Don't print program
7353 name.
7354 (Errors::warning_at_location): Likewise.
7355 (Errors::undefined_symbol): Likewise.
7356 * testsuite/debug_msg.sh: Update accordingly.
7357
bec5b579
CC
73582011-04-14 Cary Coutant <ccoutant@google.com>
7359
7360 * gold/layout.cc (Layout::symtab_section_offset): New function.
7361 * gold/layout.h (Layout::symtab_section_offset): New function.
7362 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7363
88597d34
ILT
73642011-04-12 Ian Lance Taylor <iant@google.com>
7365
7366 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7367 with MREMAP_MAYMOVE.
7368 * output.h (class Output_file): Add map_is_allocated_ field.
7369 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7370 not available, provide stubs. If mremap is not available, #define
7371 it to gold_mremap.
7372 (MREMAP_MAYMOVE): Define if not defined.
7373 (Output_file::Output_file): Initialize map_is_allocated_.
7374 (Output_file::resize): Check map_is_allocated_.
7375 (Output_file::map_anonymous): If mmap fails, use malloc.
7376 (Output_file::unmap): Don't do anything for an anonymous map.
7377 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7378 is not available, provide stubs.
7379 (File_read::View::~View): Use free rather than delete[].
7380 (File_read::make_view): Use malloc rather than new[]. If mmap
7381 fails, use malloc.
7382 (File_read::find_or_make_view): Use malloc rather than new[].
7383 * gold.h: Remove HAVE_REMAP code.
7384 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7385 exists. Rename mremap to gold_mremap. If mmap is not available
7386 don't do anything.
7387 * configure, config.in: Rebuild.
7388
11e361bc
ILT
73892011-04-11 Ian Lance Taylor <iant@google.com>
7390
7391 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7392 initialize local variable v.
7393
cdc29364
CC
73942011-04-11 Cary Coutant <ccoutant@google.com>
7395
7396 * archive.cc (Archive::include_member): Adjust call to
7397 report_object.
7398 (Add_archive_symbols::run): Track argument serial numbers.
7399 (Lib_group::include_member): Likewise.
7400 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7401 * archive.h (Incremental_archive_entry::Archive_member):
7402 Initialize arg_serial_.
7403 (Archive_member::arg_serial_): New data member.
7404 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7405 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7406 incremental link.
7407 (Sized_dynobj::do_for_all_local_got_entries): New function.
7408 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7409 function.
7410 * fileread.cc (get_mtime): New function.
7411 * fileread.h (get_mtime): New function.
7412 * gold.cc (queue_initial_tasks): Check for incremental update.
7413 (process_incremental_input): New function.
7414 (queue_middle_tasks): Don't force valid target for incremental
7415 update.
7416 * incremental-dump.cc (find_input_containing_global): Adjust
7417 size of symbol info entry.
7418 (dump_incremental_inputs): Dump argument serial number and
7419 in_system_directory flag; bias shndx by 1; print symbol names
7420 when dumping per-file symbol lists; use new symbol info readers.
7421 * incremental.cc
7422 (Output_section_incremental_inputs:update_data_size): New function.
7423 (Sized_incremental_binary::setup_readers): Setup input readers
7424 for each input file; build maps for files added from libraries
7425 and scripts.
7426 (Sized_incremental_binary::check_input_args): New function.
7427 (Sized_incremental_binary::do_check_inputs): Build map of argument
7428 serial numbers to input arguments.
7429 (Sized_incremental_binary::do_file_has_changed): Rename
7430 do_file_is_unchanged to this; compare file modification times.
7431 (Sized_incremental_binary::do_init_layout): New function.
7432 (Sized_incremental_binary::do_reserve_layout): New function.
7433 (Sized_incremental_binary::do_get_input_reader): Remove.
7434 (Sized_incremental_binary::get_symtab_view): New function.
7435 (Incremental_checker::can_incrementally_link_output_file): Remove.
7436 (Incremental_inputs::report_command_line): Exclude --debug options.
7437 (Incremental_inputs::report_archive_begin): Add parameter; track
7438 argument serial numbers; don't put input file entry for archive
7439 before archive members.
7440 (Incremental_inputs::report_archive_end): Put input file entry
7441 for archive after archive members.
7442 (Incremental_inputs::report_object): Add parameter; track argument
7443 serial numbers and in_system_directory flag.
7444 (Incremental_inputs::report_script): Add parameter; track argument
7445 serial numbers.
7446 (Output_section_incremental_inputs::set_final_data_size): Adjust
7447 size of symbol info entry; check for forwarding symbols.
7448 (Output_section_incremental_inputs::write_input_files): Write
7449 in_system_directory flag and argument serial number.
7450 (Output_section_incremental_inputs::write_info_blocks): Map section
7451 indices between incremental info and original input file; store
7452 input section index for each symbol.
7453 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7454 change operator() to visit().
7455 (class Global_got_offset_visitor): Likewise.
7456 (class Global_symbol_visitor_got_plt):
7457 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7458 classes.
7459 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7460 (Sized_incr_relobj::do_read_symbols): New function.
7461 (Sized_incr_relobj::do_layout): New function.
7462 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7463 (Sized_incr_relobj::do_add_symbols): New function.
7464 (Sized_incr_relobj::do_should_include_member): New function.
7465 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7466 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7467 (Sized_incr_relobj::do_section_size): New function.
7468 (Sized_incr_relobj::do_section_name): New function.
7469 (Sized_incr_relobj::do_section_contents): New function.
7470 (Sized_incr_relobj::do_section_flags): New function.
7471 (Sized_incr_relobj::do_section_entsize): New function.
7472 (Sized_incr_relobj::do_section_address): New function.
7473 (Sized_incr_relobj::do_section_type): New function.
7474 (Sized_incr_relobj::do_section_link): New function.
7475 (Sized_incr_relobj::do_section_info): New function.
7476 (Sized_incr_relobj::do_section_addralign): New function.
7477 (Sized_incr_relobj::do_initialize_xindex): New function.
7478 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7479 (Sized_incr_relobj::do_read_relocs): New function.
7480 (Sized_incr_relobj::do_gc_process_relocs): New function.
7481 (Sized_incr_relobj::do_scan_relocs): New function.
7482 (Sized_incr_relobj::do_count_local_symbols): New function.
7483 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7484 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7485 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7486 (Sized_incr_relobj::do_relocate): New function.
7487 (Sized_incr_relobj::do_set_section_offset): New function.
7488 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7489 (Sized_incr_dynobj::do_read_symbols): New function.
7490 (Sized_incr_dynobj::do_layout): New function.
7491 (Sized_incr_dynobj::do_add_symbols): New function.
7492 (Sized_incr_dynobj::do_should_include_member): New function.
7493 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7494 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7495 (Sized_incr_dynobj::do_section_size): New function.
7496 (Sized_incr_dynobj::do_section_name): New function.
7497 (Sized_incr_dynobj::do_section_contents): New function.
7498 (Sized_incr_dynobj::do_section_flags): New function.
7499 (Sized_incr_dynobj::do_section_entsize): New function.
7500 (Sized_incr_dynobj::do_section_address): New function.
7501 (Sized_incr_dynobj::do_section_type): New function.
7502 (Sized_incr_dynobj::do_section_link): New function.
7503 (Sized_incr_dynobj::do_section_info): New function.
7504 (Sized_incr_dynobj::do_section_addralign): New function.
7505 (Sized_incr_dynobj::do_initialize_xindex): New function.
7506 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7507 (make_sized_incremental_object): New function.
7508 (Incremental_library::copy_unused_symbols): New function.
7509 (Incremental_library::do_for_all_unused_symbols): New function.
7510 * incremental.h (enum Incremental_input_flags): New type.
7511 (class Incremental_checker): Remove.
7512 (Incremental_input_entry::Incremental_input_entry): Add argument
7513 serial number.
7514 (Incremental_input_entry::arg_serial): New function.
7515 (Incremental_input_entry::set_is_in_system_directory): New function.
7516 (Incremental_input_entry::is_in_system_directory): New function.
7517 (Incremental_input_entry::arg_serial_): New data member.
7518 (Incremental_input_entry::is_in_system_directory_): New data member.
7519 (class Script_info): Move here from script.h.
7520 (Script_info::Script_info): Add filename parameter.
7521 (Script_info::filename): New function.
7522 (Script_info::filename_): New data member.
7523 (Incremental_script_entry::Incremental_script_entry): Add argument
7524 serial number.
7525 (Incremental_object_entry::Incremental_object_entry): Likewise.
7526 (Incremental_object_entry::add_input_section): Build list of input
7527 sections with map to original shndx.
7528 (Incremental_object_entry::get_input_section_index): New function.
7529 (Incremental_object_entry::shndx_): New data member.
7530 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7531 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7532 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7533 serial number.
7534 (Incremental_inputs::report_archive_begin): Likewise.
7535 (Incremental_inputs::report_object): Likewise.
7536 (Incremental_inputs::report_script): Likewise.
7537 (class Incremental_global_symbol_reader): New class.
7538 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7539 and store flags and input file type.
7540 (Incremental_input_entry_reader::arg_serial): New function.
7541 (Incremental_input_entry_reader::type): Extract type from flags.
7542 (Incremental_input_entry_reader::is_in_system_directory): New function.
7543 (Incremental_input_entry_reader::get_input_section_count): Call
7544 accessor function for type.
7545 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7546 function for type; adjust size of global symbol entry.
7547 (Incremental_input_entry_reader::get_global_symbol_count): Call
7548 accessor function for type.
7549 (Incremental_input_entry_reader::get_object_count): Likewise.
7550 (Incremental_input_entry_reader::get_object_offset): Likewise.
7551 (Incremental_input_entry_reader::get_member_count): Likewise.
7552 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7553 (Incremental_input_entry_reader::get_member_offset): Likewise.
7554 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7555 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7556 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7557 (Incremental_input_entry_reader::get_global_symbol_reader): New
7558 function.
7559 (Incremental_input_entry_reader::get_output_symbol_index): New
7560 function.
7561 (Incremental_input_entry_reader::type_): Remove.
7562 (Incremental_input_entry_reader::flags_): New data member.
7563 (Incremental_inputs_reader::input_file_offset): New function.
7564 (Incremental_inputs_reader::input_file_index): New function.
7565 (Incremental_inputs_reader::input_file): Call input_file_offset.
7566 (Incremental_inputs_reader::input_file_at_offset): New function.
7567 (Incremental_relocs_reader::get_r_type): Reformat.
7568 (Incremental_relocs_reader::get_r_shndx): Reformat.
7569 (Incremental_relocs_reader::get_r_offset): Reformat.
7570 (Incremental_relocs_reader::data): New function.
7571 (Incremental_binary::Incremental_binary): Initialize new data members.
7572 (Incremental_binary::check_inputs): Add cmdline parameter.
7573 (Incremental_binary::file_is_unchanged): Remove.
7574 (Input_reader::arg_serial): New function.
7575 (Input_reader::get_unused_symbol_count): New function.
7576 (Input_reader::get_unused_symbol): New function.
7577 (Input_reader::do_arg_serial): New function.
7578 (Input_reader::do_get_unused_symbol_count): New function.
7579 (Input_reader::do_get_unused_symbol): New function.
7580 (Incremental_binary::input_file_count): New function.
7581 (Incremental_binary::get_input_reader): Change signature to use
7582 index instead of filename.
7583 (Incremental_binary::file_has_changed): New function.
7584 (Incremental_binary::get_input_argument): New function.
7585 (Incremental_binary::get_library): New function.
7586 (Incremental_binary::get_script_info): New function.
7587 (Incremental_binary::init_layout): New function.
7588 (Incremental_binary::reserve_layout): New function.
7589 (Incremental_binary::output_file): New function.
7590 (Incremental_binary::do_check_inputs): New function.
7591 (Incremental_binary::do_file_is_unchanged): Remove.
7592 (Incremental_binary::do_file_has_changed): New function.
7593 (Incremental_binary::do_init_layout): New function.
7594 (Incremental_binary::do_reserve_layout): New function.
7595 (Incremental_binary::do_input_file_count): New function.
7596 (Incremental_binary::do_get_input_reader): Change signature.
7597 (Incremental_binary::input_args_map_): New data member.
7598 (Incremental_binary::library_map_): New data member.
7599 (Incremental_binary::script_map_): New data member.
7600 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7601 new data members.
7602 (Sized_incremental_binary::output_section): New function.
7603 (Sized_incremental_binary::inputs_reader): Add const.
7604 (Sized_incremental_binary::symtab_reader): Add const.
7605 (Sized_incremental_binary::relocs_reader): Add const.
7606 (Sized_incremental_binary::got_plt_reader): Add const.
7607 (Sized_incremental_binary::get_symtab_view): New function.
7608 (Sized_incremental_binary::Inputs_reader): New typedef.
7609 (Sized_incremental_binary::Input_entry_reader): New typedef.
7610 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7611 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7612 (Sized_incremental_binary::do_file_has_changed): New function.
7613 (Sized_incremental_binary::do_init_layout): New function.
7614 (Sized_incremental_binary::do_reserve_layout): New function.
7615 (Sized_input_reader::Inputs_reader): Remove.
7616 (Sized_input_reader::Input_entry_reader): Remove.
7617 (Sized_input_reader::do_arg_serial): New function.
7618 (Sized_input_reader::do_get_unused_symbol_count): New function.
7619 (Sized_input_reader::do_get_unused_symbol): New function.
7620 (Sized_incremental_binary::do_input_file_count): New function.
7621 (Sized_incremental_binary::do_get_input_reader): Change signature;
7622 use index instead of filename.
7623 (Sized_incremental_binary::section_map_): New data member.
7624 (Sized_incremental_binary::input_entry_readers_): New data member.
7625 (class Sized_incr_relobj): New class.
7626 (class Sized_incr_dynobj): New class.
7627 (make_sized_incremental_object): New function.
7628 (class Incremental_library): New class.
7629 * layout.cc (Free_list::num_lists): New static data member.
7630 (Free_list::num_nodes): New static data member.
7631 (Free_list::num_removes): New static data member.
7632 (Free_list::num_remove_visits): New static data member.
7633 (Free_list::num_allocates): New static data member.
7634 (Free_list::num_allocate_visits): New static data member.
7635 (Free_list::init): New function.
7636 (Free_list::remove): New function.
7637 (Free_list::allocate): New function.
7638 (Free_list::dump): New function.
7639 (Free_list::print_stats): New function.
7640 (Layout_task_runner::run): Resize output file for incremental updates.
7641 (Layout::Layout): Initialize new data members.
7642 (Layout::set_incremental_base): New function.
7643 (Layout::init_fixed_output_section): New function.
7644 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7645 incremental updates.
7646 (Layout::create_gold_note): Do not create gold note section for
7647 incremental updates.
7648 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7649 for incremental updates.
7650 (Layout::set_section_offsets): For incremental updates, allocate space
7651 from free list.
7652 (Layout::create_symtab_sections): Layout with offsets relative to
7653 start of section; for incremental updates, allocate space from free
7654 list.
7655 (Layout::create_shdrs): For incremental updates, allocate space from
7656 free list.
7657 (Layout::finish_dynamic_section): For incremental updates, do not
7658 check --as-needed (fixed in subsequent patch).
7659 * layout.h (class Free_list): New class.
7660 (Layout::set_incremental_base): New function.
7661 (Layout::incremental_base): New function.
7662 (Layout::init_fixed_output_section): New function.
7663 (Layout::allocate): New function.
7664 (Layout::incremental_base_): New data member.
7665 (Layout::free_list_): New data member.
7666 * main.cc (main): Print Free_list statistics.
7667 * object.cc (Relobj::finalize_incremental_relocs): Add
7668 clear_counts parameter; clear counts only when clear_counts is set.
7669 (Sized_relobj::Sized_relobj): Initialize new base class.
7670 (Sized_relobj::do_layout): Don't report special sections.
7671 (Sized_relobj::do_for_all_local_got_entries): New function.
7672 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7673 symtab_off to all symbol table offsets.
7674 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7675 * object.h (class Got_offset_list): Move to top of file.
7676 (Object::Object): Allow case where input_file == NULL.
7677 (Object::~Object): Likewise.
7678 (Object::input_file): Assert that input_file != NULL.
7679 (Object::lock): Allow case where input_file == NULL.
7680 (Object::unlock): Likewise.
7681 (Object::is_locked): Likewise.
7682 (Object::token): Likewise.
7683 (Object::release): Likewise.
7684 (Object::is_incremental): New function.
7685 (Object::get_mtime): New function.
7686 (Object::for_all_local_got_entries): New function.
7687 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7688 (Object::set_is_in_system_directory): New function.
7689 (Object::is_in_system_directory): New function.
7690 (Object::do_is_incremental): New function.
7691 (Object::do_get_mtime): New function.
7692 (Object::do_for_all_local_got_entries): New function.
7693 (Object::is_in_system_directory_): New data member.
7694 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7695 (class Sized_relobj_base): New class.
7696 (class Sized_relobj): Derive from Sized_relobj_base.
7697 (class Sized_relobj::Symbols): Redeclare from base class.
7698 (class Sized_relobj::local_got_offset_list): Remove.
7699 (class Sized_relobj::Output_sections): Redeclare from base class.
7700 (class Sized_relobj::do_for_all_local_got_entries): New function.
7701 (class Sized_relobj::write_local_symbols): Add offset parameter.
7702 (class Sized_relobj::local_symbol_offset_): Update comment.
7703 (class Sized_relobj::local_dynsym_offset_): Update comment.
7704 * options.cc (Input_arguments::add_file): Remove const.
7705 * options.h (Input_file_argument::Input_file_argument):
7706 Initialize arg_serial_ (all constructors).
7707 (Input_file_argument::set_arg_serial): New function.
7708 (Input_file_argument::arg_serial): New function.
7709 (Input_file_argument::arg_serial_): New data member.
7710 (Input_arguments::Input_arguments): Initialize file_count_.
7711 (Input_arguments::add_file): Remove const.
7712 (Input_arguments::number_of_input_files): New function.
7713 (Input_arguments::file_count_): New data member.
7714 (Command_line::number_of_input_files): Call
7715 Input_arguments::number_of_input_files.
7716 * output.cc (Output_segment_headers::Output_segment_headers):
7717 Set current size.
7718 (Output_section::Input_section::current_data_size): New function.
7719 (Output_section::Output_section): Initialize new data members.
7720 (Output_section::add_input_section): Don't do merge sections for
7721 an incremental link; allocate space from free list for an
7722 incremental update.
7723 (Output_section::add_output_section_data): Allocate space from
7724 free list for an incremental update.
7725 (Output_section::update_data_size): New function.
7726 (Output_section::set_fixed_layout): New function.
7727 (Output_section::reserve): New function.
7728 (Output_segment::set_section_addresses): Remove const.
7729 (Output_segment::set_section_list_addresses): Remove const; allocate
7730 space from free list for an incremental update.
7731 (Output_segment::set_offset): Adjust size of RELRO segment for an
7732 incremental update.
7733 * output.h (Output_data::current_data_size): Move here from
7734 child classes.
7735 (Output_data::pre_finalize_data_size): New function.
7736 (Output_data::update_data_size): New function.
7737 (Output_section_headers::update_data_size): new function.
7738 (Output_section_data_build::current_data_size): Move to Output_data.
7739 (Output_data_strtab::update_data_size): New function.
7740 (Output_section::current_data_size): Move to Output_data.
7741 (Output_section::set_fixed_layout): New function.
7742 (Output_section::has_fixed_layout): New function.
7743 (Output_section::reserve): New function.
7744 (Output_section::update_data_size): New function.
7745 (Output_section::has_fixed_layout_): New data member.
7746 (Output_section::free_list_): New data member.
7747 (Output_segment::set_section_addresses): Remove const.
7748 (Output_segment::set_section_list_addresses): Remove const.
7749 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7750 New function.
7751 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7752 New function.
7753 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7754 parameter when calling Add_symbols constructor; store argument
7755 serial number for members of a lib group.
7756 (Add_symbols::locks): Allow case where token == NULL.
7757 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7758 (Read_member::~Read_member): New function.
7759 (Read_member::is_runnable): New function.
7760 (Read_member::locks): New function.
7761 (Read_member::run): New function.
7762 (Check_script::~Check_script): New function.
7763 (Check_script::is_runnable): New function.
7764 (Check_script::locks): New function.
7765 (Check_script::run): New function.
7766 (Check_library::~Check_library): New function.
7767 (Check_library::is_runnable): New function.
7768 (Check_library::locks): New function.
7769 (Check_library::run): New function.
7770 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7771 (Add_symbols::library_): New data member.
7772 (class Read_member): New class.
7773 (class Check_script): New class.
7774 (class Check_library): New class.
7775 * reloc.cc (Read_relocs::is_runnable): Allow case where
7776 token == NULL.
7777 (Read_relocs::locks): Likewise.
7778 (Scan_relocs::locks): Likewise.
7779 (Relocate_task::locks): Likewise.
7780 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7781 to clear counters.
7782 (Sized_relobj::incremental_relocs_scan): Fix comment.
7783 (Sized_relobj::do_relocate): Pass output file offset to
7784 write_local_symbols.
7785 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7786 from class declaration.
7787 * script.cc (read_input_script): Allocate Script_info; pass
7788 argument serial number to report_script.
7789 * script.h (class Script_info): Move to incremental.h.
7790 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7791 * symtab.h (Symbol_table::add_from_incrobj): New function.
7792 (Symbol_table::set_file_offset): New function.
7793
b961d0d7
CC
77942011-04-05 Cary Coutant <ccoutant@google.com>
7795
7796 * incremental-dump.cc (dump_incremental_inputs): Change signature
7797 to take a Sized_incremental_binary; change caller. Use readers
7798 in Sized_incremental_binary.
7799 * incremental.cc
7800 (Sized_incremental_binary::find_incremental_inputs_sections):
7801 Rename do_find_incremental_inputs_sections to this.
7802 (Sized_incremental_binary::setup_readers): New function.
7803 (Sized_incremental_binary::do_check_inputs): Check
7804 has_incremental_info_ flag; move setup code to setup_readers;
7805 use input readers.
7806 (Sized_incremental_binary::do_file_is_unchanged): New function.
7807 (Sized_incremental_binary::do_get_input_reader): New function.
7808 * incremental.h (class Incremental_binary): Move to end of file.
7809 (Incremental_binary::file_is_unchanged): New function.
7810 (Incremental_binary::do_file_is_unchanged): New function.
7811 (Incremental_binary::Input_reader): New class.
7812 (Incremental_binary::get_input_reader): New function.
7813 (class Sized_incremental_binary): Move to end of file.
7814 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7815 input section reader classes.
7816 (Sized_incremental_binary::has_incremental_info): New function.
7817 (Sized_incremental_binary::inputs_reader): New function.
7818 (Sized_incremental_binary::symtab_reader): New function.
7819 (Sized_incremental_binary::relocs_reader): New function.
7820 (Sized_incremental_binary::got_plt_reader): New function.
7821 (Sized_incremental_binary::do_file_is_unchanged): New function.
7822 (Sized_incremental_binary::Sized_input_reader): New class.
7823 (Sized_incremental_binary::get_input_reader): New function.
7824 (Sized_incremental_binary::find_incremental_inputs_sections):
7825 Rename do_find_incremental_inputs_sections to this.
7826 (Sized_incremental_binary::setup_readers): New function.
7827 (Sized_incremental_binary::has_incremental_info_): New data member.
7828 (Sized_incremental_binary::inputs_reader_): New data member.
7829 (Sized_incremental_binary::symtab_reader_): New data member.
7830 (Sized_incremental_binary::relocs_reader_): New data member.
7831 (Sized_incremental_binary::got_plt_reader_): New data member.
7832 (Sized_incremental_binary::current_input_file_): New data member.
7833
a869183f
PP
78342011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7835
7836 PR gold/12640
7837 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7838 violation.
7839
78402011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7841
7842 * archive.cc (Archive::include_member): Adjust call to report_object.
7843 (Add_archive_symbols::run): Add script_info to call to
7844 report_archive_begin.
7845 (Lib_group::include_member): Adjust call to report_object.
7846 (Add_lib_group_symbols::run): Adjust call to report_object.
7847 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7848 blocks. Add object count for script input files.
7849 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7850 script_info parameter; change all callers.
7851 (Incremental_inputs::report_object): Add script_info parameter;
7852 change all callers.
7853 (Incremental_inputs::report_script): Store backpointer to
7854 incremental info entry.
7855 (Output_section_incremental_inputs::set_final_data_size): Record
7856 additional information for scripts.
7857 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7858 * incremental.h (Incremental_script_entry::add_object): New function.
7859 (Incremental_script_entry::get_object_count): New function.
7860 (Incremental_script_entry::get_object): New function.
7861 (Incremental_script_entry::objects_): New data member; adjust
7862 constructor.
7863 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7864 (Incremental_inputs::report_object): Add script_info parameter.
7865 (Incremental_inputs_reader::get_object_count): New function.
7866 (Incremental_inputs_reader::get_object_offset): New function.
7867 * options.cc (Input_arguments::add_file): Return reference to
7868 new input argument.
7869 * options.h (Input_argument::set_script_info): New function.
7870 (Input_argument::script_info): New function.
7871 (Input_argument::script_info_): New data member; adjust all
7872 constructors.
7873 (Input_file_group::add_file): Return reference to new input argument.
7874 (Input_file_lib::add_file): Likewise.
7875 (Input_arguments::add_file): Likewise.
7876 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7877 * script.cc (Parser_closure::Parser_closure): Add script_info
7878 parameter; adjust all callers.
7879 (Parser_closure::script_info): New function.
7880 (Parser_closure::script_info_): New data member.
7881 (read_input_script): Report scripts earlier to incremental info.
7882 (script_add_file): Set script_info in Input_argument.
7883 (script_add_library): Likewise.
7884 * script.h (Script_options::Script_info): Rewrite class.
7885
a869183f 78862011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7887
7888 * archive.cc (Library_base::should_include_member): Move
7889 method here from class Archive.
7890 (Archive::Archive): Initialize base class.
7891 (Archive::should_include_member): Move to base class.
7892 (Archive::do_for_all_unused_symbols): New function.
7893 (Add_archive_symbols::run): Remove redundant access to
7894 incremental_inputs.
7895 (Lib_group::Lib_group): Initialize base class.
7896 (Lib_group::do_filename): New function.
7897 (Lib_group::include_member): Pass pointer to Lib_group to
7898 report_object.
7899 (Lib_group::do_for_all_unused_symbols): New function.
7900 (Add_lib_group_symbols::run): Report archive information for
7901 incremental links.
7902 * archive.h (class Library_base): New base class.
7903 (class Archive): Derive from Library_base.
7904 (Archive::filename): Move to base class.
7905 (Archive::set_incremental_info): Likewise.
7906 (Archive::incremental_info): Likewise.
7907 (Archive::Should_include): Likewise.
7908 (Archive::should_include_member): Likewise.
7909 (Archive::Armap_entry): Remove.
7910 (Archive::Unused_symbol_iterator): Remove.
7911 (Archive::unused_symbols_begin): Remove.
7912 (Archive::unused_symbols_end): Remove.
7913 (Archive::do_filename): New function.
7914 (Archive::do_get_mtime): New function.
7915 (Archive::do_for_all_unused_symbols): New function.
7916 (Archive::task_): Move to base class.
7917 (Archive::incremental_info_): Likewise.
7918 (class Lib_group): Derive from Library_base.
7919 (Lib_group::do_filename): New function.
7920 (Lib_group::do_get_mtime): New function.
7921 (Lib_group::do_for_all_unused_symbols): New function.
7922 (Lib_group::task_): Move to base class.
7923 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7924 function.
7925 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7926 function.
7927 * incremental.cc (Incremental_inputs::report_archive_begin):
7928 Use Library_base; call library's get_mtime; add incremental inputs
7929 entry before members.
7930 (class Unused_symbol_visitor): New class.
7931 (Incremental_inputs::report_archive_end): Use Library_base; use
7932 visitor class to record unused symbols; don't add incremental inputs
7933 entry after members.
7934 (Incremental_inputs::report_object): Use Library_base.
7935 * incremental.h
7936 (Incremental_archive_entry::Incremental_archive_entry): Remove
7937 unused Archive parameter.
7938 (Incremental_inputs::report_archive_begin): Use Library_base.
7939 (Incremental_inputs::report_archive_end): Likewise.
7940 (Incremental_inputs::report_object): Likewise.
7941 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7942 function.
7943 * object.h (Object::for_all_global_symbols): New function.
7944 (Object::do_for_all_global_symbols): New function.
7945 (Sized_relobj::do_for_all_global_symbols): New function.
7946 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7947 function.
7948 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7949 function.
7950
61ab3e40
ILT
79512011-03-27 Ian Lance Taylor <iant@google.com>
7952
7953 * archive.cc (Archive::interpret_header): Return -1 if something
7954 goes wrong. Change callers accordingly.
7955
30e1f9e6
CC
79562011-03-25 Cary Coutant <ccoutant@google.com>
7957
7958 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7959 * testsuite/Makefile.in: Regenerate.
7960
9370ce59 79612011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7962
7963 * plugin.cc (get_view): New.
7964 (Plugin::load): Pass get_view to the plugin.
7965 (Plugin_manager::get_view): New.
7966
9312bb0a
ILT
79672011-03-21 Ian Lance Taylor <iant@google.com>
7968
7969 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7970 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7971
7e12ba9e
ST
79722011-03-21 Sriraman Tallam <tmsriram@google.com>
7973
7974 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7975 Change == to -eq.
7976 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7977 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7978 Change == to -eq.
7979 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7980 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7981
fd7a005d
ILT
79822011-03-14 Ian Lance Taylor <iant@google.com>
7983
7984 * script-sections.cc (Sort_output_sections::script_compare):
7985 Rename from is_before, change return type.
7986 (Sort_output_sections::operator()): Adjust accordingly.
7987
ed16fd1b
ILT
79882011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7989
7990 PR gold/12572
7991 * testsuite/odr_violation2.cc: Add comment to make all error line
7992 numbers double digits.
7993 * testsuite/debug_msg.sh: Adjust expected errors.
7994
71ff8986
ILT
79952011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7996
7997 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7998 but mark earlier ones as non-canonical
7999 (offset_to_iterator): Update search target and example
8000 (do_addr2line): Return extra lines in a vector*
8001 (format_file_lineno): Extract from do_addr2line
8002 (one_addr2line): Add vector* out-param
8003 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
8004 when a lineno entry appeared last for its instruction
8005 (Dwarf_line_info): Add vector* out-param
8006 * object.cc (Relocate_info): Pass NULL for the vector* out-param
8007 * symtab.cc (Odr_violation_compare): Include the lineno in the
8008 comparison again.
8009 (linenos_from_loc): New. Combine the canonical line for an
8010 address with its other lines.
8011 (True_if_intersect): New. Helper functor to make
8012 std::set_intersection a query.
8013 (detect_odr_violations): Compare sets of lines instead of just
8014 one line for each function. This became less deterministic, but
8015 has fewer false positives.
8016 * symtab.h: Declarations.
8017 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8018 mix an optimized and non-optimized object in the same binary
8019 (odr_violation2.so): Same.
8020 * testsuite/Makefile.in: Regenerate from Makefile.am.
8021 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8022 * testsuite/debug_msg.sh: Update line numbers and add
8023 assertions.
8024 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8025 non-optimized context.
8026 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8027 isn't inlined, and use OdrDerived in an optimized context.
8028 * testsuite/odr_header1.h: Defines OdrDerived, where
8029 optimization will change the
8030 first-instruction-in-the-destructor's file and line number.
8031 * testsuite/odr_header2.h: Defines OdrBase.
8032
a19fefdc
ILT
80332011-03-09 Ian Lance Taylor <iant@google.com>
8034
8035 * fileread.cc (File_read::clear_views): Don't delete the whole
8036 file view.
8037
ecb351e9
ILT
80382011-03-08 Ian Lance Taylor <iant@google.com>
8039
8040 PR gold/12525
8041 * fileread.cc: #include <climits>.
8042 (GOLD_IOV_MAX): Define.
8043 (File_read::read_multiple): Limit number of entries by iov_max.
8044 * fileread.h (class File_read): Always set max_readv_entries to
8045 128.
8046
b821d13c
ILT
80472011-03-07 Ian Lance Taylor <iant@google.com>
8048
8049 PR gold/12525
8050 * options.h (class General_options): Add -dy and -dn.
8051
89243142
CC
80522011-03-02 Cary Coutant <ccoutant@google.com>
8053
8054 * testsuite/script_test_9.t: Add TLS segment.
8055
d0773f31
ILT
80562011-03-02 Simon Baldwin <simonb@google.com>
8057
8058 * configure.ac: Add check for gnu_indirect_function support in
8059 the toolchain building binutils.
8060 * configure: Rebuild.
8061
9370ce59 80622011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8063
8064 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8065 plugin only symbols.
8066 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8067 in plugin files as not needed in the symbol table.
8068
4cf7a849
ST
80692011-02-11 Sriraman Tallam <tmsriram@google.com>
8070
8071 * output.cc (Output_section::add_input_section): Delay fill
8072 generation for section ordering.
8073
b578bd7d
ILT
80742011-02-09 Ian Lance Taylor <iant@google.com>
8075
8076 PR gold/12316
8077 * object.h (class Sized_relobj): Remove clear_local_symbols.
8078 * reloc.cc (Sized_relobj::do_relocate): Don't call
8079 clear_local_symbols.
8080
9370ce59 80812011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8082
8083 * plugin.cc (is_visible_from_outside): Return true for symbols
8084 in the -u option.
8085
55382fb7
ILT
80862011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8087
8088 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8089 filename.
8090
4e271fff
ST
80912011-02-02 Sriraman Tallam <tmsriram@google.com>
8092
8093 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8094 to std::string.
4e271fff 8095 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8096 section_name to be std::string.
4e271fff
ST
8097 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8098
d433c3ac
ILT
80992011-01-25 Ian Lance Taylor <iant@google.com>
8100
8101 * script.cc (script_add_extern): Rewrite to use
8102 add_symbol_reference.
8103
880473a6
DK
81042011-01-25 Doug Kwan <dougkwan@google.com>
8105
d433c3ac 8106 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8107
f30f86fa
ILT
81082011-01-24 Ian Lance Taylor <iant@google.com>
8109
8110 * options.h (class General_options): Accept
8111 --no-detect-odr-violations.
8112
8e51a0b9
ILT
81132011-01-24 Ian Lance Taylor <iant@google.com>
8114
8115 * version.cc (version_string): Bump to 1.11.
8116
0f3b89d8
ILT
81172011-01-24 Ian Lance Taylor <iant@google.com>
8118
8119 * plugin.cc (class Plugin_rescan): Define new class.
8120 (Plugin_manager::claim_file): Set any_claimed_.
8121 (Plugin_manager::save_archive): New function.
8122 (Plugin_manager::save_input_group): New function.
8123 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8124 necessary.
8125 (Plugin_manager::new_undefined_symbol): New function.
8126 (Plugin_manager::rescan): New function.
8127 (Plugin_manager::rescannable_defines): New function.
8128 (Plugin_manager::add_input_file): Set any_added_.
8129 * plugin.h (class Plugin_manager): define new fields rescannable_,
8130 undefined_symbols_, any_claimed_, and any_added_. Declare
8131 Plugin_rescan as friend. Declare new functions.
8132 (Plugin_manager::Rescannable): Define type.
8133 (Plugin_manager::Rescannable_list): Define type.
8134 (Plugin_manager::Undefined_symbol_list): Define type.
8135 (Plugin_manager::Plugin_manager): Initialize new fields.
8136 * archive.cc (Archive::defines_symbol): New function.
8137 (Add_archive_symbols::run): Pass archive to plugins if any.
8138 * archive.h (class Archive): Declare defines_symbol.
8139 * readsyms.cc (Input_group::~Input_group): New function.
8140 (Finish_group::run): Pass input_group to plugins if any.
8141 * readsyms.h (class Input_group): Declare destructor.
8142 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8143 any.
8144
3bb951e5
ILT
81452011-01-10 Ian Lance Taylor <iant@google.com>
8146
8147 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8148 section as relro.
8149 (Layout::set_segment_offsets): Reset increase_relro before calling
8150 set_section_addresses a second time.
8151
0aa45fac
CC
81522011-01-04 Cary Coutant <ccoutant@google.com>
8153
8154 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8155 sections before NOBITS sections.
8156
0db46eb4
L
81572011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8158
8159 * version.cc (print_version): Update copyright to 2011.
8160
829c9745
CC
81612010-12-23 Cary Coutant <ccoutant@google.com>
8162
8163 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8164 of OS to this->add. Add OD parameter to second form of the function.
8165
7500420b
ILT
81662010-12-20 Ian Lance Taylor <iant@google.com>
8167
8168 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8169 second of two consecutive entries with same offset.
8170
f8e9a930
RW
81712010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8172
8173 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8174 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8175 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8176 to avoid unneeded links against $(LDADD).
8177 * testsuite/Makefile.in: Regenerate.
8178
2fbb4320
ILT
81792010-12-15 Ian Lance Taylor <iant@google.com>
8180
8181 PR gold/12324
8182 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8183 for R_X86_64_32 and R_X86_64_PC32.
8184 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8185 ver_matching_def_pic.o.
8186 (ver_matching_def_pic.o): New target.
8187
fedb228d
RW
81882010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8189
8190 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8191 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8192 Move definition before File_read::View member definitions.
8193 (File_read::View::~View): Initialize and hold lock before
8194 updating current_mapped_bytes.
8195
9b547ce6
RW
81962010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8197
8198 * dwarf_reader.cc: Remove outdated comment.
8199 * gold-threads.cc: Fix typo in error message.
8200 * archive.cc: Fix typos in comments.
8201 * archive.h: Likewise.
8202 * arm-reloc-property.cc: Likewise.
8203 * arm-reloc-property.h: Likewise.
8204 * arm-reloc.def: Likewise.
8205 * arm.cc: Likewise.
8206 * attributes.h: Likewise.
8207 * cref.cc: Likewise.
8208 * ehframe.cc: Likewise.
8209 * fileread.h: Likewise.
8210 * gold.h: Likewise.
8211 * i386.cc: Likewise.
8212 * icf.cc: Likewise.
8213 * incremental.h: Likewise.
8214 * int_encoding.cc: Likewise.
8215 * layout.h: Likewise.
8216 * main.cc: Likewise.
8217 * merge.h: Likewise.
8218 * object.cc: Likewise.
8219 * object.h: Likewise.
8220 * options.cc: Likewise.
8221 * readsyms.cc: Likewise.
8222 * reduced_debug_output.cc: Likewise.
8223 * reloc.cc: Likewise.
8224 * script-sections.cc: Likewise.
8225 * sparc.cc: Likewise.
8226 * symtab.h: Likewise.
8227 * target-reloc.h: Likewise.
8228 * target.cc: Likewise.
8229 * target.h: Likewise.
8230 * timer.cc: Likewise.
8231 * timer.h: Likewise.
8232 * x86_64.cc: Likewise.
8233
83e17bd5
CC
82342010-12-09 Cary Coutant <ccoutant@google.com>
8235
8236 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8237 stack.
8238 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8239 parameter; change all callers.
8240 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8241 * options.h (warn_execstack): New option.
8242
017257f8
DK
82432010-12-07 Doug Kwan <dougkwan@google.com>
8244
8245 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8246 like function call relocations.
8247
c20cbc06
ILT
82482010-12-07 Ian Lance Taylor <iant@google.com>
8249
8250 * archive.cc (Archive::get_elf_object_for_member): Permit
8251 punconfigured to be NULL.
8252 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8253 (Archive::include_member): Pass NULL to get_elf_object_for_member
8254 if we searched for the archive and this is the first included
8255 object.
8256
4dbfafcc
ILT
82572010-12-01 Ian Lance Taylor <iant@google.com>
8258
8259 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8260 track_relocs_type_ field.
8261 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8262 Set track_relocs_type_.
8263 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8264 contents when using RELA relocs.
8265 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8266 reloc_map_.
8267 * reloc.cc (Track_relocs::next_addend): New function.
8268 * reloc.h (class Track_relocs): Declare next_addend.
8269
e5e19edd
ILT
82702010-12-01 Ian Lance Taylor <iant@google.com>
8271
8272 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8273 virtual destructor.
8274
9a5ce24c
ILT
82752010-12-01 Ian Lance Taylor <iant@google.com>
8276
8277 * README: Update compilers known to work and fail.
8278
c7791212
NC
82792010-11-23 Matthias Klose <doko@ubuntu.com>
8280
8281 * configure.in: For --enable-gold, handle value `default' instead of
8282 `both*'. Always install ld as ld.bfd, install as ld if gold is
8283 not the default.
8284 * configure: Regenerate.
8285
0ad220c9
DK
82862010-11-18 Doug Kwan <dougkwan@google.com>
8287
8288 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8289 and right_alignment to be zero. Store result alignment only if it is
8290 greater than existing alignment.
8291
ab8056e0
CC
82922010-11-16 Cary Coutant <ccoutant@google.com>
8293
8294 PR gold/12220
8295 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8296 Check for ".zdebug_line".
8297
fd064a5b
CC
82982010-11-16 Doug Kwan <dougkwan@google.com>
8299 Cary Coutant <ccoutant@google.com>
8300
8301 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8302 by reference; adjust all callers.
8303 * output.cc (Output_segment::set_section_addresses): Adjust references
8304 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8305 list is empty.
8306 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8307 end at page boundary.
8308
6fc6ea19
CC
83092010-11-16 Cary Coutant <ccoutant@google.com>
8310
8311 PR gold/12220
8312 * layout.cc (Layout::choose_output_section): Transform names of
8313 compressed sections even when using a script with a SECTIONS clause.
8314 (Layout::output_section_name): Remove code to transform
8315 compressed debug section names.
8316 * output.cc (Output_section::add_input_section): Use uncompressed
8317 section size when tracking input sections.
8318
95a2c8d6
RS
83192010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8320
8321 * symtab.h (Symbol::NON_PIC_REF): Remove.
8322 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8323 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8324 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8325 (Symbol::use_plt_offset): Take a flags argument and pass it
8326 directly to needs_dynamic_reloc. Restrict check for undefined
8327 weak symbols to function calls.
8328 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8329 (Target_arm::Scan::global): Use it.
8330 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8331 (Target_arm::Relocate::relocate): Likewise.
8332 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8333 parameter with an r_type parameter. Use get_reference_flags
8334 to get the flags.
8335 (Target_arm::Relocate::relocate): Update accordingly.
8336 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8337 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8338 (Target_i386::Scan::global): Likewise.
8339 (Target_i386::Relocate::relocate): Likewise.
8340 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8341 parameter with an r_type parameter. Use get_reference_flags
8342 to get the flags.
8343 (Target_i386::Relocate::relocate): Update accordingly.
8344 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8345 (Target_powerpc::Scan::global): Use it.
8346 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8347 (Target_powerpc::Relocate::relocate): Likewise.
8348 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8349 (Target_sparc::Scan::global): Use it.
8350 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8351 (Target_sparc::Relocate::relocate): Likewise.
8352 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8353 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8354 (Target_x86_64::Scan::global): Likewise.
8355 (Target_x86_64::Relocate::relocate): Likewise.
8356
f625ae50
DK
83572010-11-08 Doug Kwan <dougkwan@google.com>
8358 Cary Coutant <ccoutant@google.com>
8359
8360 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8361 (Arm_exidx_merge_section::section_contents_): New data member.
8362 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8363 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8364 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8365 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8366 in parameters instead of calling Object::section_contents without
8367 locking.
8368 (Arm_output_section::group_section): New parameter TASK. Pass it
8369 to callees that need locking objects.
8370 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8371 to lock EXIDX input sections. Fix a formatting issue. Call
8372 Arm_exidx_merged_section::build_contents to create merged section
8373 contents.
8374 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8375 to lock object of stub table owner.
8376 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8377 TEXT_SIZE to initialize data member TEXT_SIZE_.
8378 (Arm_exidx_input_section::addralign): Fix typo in comment.
8379 (Arm_exidx_input_section::text_size): New method.
8380 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8381 that require locking objects. Lock objects before scanning for stubs
8382 and updating local symbols.
8383 (Arm_input_section<big_endian>::init): Copy contents of original
8384 input section.
2e702c99 8385 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8386 original input section instead of calling Object::section_contents
8387 without locking.
8388 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8389 size without calling Object::section_size().
8390 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8391 for size. Allocate a buffer for merged EXIDX entries.
8392 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8393 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8394 building code to Arm_exidx_merged_section::build_contetns. Write
8395 out contetns in buffer instead of building it on the fly.
8396 (Arm_relobj::make_exidx_input_section): Also pass text section size
8397 to Arm_exidx_input_section constructor.
8398 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8399 (Arm_dynobj::do_read_symbols): Fix memory leak.
8400 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8401 * target.h: (class Task): Add forward declaration.
8402 (Target::relax): Add new parameter TASK and pass it to
8403 Target::do_relax().
8404 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8405
5f9bcf58
CC
84062010-11-05 Cary Coutant <ccoutant@google.com>
8407
8408 PR gold/10708
8409 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8410 object when reading from the file.
8411 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8412 second layout pass.
8413 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8414 when reading section contents.
8415 (get_section_contents): Likewise.
8416 (icf::find_identical_sections): Likewise.
8417 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8418 object when reading from the file.
8419 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8420 the object when doing deferred section layout.
8421
e597fa08
NC
84222010-11-03 Nick Clifton <nickc@redhat.com>
8423
8424 PR gold/12001
8425 * script.h (class Symbol_assignment: name): New member. Returns
8426 the name of the symbol.
8427 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8428 Returns true if the given symbol name is on the list of
8429 assignments wating to be processed.
8430 * archive.cc (should_incldue_member): If the symbol is undefined,
8431 check to see if it is on the list of symbols pending assignment.
8432
3f9a3278
ILT
84332010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8434
8435 * script-sections.cc (Script_sections::find_memory_region): Check
8436 for a NULL output section pointer.
8437
d06fb4d1
DK
84382010-10-29 Doug Kwan <dougkwan@google.com>
8439
8440 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8441 Output_section::add_relaxed_input_section.
8442 * output.cc (Output_section::add_relaxed_input_section): Add new
8443 arguments LAYOUT and NAME. Set section order index.
8444 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8445 Copy section order index.
8446 * output.h (Output_section::add_relaxed_input_section): Add new
8447 arguments LAYOUT and NAME.
8448
90e24de5
ILT
84492010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8450
8451 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8452 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8453 * testsuite/Makefile.in: Regenerate.
8454
c9484ea5
DK
84552010-10-20 Doug Kwan <dougkwan@google.com>
8456
8457 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8458 without SHF_LINK_ORDER flags.
8459 * layout.cc (Layout::choose_output_section): Do not filter
8460 SHF_LINK_ORDER flag in a relocatable link.
8461
5bc2f5be
CC
84622010-10-17 Cary Coutant <ccoutant@google.com>
8463
8464 * output.h (Output_segment::set_section_addresses): Change function
8465 signature. Update all callers.
8466 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8467 sections.
8468 (Output_segment::set_section_addresses): Align after last TLS
8469 section. Add padding before last relro section instead of after.
8470
0c91cf04
DK
84712010-10-17 Doug Kwan <dougkwan@google.com>
8472
8473 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8474 GOT output section to be writable.
8475
8c21d9d3
CC
84762010-10-14 Cary Coutant <ccoutant@google.com>
8477
8478 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8479 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8480 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8481 mode.
8482 * incremental.cc (report_command_line): Ignore all forms of
8483 --incremental.
8484 * layout.cc (Layout::Layout): Check parameters for incremental link
8485 mode.
8486 * options.cc (General_options::parse_incremental): New function.
8487 (General_options::parse_no_incremental): New function.
8488 (General_options::parse_incremental_full): New function.
8489 (General_options::parse_incremental_update): New function.
8490 (General_options::incremental_mode_): New data member.
8491 (General_options::finalize): Check incremental_mode_.
8492 * options.h (General_options): Update help text for --incremental.
8493 Add --no-incremental, --incremental-full, --incremental-update.
8494 (General_options::Incremental_mode): New enum type.
8495 (General_options::incremental_mode): New function.
8496 (General_options::incremental_mode_): New data member.
8497 * parameters.cc (Parameters::incremental_mode_): New data member.
8498 (Parameters::set_options): Set incremental_mode_.
8499 (Parameters::set_incremental_full): New function.
8500 (Parameters::incremental): New function.
8501 (Parameters::incremental_update): New function.
8502 (set_parameters_incremental_full): New function.
8503 * parameters.h (Parameters::set_incremental_full): New function.
8504 (Parameters::incremental): New function.
8505 (Parameters::incremental_update): New function.
8506 (Parameters::incremental_mode_): New data member.
8507 (set_parameters_incremental_full): New function.
8508 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8509 incremental link mode.
8510 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8511 (Sized_relobj::do_relocate_sections): Likewise.
8512 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8513 option.
8514 * testsuite/Makefile.in: Regenerate.
8515 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8516
bb32aa18 85172010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8518
8519 * script-sections.h (class Script_sections): Make
8520 Sections_elements typedef public.
8521 * script-sections.cc (class Sort_output_sections): Add elements_
8522 field. Add constructor which sets it; change all callers.
8523 (Sort_output_sections::is_before): New function.
8524 (Sort_output_sections::operator()): Call is_before.
8525 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8526 conditional.
8527 * testsuite/script_test_10.sh: New test. Test script section
8528 order.
8529 * testsuite/script_test_10.t: Likewise.
8530 * testsuite/script_test_10.s: Likewise.
8531 * testsuite/Makefile.am: Wrap the cross linker tests and the
8532 common tests into NATIVE_OR_CROSS_LINKER.
8533 (check_SCRIPTS): Add script_test_10.sh.
8534 (check_DATA): Add script_test_10.stdout.
8535 (script_test_10.o, script_test_10): New targets.
8536 (script_test_10.stdout): New target.
8537 * configure, testsuite/Makefile.in: Regenerate.
8538
3cef7179
ILT
85392010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8540
8541 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8542 error for the deprecated relocations.
8543 (Target_arm::Scan::global): Likewise.
8544 (Target_arm::Relocate::relocate): Likewise.
8545
7411e9a8
RS
85462010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8547
8548 * fileread.cc (Input_file::find_file): Initialize *found_name
8549 and *namep when using the fallback search for case 4.
8550
6a9da32a
CC
85512010-10-11 Cary Coutant <ccoutant@google.com>
8552
8553 * options.h (class General_options): Redefine -z lazy as an alias for
8554 the negation of -z now.
8555
ac897c20
ILT
85562010-10-11 Ian Lance Taylor <iant@google.com>
8557
8558 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8559 binding.
8560
ea5cae92
NC
85612010-10-06 Nick Clifton <nickc@redhat.com>
8562
8563 * script-sections.cc(class Memory_region): Remove
8564 current_lma_offset_ field. Rename current_vma_offset_ to
8565 current_offset_. Add last_section_ field.
8566 (Memory_region::get_current_vma_address): Rename to
8567 get_current_address.
8568 (Memory_region::get_current_lma_address): Delete.
8569 (Memory_region::increment_vma_offset): Rename to
8570 increment_offset.
8571 (Memory_region::increment_lma_offset): Delete.
8572 (Memory_region::attributes_compatible): New method. Returns
8573 true if the provided section is compatible with the region.
8574 (Memory_region::get_last_section): New method. Returns the last
8575 section to use the region.
8576 (Memory_region::set_last_section): New method. Stores the last
8577 section to use the region.
8578 (Script_sections::block_in_region): New method. Returns true if
8579 a block of memory is contained within a region.
8580 (Script_sections::find_memory_region): New method. Locates a
8581 memory region to be used to set a VMA or LMA address.
8582 (Output_section_definition::set_section_addresses): Add code to
8583 check for addresses set by memory regions.
8584 (Output_segment::set_section_addresses): Remove memory region
8585 walking code.
8586 (Script_sections::create_segment): Add a warning if a header
8587 segment is created outside of any region.
8588 * script-sections.h (class Script_sections): Add prototypes for
8589 find_memory_region and block_in_region methods.
8590 * testsuite/memory_test.s: Use .long instead of .word.
8591 * testsuite/memory_test.t: Add some more output sections.
8592 * testsuite/memory_test.sh: Update expected output.
8593
a9bfd952
DK
85942010-10-02 Doug Kwan <dougkwan@google.com>
8595
8596 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8597 defintion to symtab.h
8598 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8599 declaration to defintion.
8600
bacff3ab
NC
86012010-10-01 Nick Clifton <nickc@redhat.com>
8602
8603 * expression.cc (eval): Replace dummy argument with NULL.
8604 (eval_maybe_dot): Check for a NULL result section pointer.
8605 (Symbol_expression::value): Likewise.
8606 (Dot_expression::value): Likewise.
8607 (BINARY_EXPRESSION): Likewise.
8608 (Max_expression::value): Likewise.
8609 (Min_expression::value): Likewise.
8610 (Absolute_expression::value): Likewise.
8611 (Addr_expression::value_from_output_section): Likewise.
8612 (Loaddddr_expression::value_from_output_section): Likewise.
8613 (Segment_start_expression::value): Likewise.
8614 * script-sections.cc
8615 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8616 argument with NULL.
8617 (Sections_elememt_dot_assignment::set_section_addresses):
8618 Likewise.
8619 (Output_data_expression::do_write_to_buffer): Likewise.
8620 (Output_section_definition::finalize_symbols): Likewise.
8621 (Output_section_definition::set_section_addresses): Likewise.
8622
f81bc8b5
DK
86232010-09-30 Doug Kwan <dougkwan@google.com>
8624
8625 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8626
c95e9f27
ST
86272010-09-28 Sriraman Tallam <tmsriram@google.com>
8628
8629 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8630 function.
c95e9f27
ST
8631 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8632 virtual function.
8633 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8634 virtual function.
8635 * icf.cc (get_section_contents): Inline merge sections only when
8636 target allows it.
8637
3cac54d2
RW
86382010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8639
8640 * configure: Regenerate.
8641
2904037a
ILT
86422010-09-17 Ian Lance Taylor <iant@google.com>
8643
8644 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8645 * testsuite/Makefile.am (memory_test.o): New target.
8646 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8647 memory_test.t.
8648 * testsuite/Makefile.in: Rebuild.
2904037a 8649
bca7fb63
DK
86502010-09-17 Doug Kwan <dougkwan@google.com>
8651
8652 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8653 defintion if relocation uses GOT entries of the symbol.
8654 * testsuite/icf_safe_test.sh: Fix test.
8655 * testsuite/icf_safe_so_test.sh: Fix test.
8656
4ef28648
CC
86572010-09-16 Cary Coutant <ccoutant@google.com>
8658
8659 * script_sections.cc (class Memory_region): Remove "NULL" from
8660 vector initializations.
8661
793990de
CC
86622010-09-15 Cary Coutant <ccoutant@google.com>
8663
8664 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8665 Resolve forwarding symbols.
8666
81e015e2
DK
86672010-09-15 Doug Kwan <dougkwan@google.com>
8668
8669 * gold/testsuite/script_test_3.t: Add ARM special sections.
8670 * gold/testsuite/script_test_4.t: Same.
8671 * gold/testsuite/script_test_5.t: Same.
8672 * gold/testsuite/script_test_6.t: Same.
8673 * gold/testsuite/script_test_7.t: Same.
8674 * gold/testsuite/script_test_7.t: Same.
8675 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8676
36171d64
CC
86772010-09-14 Cary Coutant <ccoutant@google.com>
8678
8679 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8680 (Target_x86_64::Relocate::relocate_tls): Replace check for
8681 saw_tls_block_reloc_ with test for executable section.
8682
d89051bd
CC
86832010-09-12 Cary Coutant <ccoutant@google.com>
8684
8685 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8686 position-independent executables to shared libraries need dynamic
8687 relocations.
8688 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8689 position-independent executables.
8690 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8691 * testsuite/Makefile.in: Regenerate.
8692
fca41f0f
NC
86932010-09-10 Nick Clifton <nickc@redhat.com>
8694
8695 PR gold/11997
8696 * testsuite/memory_test.t: Discard any sections that are not
8697 needed.
8698
6695e4b3
L
86992010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8700
8701 PR gold/11996
8702 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8703 "This::" to work around a bug in gcc 4.2.
8704
8705 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8706
0f72bf6f
RÁE
87072010-09-09 Rafael Espindola <espindola@google.com>
8708
8709 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8710 sections with different PF_X flags in the same segment.
8711 (Layout::find_first_load_seg): Search all segments to find the first
8712 one.
8713 * options.h (rosegment): New.
8714
87152010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8716
05a79166 8717 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8718
aa98ff75
DK
87192010-09-08 Doug Kwan <dougkwan@google.com>
8720
8721 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8722 (Arm_relobj::do_relocate_sections): Add new parameter for output
8723 file to match the parent.
8724 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8725 of local symbols instead of input values. Update code to track
8726 changes in gold::relocate_section.
8727 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8728 (Sized_relobj::compute_final_local_value_internal): New methods.
8729 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8730 body into private version of Sized_relobj::compute_final_local_value.
8731 Call the inline method.
8732 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8733 merged symbol value if there is one.
8734 (Symbol_value::has_output_value): New method defintiion.
8735 (Sized_relobj::Compute_final_local_value_status): New enum type.
8736 (Sized_relobj::compute_final_local_value): New methods.
8737 (Sized_relobj::compute_final_local_value_internal): New methods.
8738 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8739 and arm_cortex_a8.sh.
8740 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8741 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8742 New tests.
8743 * Makefile.in: Regenerate.
8744 * testsuite/arm_bl_out_of_range.s: Update test.
8745 * testsuite/thumb_bl_out_of_range.s: Ditto.
8746 * testsuite/thumb_blx_out_of_range.s: Ditto.
8747 * testsuite/arm_branch_out_of_range.sh: New file.
8748 * testsuite/arm_cortex_a8.sh: Ditto.
8749 * testsuite/arm_cortex_a8_b.s: Ditto.
8750 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8751 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8752 * testsuite/arm_cortex_a8_bl.s: Ditto.
8753 * testsuite/arm_cortex_a8_blx.s: Ditto.
8754 * testsuite/arm_cortex_a8_local.s: Ditto.
8755 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8756 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8757
05a79166
L
87582010-09-08 Rafael Espindola <espindola@google.com>
8759
8760 * Makefile.am (memory_test.stdout): Run readelf with -W.
8761 * Makefile.in: Regenerate.
8762 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8763 64 bit output.
8764
33dbc701
RÁE
87652010-09-08 Rafael Espindola <espindola@google.com>
8766
8767 * script-sections.cc (Script_sections::add_memory_region): Convert
8768 field precision to int.
8769 * script.cc (script_set_section_region, script_set_section_region):
8770 Convert field precision to int.
8771
731ca54a
RÁE
87722010-09-08 Rafael Espindola <espindola@google.com>
8773
8774 * arm.cc (do_finalize_sections): Create the __exidx_start and
8775 __exdix_end symbols even when the section is missing.
8776
7f8cd844
NC
87772010-09-08 Nick Clifton <nickc@redhat.com>
8778
8779 * README: Remove claim that MEMORY is not supported.
8780 * expression.cc (script_exp_function_origin)
8781 (script_exp_function_length): Move from here to ...
8782 * script.cc: ... here.
8783 (script_set_section_region, script_add_memory)
8784 (script_parse_memory_attr, script_include_directive): New
8785 functions.
8786 * script-sections.cc
8787 (class Memory_region): New class.
8788 (class Output_section_definition): Add set_memory_region,
8789 set_section_vma, set_section_lma and get_section_name methods.
8790 (class Script_Sections): Add add_memory_region,
8791 find_memory_region, find_memory_region_origin,
8792 find_memory_region_length and set_memory_region methods.
8793 Have set_section_addresses method walk the list of set memory
8794 regions.
8795 Extend the print methos to display memory regions.
8796 * script-sections.h: Add prototypes for new methods.
8797 Add enum for MEMORY region attributes.
8798 * yyscript.y: Add support for parsing MEMORY regions.
8799 * script-c.h: Add prototypes for new functions.
8800 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8801 * testsuite/Makefile.in: Regenerate.
8802 * testsuite/memory_test.sh: New script.
8803 * testsuite/memory_test.s: New assembler source file.
8804 * testsuite/memory_test.t: New linker script.
8805
a4649286
DK
88062010-08-27 Doug Kwan <dougkwan@google.com>
8807
8808 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8809 reference override an existing dynamic weak reference.
8810 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8811 * testsuite/Makefile.in: Regenerate.
8812 * testsuite/dyn_weak_ref.sh: New file.
8813 * testsuite/dyn_weak_ref_1.c: Ditto.
8814 * testsuite/dyn_weak_ref_2.c: Ditto.
8815
b56648ad
ILT
88162010-08-27 Ian Lance Taylor <iant@google.com>
8817
8818 * incremental.h (class Incremental_input_entry): Add virtual
8819 destructor.
8820
809313cb
ILT
88212010-08-27 Ian Lance Taylor <iant@google.com>
8822
8823 * testsuite/start_lib_test_3.c: Mark t3 as used.
8824
11e32464
NC
88252010-08-27 Nick Clifton <nickc@redhat.com>
8826
8827 * options.cc (version_script): Fix small typo in previous
8828 whitespace tidyup.
8829
ca09d69a
NC
88302010-08-25 Nick Clifton <nickc@redhat.com>
8831
8832 * archive.cc: Formatting fixes: Remove whitespace between
8833 typename and following asterisk. Remove whitespace between
8834 function name and opening parenthesis.
8835 * archive.h: Likewise.
8836 * arm.cc: Likewise.
8837 * attributes.cc: Likewise.
8838 * attributes.h: Likewise.
8839 * common.cc: Likewise.
8840 * copy-relocs.cc: Likewise.
8841 * dirsearch.h: Likewise.
8842 * dynobj.cc: Likewise.
8843 * ehframe.cc: Likewise.
8844 * ehframe.h: Likewise.
8845 * expression.cc: Likewise.
8846 * fileread.cc: Likewise.
8847 * fileread.h: Likewise.
8848 * gc.h: Likewise.
8849 * gold-threads.cc: Likewise.
8850 * gold.cc: Likewise.
8851 * i386.cc: Likewise.
8852 * icf.h: Likewise.
8853 * incremental-dump.cc: Likewise.
8854 * incremental.cc: Likewise.
8855 * layout.cc: Likewise.
8856 * layout.h: Likewise.
8857 * main.cc: Likewise.
8858 * merge.cc: Likewise.
8859 * merge.h: Likewise.
8860 * object.cc: Likewise.
8861 * object.h: Likewise.
8862 * options.cc: Likewise.
8863 * options.h: Likewise.
8864 * output.cc: Likewise.
8865 * output.h: Likewise.
8866 * plugin.cc: Likewise.
8867 * plugin.h: Likewise.
8868 * powerpc.cc: Likewise.
8869 * reloc.cc: Likewise.
8870 * script-c.h: Likewise.
8871 * script-sections.cc: Likewise.
8872 * script.cc: Likewise.
8873 * stringpool.cc: Likewise.
8874 * symtab.cc: Likewise.
8875 * symtab.h: Likewise.
8876 * target.cc: Likewise.
8877 * timer.cc: Likewise.
8878 * timer.h: Likewise.
8879 * version.cc: Likewise.
8880 * x86_64.cc: Likewise.
8881
b8fa8750
NC
88822010-08-24 Nick Clifton <nickc@redhat.com>
8883
8884 PR 11899
8885 * layout.cc (segment_precedes): Sort segments by their physical
8886 addresses, if they have been set.
8887
9919d93b
CC
88882010-08-23 Cary Coutant <ccoutant@google.com>
8889
8890 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8891 symbols data.
8892 (Lib_group::include_member): Unlock object after deleting its
8893 symbols data.
8894 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8895 the bug fixed here.
8896
97b4be1c
CC
88972010-08-19 Neil Vachharajani <nvachhar@google.com>
8898 Cary Coutant <ccoutant@google.com>
8899
8900 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8901 constructor, and set_blocker.
8902 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8903 readsyms_blocker_.
8904 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8905 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8906 * testsuite/Makefile.am (start_lib_test): New test case.
8907 * testsuite/Makefile.in: Regenerate.
8908 * testsuite/start_lib_test_main.c: New file.
8909 * testsuite/start_lib_test_1.c: New file.
8910 * testsuite/start_lib_test_2.c: New file.
8911 * testsuite/start_lib_test_3.c: New file.
8912
dd0b1884
ILT
89132010-08-19 Ian Lance Taylor <iant@google.com>
8914
8915 * Makefile.in: Rebuild with automake 1.11.1.
8916 * aclocal.m4: Likewise.
8917 * testsuite/Makefile.in: Likewise.
8918
7223e9ca
ILT
89192010-08-19 Ian Lance Taylor <iant@google.com>
8920
8921 PR 10893
8922 * i386.cc (class Output_data_plt_i386): Update declarations.
8923 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8924 local_ifuncs_ fields.
8925 (Target_i386::do_plt_section_for_global): New function.
8926 (Target_i386::do_plt_section_for_local): New function.
8927 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8928 parameter; change all callers. Initialize global_ifuncs_ and
8929 local_ifuncs_. If doing a static link define __rel_iplt_start and
8930 __rel_iplt_end.
8931 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8932 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8933 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8934 symbols.
8935 (Target_i386::make_plt_section): New function, broken out of
8936 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8937 (Target_i386::make_plt_entry): Call make_plt_section.
8938 (Target_i386::make_local_ifunc_plt_entry): New function.
8939 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8940 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8941 R_386_IRELATIVE to switch.
8942 (Target_i386::Scan::global): Likewise.
8943 (Target_i386::Relocate::relocate): Likewise.
8944 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8945 switch.
8946 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8947 (Target_x86_64::do_plt_section_for_global): New function.
8948 (Target_x86_64::do_plt_section_for_local): New function.
8949 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8950 parameter; change all callers. If doing a static link define
8951 __rela_iplt_start and __rela_iplt_end.
8952 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8953 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8954 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8955 to point to .plt.
8956 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8957 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8958 switch.
8959 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8960 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8961 R_X86_64_IRELATIVE to switch.
8962 (Target_x86_64::Scan::global): Likewise.
8963 (Target_x86_64::Relocate::relocate): Likewise.
8964 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8965 switch.
8966 * target.h (class Target): Add plt_section_for_global and
8967 plt_section_for_local functions. Add do_plt_section_for_global
8968 and do_plt_section_for_local virtual functions.
8969 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8970 clarifying comments.
8971 (Symbol::use_plt_offset): Handle IFUNC symbol.
8972 * object.cc (Sized_relobj::Sized_relobj): Initialize
8973 local_plt_offsets_.
8974 (Sized_relobj::local_has_plt_offset): New function.
8975 (Sized_relobj::local_plt_offset): New function.
8976 (Sized_relobj::set_local_plt_offset): New function.
8977 (Sized_relobj::do_count): Handle IFUNC symbol.
8978 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8979 a bit away from input_shndx_ field. Add set_is_func_symbol and
8980 is_ifunc_symbol functions.
8981 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8982 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8983 local_plt_offsets_ field.
8984 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8985 * output.h (class Output_section_data): Add non-const
8986 output_section function.
8987 (class Output_data_got): Update declarations.
8988 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8989 Add use_plt_offset parameter to global and local constructors.
8990 Change all callers. Change local_sym_index_ field to 31 bits.
8991 Change GSYM_CODE and CONSTANT_CODE accordingly.
8992 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8993 doing a static link don't set sh_link field.
8994 (Output_data_got::Got_entry::write): Use PLT offset if
8995 appropriate.
8996 (Output_data_got::add_global_plt): New function.
8997 (Output_data_got::add_local_plt): New function.
8998 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8999 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
9000 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
9001 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
9002 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
9003 IFUNC conditional.
9004 * testsuite/ifunc-sel.h: New file.
9005 * testsuite/ifuncmain1.c: New file.
9006 * testsuite/ifuncmain1vis.c: New file.
9007 * testsuite/ifuncmod1.c: New file.
9008 * testsuite/ifuncdep2.c: New file.
9009 * testsuite/ifuncmain2.c: New file.
9010 * testsuite/ifuncmain3.c: New file.
9011 * testsuite/ifuncmod3.c: New file.
9012 * testsuite/ifuncmain4.c: New file.
9013 * testsuite/ifuncmain5.c: New file.
9014 * testsuite/ifuncmod5.c: New file.
9015 * testsuite/ifuncmain6pie.c: New file.
9016 * testsuite/ifuncmod6.c: New file.
9017 * testsuite/ifuncmain7.c: New file.
9018 * configure, testsuite/Makefile.in: Rebuild.
9019
56f75c03
ILT
90202010-08-18 Ian Lance Taylor <iant@google.com>
9021
9022 * incremental.cc
9023 (Output_section_incremental_inputs::write_input_files): Add cast
9024 to avoid signed/unsigned comparison warning.
9025 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9026
55455f89
CC
90272010-08-12 Cary Coutant <ccoutant@google.com>
9028
9029 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9030
e2054bcb
ILT
90312010-08-13 Ian Lance Taylor <iant@google.com>
9032
9033 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9034
74f67560
DK
90352010-08-12 Cary Coutant <ccoutant@google.com>
9036 Doug Kwan <dougkwan@google.com>
9037
9038 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9039 defintion overrides non-weak undef, remember that the original undef
9040 is not weak.
9041 * symtab.cc (Symbol_table::sized_write_global): For undef without
9042 an original weak binding, set binding to global in output.
9043 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9044 * testsuite/Makefile.in: Regenerate.
9045 * testsuite/strong_ref_weak_def.sh: New file.
9046 * testsuite/strong_ref_weak_def_1.c: Ditto.
9047 * testsuite/strong_ref_weak_def_2.c: Ditto.
9048
d1238d12
CC
90492010-08-12 Cary Coutant <ccoutant@google.com>
9050
9051 * testsuite/incremental_test.sh: Rewrite.
9052 * testsuite/incremental_test_1.c: Rewrite.
9053 * testsuite/incremental_test_2.c: Rewrite.
9054
0e70b911
CC
90552010-08-12 Cary Coutant <ccoutant@google.com>
9056
9057 * arm.cc (Target_arm::got_size): Add const.
9058 (Target_arm::got_entry_count): New function.
9059 (Target_arm::plt_entry_count): New function.
9060 (Target_arm::first_plt_entry_offset): New function.
9061 (Target_arm::plt_entry_size): New function.
9062 (Output_data_plt_arm::entry_count): New function.
9063 (Output_data_plt_arm::first_plt_entry_offset): New function.
9064 (Output_data_plt_arm::get_plt_entry_size): New function.
9065 * i386.cc (Target_i386::got_size): Add const.
9066 (Target_i386::got_entry_count): New function.
9067 (Target_i386::plt_entry_count): New function.
9068 (Target_i386::first_plt_entry_offset): New function.
9069 (Target_i386::plt_entry_size): New function.
9070 (Output_data_plt_i386::entry_count): New function.
9071 (Output_data_plt_i386::first_plt_entry_offset): New function.
9072 (Output_data_plt_i386::get_plt_entry_size): New function.
9073 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9074 find_incremental_inputs_sections. Dump incremental_got_plt section.
9075 * incremental.cc: Include target.h.
9076 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9077 parameter. Adjust all callers. Find incremental_got_plt section.
9078 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9079 section.
9080 (Output_section_incremental_inputs::set_final_data_size): Calculate
9081 size of incremental_got_plt section.
9082 (Output_section_incremental_inputs::do_write): Write the
9083 incremental_got_plt section.
9084 (Got_plt_view_info): New struct.
9085 (Local_got_offset_visitor): New class.
9086 (Global_got_offset_visitor): New class.
9087 (Global_symbol_visitor_got_plt): New class.
9088 (Output_section_incremental_inputs::write_got_plt): New function.
9089 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9090 Add parameter. Adjust all callers.
9091 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9092 (Incremental_inputs::got_plt_section): New function.
9093 (Incremental_inputs::got_plt_section_): New data member.
9094 (Incremental_got_plt_reader): New class.
9095 * layout.cc (Layout::create_incremental_info_sections): Add the
9096 incremental_got_plt section.
9097 * object.h (Got_offset_list::get_list): New function.
9098 (Got offset_list::for_all_got_offsets): New function.
9099 (Sized_relobj::local_got_offset_list): New function.
9100 * powerpc.cc (Target_powerpc::got_size): Add const.
9101 (Target_powerpc::got_entry_count): New function.
9102 (Target_powerpc::plt_entry_count): New function.
9103 (Target_powerpc::first_plt_entry_offset): New function.
9104 (Target_powerpc::plt_entry_size): New function.
9105 (Output_data_plt_powerpc::entry_count): New function.
9106 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9107 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9108 * sparc.cc (Target_sparc::got_size): Add const.
9109 (Target_sparc::got_entry_count): New function.
9110 (Target_sparc::plt_entry_count): New function.
9111 (Target_sparc::first_plt_entry_offset): New function.
9112 (Target_sparc::plt_entry_size): New function.
9113 (Output_data_plt_sparc::entry_count): New function.
9114 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9115 (Output_data_plt_sparc::get_plt_entry_size): New function.
9116 * symtab.h (Symbol::got_offset_list): New function.
9117 (Symbol_table::for_all_symbols): New function.
9118 * target.h (Sized_target::got_entry_count): New function.
9119 (Sized_target::plt_entry_count): New function.
9120 (Sized_target::plt_entry_size): New function.
9121 * x86_64.cc (Target_x86_64::got_size): Add const.
9122 (Target_x86_64::got_entry_count): New function.
9123 (Target_x86_64::plt_entry_count): New function.
9124 (Target_x86_64::first_plt_entry_offset): New function.
9125 (Target_x86_64::plt_entry_size): New function.
9126 (Output_data_plt_x86_64::entry_count): New function.
9127 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9128 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9129
09ec0418
CC
91302010-08-12 Cary Coutant <ccoutant@google.com>
9131
9132 * archive.cc: Include incremental.h.
9133 (Archive::Archive): Initialize incremental_info_.
9134 (Archive::include_member): Record archive members in incremental info.
9135 (Add_archive_symbols::run): Record begin and end of an archive in
9136 incremental info.
9137 (Lib_group::include_member): Record objects in incremental info.
9138 * archive.h (Incremental_archive_entry): Forward declaration.
9139 (Archive::set_incremental_info): New member function.
9140 (Archive::incremental_info): New member function.
9141 (Archive::Unused_symbol_iterator): New class.
9142 (Archive::unused_symbols_begin): New member function.
9143 (Archive::unused_symbols_end): New member function.
9144 (Archive::incremental_info_): New data member.
9145 * incremental-dump.cc (find_input_containing_global): New function.
9146 (dump_incremental_inputs): Dump new incremental info sections.
9147 * incremental.cc: Include symtab.h.
9148 (Output_section_incremental_inputs): New class.
9149 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9150 new incremental info sections.
9151 (Sized_incremental_binary::do_check_inputs): Likewise.
9152 (Incremental_inputs::report_archive): Remove.
9153 (Incremental_inputs::report_archive_begin): New function.
9154 (Incremental_inputs::report_archive_end): New function.
9155 (Incremental_inputs::report_object): New function.
9156 (Incremental_inputs::finalize_inputs): Remove.
9157 (Incremental_inputs::report_input_section): New function.
9158 (Incremental_inputs::report_script): Rewrite.
9159 (Incremental_inputs::finalize): Do nothing but finalize string table.
9160 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9161 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9162 (Incremental_inputs::create_data_sections): New function.
9163 (Incremental_inputs::relocs_entsize): New function.
9164 (Output_section_incremental_inputs::set_final_data_size): New function.
9165 (Output_section_incremental_inputs::do_write): New function.
9166 (Output_section_incremental_inputs::write_header): New function.
9167 (Output_section_incremental_inputs::write_input_files): New function.
9168 (Output_section_incremental_inputs::write_info_blocks): New function.
9169 (Output_section_incremental_inputs::write_symtab): New function.
9170 * incremental.h (Incremental_script_entry): Forward declaration.
9171 (Incremental_object_entry): Forward declaration.
9172 (Incremental_archive_entry): Forward declaration.
9173 (Incremental_inputs): Forward declaration.
9174 (Incremental_inputs_header_data): Remove.
9175 (Incremental_inputs_header): Remove.
9176 (Incremental_inputs_header_write): Remove.
9177 (Incremental_inputs_entry_data): Remove.
9178 (Incremental_inputs_entry): Remove.
9179 (Incremental_inputs_entry_write): Remove.
9180 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9181 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9182 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9183 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9184 Likewise.
9185 (Incremental_input_entry): New class.
9186 (Incremental_script_entry): New class.
9187 (Incremental_object_entry): New class.
9188 (Incremental_archive_entry): New class.
9189 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9190 (Incremental_inputs::report_inputs): Remove.
9191 (Incremental_inputs::report_archive): Remove.
9192 (Incremental_inputs::report_archive_begin): New function.
9193 (Incremental_inputs::report_archive_end): New function.
9194 (Incremental_inputs::report_object): Change prototype.
9195 (Incremental_inputs::report_input_section): New function.
9196 (Incremental_inputs::report_script): Change prototype.
9197 (Incremental_inputs::get_reloc_count): New function.
9198 (Incremental_inputs::set_reloc_count): New function.
9199 (Incremental_inputs::create_data_sections): New function.
9200 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9201 (Incremental_inputs::inputs_section): New function.
9202 (Incremental_inputs::symtab_section): New function.
9203 (Incremental_inputs::relocs_section): New function.
9204 (Incremental_inputs::get_stringpool): Add const.
9205 (Incremental_inputs::command_line): Add const.
9206 (Incremental_inputs::inputs): Remove.
9207 (Incremental_inputs::command_line_key): New function.
9208 (Incremental_inputs::input_file_count): New function.
9209 (Incremental_inputs::input_files): New function.
9210 (Incremental_inputs::relocs_entsize): New function.
9211 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9212 (Incremental_inputs::finalize_inputs): Remove.
9213 (Incremental_inputs::Input_info): Remove.
9214 (Incremental_inputs::lock_): Remove.
9215 (Incremental_inputs::inputs_): Change type.
9216 (Incremental_inputs::inputs_map_): Remove.
9217 (Incremental_inputs::current_object_entry_): New data member.
9218 (Incremental_inputs::inputs_section_): New data member.
9219 (Incremental_inputs::symtab_section_): New data member.
9220 (Incremental_inputs::relocs_section_): New data member.
9221 (Incremental_inputs::reloc_count_): New data member.
9222 (Incremental_inputs_reader): New class.
9223 (Incremental_symtab_reader): New class.
9224 (Incremental_relocs_reader): New class.
9225 * layout.cc (Layout::finalize): Move finalization of incremental info
9226 and creation of incremental info sections to follow finalization of
9227 symbol table. Set offsets for postprocessing sections.
9228 (Layout::create_incremental_info_sections): Call
9229 Incremental_inputs::create_data_sections. Add incremental symtab
9230 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9231 sections to layout after input sections.
9232 * layout.h (struct Timespec): Forward declaration.
9233 (Layout::incremental_inputs): Add const.
9234 (Layout::create_incremental_info_sections): Add parameter.
9235 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9236 * object.cc: Include incremental.h.
9237 (Relobj::finalize_incremental_relocs): New function.
9238 (Sized_relobj::do_layout): Record input sections in incremental info.
9239 * object.h (Object::output_section): New function.
9240 (Object::output_section_offset): Moved from Relobj.
9241 (Object::get_incremental_reloc_base): New function.
9242 (Object::get_incremental_reloc_count): New function.
9243 (Object::do_output_section): New function.
9244 (Object::do_output_section_offset): Moved from Relobj.
9245 (Object::do_get_incremental_reloc_base): New function.
9246 (Object::do_get_incremental_reloc_count): New function.
9247 (Object::Object): Initialize new data members.
9248 (Relobj::output_section): Renamed do_output_section and moved to
9249 protected.
9250 (Relobj::output_section_offset): Moved to Object.
9251 (Relobj::do_get_incremental_reloc_base): New function.
9252 (Relobj::do_get_incremental_reloc_count): New function.
9253 (Relobj::allocate_incremental_reloc_counts): New function.
9254 (Relobj::count_incremental_reloc): New function.
9255 (Relobj::finalize_incremental_relocs): New function.
9256 (Relobj::next_incremental_reloc_index): New function.
9257 (Relobj::reloc_counts_): New data member.
9258 (Relobj::reloc_bases_): New data member.
9259 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9260 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9261 (Sized_relobj::incremental_relocs_scan): New function.
9262 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9263 (Sized_relobj::incremental_relocs_write): New function.
9264 (Sized_relobj::incremental_relocs_write_reltype): New function.
9265 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9266 incremental link.
9267 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9268 archives and object files elsewhere.
9269 (Add_symbols::run): Report object files here.
9270 (Finish_group::run): Report end of archive at end of group.
9271 * reloc.cc: Include layout.h, incremental.h.
9272 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9273 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9274 (Sized_relobj::incremental_relocs_scan): New function.
9275 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9276 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9277 (Sized_relobj::incremental_relocs_write): New function.
9278 (Sized_relobj::incremental_relocs_write_reltype): New function.
9279 * script.cc (read_input_script): Rewrite test for incremental link.
9280 Change call to Incremental_inputs::report_script.
9281 * symtab.h (Symbol_table::first_global_index): New function.
9282 (Symbol_table::output_count): New function.
9283
ce0d1972
DK
92842010-08-12 Doug Kwan <dougkwan@google.com>
9285
9286 * arm.cc (Target_arm::merge_object_attributes): Check command line
9287 options --no-wchar-size-warning and --no-enum-size-warning.
9288 * options.h (General_options): Add ld-compatible options
9289 --no-enum-size-warning and --no-wchar-size-warning.
9290
6e5710ce
ILT
92912010-08-04 Ian Lance Taylor <iant@google.com>
9292
9293 * x86_64.cc (Target_x86_64::Scan::local): Use
9294 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9295 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9296 (Target_x86_64::Scan::global): Likewise.
9297 (Target_x86_64::Relocate::relocate): Likewise.
9298 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9299 Likewise.
9300
fef830db
CC
93012010-08-03 Cary Coutant <ccoutant@google.com>
9302
9303 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9304 to reserve space in merged_strings vector. Keep total input size
9305 for stats.
9306 (Output_merge_string::do_print_merge_stats): Print total input size.
9307 * merge.h (Output_merge_string): Add input_size_ field.
9308 * stringpool.cc (Stringpool_template::string_length): Move
9309 implementations out of Stringpool_template class and place in
9310 stringpool.h.
9311 * stringpool.h (string_length): Move out of Stringpool_template.
9312
1e3811b0
ILT
93132010-08-03 Ian Lance Taylor <iant@google.com>
9314
9315 PR 11712
9316 * layout.cc (relaxation_loop_body): If address of load segment is
9317 set, adjust address to include headers if possible.
9318
7af0c620
ILT
93192010-08-03 Ian Lance Taylor <iant@google.com>
9320
9321 * version.cc (version_string): Bump to 1.10.
9322
22f0da72
ILT
93232010-08-03 Ian Lance Taylor <iant@google.com>
9324
9325 PR 11805
9326 * layout.h (enum Output_section_order): Define.
9327 (class Layout): Update declarations.
9328 * layout.cc (Layout::get_output_section): Add order parameter.
9329 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9330 is_first_non_relro parameters. Change all callers.
9331 (Layout::choose_output_section): Likewise.
9332 (Layout::add_output_section_data): Likewise.
9333 (Layout::make_output_section): Likewise. Set order.
9334 (Layout::default_section_order): New function.
9335 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9336 * output.cc (Output_section::Output_section): Initialize order_.
9337 Don't initialize deleted fields.
9338 (Output_segment::Output_segment): Don't initialize deleted
9339 fields.
9340 (Output_segment::add_output_section_to_load): New function
9341 replacing add_output_section. Change all callers to call this or
9342 add_output_section_to_nonload.
9343 (Output_segment::add_output_section_to_nonload): New function.
9344 (Output_segment::remove_output_section): Rewrite.
9345 (Output_segment::add_initial_output_data): Likewise.
9346 (Output_segment::has_any_data_sections): Likewise.
9347 (Output_segment::is_first_section_relro): Likewise.
9348 (Output_segment::maximum_alignment): Likewise.
9349 (Output_segment::has_dynamic_reloc): New function replacing
9350 dynamic_reloc_count. Change all callers.
9351 (Output_segment::has_dynamic_reloc_list): New function replacing
9352 dynamic_reloc_count_list. Change all callers.
9353 (Output_segment::set_section_addresses): Rewrite.
9354 (Output_segment::set_offset): Rewrite.
9355 (Output_segment::find_first_and_last_list): Remove.
9356 (Output_segment::set_tls_offsets): Rewrite.
9357 (Output_segment::first_section_load_address): Likewise.
9358 (Output_segment::output_section_count): Likewise.
9359 (Output_segment::section_with_lowest_load_address): Likewise.
9360 (Output_segment::write_section_headers): Likewise.
9361 (Output_segment::print_sections_to_map): Likewise.
9362 * output.h (class Output_data): Remove dynamic_reloc_count_
9363 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9364 (Output_data::add_dynamic_reloc): Rewrite.
9365 (Output_data::has_dynamic_reloc): New function.
9366 (Output_data::dynamic_reloc_count): Remove.
9367 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9368 is_last_relro_, is_first_non_relro_, is_interp_,
9369 is_dynamic_linker_section_ fields. Add order and set_order
9370 functions. Remove is_relro_local, set_is_relro_local,
9371 is_last_relro, set_is_last_relro, is_first_non_relro,
9372 set_is_first_non_relro functions, is_interp, set_is_interp,
9373 is_dynamic_linker_section, and set_is_dynamic_linker_section
9374 functions.
9375 (class Output_segment): Change Output_data_list from std::list to
9376 std:;vector. Add output_lists_ field. Remove output_data_ and
9377 output_bss_ fields. Update declarations.
9378
3ff2ccb0
ILT
93792010-08-02 Ian Lance Taylor <iant@google.com>
9380
9381 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9382 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9383 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9384
88a4108b
ILT
93852010-08-02 Ian Lance Taylor <iant@google.com>
9386
9387 PR 11855
9388 * script.cc (Script_options::Script_options): Initialize
9389 symbol_definitions_ and symbol_references_.
9390 (Script_options::add_symbol_assignment): Update
9391 symbol_definitions_ and symbol_references_.
9392 (Script_options::add_symbol_reference): New function.
9393 (script_symbol): New function.
9394 * script.h (class Script_options): Add symbol_definitions_ and
9395 symbol_references_ fields.
9396 (Script_options::referenced_const_iterator): New type.
9397 (Script_options::referenced_begin): New function.
9398 (Script_options::referenced_end): New function.
9399 (Script_options::is_referenced): New function.
9400 (Script_options::any_unreferenced): New function.
9401 * script-c.h (script_symbol): Declare.
9402 * yyscript.y (exp): Call script_symbol.
9403 * symtab.cc: Include "script.h".
9404 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9405 Change all callers. Check symbols referenced by scripts.
9406 (Symbol_table::add_undefined_symbols_from_command_line): Add
9407 layout parameter. Change all callers.
9408 (Symbol_table::do_add_undefined_symbols_from_command_line):
9409 Likewise. Break out loop body. Check symbols referenced by
9410 scripts.
9411 (Symbol_table::add_undefined_symbol_from_command_line): New
9412 function broken out of
9413 do_add_undefined_symbols_from_command_line.
9414 * symtab.h (class Symbol_table): Update declarations.
9415 * archive.cc: Include "layout.h".
9416 (Archive::should_include_member): Add layout parameter. Change
9417 all callers. Check for symbol mentioned in expression.
9418 * archive.h (class Archive): Update declaration.
9419 * object.cc (Sized_relobj::do_should_include_member): Add layout
9420 parameter.
9421 * object.h (Object::should_include_member): Add layout parameter.
9422 Change all callers.
9423 (Object::do_should_include_member): Add layout parameter.
9424 (class Sized_relobj): Update declaration.
9425 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9426 parameter.
9427 * dynobj.h (class Sized_dynobj): Update declaration.
9428 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9429 layout parameter.
9430 * plugin.h (class Sized_pluginobj): Update declaration.
9431
5f1ab67a
ILT
94322010-08-02 Ian Lance Taylor <iant@google.com>
9433
9434 PR 11866
9435 * output.cc (Output_segment::set_offset): Search for the first and
9436 last sections rather than assuming that the list is in order.
9437 (Output_segment::find_first_and_last_list): New function.
9438 * output.h (class Output_segment): Update declarations.
9439 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9440 (relro_strip_test_SOURCES): New variable.
9441 (relro_strip_test_DEPENDENCIES): New variable.
9442 (relro_strip_test_LDFLAGS): New variable.
9443 (relro_strip_test_LDADD): New variable.
9444 (relro_strip_test.so): New target.
9445
a8df5856
ILT
94462010-08-02 Ian Lance Taylor <iant@google.com>
9447
9448 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9449 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9450 (Target_i386::got_tlsdesc_section): New function.
9451 (Target_i386::got_section): Create space for GOT entries for
9452 TLSDESC relocations.
9453 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9454 R_386_TLS_GOTDESC.
9455 (Target_i386::Scan::global): Likewise.
9456 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9457 using TLSDESC GOT.
9458 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9459 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9460 (Target_x86_64::got_tlsdesc_section): New function.
9461 (Target_x86_64::got_section): Create space for GOT entries for
9462 TLSDESC relocations.
9463 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9464 R_386_TLS_GOTDESC.
9465 (Target_x86_64::Scan::global): Likewise.
9466 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9467 using TLSDESC GOT.
9468
0c10a0a6
ILT
94692010-08-02 Ian Lance Taylor <iant@google.com>
9470
9471 * testsuite/final_layout.sh: Use dc to convert from hex to
9472 decimal.
9473
41cbeecc
ST
94742010-07-29 Sriraman Tallam <tmsriram@google.com>
9475
9476 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9477 paramter to the call to gold::gc_process_relocs.
9478 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9479 paramter to the call to gold::gc_process_relocs.
9480 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9481 parameter to the call to gold::gc_process_relocs.
9482 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9483 template parameter to the call to gold::gc_process_relocs.
9484 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9485 paramter to the call to gold::gc_process_relocs.
9486 * gc.h (get_embedded_addend_size): New function.
9487 (gc_process_relocs): Save the size of the reloc for use by ICF.
9488 * icf.cc (get_section_contents): Get the addend from the text section
9489 for SHT_REL relocation sections.
9490 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9491 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9492 * int_encoding.h (read_from_pointer): New overloaded function.
9493 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9494 * testsuite/icf_sht_rel_addend_test.sh: New file.
9495 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9496 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9497
6ea55b82
RW
94982010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9499
9500 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9501 * Makefile.in: Regenerate.
9502 * testsuite/Makefile.in: Regenerate.
9503
9691462b
ILT
95042010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9505
9506 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9507 * gold/testsuite/debug_msg.cc: Likewise.
9508 * gold/testsuite/odr_violation1.cc
9509 * gold/testsuite/odr_violation2.cc
9510
76897331
CC
95112010-07-21 Cary Coutant <ccoutant@google.com>
9512
9513 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9514 string, and length fields.
9515 (Output_merge_string::Merged_strings_list): New type.
9516 (Output_merge_string::Merged_strings_lists): New typedef.
9517 (Output_merge_string): Replace merged_strings_ with
9518 merged_strings_lists_.
9519 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9520 Merged_strings_list per input object and section. Don't store pointer
9521 to the string. Don't store length with each merged string entry.
9522 (Output_merge_string::finalize_merged_data): Loop over list of merged
9523 strings lists. Recompute length of each merged string.
9524
78384e8f
CC
95252010-07-15 Cary Coutant <ccoutant@google.com>
9526
9527 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9528 here.
9529
783659f9
ILT
95302010-07-14 Ian Lance Taylor <iant@google.com>
9531
9532 * descriptors.cc (Descriptors::open): Report correct name in error
9533 message.
9534
131687b4
DK
95352010-07-13 Doug Kwan <dougkwan@google.com>
9536
9537 * arm.cc (Arm_input_section::Arm_input_section): For a
9538 SHT_ARM_EXIDX section, always keeps the input sections.
9539 (Arm_input_section::set_exidx_section_link): New method.
9540 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9541 has_errors_ to false.
9542 (Arm_exidx_input_section::has_errors,
9543 Arm_exidx_input_section::set_has_errors): New methods.
9544 (Arm_exidx_input_section::has_errors_): New data member.
9545 (Arm_relobj::get_exidx_shndx_list): New method.
9546 (Arm_output_section::append_text_sections_to_list): Do not skip
9547 section without SHF_EXECINSTR.
9548 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9549 errors.
2e702c99 9550 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9551 section header. Make error messages more verbose. Check for
9552 a non-executable section linked to an EXIDX section.
9553 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9554 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9555 check that there is no deferred EXIDX section if we exit early.
9556 Instead of not making an EXIDX section in case of an error, make one
9557 and set the has_errors flag of it.
9558 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9559 in a relocatable link.
9560 (Target_arm::do_relax): Look for the EXIDX output section instead of
9561 assuming that it is called .ARM.exidx.
2e702c99 9562 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9563 section list. Do not check for SHF_EXECINSTR section flags but
9564 skip any input section with errors.
9565 * output.cc (Output_section::Output_section): Initialize
9566 always_keeps_input_sections_ to false.
9567 (Output_section::add_input_section): Check for
9568 always_keeps_input_sections_.
9569 * output.h (Output_section::always_keeps_input_sections,
9570 Output_section::set_always_keeps_input_sections): New methods.
9571 (Output_section::always_keeps_input_sections): New data member.
9572
69517287
RÁE
95732010-07-13 Rafael Espindola <espindola@google.com>
9574
9575 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9576 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9577
82742395
ILT
95782010-07-13 Philip Herron <herron.philip@googlemail.com>
9579 Ian Lance Taylor <iant@google.com>
9580
9581 * output.h (Output_section_lookup_maps::add_merge_section):
9582 Correct check of whether value was inserted.
9583 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9584 (Output_section_lookup_maps::add_relaxed_input_section):
9585 Likewise.
9586 * arm.cc (Target_arm::got_section): Remove used local os.
9587 * i386.cc (Target_i386::got_section): Likewise.
9588 * x86_64.cc (Target_x86_64::got_section): Likewise.
9589 * sparc.cc (Target_sparc::got_section): Likewise.
9590 (Target_sparc::relocate): Remove unused local have_got_offset.
9591 * powerpc.cc (Target_powerpc::relocate): Likewise.
9592
f2d707b5
ILT
95932010-07-13 Ian Lance Taylor <iant@google.com>
9594
241531d6
ILT
9595 * compressed_output.cc (zlib_decompress): Fix signature in
9596 !HAVE_ZLIB_H case.
9597
f2d707b5
ILT
9598 * archive.cc (Archive::include_member): Unlock an external member
9599 of a thin archive. Don't bother to delete an object we know is
9600 NULL.
9601
a2e47362
CC
96022010-07-12 Cary Coutant <ccoutant@google.com>
9603
9604 * compressed_output.cc (zlib_decompress): New function.
9605 (get_uncompressed_size): New function.
9606 (decompress_input_section): New function.
9607 * compressed_output.h (get_uncompressed_size): New function.
9608 (decompress_input_section): New function.
9609 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9610 Handle compressed debug sections.
9611 * layout.cc (is_compressed_debug_section): New function.
9612 (Layout::output_section_name): Map compressed section names to
9613 canonical names.
9614 * layout.h (is_compressed_debug_section): New function.
9615 (is_debug_info_section): Recognize compressed debug sections.
9616 * merge.cc: Include compressed_output.h.
9617 (Output_merge_data::do_add_input_section): Handle compressed
9618 debug sections.
9619 (Output_merge_string::do_add_input_section): Handle compressed
9620 debug sections.
9621 * object.cc: Include compressed_output.h.
9622 (Sized_relobj::Sized_relobj): Initialize new data members.
9623 (build_compressed_section_map): New function.
9624 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9625 * object.h (Object::section_is_compressed): New method.
9626 (Object::do_section_is_compressed): New method.
9627 (Sized_relobj::Compressed_section_map): New type.
9628 (Sized_relobj::do_section_is_compressed): New method.
9629 (Sized_relobj::compressed_sections_): New data member.
9630 * output.cc (Output_section::add_input_section): Handle compressed
9631 debug sections.
9632 * reloc.cc: Include compressed_output.h.
9633 (Sized_relobj::write_sections): Handle compressed debug sections.
9634
ce279a62
CC
96352010-07-08 Cary Coutant <ccoutant@google.com>
9636
9637 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9638 weak when resolving to a dynamic def.
9639 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9640 for weak undef/dynamic def cases. Adjust callers.
9641 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9642 undef_binding_weak_.
9643 (Symbol_table::sized_write_globals): Adjust symbol binding.
9644 (Symbol_table::sized_write_symbol): Add binding parameter.
9645 * symtab.h (Symbol::set_undef_binding): New method.
9646 (Symbol::is_undef_binding_weak): New method.
9647 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9648 (Symbol_table::should_override): Add new parameter.
9649 (Symbol_table::sized_write_symbol): Add new parameter.
9650
9651 * testsuite/weak_undef_file1.cc: Add new test case.
9652 * testsuite/weak_undef_file2.cc: Fix header comment.
9653 * testsuite/weak_undef_test.cc: Add new test case.
9654
b2286c10
DK
96552010-06-29 Doug Kwan <dougkwan@google.com>
9656
9657 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9658 Initialize USE_SYMBOL_.
9659 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9660 definition.
9661 (Arm_reloc_property::uses_symbol_): New data member declaration.
9662 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9663 uses symbol value and symbol is undefined but not weakly undefined.
9664
4802450a
RÁE
96652010-06-28 Rafael Espindola <espindola@google.com>
9666
9667 * plugin.cc (Plugin::load): Use dlerror.
9668
e5ca47ba
ILT
96692010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9670
9671 * symtab.cc (detect_odr_violations): When reporting an ODR
9672 violation, report an object where the symbol is defined.
9673
8a75a161
DK
96742010-06-25 Doug Kwan <dougkwan@google.com>
9675
9676 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9677 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9678 definition.
9679 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9680 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9681 target hook to detect function points.
9682 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9683 * icf.h (Icf::check_section_for_function_pointers): Change type of
9684 parameter SECTION_NAME to const reference to std::string. Use
9685 target hook to determine if section may have unsafe pointers.
9686 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9687 method definition.
9688
42218b9f
RÁE
96892010-06-21 Rafael Espindola <espindola@google.com>
9690
9691 * fileread.cc (Input_file::find_fie): New
9692 (Input_file::open): Use Input_file::find_fie.
9693 * fileread.h (Input_file::find_fie): New
9694 * plugin.cc (set_extra_library_path): New.
9695 (Plugin::load): Add set_extra_library_path to the transfer vector.
9696 (Plugin_manager::set_extra_library_path): New.
9697 (Plugin_manager::add_input_file): Use the extra search path if set.
9698 (set_extra_library_path(): New.
9699 * plugin.h (Plugin_manager): Add set_extra_library_path and
9700 extra_search_path_.
9701
a0506cca
CC
97022010-06-19 Cary Coutant <ccoutant@google.com>
9703
9704 * layout.cc (gdb_sections): Add .debug_types.
9705 (lines_only_debug_sections): Likewise.
9706
6508b958
RÁE
97072010-06-18 Rafael Espindola <espindola@google.com>
9708
9709 * plugin.cc (add_input_file,add_input_library)
9710 (Plugin_manager::add_input_file): Make filename arguments const.
9711 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9712 const.
9713
3e235302
DK
97142010-06-16 Doug Kwan <dougkwan@google.com>
9715
9716 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9717 .ARM.attributes section if we have not merged any input
9718 attributes sections.
9719
106e8a6c
DK
97202010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9721
9722 * arm.cc: Allow combining objects with no EABI version
9723 information.
9724
91ff43fe
RÁE
97252010-06-15 Rafael Espindola <espindola@google.com>
9726
9727 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9728
68ed838c
ILT
97292010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9730
9731 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9732 (struct iovec): Correct !HAVE_READV definition.
9733
f3a2388f
CC
97342010-06-10 Cary Coutant <ccoutant@google.com>
9735
9736 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9737 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9738 reloc sections.
9739 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9740
9741 PR 11683
9742 * symtab.h (Symbol::is_placeholder): New member function.
9743 * target-reloc.h (relocate_section): Check for placeholder symbols.
9744
9745 * testsuite/Makefile.am (plugin_test_8): New test.
9746 (plugin_test_9): New test.
9747 * testsuite/Makefile.in: Regenerate.
9748
e1df38aa
NC
97492010-06-09 Nick Clifton <nickc@redhat.com>
9750
9751 * yyscript.y (input_list_element): Allow strings prefixed with
9752 the '-' character. Treat these as libraries.
9753 * script.cc (script_add_library): New function. Adds a library
9754 specified by "-l<name>" found in an input script.
9755 * script-c.h: Add prototype for script_add_library.
9756
25bbe950
DK
97572010-06-07 Doug Kwan <dougkwan@google.com>
9758
9759 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9760 Restrict stub-group size to be within long conditional branch
9761 range when working around cortex-A8 erratum.
9762
0f32ea4c
ILT
97632010-06-07 Damien Diederen <dd@crosstwine.com>
9764
9765 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9766 #ifdef typo.
9767
8fe2a369
ST
97682010-06-03 Sriraman Tallam <tmsriram@google.com>
9769
9770 PR gold/11658
9771 * output.cc
9772 (Output_section::Input_section_sort_entry::compare_section_ordering):
9773 Change to return non-zero correctly.
9774 (Output_section::Input_section_sort_section_order_index_compare
9775 ::operator()): Change to fix ambiguity in comparisons.
9776
6e9ba2ca
ST
97772010-06-01 Sriraman Tallam <tmsriram@google.com>
9778
9779 * gold.h (is_wildcard_string): New function.
9780 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9781 (Layout::layout_eh_frame): Ditto.
9782 (Layout::find_section_order_index): New method.
9783 (Layout::read_layout_from_file): New method.
9784 * layout.h (Layout::find_section_order_index): New method.
9785 (Layout::read_layout_from_file): New method.
9786 (Layout::input_section_position_): New private member.
9787 (Layout::input_section_glob_): New private member.
9788 * main.cc (main): Call read_layout_from_file here.
9789 * options.h (--section-ordering-file): New option.
9790 * output.cc (Output_section::input_section_order_specified_): New
9791 member.
9792 (Output_section::Output_section): Initialize new member.
9793 (Output_section::add_input_section): Add new parameter.
9794 Keep input sections when --section-ordering-file is used.
9795 (Output_section::set_final_data_size): Sort input sections when
9796 section ordering file is specified.
9797 (Output_section::Input_section_sort_entry): Add new parameter.
9798 Check sorting type.
9799 (Output_section::Input_section_sort_entry::compare_section_ordering):
9800 New method.
9801 (Output_section::Input_section_sort_compare::operator()): Change to
9802 consider section_order_index.
9803 (Output_section::Input_section_sort_init_fini_compare::operator()):
9804 Change to consider section_order_index.
9805 (Output_section::Input_section_sort_section_order_index_compare
9806 ::operator()): New method.
9807 (Output_section::sort_attached_input_sections): Change to sort
9808 according to section order when specified.
e1df38aa
NC
9809 (Output_section::add_input_section<32, true>): Add new parameter.
9810 (Output_section::add_input_section<64, true>): Add new parameter.
9811 (Output_section::add_input_section<32, false>): Add new parameter.
9812 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9813 * output.h (Output_section::add_input_section): Add new parameter.
9814 (Output_section::input_section_order_specified): New
9815 method.
9816 (Output_section::set_input_section_order_specified): New method.
9817 (Input_section::Input_section): Initialize section_order_index_.
9818 (Input_section::section_order_index): New method.
9819 (Input_section::set_section_order_index): New method.
9820 (Input_section::section_order_index_): New member.
9821 (Input_section::Input_section_sort_section_order_index_compare): New
9822 struct.
9823 (Output_section::input_section_order_specified_): New member.
9824 * script-sections.cc (is_wildcard_string): Delete and move modified
9825 method to gold.h.
9826 (Output_section_element_input::Output_section_element_input): Modify
9827 call to is_wildcard_string.
9828 (Output_section_element_input::Input_section_pattern
9829 ::Input_section_pattern): Ditto.
9830 (Output_section_element_input::Output_section_element_input): Ditto.
9831 * testsuite/Makefile.am (final_layout): New test case.
9832 * testsuite/Makefile.in: Regenerate.
9833 * testsuite/final_layout.cc: New file.
9834 * testsuite/final_layout.sh: New file.
9835
3537c84b
RÁE
98362010-06-01 Rafael Espindola <espindola@google.com>
9837
9838 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9839
105b6afd
RÁE
98402010-06-01 Rafael Espindola <espindola@google.com>
9841
9842 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9843 visibility of symbols.
9844
29e11421
DK
98452010-05-27 Doug Kwan <dougkwan@google.com>
9846
9847 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9848 from start of output section instead of address for a local symbol
9849 in a merged or relaxed section when doing a relocatable link.
9850
5e0f337e
RÁE
98512010-05-26 Rafael Espindola <espindola@google.com>
9852
703d02da 9853 PR 11604
5e0f337e
RÁE
9854 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9855 adding sections the garbage collector removed.
9856 * gold/testsuite/Makefile.am: Add test.
9857 * gold/testsuite/Makefile.in: Regenerate.
9858 * gold/testsuite/plugin_test_7.sh: New.
9859 * gold/testsuite/plugin_test_7_1.c: New.
9860 * gold/testsuite/plugin_test_7_2.c: New.
9861
f4187277
RÁE
98622010-05-26 Rafael Espindola <espindola@google.com>
9863
9864 * script-sections.cc (Output_section_definition::set_section_addresses):
9865 Check for --section-start.
9866
5c388529
DK
98672010-05-26 Doug Kwan <dougkwan@google.com>
9868
9869 * arm.cc (Arm_scan_relocatable_relocs): New class.
9870 (Target_arm::relocate_special_relocatable): New method.
9871 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9872 (Arm_relocate_functions::thumb_branch_common): Same.
9873 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9874 instead of Default_scan_relocatable_relocs.
9875 * target-reloc.h (relocate_for_relocatable): Let target handle
9876 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9877 * target.h (Sized_target::relocate_special_relocatable): New method.
9878
bca1c3ae
ILT
98792010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9880
9881 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9882
0439c796
DK
98832010-05-23 Doug Kwan <dougkwan@google.com>
9884
9885 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9886 instead of a cast.
9887 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9888 with a direct branch, not a conditional branch, to a stub.
9889 * merge.cc (Output_merge_base::record_input_section): New method
9890 defintion.
9891 (Output_merge_data::do_add_input_section): Record input section if
9892 keeps-input-sections flag is set.
9893 (Output_merge_string::do_add_input_section): Ditto.
9894 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9895 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9896 INPUT_SECTIONS_.
9897 (Output_merge_base::keeps_input_sections,
9898 Output_merge_base::set_keeps_input_sections,
9899 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9900 method definitions.
9901 (Output_merge_base::Input_sections): New type declaration.
9902 (Output_merge_base::input_sections_begin,
9903 Output_merge_base::input_sections_end,
9904 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9905 (Output_merge_base::bool keeps_input_sections_,
9906 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9907 Output_merge_base::input_sections_): New data members.
9908 (Output_merge_data::do_set_keeps_input_sections): New method
9909 defintion.
9910 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9911 * output.cc (Output_section::Input_section::relobj): Move method
9912 defintion from class declaration to here and handle merge sections.
9913 (Output_section::Input_section::shndx): Ditto.
9914 (Output_section::Output_section): Remove initializations of removed
9915 data members and initialize new data member LOOKUP_MAPS_.
9916 (Output_section::add_input_section): Set keeps-input-sections flag
9917 for a newly created merge output section as appropriate. Adjust code
9918 to use Output_section_lookup_maps class.
9919 (Output_section::add_relaxed_input_section): Adjst code for lookup
9920 maps code refactoring.
2e702c99 9921 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9922 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9923 class. If adding input section to a newly created merge output
9924 section fails, remove the new merge section.
9925 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9926 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9927 (Output_section::find_merge_section): Ditto.
0439c796 9928 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9929 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9930 Output_section_lookup_maps class.
9931 (Output_section::get_input_sections): Export merge sections. Adjust
9932 code to use Output_section_lookup_maps class.
9933 (Output_section:::add_script_input_section): Adjust code to use
9934 Output_section_lookup_maps class. Update lookup maps for merge
9935 sections also.
9936 (Output_section::discard_states): Use Output_section_lookup_maps.
9937 (Output_section::restore_states): Same.
9938 * output.h (Merge_section_properties): Move class defintion out of
9939 Output_section.
9940 (Output_section_lookup_maps): New class.
9941 (Output_section::Input_section::is_merge_section): New method
9942 defintion.
9943 (Output_section::Input_section::relobj): Move defintion out of class
9944 defintion. Declare method only.
9945 (Output_section::Input_section::shndx): Ditto.
9946 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9947 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9948 (Output_section::Merge_section_by_properties_map,
9949 Output_section::Output_section_data_by_input_section_map,
9950 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9951 Remove types.
2e702c99 9952 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9953 KEEPS_INPUT_SECTIONS.
9954 (Output_section::build_lookup_maps): New method declaration.
9955 (Output_section::merge_section_map_,
9956 Output_section::merge_section_by_properties_map_,
9957 Output_section::relaxed_input_section_map_,
9958 Output_section::is_relaxed_input_section_map_valid_): Remove data
9959 members.
9960 (Output_section::lookup_maps_): New data member.
9961
76295588
L
99622010-05-21 Doug Kwan <dougkwan@google.com>
9963
9964 PR gold/11619
9965 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9966 avoid a compilation error.
9967
d103a984
RÁE
99682010-05-19 Rafael Espindola <espindola@google.com>
9969
9970 * script-sections.cc (Output_section_definition::allocate_to_segment):
9971 Update the phdrs_list even when the output section is NULL.
9972 * testsuite/Makefile.am: Add test.
9973 * testsuite/Makefile.in: Regenerate.
9974 * testsuite/script_test_9.cc: New.
9975 * testsuite/script_test_9.sh: New.
9976 * testsuite/script_test_9.t: New.
9977
6625d24e
DK
99782010-05-19 Doug Kwan <dougkwan@google.com>
9979
9980 * arm.cc (Arm_input_section::original_size): New method.
9981 (Arm_input_section::do_addralign): Add a cast.
9982 (Arm_input_section::do_output_offset): Remove static cast.
9983 (Arm_input_section::original_addralign,
9984 Arm_input_section::original_size_): Change type to uint32_t.
9985 (Arm_input_section::init): Add safe casts for section alignment
9986 and size.
9987 (Arm_input_section::set_final_data_size): Do not set address and
9988 offset of stub table.
9989 (Arm_output_section::fix_exidx_coverage): Change use of of
9990 Output_section::Simple_input_section to that of
9991 Output_section::Input_section.
9992 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9993 except for the first pass.
9994 * output.cc (Output_section::get_input_sections): Change type of
9995 input_sections to std::list<Input_section>.
9996 (Output_section::add_script_input_section): Rename from
9997 Output_section::add_simple_input_section. Change type of SIS
9998 parameter from Simple_input_section to Input_section.
9999 * output.h (Output_section::Simple_input_section): Remove class.
10000 (Output_section::Input_section): Change class visibility to public.
10001 (Output_section::Input_section::addralign): Use stored alignments
10002 for special input sections if set.
10003 (Output_section::Input_section::set_addralign): New method.
10004 (Output_section::get_input_sections): Change parameter type from
10005 list of Simple_input_section to list of Input_section.
10006 (Output_section::add_script_input_section): Rename from
10007 Output_section::add_simple_input_section. Change first parameter's
10008 type from Simple_input_section to Input_section and remove the
10009 second and third parameters.
10010 * script-sections.cc (Input_section::Input_section_list): Change
10011 type to list of Output_section::Input_section/
10012 (Input_section_info::Input_section_info): Change parameter type of
10013 INPUT_SECTION to Output_section::Input_section.
10014 (Input_section_info::input_section): Change return type.
10015 (Input_section_info::input_section_): Change type to
10016 Output_section::Input_section.
10017 (Output_section_element_input::set_section_addresses): Adjust code
10018 to use Output_section::Input_section instead of
10019 Output_section::Simple_input_section. Adjust code for renaming
10020 of Output_section::add_simple_input_section.
10021 (Orphan_output_section::set_section_addresses): Ditto.
10022
e1e82ea4
RW
100232010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10024
10025 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10026 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10027
91e75c8a
RÁE
100282010-05-18 Rafael Espindola <espindola@google.com>
10029
10030 * options.cc (General_options::finalize): Handle -nostdlib.
10031 * options.h (nostdlib): New option.
10032 * script.cc (script_add_search_dir): Handle -nostdlib.
10033
da59ad79
DK
100342010-05-12 Doug Kwan <dougkwan@google.com>
10035
10036 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10037 attributes section only if there no attributes section after merging.
10038 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10039 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10040 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10041 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10042 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10043 and arm_attr_merge_7.stdout.
10044 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10045 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10046 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10047 arm_attr_merge_7b.o): New rules.
10048 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10049 arm_attr_merge_7
10050 * testsuite/Makefile.in: Regenerate.
10051 * testsuite/arm_attr_merge.sh: New file.
10052 * testsuite/arm_attr_merge_[67][ab].s: Same.
10053
3e01a7fd
NC
100542010-05-05 Nick Clifton <nickc@redhat.com>
10055
10056 * po/es.po: Updated Spanish translation.
10057
7ad2014a
L
100582010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10059
10060 * Makefile.am (install-exec-local): Properly install gold as
10061 default cross linker.
10062 * Makefile.in: Regenerated.
10063
4fda8867
NC
100642010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10065 Nick Clifton <nickc@redhat.com>
10066
10067 * configure.ac (install_as_default): Define and set to false
10068 unless --enable-gold or --enable-gold=both/gold has been
10069 specified.
10070 * configure: Regenerate.
10071
10072 * Makefile.am (install-exec-local): Install the executable as
10073 'ld.gold'. If install_as_default is true then also install it as
10074 'ld'.
10075 * Makefile.in: Regenerated.
10076
bd288ea2
ILT
100772010-04-24 Ian Lance Taylor <iant@google.com>
10078
10079 * layout.cc (Layout::layout_reloc): In relocatable link don't
10080 combine reloc sections for grouped sections.
10081
ef38fd8a
ST
100822010-04-23 Sriraman Tallam <tmsriram@google.com>
10083
10084 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10085 sections that are not ordinary to icf.
10086 * icf.cc (get_section_contents): Handle relocation pointing to section
10087 with no object or shndx information.
10088 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10089 * testsuite/Makefile.in: Regenerate.
10090 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10091 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10092
f6973bdc
ILT
100932010-04-22 Ian Lance Taylor <iant@google.com>
10094
10095 * expression.cc (Expression::Expression_eval_info): Add
10096 result_alignment_pointer field.
10097 (Expression::eval_with_dot): Add result_alignment_pointer
10098 parameter. Change all callers.
10099 (Expression::eval_maybe_dot): Likewise.
10100 (class Binary_expression): Add alignment_pointer parameter to
10101 left_value and right_value. Change all callers.
10102 (BINARY_EXPRESSION): Set result alignment.
10103 (class Trinary_expression): Add alignment_pointer parameter to
10104 arg2_value and arg3_value. Change all callers.
10105 (Trinary_cond::value): Set result alignment.
10106 (Max_expression::value, Min_expression::value): Likewise.
10107 (Align_expression::value): Likewise.
10108 * script-sections.cc (class Sections_element): Add dot_alignment
10109 parameter to set_section_addresses virtual function. Update
10110 instantiations.
10111 (class Output_section_element): Likewise.
10112 (Script_sections::create_segments): Add dot_alignment parameter.
10113 Change all callers.
10114 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10115 (Script_sections::set_phdrs_clause_addresses): Likewise.
10116 * script-sections.h: Update declarations.
10117 * script.h: Update declarations.
10118 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10119 min_p_align.
10120 * testsuite/script_test_3.t: Set large alignment.
10121 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10122 segment has expected alignment.
10123
9c9c98a5
NC
101242010-04-22 Nick Clifton <nickc@redhat.com>
10125
10126 * po/gold.pot: Updated by the Translation project.
10127 * po/vi.po: Updated Vietnamese translation.
10128
2253bfba
L
101292010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10130
10131 * testsuite/Makefile.am (check_PROGRAMS): Add
10132 icf_virtual_function_folding_test.
10133 * testsuite/Makefile.in: Regenerated.
10134
85fdf906
AH
101352010-04-15 Andrew Haley <aph@redhat.com>
10136
10137 * options.h (merge_exidx_entries): New option.
10138 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10139 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10140 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10141 (Target_arm::merge_exidx_entries): New function.
10142 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10143 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10144 to Arm_exidx_fixup constructor.
10145 Add new arg, merge_exidx_entries.
10146 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10147 Arm_output_section::fix_exidx_coverage.
10148
ce97fa81
ST
101492010-04-18 Sriraman Tallam <tmsriram@google.com>
10150
10151 * icf.cc (get_section_contents): Check for preemptible functions.
10152 Ignore addend when appropriate.
10153 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10154 section folded.
10155 (add_from_relobj): Check for section folded.
10156 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10157 * symtab.h (should_add_dynsym_entry): Add new parameter.
10158 * target-reloc.h (scan_relocs): Check for section folded.
10159 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10160 Check reloc types for function pointers in shared objects.
10161 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10162 case.
10163 (icf_preemptible_functions_test): New test case.
10164 (icf_string_merge_test): New test case.
10165 * testsuite.Makefile.in: Regenerate.
10166 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10167 bar_glob. Refactor code.
10168 * testsuite/icf_preemptible_functions_test.cc: New file.
10169 * testsuite/icf_preemptible_functions_test.sh: New file.
10170 * testsuite/icf_string_merge_test.cc: New file.
10171 * testsuite/icf_string_merge_test.sh: New file.
10172 * testsuite/icf_virtual_function_folding_test.cc: New file.
10173 * testsuite/icf_virtual_function_folding_test.sh: New file.
10174
04ceb17c
DK
101752010-04-14 Doug Kwan <dougkwan@google.com>
10176
10177 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10178 for local symbol recounting if we remove a section due to ICF.
10179 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10180 there are no regular objects in input.
10181
153e7da4
DK
101822010-04-13 Doug Kwan <dougkwan@google.com>
10183
10184 * arm.cc (Arm_input_section::set_final_data_size): Compute
10185 accurate final data size instead of using current data size.
10186
4dbd9faf
DK
101872010-04-09 Doug Kwan <dougkwan@google.com>
10188
10189 * layout.cc (Layout::choose_output_section): Handle script section
10190 types.
10191 (Layout::make_output_section_for_script): Add section type parameter.
10192 Handle script section types.
10193 * layout.h (Layout::make_output_section_for_script): Add section
10194 type parameter.
10195 * output.cc (Output_section::Output_section): Initialize data member
10196 is_noload_.
10197 (Output_section::do_reset_address_and_file_offset): Do not set address
10198 to 0 if section is a NOLOAD section.
10199 * output.h (Output_section::is_noload): New method.
10200 (Output_section::set_is_noload): Ditto.
10201 (Output_section::is_noload_): New data member.
10202 * script-c.h (Script_section_type): New enum type.
10203 (struct Parser_output_section_header): Add new file section_type.
10204 * script-sections.cc (Sections_element::output_section_name): Add
10205 parameter for returning script section type.
10206 (Output_section_definition::output_section_name): Ditto.
10207 (Output_section_definition::section_type)P; New method.
10208 (Output_section_definiton::script_section_type_name): Ditto.
10209 (Output_section_definition::script_section_type_): New data member.
10210 (Output_section_definition::Output_section_definition): Initialize
10211 data member Output_section_definition::script_section_type_.
10212 (Output_section_definition::create_sections): Pass script section type
10213 to Layout::make_output_section_for_script.
10214 (Output_section_definition::output_section_name): Return script
10215 section type to caller.
10216 (Output_section_definition::set_section_address): Do not advance
10217 dot value and load address if section type is NOLOAD. Set address
10218 of NOLOAD sections regardless of section flags.
10219 (Output_section_definition::print): Print section type if it is
10220 not SCRIPT_SECTION_TYPE_NONE.
10221 (Output_section_definition::section_type): New method.
10222 (Output_section_definition::script_section_type_name): Ditto.
10223 (Script_sections::output_section_name): Add new parameter
10224 PSECTION_TYPE for returning script section type. Pass it to
10225 section elements. Handle discard sections.
10226 (Sort_output_sections::operator()): Handle NOLOAD sections.
10227 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10228 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10229 returning script section type.
10230 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10231 INFO and NOLOAD.
10232 * yyscript.y (union): Add new field SECTION_TYPE.
10233 (COPY, DSECT, INFO, NOLOAD): New tokens.
10234 (opt_address_and_section_type): Change type to output_section_header.
10235 (section_type): New non-terminal
10236 (section_header): Handle section type.
2253bfba 10237 (opt_address_and_section_type): Return section type value.
4dbd9faf 10238
721ea635
L
102392010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10240
10241 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10242 * testsuite/plugin_common_test_2.c (foo): Likewise.
10243
6bf924b0
DK
102442010-04-08 Doug Kwan <dougkwan@google.com>
10245
10246 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10247 Output_merge_data.
10248 * output.cc (Output_section::add_merge_input_section): Simplify
10249 code and return status of Output_merge_base::add_input_section.
e1df38aa 10250 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10251 returns true.
10252
24af6f92
DK
102532010-04-07 Doug Kwan <dougkwan@google.com>
10254
10255 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10256 if section is marked as containing instructions but has no mapping
10257 symbols.
10258 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10259 correct section index.
10260 (Arm_relobj::find_linked_text_section): Ditto.
10261
00698fc5
CC
102622010-04-07 Cary Coutant <ccoutant@google.com>
10263
10264 * archive.cc (include_member): Destroy Read_symbols_data object before
10265 releasing file.
10266 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10267 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10268 (Read_symbols_data::~Read_symbols_data) New destructor.
10269 (Section_relocs::Section_relocs) New constructor.
10270 (Section_relocs::~Section_relocs) New destructor.
10271 (Read_relocs_data::Read_relocs_data) New constructor.
10272 (Read_relocs_data::~Read_relocs_data) New destructor.
10273 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10274 pointers to NULL after deleting.
10275
7296d933
DK
102762010-04-07 Doug Kwan <dougkwan@google.com>
10277
10278 * arm.cc: Replace "endianity" with "endianness" in comments.
10279 (Arm_exidx_cantunwind): Ditto.
10280 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10281 (Arm_relobj::merge_flags_and_attributes): New method.
10282 (Arm_relobj::merge_flags_and_attributes_): New data member.
10283 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10284 (Arm_relobj::scan_sections_for_stubs): Ditto.
10285 (Arm_relobj::do_read_symbols): Check to see if we really want to
10286 merge processor-specific flags and attributes. Exit early if
10287 an object is empty except for section names and the undefined symbol.
10288 (Target_arm::do_finalize_sections): Move check for ELF format to
10289 Arm_relobj::do_read_symbols. Merge processor specific flags and
10290 attributes from a regular object only when we have determined that
10291 it is aapropriate. Do not create an .ARM.attributes section in
10292 output if there is no regular input object.
10293 (Target_arm::merge_processor_specific_flags): Check
10294 --warn-mismatch before printing any error.
10295 (Target_arm::merge_object_attributes): Ditto.
10296 * gold.cc (queue_middle_tasks): Handle the case in which there is
10297 no regular object in input.
10298 * options.cc (General_options::parse_EB): New method.
10299 (General_options::parse_EL): Same.
10300 (General_options::General_options): Initialize endianness_.
10301 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10302 New options.
10303 (General_options::Endianness): New enum.
10304 (General_options::endianness): New method.
10305 (General_options::endianness_): New data member.
10306 * parameters.cc (Parameters::set_options): Check target endianness.
10307 (Parameters::set_target_once): Ditto.
10308 (Parameters::check_target_endianness): New method.
10309 (parameters_force_valid_target): If either -EL or -EB is specified,
10310 use it to define endianness of default target.
10311 * parameters.h (Parameters::check_target_endianness): New method
10312 declaration.
10313 * target.h (class Target): Change "endianity" to "endianness"
10314 in comments.
10315
efc8d4f2
RW
103162010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10317
10318 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10319 * configure: Regenerate.
10320 * Makefile.in: Regenerate.
10321 * testsuite/Makefile.in: Regenerate.
10322
be234d88
CC
103232010-04-06 Cary Coutant <ccoutant@google.com>
10324
10325 gcc PR lto/42757
10326 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10327 prevailing definitions of common symbols.
10328 * testsuite/plugin_test_6.sh: New test case.
10329 * testsuite/plugin_common_test_1.c: New test case.
10330 * testsuite/plugin_common_test_2.c: New test case.
10331 * testsuite/Makefile.am (plugin_test_6): New test case.
10332 * testsuite/Makefile.in: Regenerate.
10333
bd32c6bd
NC
103342010-04-06 Nick Clifton <nickc@redhat.com>
10335
10336 * po/vi.po: New Vietnamese translation.
10337
323c532f
DK
103382010-03-30 Doug Kwan <dougkwan@google.com>
10339
10340 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10341
4fcd97eb
DK
103422010-03-25 Doug Kwan <dougkwan@google.com>
10343
10344 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10345 to avoid a conversion warning on a 32-bit host.
10346
4ebf39db
ILT
103472010-03-24 Ian Lance Taylor <iant@google.com>
10348
10349 * testsuite/script_test_3.t: Add a TLS segment.
10350 * testsuite/Makefile.am (check_PROGRAMS): Add
10351 tls_phdrs_script_test.
10352 (tls_phdrs_script_test_SOURCES): Define.
10353 (tls_phdrs_script_test_DEPENDENCIES): Define.
10354 (tls_phdrs_script_test_LDFLAGS): Define.
10355 (tls_phdrs_script_test_LDADD): Define.
10356 * testsuite/Makefile.in: Rebuild.
10357
4a599bdd
CC
103582010-03-23 Cary Coutant <ccoutant@google.com>
10359
10360 * fileread.cc (find_or_make_view): Fix comment.
10361
6c93b22c
ILT
103622010-03-23 Ian Lance Taylor <iant@google.com>
10363
10364 * script-sections.cc (class Orphan_section_placement): Define
10365 PLACE_TLS and PLACE_TLS_BSS.
10366 (Orphan_section_placement::Orphan_section_placement): Initialize
10367 new places.
10368 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10369 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10370 (tls_script_test_SOURCES): Define.
10371 (tls_script_test_DEPENDENCIES): Define.
10372 (tls_script_test_LDFLAGS): Define.
10373 (tls_script_test_LDADD): Define.
10374 * testsuite/Makefile.in: Rebuild.
10375
a2c7281b
DK
103762010-03-22 Doug Kwan <dougkwan@google.com>
10377
10378 * arm.cc (Arm_relocate_functions::abs8,
10379 Arm_relocate_functions::abs16): Use correct check for overflow
10380 specified in the ARM ELF specs.
10381 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10382 target of a BLX instruction specially.
10383 (Reloc_stub::stub_type_for_reloc): Ditto.
10384 (Relocate::relocate): Use symbolic names instead of numeric relocation
10385 codes to report error.
10386 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10387 workaround.
10388 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10389 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10390 thumb2_blx_out_of_range.stdout
10391 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10392 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10393 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10394 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10395 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10396 thumb2_blx_in_range, thumb2_blx_in_range.o,
10397 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10398 thumb2_blx_out_of_range.o): New rules.
2e702c99 10399 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10400 thumb2_blx_in_range and thumb2_blx_out_of_range.
10401 * testsuite/Makefile.in: Regenerate.
10402 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10403 * testsuite/thumb_blx_in_range.s: New file.
10404 * testsuite/thumb_blx_out_of_range.s: New file.
10405
b0193076
RÁE
104062010-03-22 Rafael Espindola <espindola@google.com>
10407
10408 * archive.cc (Should_include): Move to archive.h.
10409 (should_include_member): Make it a member of Archive.
10410 (Lib_group): New.
10411 (Add_lib_group_symbols): New.
10412 * archive.h: Include options.h.
10413 (Archive_member): Moved from Archive.
10414 (Should_include): Moved from archive.cc.
10415 (Lib_group): New.
10416 (Add_lib_group_symbols): New.
10417 * dynobj.cc (do_should_include_member): New.
10418 * dynobj.h (do_should_include_member): New.
10419 * gold.cc (queue_initial_tasks): Update call to queue.
10420 * main.cc (main): Print lib group stats.
10421 * object.cc (do_should_include_member): New.
10422 * object.h: Include archive.h.
10423 (Object::should_include_member): New.
10424 (Object::do_should_include_member): New.
10425 (Sized_relobj::do_should_include_member): New.
10426 * options.cc (General_options::parse_start_lib): New.
10427 (General_options::parse_end_lib): New.
10428 (Input_arguments::add_file): Handle lib groups.
10429 (Input_arguments::start_group): Check we are not in a lib.
10430 (Input_arguments::start_lib): New.
10431 (Input_arguments::end_lib): New.
10432 * options.h (General_options): Add start_lib and end_lib.
10433 (Input_argument::lib_): New.
10434 (Input_argument::lib): New.
10435 (Input_argument::is_lib): New.
10436 (Input_file_lib): New.
10437 (Input_arguments::in_lib_): New.
10438 (Input_arguments::in_lib): New.
10439 (Input_arguments::start_lib): New.
10440 (Input_arguments::end_lib_): New.
10441 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10442 in unused members as preempted.
10443 (Sized_pluginobj::do_should_include_member): New.
10444 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10445 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10446 return the blocker.
10447 (Read_symbols::do_whole_lib_group): New.
10448 (Read_symbols::do_lib_group): New.
10449 (Read_symbols::do_read_symbols): Handle lib groups.
10450 (Read_symbols::get_name): Handle lib groups.
10451 * readsyms.h (Read_symbols): Add an archive member pointer.
10452 (Read_symbols::do_whole_lib_group): New.
10453 (Read_symbols::do_lib_group): New.
10454 (Read_symbols::member_): New.
10455 * script.cc (read_input_script): Update call to queue_soon.
10456
d099120c
DK
104572010-03-19 Doug Kwan <dougkwan@google.com>
10458
10459 * arm.cc (Stub_table::Stub_table): Initialize new data members
10460 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10461 (Stub_table::add_reloc_stub): Assign stub offset and update
10462 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10463 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10464 New data members.
2e702c99 10465 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10466 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10467 instead of going over all reloc stubs.
2e702c99 10468 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10469 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10470 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10471 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10472 Stringpool_template::offset_.
10473 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10474 Stringpool_template::offset_ to zero.
10475
1aa37384
DK
104762010-03-15 Doug Kwan <dougkwan@google.com>
10477
10478 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10479 offset_.
10480 (Stringpool_template::new_key_offset): New method.
10481 (Stringpool_template::add_string): Assign offsets when adding new
10482 strings.
10483 (Stringpool_template::set_string_offsets): Do not set string offsets
10484 when not optimizing.
10485 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10486 member size_.
2e702c99
RM
10487 (Chunked_vector::clear): Clear size_.
10488 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10489 (Chunked_vector::size): Return size_.
10490 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10491 (Chunked_vector::size_): New data member.
1aa37384
DK
10492 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10493 (Stringpool_template::new_key_offset): New method declaration.
10494 (Stringpool_template::offset_): New data member.
10495
b672b057
RÁE
104962010-03-15 Rafael Espindola <espindola@google.com>
10497
10498 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10499 Add_symbols' constructor.
10500 * readsyms.h (Add_symbols): Remove the input_group member.
10501
b6848d3c
ILT
105022010-03-10 Ian Lance Taylor <iant@google.com>
10503
10504 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10505 target to ask whether a reference to a symbol requires a stack
10506 split.
10507 * target.h (Target::is_call_to_non_split): New function.
10508 (Target::do_is_call_to_non_split): Declare virtual function.
10509 * target.cc: Include "symtab.h".
10510 (Target::do_is_call_to_non_split): New function.
10511 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10512
a2a5469e
CC
105132010-03-10 Cary Coutant <ccoutant@google.com>
10514
10515 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10516 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10517 (File_read::open[2]): Add whole_file_view_ to list of views.
10518 (File_read::make_view): Remove test of whole_file_view_.
10519 (File_read::find_or_make_view): Create whole_file_view_ if
10520 necessary.
10521 (File_read::clear_views): Replace bool parameter with enum;
10522 adjust all callers. Don't delete views with permanent data;
10523 do delete cached views and views from archives if
10524 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10525 if clearing the corresponding view.
10526 * fileread.h (File_read::Clear_views_mode): New enum.
10527 (File_read::View::is_permanent_view): New method.
10528 (File_read::clear_views): Replace bool parameter
10529 with enum; adjust all callers.
10530 * options.h (General_options): Change keep_files_mapped option;
10531 add map_whole_files.
10532 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10533 releasing the file.
10534 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10535 the file.
10536
8861f32b
DM
105372010-03-10 David S. Miller <davem@davemloft.net>
10538
10539 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10540
d62d0f5f
ST
105412010-03-09 Sriraman Tallam <tmsriram@google.com>
10542
10543 * icf.cc (get_section_contents): Add '@' marker after processing the
10544 merge reloc.
10545
9177756d
DK
105462010-03-08 Doug Kwan <dougkwan@google.com>
10547
10548 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10549 due to a conversion warning.
10550 (Arm_relobj::update_output_local_symbol_count): Check for local
10551 symbol with unset output index.
10552
9e9e071b
ILT
105532010-03-05 Ian Lance Taylor <iant@google.com>
10554
10555 * options.h (class General_options): Add --spare-dynamic-tags.
10556 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10557 --spare-dynamic-tags.
10558
a81ee015
ILT
105592010-03-05 Ian Lance Taylor <iant@google.com>
10560
10561 * incremental.cc: Include "libiberty.h".
10562
44ec90b9
RO
105632010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10564
10565 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10566 function, is_info_ member.
10567 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10568 (Versions::Versions): Update caller.
10569 (Versions::define_base_version): Likewise.
10570 (Versions::add_def): Likewise.
10571
0897ed3b
ST
105722010-03-03 Sriraman Tallam <tmsriram@google.com>
10573
10574 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10575 (Scan::possible_function_pointer_reloc): New function.
10576 (Scan::local_reloc_may_be_function_pointer): Change to call
10577 possible_function_pointer_reloc.
10578 (Scan::global_reloc_may_be_function_pointer): Ditto.
10579 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10580 relocations in ".data.rel.ro._ZTV" section.
10581 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10582 * testsuite/icf_safe_so_test.cc: Ditto.
10583 * testsuite/icf_safe_test.cc: Ditto.
10584 * testsuite/icf_safe_test.sh: Ditto.
10585
d3bbad62
ILT
105862010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10587 Ian Lance Taylor <iant@google.com>
10588
10589 * target-reloc.h (relocate_section): Check the symbol table index
10590 for -1U before setting the local symbol index.
10591 (scan_relocatable_relocs): If copying the relocation, record that
10592 the local symbol is required.
10593 * object.h (Symbol_value::is_output_symtab_index_set): New
10594 function.
10595 (Symbol_value::may_be_discarded_from_output_symtab): New
10596 function.
10597 (Symbol_value::has_output_symtab_entry): New function.
10598 (Symbol_value::needs_output_symtab_entry): Remove.
10599 (Symbol_value::output_symtab_index): Make sure the symbol index is
10600 set.
10601 (Symbol_value::set_output_symtab_index): Make sure the symbol
10602 index is not set. Make sure the new index is valid.
10603 (Symbol_value::set_must_have_output_symtab_entry): New function.
10604 (Symbol_value::has_output_dynsym_entry): New function.
10605 (Symbol_value::set_output_dynsym_index): Make sure the new index
10606 is valid.
10607 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10608 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10609 local symbol if permitted.
10610 (Sized_relobj::do_finalize_local_symbols): Call
10611 is_output_symtab_index_set rather than needs_output_symtab_entry.
10612 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10613 rather than needs_output_symtab_entry. Call
10614 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10615 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10616 is_output_symtab_index_set rather than needs_output_symtab_entry.
10617 * testsuite/discard_locals_relocatable_test.c: New file.
10618 * testsuite/discard_locals_test.sh: Test -r.
10619 * testsuite/Makefile.am (check_DATA): Add
10620 discard_locals_relocatable_test1.syms,
10621 discard_local_relocatable_test2.syms.
10622 (MOSTLYCLEANFILES): Likewise. Also add
10623 discard_locals_relocatable_test1.lout and
10624 discard_locals_relocatable_test2.out.
10625 (discard_locals_relocatable_test1.syms): New target.
10626 (discard_locals_relocatable_test.o): New target.
10627 (discard_locals_relocatable_test1.out): New target.
10628 (discard_locals_relocatable_test2.syms): New target.
10629 (discard_locals_relocatable_test2.out): New target.
10630 (various): Add missing ../ld-new dependencies.
10631 * testsuite/Makefile.in: Rebuild.
10632
7e8ccf26
NC
106332010-03-03 Nick Clifton <nickc@redhat.com>
10634
10635 * po/fi.po: New Finnish translation.
10636
2a0ff005
DK
106372010-03-01 Doug Kwan <dougkwan@google.com>
10638
10639 * layout.cc (Layout::Layout): Force section types of .init_array*,
10640 .preinit_array* and .fini_array* sections.
10641 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10642 Fix check of return value of std::string::find.().
10643 (Output_section::Input_section_sort_compare::operator()): Remove
10644 comment about .init_array.
10645 (Output_section::Input_section_sort_init_fini_compare::operator()):
10646 New method.
10647 (Output_section::sort_attached_input_sections): Handle .init_array
10648 and .fini_array specially.
10649 * output.h (Output_section::Inut_section_sort_compare): Update
10650 comment.
10651 (Output_section::Input_section_sort_init_fini_compare): New struct.
10652
c3e4ae29
DK
106532010-02-26 Doug Kwan <dougkwan@google.com>
10654
10655 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10656 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10657 * testsuite/debug_msg.sh: Avoid matching source line number for
10658 use of global variable undef_int.
10659
2fd9ae7a
DK
106602010-02-26 Doug Kwan <dougkwan@google.com>
10661
10662 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10663 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10664 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10665 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10666 * options.cc (General_options::General_options): Initialize member
10667 fix_v4bx_.
10668 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10669 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10670 and rm_no_fix_v4bx.stdout
10671 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10672 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10673 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10674 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10675 and arm_no_fix_v4bx.
10676 * Makefile.in: Regenerate.
10677 * testsuite/arm_fix_v4bx.s: New file.
10678 * testsuite/arm_fix_v4bx.sh: Ditto.
10679
67ec7d0b
DK
106802010-02-24 Doug Kwan <dougkwan@google.com>
10681
10682 * arm.cc (Target_arm::got_section): Make the .got section the first
10683 non RELRO section in the data segment.
10684 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10685 suffixes of section names.
10686
10165461
DK
106872010-02-24 Doug Kwan <dougkwan@google.com>
10688
10689 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10690 flags and attributes merging if an input file is a binary file.
10691 * fileread.cc (Input_file::open): Record format of original file.
10692 * fileread.h (Input_file::Format): New enum type.
2e702c99 10693 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10694 (Input_file::format): New method definition.
10695 (Input_file::format_):: New data member.
10696
4a54abbb
DK
106972010-02-24 Doug Kwan <dougkwan@google.com>
10698
10699 * arm.cc (Arm_output_data_got): New class.
10700 (ARM_TCB_SIZE): New constant
10701 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10702 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10703 If user uses a script with a SECTIONS clause, issue only a warning
10704 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10705 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10706 garbage collection.
10707 (Target_arm::got_mode_index_entry): Handle static linking.
10708 (Target_arm::Scan::local): Ditto.
10709 (Target_arm::Scan::global): Ditto.
10710 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10711 all incorrectly implemented relocations.
e1df38aa 10712 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10713 Arm_output_section::fix_exidx_coverage.
10714 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10715 from ".ARM.exidx." and ".ARM.extab.".
10716
ca419a6f
ILT
107172010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10718
10719 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10720 section if it does not already exist.
10721 * attributes.cc (Attributes_section_data::Attributes_section_data):
10722 Don't crash if size is zero.
10723
135b9c78
ILT
107242010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10725 Ian Lance Taylor <iant@google.com>
10726
10727 * gold.cc (queue_middle_tasks): If no input files were opened,
10728 exit.
10729 * workqueue.h (Task_function::Task_function): Assert that there is
10730 a blocker.
10731
bb0bfe4f
DK
107322010-02-22 Doug Kwan <dougkwan@google.com>
10733
10734 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10735 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10736 types to avoid warnings due to different uint64_t implementations
10737 on different hosts.
10738
2a2b6d42
DK
107392010-02-21 Doug Kwan <dougkwan@google.com>
10740
10741 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10742 handling of the maximum backward branch offset.
2e702c99 10743 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10744 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10745 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10746 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10747 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10748 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10749 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10750 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10751 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10752 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10753 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10754 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10755 thumb2_bl_out_of_range.o): New rules.
10756 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10757 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10758 thumb2_bl_out_of_range
10759 * testsuite/Makefile.in: Regenerate.
10760 * testsuite/arm_bl_in_range.s: New file.
10761 * testsuite/arm_bl_out_of_range.s: Ditto.
10762 * testsuite/arm_branch_in_range.sh: Ditto.
10763 * testsuite/arm_branch_range.t: Ditto.
10764 * testsuite/thumb2_branch_range.t: Ditto.
10765 * testsuite/thumb_bl_in_range.s: Ditto.
10766 * testsuite/thumb_bl_out_of_range.s: Ditto.
10767 * testsuite/thumb_branch_range.t: Ditto.
10768
b487ad64
ST
107692010-02-20 Sriraman Tallam <tmsriram@google.com>
10770
10771 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10772 Add reloc offset information.
10773 * icf.cc (get_section_contents): Change iterators to point to the new
10774 vectors. Add reloc offset information to the contents.
10775 * icf.h (Icf::Sections_reachable_info): New typedef.
10776 (Icf::Sections_reachable_list): New typedef.
10777 (Icf::Offset_info): New typedef.
10778 (Icf::Reloc_info): New struct typedef.
10779 (Icf::Reloc_info_list): New typedef.
10780 (Icf::symbol_reloc_list): Delete method.
10781 (Icf::addend_reloc_list): Delete method.
10782 (Icf::section_reloc_list): Delete method.
10783 (Icf::reloc_info_list): New method.
10784 (Icf::reloc_info_list_): New member.
10785
f96accdf
DK
107862010-02-19 Doug Kwan <dougkwan@google.com>
10787
10788 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10789 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10790 * arm.cc (Arm_relocation_functions): New forward declaration.
10791 (Target_arm::Target_arm): Initialize new data members
10792 got_mod_index_offset_ and tls_base_symbol_defined_.
10793 (Target_arm::Relocate::relocate_tls): New method.
10794 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10795 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10796 New methods.
2e702c99 10797 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10798 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10799 (Target_arm::got_mod_index_offset_,
10800 Target_arm::tls_base_symbol_defined_): New data members.
10801 (Target_arm::Scan::local, Target::Scan::global,
10802 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10803 relocations.
10804
c8761b9a
DK
108052010-02-18 Doug Kwan <dougkwan@google.com>
10806
10807 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10808 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10809 text section as a parameter becuase some broken tools may not set
10810 the link in section header.
10811 (Target_arm::has_got_section): New method.
10812 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10813 without any mapping symbol as data only. Remove warning.
10814 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10815 link in its section header, try to discover the link by inspecting the
10816 REL31 relocation at the beginning of the section.
10817 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10818 in error message.
10819 (Target_arm::Scan::global): Treat any reference to the symbol
10820 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10821
21bb3914
ST
108222010-02-12 Sriraman Tallam <tmsriram@google.com>
10823
10824 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10825 (Scan::global_reloc_may_be_function_pointer): New function.
10826 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10827 (Scan::global_reloc_may_be_function_pointer): New function.
10828 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10829 (Scan::global_reloc_may_be_function_pointer): New function.
10830 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10831 (Scan::global_reloc_may_be_function_pointer): New function.
10832 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10833 (Scan::global_reloc_may_be_function_pointer): New function.
10834 (Scan::possible_function_pointer_reloc): New function.
10835 (Target_x86_64::can_check_for_function_pointers): New function.
10836 * gc.h (gc_process_relocs): Scan relocation types to determine if
10837 function pointers were taken for targets that support it.
10838 * icf.cc (Icf::find_identical_sections): Include functions for
10839 folding in safe ICF whose pointer is not taken.
10840 * icf.h (Secn_fptr_taken_set): New typedef.
10841 (fptr_section_id_): New member.
10842 (section_has_function_pointers): New function.
10843 (set_section_has_function_pointers): New function.
10844 (check_section_for_function_pointers): New function.
10845 * options.h: Fix comment for safe ICF option.
10846 * target.h (can_check_for_function_pointers): New function.
10847 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10848 Modify icf_safe_test for X86-64.
10849 * testsuite/Makefile.in: Regenerate.
10850 * testsuite/icf_safe_so_test.cc: New file.
10851 * testsuite/icf_safe_so_test.sh: New file.
10852 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10853 (main): Change to take pointer to function kept_func_3.
10854 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10855 folding is done correctly for X86-64.
10856
0da6fa6c
DM
108572010-02-12 David S. Miller <davem@davemloft.net>
10858
10859 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10860 is_symbolless parameter.
10861 (Output_reloc<SHT_REL>::is_symbolless): New.
10862 (Output_reloc<SHT_REL>::is_symbolless_): New.
10863 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10864 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10865 (Output_reloc<SHT_RELA>::is_symbolless): New.
10866 (Output_data_reloc::add_global): Handle is_symbolless.
10867 (Output_data_reloc::add_global_relative): Likewise.
10868 (Output_data_reloc::add_local): Likewise.
10869 (Output_data_reloc::add_local_relative): Likewise.
10870 (Output_data_reloc::add_symbolless_global_addend): New.
10871 (Output_data_reloc::add_symbolless_local_addend): New.
10872 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10873 is_symbolless.
10874 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10875 instead of ->is_relative_
10876 (Output_reloc::write): Likewise.
10877 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10878 (Output_reloc::write_rel): Simplify.
10879
10880 * sparc.cc (Target_sparc::Scan::local): Use
10881 ->add_symbolless_local_addend as needed.
10882 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10883 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10884 based upon relocation offset.
10885
e4782e83
DK
108862010-02-11 Doug Kwan <dougkwan@google.com>
10887
10888 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10889 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10890 beginning of function.
10891 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10892 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10893 parameter is_32bit in calls to should_apply_static_reloc.
10894 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10895 (check_DATA): Add arm_abs_global.stdout.
10896 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10897 arm_abs_global.stdout): New rules.
10898 (MOSTLLYCLEANFILES): Add arm_abs_global
10899 * Makefile.in: Regenerate.
10900 * testsuite/arm_abs_global.s: New file.
10901 * testsuite/arm_abs_global.sh: Ditto.
10902 * testsuite/arm_abs_lib.s: Ditto.
10903
93ceb764
ILT
109042010-02-11 Ian Lance Taylor <iant@google.com>
10905
10906 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10907 Read_relocs task.
10908 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10909 Allocate_commons_task first.
10910 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10911 task, rather than symtab_lock_.
10912 (Gc_process_relocs::~Gc_process_relocs): New function.
10913 (Gc_process_relocs::is_runnable): Check this_blocker_.
10914 (Gc_process_relocs::locks): Use next_blocker_ rather than
10915 blocker_.
10916 (Scan_relocs::~Scan_relocs): New function.
10917 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10918 symtab_lock_.
10919 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10920 next_blocker_.
10921 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10922 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10923 constructor accordingly.
10924 (class Gc_process_relocs): Likewise.
10925 (class Scan_relocs): Likewise.
10926 * common.h (class Allocate_commons_task): Remove symtab_lock_
10927 field, and corresponding constructor parameter.
10928 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10929 symtab_lock_.
10930 (Allocate_commons_task::locks): Likewise.
10931
114dfbe1
ILT
109322010-02-11 Ian Lance Taylor <iant@google.com>
10933
10934 * gold-threads.h (class Once): Define.
10935 (class Initialize_lock): Rewrite as child of Once.
10936 * gold-threads.cc (class Once_initialize): Define.
10937 (once_pointer_control): New static variable.
10938 (once_pointer, once_arg): New static variables.
10939 (c_run_once): New static function.
10940 (Once::Once, Once::run_once, Once::internal_run): New functions.
10941 (class Initialize_lock_once): Remove.
10942 (initialize_lock_control): Remove.
10943 (initialize_lock_pointer): Remove.
10944 (initialize_lock_once): Remove.
10945 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10946 (Initialize_lock::initialize): Rewrite.
10947 (Initialize_lock::do_run_once): New function.
10948 * archive.cc (Archive::interpret_header): Only clear name if it is
10949 not already empty.
10950 * fileread.cc: Include "gold-threads.h"
10951 (file_counts_lock): New static variable.
10952 (file_counts_initialize_lock): Likewise.
10953 (File_read::release): Only increment counts when using --stats.
10954 Use a lock around the increment.
10955 * parameters.cc (class Set_parameters_target_once): Define.
10956 (set_parameters_target_once): New static variable.
10957 (Parameters::Parameters): Move here from parameters.h.
10958 (Parameters::set_target): Rewrite.
10959 (Parameters::set_target_once): New function.
10960 (Parameters::clear_target): Move here and rewrite.
10961 * parameters.h (class Parameters): Update declarations. Add
10962 set_parameters_target_once_ field.
10963 (Parameters::Parameters): Move to parameters.cc.
10964 (Parameters::clear_target): Likewise.
10965 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10966 task.
10967 (Start_group::~Start_group): New function.
10968 (Start_group::is_runnable): New function.
10969 (Start_group::locks, Start_group::run): New functions.
10970 (Finish_group::run): Change saw_undefined to size_t.
10971 * readsyms.h (class Start_group): Define.
10972 (class Finish_group): Change saw_undefined_ field to size_t.
10973 (Finish_group::Finish_group): Remove saw_undefined and
10974 this_blocker parameters. Change all callers.
10975 (Finish_group::set_saw_undefined): New function.
10976 (Finish_group::set_blocker): New function.
10977 * symtab.h (class Symbol_table): Change saw_undefined to return
10978 size_t. Change saw_undefined_ field to size_t.
10979 * target-select.cc (Set_target_once::do_run_once): New function.
10980 (Target_selector::Target_selector): Initialize set_target_once_
10981 field. Don't initialize lock_ and initialize_lock_ fields.
10982 (Target_selector::instantiate_target): Rewrite.
10983 (Target_selector::set_target): New function.
10984 * target-select.h (class Set_target_once): Define.
10985 (class Target_selector): Update declarations. Make
10986 Set_target_once a friend. Remove lock_ and initialize_lock_
10987 fields. Add set_target_once_ field.
10988
fa17a3f4
ILT
109892010-02-10 Ian Lance Taylor <iant@google.com>
10990
10991 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10992 queueing any tasks.
10993 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10994 (queue_middle_tasks): Add all blockers before queueing any tasks.
10995 (queue_final_tasks): Likewise.
10996 * token.h (Task_token::add_blockers): New function.
10997 * object.h (Input_objects::number_of_relobjs): New function.
10998
c7177d31
ILT
109992010-02-10 Ian Lance Taylor <iant@google.com>
11000
5de0e392
ILT
11001 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
11002 shared, not if not position independent.
11003 * x86_64.cc (Relocate::relocate_tls): Likewise.
11004 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
11005 (tls_pie_pic_test): New target.
11006 * testsuite/Makefile.in: Rebuild.
11007
c7177d31
ILT
11008 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11009 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11010 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11011 * testsuite/Makefile.in: Rebuild.
11012
684b268a
DM
110132010-02-09 David S. Miller <davem@davemloft.net>
11014
11015 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11016 R_SPARC_RELATIVE using ->add_local_relative().
11017 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11018
612a8d3d
DM
11019 * output.h (Output_data_dynamic::add_section_size): New method
11020 that takes two Output_data objects.
11021 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11022 entry param. Handle it in initializers.
11023 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11024 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11025 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11026 arg.
11027 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11028 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11029 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11030 for dynrel_includes_plt.
11031 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11032 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11033 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11034 before .rela.plt
11035 (Target_sparc::do_finalize_sections): Update to pass true for
11036 dynrel_includes_plt.
11037 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11038 output before .rela.plt
11039 (Target_powerpc::do_finalize_sections): Update to pass true for
11040 dynrel_includes_plt when 32-bit.
11041
cb1be87e
DK
110422010-02-08 Doug Kwan <dougkwan@google.com>
11043
11044 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11045 method.
11046 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11047 Arm_relobj::scan_section_for_cortex_a8_stubs,
11048 Arm_relobj::do_relocation_section): Instead of calling
11049 Output_section::output_address, use faster
11050 Arm_relobj::simple_input_section_output_address.
11051
705b5121
DM
110522010-02-08 David S. Miller <davem@davemloft.net>
11053
11054 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11055 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11056 relocation helper function.
11057
024c4466
DM
11058 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11059 just like R_SPARC_GOT{10,13,22}.
11060 (Target_sparc::Scan::local): Likewise.
11061 (Target_sparc::Relocate:relocate): Likewise.
11062
9109c078
ILT
110632010-02-06 Ian Lance Taylor <iant@google.com>
11064
11065 * configure.ac: Rewrite targetobjs duplicate removal code to use
11066 only shell constructs.
11067 * configure: Rebuild.
11068
cf846138
DK
110692010-02-05 Doug Kwan <dougkwan@google.com>
11070
11071 PR 11247
11072 * arm.cc (Arm_relobj::section_is_scannable): New method.
11073 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11074 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11075
6cfaf60b
DK
110762010-02-04 Doug Kwan <dougkwan@google.com>
11077
11078 PR 11247
11079 * arm-reloc-property.cc (cstdio): Include.
11080 * configure.ac (targetobjs): Remove duplicates.
11081 * configure: Regenerate.
11082 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11083 big and little endian version for a given address size.
11084
5c57f1be
DK
110852010-02-03 Doug Kwan <dougkwan@google.com>
11086
11087 * arm-reloc-property.cc
11088 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11089 definition.
11090 * arm-reloc-property.h
11091 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11092 New method definition.
11093 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11094 declaration.
11095 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11096 overflow to N.
11097 (GOT_PREL): Change implemented to Y.
11098 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11099 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11100 (Arm_relocate_functions::movw_abs_nc): Remove method.
11101 (Arm_relocate_functions::movt_abs): Ditto.
11102 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11103 (Arm_relocate_functions::thm_movt_abs): Ditto.
11104 (Arm_relocate_functions::movw_rel_nc): Ditto.
11105 (Arm_relocate_functions::movw_rel): Ditto.
11106 (Arm_relocate_functions::movt_rel): Ditto.
11107 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11108 (Arm_relocate_functions:thm_movw_rel): Ditto.
11109 (Arm_relocate_functions:thm_movt_rel): Ditto.
11110 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11111 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11112 New method definitions.
11113 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11114 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11115 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11116 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11117 (Target_arm::Relocate::relocate): Check for non-static or
11118 unimplemented relocation code and exit early. Change calls to
11119 Target_arm::reloc_uses_thumb_bit and
11120 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11121 instead. Refactor code to handle similar relocations to increase
11122 code sharing. Remove check for unsupported relocation code in switch
11123 statement.
11124 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11125 relocation property table to find out size. Change error message to
11126 print out the name of a relocation code instead of the numeric value.
11127 (Target_arm::scan_reloc_for_stub): Use relocation property table
11128 instead of calling Target_arm::reloc_uses_thumb_bit().
11129
218c5831
DK
111302010-02-02 Doug Kwan <dougkwan@google.com>
11131
11132 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11133 types of relaxed input section.
11134
0d31c79d
DK
111352010-02-02 Doug Kwan <dougkwan@google.com>
11136
11137 * Makefile.am (HFILES): Add arm-reloc-property.h.
11138 (DEFFILES): New.
2e702c99
RM
11139 (TARGETSOURCES): Add arm-reloc-property.cc
11140 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11141 (libgold_a_SOURCES): $(DEFFILES)
11142 * Makefile.in: Regenerate.
11143 * arm-reloc-property.cc: New file.
11144 * arm-reloc-property.h: New file.
11145 * arm-reloc.def: New file.
11146 * arm.cc: Update comments.
11147 (arm-reloc-property.h): New included header.
11148 (arm_reloc_property_table): New global variable.
11149 (Target_arm::do_select_as_default_target): New method definition.
11150 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11151 arm-reloc-property to targ_extra_obj.
11152 * parameters.cc (set_parameters_target): Call
11153 Target::select_as_default_target().
11154 * target.h (Target::select_as_default_target): New method definition.
11155 (Target::do_select_as_default_target): Same.
11156
546c7457
DK
111572010-02-01 Doug Kwan <dougkwan@google.com>
11158
11159 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11160 first_output_text_section_.
11161 (Arm_exidx_fixup::first_output_text_section): New method definition.
11162 (Arm_exidx_fixup::first_output_text_section_): New data member.
11163 (Arm_exidx_fixup::process_exidx_section): Record the first text
11164 output section seen.
11165 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11166 and entsize in output section header.
11167
11b861d5
DK
111682010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11169
11170 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11171 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11172 (Arm_relocate_functions::thm_alu11): New Method.
11173 (Arm_relocate_functions::thm_pc8): New Method.
11174 (Arm_relocate_functions::thm_pc12): New Method.
11175 (Target_arm::Scan::local): Handle the relocations.
11176 (Target_arm::Scan::global): Likewise.
11177 (Target_arm::Relocate::relocate): Likewise.
11178 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11179
c9a2c125
DK
111802010-01-29 Doug Kwan <dougkwan@google.com>
11181
11182 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11183 of relocation types as ld.
11184
1521477a
DK
111852010-01-29 Doug Kwan <dougkwan@google.com>
11186
11187 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11188 to public.
11189 (Arm_relocate_functions::thumb_branch_common): Ditto.
11190 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11191 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11192 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11193 Arm_relocate_functions::jump24): Remove.
11194 (Target_arm::Relocate::relocate): Adjust code to call
11195 Arm_relocation_functions::arm_branch_common and
11196 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11197 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11198
e7eca48c
DK
111992010-01-29 Doug Kwan <dougkwan@google.com>
11200
11201 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11202 output_local_symbol_count_needs_update_.
11203 (Arm_relobj::output_local_symbol_count_needs_update,
11204 Arm_relobj::set_output_local_symbol_count_needs_update,
11205 Arm_relobj::update_output_local_symbol_count): New methods.
11206 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11207 member.
11208 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11209 of pointed function as in a R_ARM_PREL31 relocation.
11210 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11211 for output local symbol count updating.
11212 (Target_arm::do_relax): Update output local symbol counts in objects
11213 if necessary.
11214 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11215
02961d7e
ILT
112162010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11217
11218 * arm.cc: Added support for the ARM relocations:
11219 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11220 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11221 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11222 movw_prel_nc).
11223 (Arm_relocate_functions::movw_rel): New method.
11224 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11225 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11226 thm_movw_prel_nc).
11227 (Arm_relocate_functions::thm_movw_rel): New method.
11228 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11229 thm_movt_prel).
11230 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11231 relocations.
11232 (Target_arm::Scan::global): Likewise.
11233 (Target_arm::Relocate::relocate): Likewise.
11234 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11235 Likewise.
11236
b10d2873
ILT
112372010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11238
11239 * arm.cc: Added support for ARM group relocations.
11240 (Target_arm::reloc_needs_sym_origin): New method.
11241 (Arm_relocate_functions::calc_grp_kn): New method.
11242 (Arm_relocate_functions::calc_grp_residual): New method.
11243 (Arm_relocate_functions::calc_grp_gn): New method.
11244 (Arm_relocate_functions::arm_grp_alu): New Method.
11245 (Arm_relocate_functions::arm_grp_ldr): New Method.
11246 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11247 (Arm_relocate_functions::arm_grp_ldc): New Method.
11248 (Target_arm::Scan::local): Handle the ARM group relocations.
11249 (Target_arm::Scan::global): Likewise.
11250 (Target_arm::Relocate::relocate): Likewise.
11251 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11252 Likewise.
11253
2b328d4e
DK
112542010-01-26 Doug Kwan <dougkwan@google.com>
11255
11256 * arm.cc (set): Include.
11257 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11258 pointer type.
2e702c99 11259 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11260 (Arm_output_section::append_text_sections_to_list): New method.
11261 (Arm_output_section::fix_exidx_coverage): Ditto.
11262 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11263 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11264 Relobj::set_section_offset() instead of
11265 Sized_relobj::invalidate_section_offset().
2e702c99 11266 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11267 parameter for section headers. Ignore relocation sections for
11268 unallocated sections and EXIDX sections.
11269 (Target_arm::fix_exidx_coverage): New method.
11270 (Target_arm::output_section_address_less_than): New type.
11271 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11272 linked text section instead of the EXIDX section.
11273 (Arm_output_section::create_stub_group): Add an assertion to check
11274 that this is not an EXIDX output section.
11275 (Arm_output_section::append_text_sections_to_list): New method.
11276 (Arm_output_section::fix_exidx_coverage): Ditto.
11277 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11278 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11279 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11280 first pass.
11281 (Target_arm::fix_exidx_coverage): New method.
11282 * object.h (Relobj::set_output_section): New method.
11283 (Sized_relobj::invalidate_section_offset): Remove method.
11284 (Sized_relobj::do_invalidate_section_offset): Remove method.
11285 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11286
c7f3c371
DK
112872010-01-25 Doug Kwan <dougkwan@google.com>
11288
11289 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11290 Fix warning due to signed and unsigned comparison on a 32-bit host.
11291
8923b24c
DK
112922010-01-22 Doug Kwan <dougkwan@google.com>
11293
11294 * arm.cc (Target_arm::do_relax): Record an output section for section
11295 offset adjustment it contains any stub table that has changed.
11296 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11297 offsets in an output section if necessary.
11298 * output.cc (Output_section::Output_section): Initialize
11299 section_offsets_need_adjustments_.
11300 (Output_section::add_input_section_for_script): Renamed to
11301 Output_section::add_simple_input_section.
11302 (Output_section::save_states): Add a comment.
11303 (Output_section::discard_states): New method defintion.
11304 (Output_section::adjust_section_offsets): Same.
11305 * output.h (Output_section::add_input_section_for_script): Renamed to
11306 Output_section::add_simple_input_section.
11307 (Output_section::discard_states): New method declaration.
11308 (Output_section::adjust_section_offsets): Same.
11309 (Output_section::section_offsets_need_adjustment,
11310 Output_section::set_section_offsets_need_adjustment): New method
11311 definitions.
11312 (Output_section::section_offsets_need_adjustment_): New data member.
11313 * script-sections.cc
11314 (Output_section_element_input::set_section_address): Adjust code for
11315 renaming of Output_section::add_input_section_for_script.
11316 (Orphan_output_section::set_section_address): Same.
11317
9b2fd367
DK
113182010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11319
11320 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11321 Fix_v4bx enum values .
11322 * gold/options.h (General_options): New option definitions.
11323 (General_options::fix_v4bx): New method.
11324 (General_options::Fix_v4bx): New enum.
11325 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11326 (General_options::parse_fix_v4bx_interworking): New method.
11327
80d0d023
DK
113282010-01-22 Doug Kwan <dougkwan@google.com>
11329
11330 * arm.cc (Arm_exidx_fixup): New class.
11331
af2cdeae
DK
113322010-01-21 Doug Kwan <dougkwan@google.com>
11333
11334 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11335 classes.
11336 (Arm_exidx_section_offset_map): New type.
11337
993d07c1
DK
113382010-01-21 Doug Kwan <dougkwan@google.com>
11339
11340 * arm.cc (Arm_exidx_input_section): New class.
11341 (Arm_relobj::exidx_input_section_by_link,
11342 Arm_relobj::exidx_input_section_by_shndx,
11343 Arm_relobj::make_exidx_input_section): New methods.
11344 (read_arm_attributes_section): Remove.
11345 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11346 information about them.
11347 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11348 to here.
11349
5ac169d4
DK
113502010-01-20 Doug Kwan <dougkwan@google.com>
11351
11352 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11353 Input_section_specifier to Section_id.
11354 (Target_arm::new_arm_input_section: Adjust code for change of key
11355 type.
11356 (Target_arm::find_arm_input_section): Ditto.
11357 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11358 (Section_id): Remove.
11359 (Garbage_collection::Section_id_hash): Remove.
11360 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11361 (Section_id): Remove.
11362 (Icf::Section_id_hash): Remove.
11363 * object.h (Section_id, Const_section_id, Section_id_hash,
11364 Const_section_id_hash): New type definitions.
11365 * output.cc (Output_section::add_relaxed_input_section): Change to
11366 use Const_section_id instead of Input_section_specifier as key type.
11367 (Output_section::add_merge_input_section): Ditto.
11368 (Output_section::build_relaxation_map): Change to use Section_id
11369 instead of Input_section_specifier as key type.
2e702c99 11370 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11371 Ditto.
11372 (Output_section::convert_input_sections_to_relaxed_sections): Change
11373 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11374 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11375 (Output_section::find_relaxed_input_section): Ditto.
11376 * output.h (Input_section_specifier): Remove class.
11377 (Output_section::Output_section_data_by_input_section_map): Change
11378 key type to Const_section_id.
11379 (Output_section::Output_relaxed_input_section_by_input_section_map):
11380 Ditto.
11381 (Output_section::Relaxation_map): Change key type to Section_id.
11382
a2162063
ILT
113832010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11384
11385 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11386 (class Arm_v4bx_stub): New class.
11387 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11388 (Stub_factory::make_arm_v4bx_stub): New method.
11389 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11390 (Stub_table::empty): Handle v4bx stubs.
11391 (Stub_table::add_arm_v4bx_stub): New method.
11392 (Stub_table::find_arm_v4bx_stub): New method.
11393 (Arm_relocate_functions::v4bx): New method.
11394 (Target_arm::fix_v4bx): New method.
11395 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11396 (Stub_table::relocate_stubs): Likewise.
11397 (Stub_table::do_write): Likewise.
11398 (Stub_table::update_data_size_and_addralign): Likewise.
11399 (Stub_table::finalize_stubs): Likewise.
11400 (Target_arm::Scan::local): Likewise.
11401 (Target_arm::Scan::global): Likewise.
11402 (Target_arm::do_finalize_sections): Likewise.
11403 (Target_arm::Relocate::relocate): Likewise.
11404 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11405 Likewise.
11406 (Target_arm::scan_reloc_for_stub): Likewise.
11407 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11408
5696ab0b
ILT
114092010-01-19 Ian Lance Taylor <iant@google.com>
11410
11411 * output.cc (Output_section_headers::do_sized_write): Write large
11412 segment count to sh_info field.
11413 (Output_file_header::do_sized_write): For large segment count,
11414 write PN_XNUM to e_phnum field.
11415
800d0f56
ILT
114162010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11417
11418 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11419 (Arm_relocate_functions::thm_jump8): New function.
11420 (Arm_relocate_functions::thm_jump11): New function.
11421 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11422 R_ARM_THM_JUMP11.
11423 (Target_arm::Scan::global): Likewise.
11424 (Target_arm::Relocate::relocate): Likewise.
11425 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11426 Likewise.
11427
41263c05
DK
114282010-01-14 Doug Kwan <dougkwan@google.com>
11429
11430 * arm.cc (map, utility): Include headers.
11431 (Target_arm::apply_cortex_a8_workaround): New method.
11432 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11433 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11434 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11435 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11436 the --[no-]fix-cortex-a8 command line options.
11437 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11438 (Target_arm::relocate_stub): Use addend in instruction template.
11439 * options.h (DEFINE_bool): Set the user-set flag.
11440 (General_options): Add --[no-]-fix-cortex options.
11441 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11442 : Update fast look-up map after conversion.
41263c05 11443
459e9b03
ST
114442010-01-14 Sriraman Tallam <tmsriram@google.com>
11445
11446 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11447 in the first pass of do_layout.
11448
b521dfe4
DK
114492010-01-13 Doug Kwan <dougkwan@google.com>
11450
11451 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11452 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11453 apparent compiler problem of not folding static constant integral
11454 data members of elfcpp::Elf_sizes<32>.
11455
44272192
DK
114562010-01-13 Doug Kwan <dougkwan@google.com>
11457
11458 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11459 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11460 Arm_relobj::scan_section_for_cortex_a8_erratum,
11461 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11462 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11463 sections to scan for relocation stubs into a new method
11464 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11465 relocation and Cortex-A8 stub scanning.
11466 (Target_arm::do_relax): Force stubs to be after stubbed sections
11467 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11468 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11469 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11470
44b71ece
ILT
114712010-01-12 Ian Lance Taylor <iant@google.com>
11472
11473 * target-reloc.h (visibility_error): New inline function.
11474 (relocate_section): Call visibility_error.
11475 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11476 (MOSTLYCLEANFILES): Likewise.
11477 (protected_4_pic.o, protected_3.err): New targets.
11478 * testsuite/protected_4.cc: New file.
11479
a120bc7f
DK
114802010-01-12 Doug Kwan <dougkwan@google.com>
11481
11482 * arm.cc (Cortex_a8_reloc): New class.
11483 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11484 and cortex_a8_relocs_info_.
11485 (Target_arm::fix_cortex_a8): New method definition.
11486 (Target_arm::Cortex_a8_relocs_info): New type.
11487 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11488 New data member declarations.
11489 (Target_arm::scan_reloc_for_stub): Record information about
11490 relocations for THUMB branches that might be exempted from the
11491 Cortex-A8 workaround.
11492 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11493 at the beginning of a relaxation pass.
11494
20138696
DK
114952010-01-12 Doug Kwan <dougkwan@google.com>
11496
11497 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11498 (Arm_relobj::Mapping_symbol_position,
11499 Arm_reloj::Mapping_symbol_position_less,
11500 Arm_relobj::Mapping_symbols_info): New types.
11501 (Target_arm::is_mapping_symbol_name): New method definition.
11502 (Arm_relobj::do_count_local_symbols): Save information about mapping
11503 symbols.
11504
089d69dc
DK
115052010-01-11 Doug Kwan <dougkwan@google.com>
11506
11507 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11508 Arm_relocate_functions::thumb32_branch_upper,
11509 Arm_relocate_functions::thumb32_branch_lower,
11510 Arm_relocate_functions::thumb32_cond_branch_offset,
11511 Arm_relocate_functions::thumb32_cond_branch_upper,
11512 Arm_relocate_functions::thumb32_cond_branch_lower,
11513 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11514 branch offset encoding.
11515 (Arm_relocate_functions::thumb_branch_common): Use new branch
11516 offset encoding methods to avoid code duplication.
11517 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11518 (Stub_addend_reader::operator()): Use new branch encoding method
11519 to avoid code duplication.
11520
99e5bff2
DK
115212010-01-11 Doug Kwan <dougkwan@google.com>
11522
11523 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11524 (Target_arm::do_finalize_sections): Define special EXIDX section
11525 symbols only if referenced.
11526 * gc.h (Garbage_collection::add_reference): New method.
11527 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11528 code duplication.
11529
98e090bd
ILT
115302010-01-11 Ian Lance Taylor <iant@google.com>
11531
d0a91bd8
ILT
11532 * script.cc (Version_script_info::build_expression_list_lookup):
11533 Change complaing about duplicate wildcard match from error to
11534 warning.
11535
98e090bd
ILT
11536 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11537 of 2009-12-30.
11538 (Version_script_info::Version_script_info): Initialize globs_,
11539 default_version_, default_is_global_, and exact_. Don't
11540 initialize globals_ or locals_.
11541 (Version_script_info::build_lookup_tables): Build local symbols
11542 first.
11543 (Version_script_info::unquote): New function.
11544 (Version_script_info::add_exact_match): New function.
11545 (Version_script_info::build_expression_list_lookup): Remove lookup
11546 parameter. Add is_global parameter. Change all callers. Handle
11547 wildcard pattern specially. Unquote pattern. Call
11548 add_exact_match.
11549 (Version_script_info::get_name_to_match): New function.
11550 (Version_script_info::get_symbol_version): New function.
11551 (Version_script_info::get_symbol_version_helper): Remove.
11552 (Version_script_info::check_unmatched_names): Call unquote.
11553 * script.h (class Version_script_info): Change get_symbol_version
11554 to be non-inline and add is_global parameter; change all callers.
11555 Rewrite symbol_is_local. Update declarations. Define struct
11556 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11557 Remove globals_ and locals_ members. Add exact_, globs_,
11558 default_version_, is_global_.
11559 (Version_script_info::Glob): Remove pattern, add expression and
11560 is_global. Update constructor. Change all callers.
11561 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11562 default version.
11563 (Versions::symbol_section_contents): If a symbol is undefined, or
11564 defined in a dynamic object, set the version index to
11565 VER_NDX_LOCAL.
11566 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11567 symbol_is_local.
11568 (Symbol_table::add_from_pluginobj): Likewise.
11569 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11570
d56962d3
DK
115712010-01-11 Doug Kwan <dougkwan@google.com>
11572
11573 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11574 (incremental_dump_LDADD): Add linking option for libintl.
11575 * Makefile.in: Regenerate.
11576
94e6ee91
L
115772010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11578
11579 PR gold/11144
11580 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11581 instead of -Ds.
11582 * testsuite/Makefile.in: Regenerated.
11583
e96c574b
DK
115842010-01-10 Doug Kwan <dougkwan@google.com>
11585
11586 * options.h (DEFINE_var): Use parentheses around argument varname__
11587 in macro body to avoid any unintended subsequent substitutions.
11588
7198066b
ILT
115892010-01-10 Ian Lance Taylor <iant@google.com>
11590
ba4d53bf
ILT
11591 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11592 candidates before doing symbol resolution.
11593
7198066b
ILT
11594 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11595 ODR candidates if only one is weak.
11596
a2beed37
ILT
115972010-01-08 Ian Lance Taylor <iant@google.com>
11598
11599 * script.cc (Version_script_info::build_expression_list_lookup):
11600 Don't warn about ambiguous version, just record the ambiguity.
11601 (Version_script_info::get_symbol_version_helper): Give error if
11602 version is ambiguous.
11603
2fb7225c
DK
116042010-01-08 Doug Kwan <dougkwan@google.com>
11605
11606 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11607 prev_data_size_ and prev_addralign_. Remove initializer for
11608 deleted data member has_been_changed_.
11609 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11610 to determine if the table is empty.
11611 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11612 Remove.
11613 (Stub_table::add_reloc_stub): Define method in class definition
11614 instead of just declaring it there.
11615 (Stub_table::add_cortex_a8_stub): New method definition.
11616 (Stub_table::update_data_size_and_addralign): Ditto.
11617 (Stub_table::finalize_stubs): Ditto.
11618 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11619 (Stub_table::do_addralign_): Return address alignment in the
11620 (Stub_table::do_reset_address_and_file_offset): Define method in
11621 class definition instead of declaring it there. Set current data
11622 size to be the data size of the previous pass.
11623 (Stub_table::set_final_data_size): Use current data size as the
11624 final data size.
11625 (Stub_table::relocate_stub): Change parameter type of stub from
11626 Reloc_stub pointer to Stub pointer.
11627 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11628 (Stub_table::Cortex_a8_stub_list): New typedef.
11629 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11630 Stub_table::prev_addralign_): New data member.
11631 (Arm_relobj::Arm_relobj): Initialize data member
11632 section_has_cortex_a8_workaround_.
11633 (Arm_relobj::section_has_cortex_a8_workaround,
11634 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11635 definitions.
11636 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11637 declarations.
11638 (Target_arm::relocate_stub): Change parameter type of stub from
11639 Reloc_stub pointer to Stub pointer.
11640 (Insn_template::size, Insn_template::alignment): Handle
11641 THUMB16_SPECIAL_TYPE.
11642 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11643 Stub_table::update_data_size_and_addralign,
11644 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11645 definitions.
11646 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11647 (Stub_table::do_write): Ditto.
11648 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11649
880cd20d
ILT
116502010-01-08 Ian Lance Taylor <iant@google.com>
11651
11652 PR 11108
11653 * symtab.h (class Symbol): Remove fields is_target_special_ and
11654 has_plt_offset_. Add field is_defined_in_discarded_section_.
11655 (Symbol::is_defined_in_discarded_section): New function.
11656 (Symbol::set_is_defined_in_discarded_section): New function.
11657 (Symbol::has_plt_offset): Rewrite.
11658 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11659 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11660 Don't initialize is_target_special_ or has_plt_offset_.
11661 Initialize is_defined_in_discarded_section_.
11662 (Symbol_table::add_from_relobj): If appropriate, set
11663 is_defined_in_discarded_section.
11664 * resolve.cc (Symbol::override_base_with_special): Don't test
11665 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11666 * target-reloc.h (relocate_section): Do special handling for
11667 symbols defined in discarded sections for global symbols as well
11668 as local symbols.
11669
2703e3eb
ILT
116702010-01-08 Ian Lance Taylor <iant@google.com>
11671
11672 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11673 the SHT_SYMTAB case.
11674
339d40a3
ILT
116752010-01-08 Ian Lance Taylor <iant@google.com>
11676
11677 * object.cc (Sized_relobj::do_layout): Don't get confused if
11678 layout_eh_frame returns NULL.
11679
abecea76
ILT
116802010-01-08 Ian Lance Taylor <iant@google.com>
11681
11682 PR 11084
11683 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11684 dynamic symbol table, use the normal symbol table.
11685 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11686 symbol table.
11687
6b7dd3f3
ILT
116882010-01-08 Ian Lance Taylor <iant@google.com>
11689
11690 PR 11072
11691 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11692 sections.
11693
36c50e63
L
116942010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11695
11696 * version.cc (print_version): Change to "Copyright 2010".
11697
e291e7b9
ILT
116982010-01-08 Ian Lance Taylor <iant@google.com>
11699
11700 PR 10287
11701 PR 11063
11702 * i386.cc (class Target_i386): Change return type of plt_section
11703 to be non-const.
11704 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11705 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11706 tls_desc_rel_ field.
11707 (Output_data_plt_i386::rel_tls_desc): New function.
11708 (Target_i386::rel_tls_desc_section): New function.
11709 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11710 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11711 R_386_TLS_DESC reloc in rel_tls_desc_section.
11712 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11713 Define struct Tlsdesc_info.
11714 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11715 (Target_x86_64::do_reloc_symbol_index): New function.
11716 (Target_x86_64::add_tlsdesc_info): New function.
11717 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11718 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11719 tlsdesc_rel_ field.
11720 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11721 all callers.
11722 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11723 (Target_x86_64::rela_tlsdesc_section): New function.
11724 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11725 handling.
11726 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11727 (Target_x86_64::do_reloc_addend): New function.
11728 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11729 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11730 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11731 (Output_reloc::type): New function.
11732 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11733 (Output_reloc::is_target_specific): New function.
11734 (Output_reloc::target_arg): New function.
11735 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11736 absolute relocs and target specific relocs.
11737 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11738 add_target_specific.
11739 (class Output_data_reloc) [SHT_RELA]: Likewise.
11740 * output.cc (Output_reloc::Output_reloc): Add four new versions
11741 for absolute relocs and target specific relocs.
11742 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11743 (Output_reloc::get_symbol_index): Likewise.
11744 (Output_reloc::local_section_offset): Check that local_sym_index_
11745 is not TARGET_CODE or 0.
11746 (Output_reloc::symbol_value): Likewise.
11747 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11748 reloc.
11749 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11750 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11751 functions.
11752 * layout.cc (add_target_dynamic_tags): Use output section for
11753 DT_PLTRELSZ and DT_JMPREL.
11754
3a44184e
ILT
117552010-01-07 Ian Lance Taylor <iant@google.com>
11756
11757 PR 11061
11758 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11759 function.
11760 (class Output_data_reloc_generic): Define.
11761 (class Output_data_reloc_base): Change base class to
11762 Output_data_reloc_generic. Change add() method to call
11763 bump_relative_reloc_count for a relative reloc. Remove
11764 sort_relocs_ field.
11765 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11766 to sort_relocs().
11767 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11768 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11769 appropriate.
11770 * layout.h (class Layout): Update declaration.
11771
ea715a34
ILT
117722010-01-07 Ian Lance Taylor <iant@google.com>
11773
11774 * output.h (class Output_data): Add const version of
11775 output_section and do_output_section.
11776 (class Output_section_data): Add const version of
11777 do_output_section.
11778 (class Output_section): Likewise.
11779 * layout.cc (Layout::add_target_dynamic_tags): New function.
11780 * layout.h (class Layout): Update declarations.
11781 * arm.cc (Target_arm::do_finalize_sections): Use
11782 add_target_dynamic_tags.
11783 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11784 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11785 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11786 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11787
659948a4
ILT
117882010-01-07 Ian Lance Taylor <iant@google.com>
11789
11790 PR 11042
11791 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11792 object as needed.
11793
9d3b86f6
ILT
117942010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11795 Ian Lance Taylor <iant@google.com>
11796
11797 PR 11019
11798 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11799 Xindex::read_symtab_xindex.
11800
bb0d3eb0
DK
118012010-01-07 Doug Kwan <dougkwan@google.com>
11802
11803 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11804 (Insn_template::thumb16_bcond_insn): New method declaration.
11805 (Insn_template): Fix spelling.
11806 (Stub::thumb16_special): New method declaration.
11807 (Stub::do_write): Define virtual method which was previously pure
11808 virtual.
11809 (Stub::do_thumb16_special): New method declaration.
11810 (Stub::do_fixed_endian_write): New template member.
11811 (Reloc_stub::do_write): Remove.
11812 (Reloc_stub::do_fixed_endian_write): Remove.
11813 (Cortex_a8_stub): New class definition.
11814 (Stub_factory::make_cortex_a8_stub): New method definition.
11815 (Stub_factory::Stub_factory): Add missing static storage class
11816 qualifier for elf32_arm_stub_a8_veneer_blx.
11817
ffeef7df
ILT
118182010-01-07 Ian Lance Taylor <iant@google.com>
11819
dc3f80fe
ILT
11820 PR 10980
11821 * options.h (class General_options): Add --warn-unresolved-symbols
11822 and --error-unresolved-symbols.
11823 * errors.cc (Errors::undefined_symbol): Implement
11824 --warn-unresolved-symbols.
11825
ffeef7df
ILT
11826 * options.h (class General_options): Add -z text and -z textoff.
11827 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11828
f1ec9ded
ST
118292010-01-06 Sriraman Tallam <tmsriram@google.com>
11830
11831 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11832 (Garbage_collection::cident_sections): New function.
11833 (Garbage_collection::add_cident_section): New function.
11834 (Garbage_collection::cident_sections_): New member.
11835 (gc_process_relocs): Add references to sections whose names are C
11836 identifiers.
11837 * gold.h (cident_section_start_prefix): New constant.
11838 (cident_section_stop_prefix): New constant.
11839 (is_cident): New function.
11840 * layout.cc (Layout::define_section_symbols): Replace string constants
11841 with the newly defined constants.
11842 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11843 C identifiers.
11844 * testsuite/Makefile.am: Add gc_orphan_section_test.
11845 * testsuite/Makefile.in: Regenerate.
11846 * testsuite/gc_orphan_section_test.cc: New file.
11847 * testsuite/gc_orphan_section_test.sh: New file.
11848
6eda8c29
ILT
118492010-01-06 Ian Lance Taylor <iant@google.com>
11850
b9674e17
ILT
11851 PR 10980
11852 * options.h (class General_options): Add --warn-shared-textrel.
11853 * layout.cc (Layout::finish_dynamic_section): Implement
11854 --warn-shared-textrel.
11855
6eda8c29
ILT
11856 PR 10980
11857 * options.h (class General_options): Add --warn-multiple-gp.
11858
32dcd44e
ILT
118592010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11860
11861 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11862 $(THREADSLIB) and $(LIBDL).
11863 * Makefile.in: Rebuild.
11864
a192ba05
ILT
118652010-01-06 Ian Lance Taylor <iant@google.com>
11866
11867 PR 10980
11868 * options.cc (General_options::parse_section_start): New function.
11869 (General_options::section_start): New function.
11870 (General_options::General_options): Initialize all members.
11871 * options.h: Include <map>
11872 (class General_options): Add --section-start. Add section_starts_
11873 member.
11874 * layout.cc (Layout::attach_allocated_section_to_segment): If
11875 --section-start was used, set the address of the segment. Remove
11876 local sort_sections.
11877 (Layout::relaxation_loop_body): If the address of the load segment
11878 has been set by --section-start, don't use it.
11879 * output.h (Output_segment::update_flags_for_output_section): New
11880 function.
11881 * output.cc (Output_segment::add_output_section): Call
11882 update_flags_for_output_section.
11883
dde3f402
ILT
118842010-01-05 Ian Lance Taylor <iant@google.com>
11885
62dfdd4d
ILT
11886 PR 10980
11887 * options.h (class General_options): Add --undefined-version.
11888 * script.cc (struct Version_expression): Add was_matched_by_symbol
11889 field.
11890 (Version_script_info::matched_symbol): New function.
11891 (Version_script_info::get_symbol_version_helper): Call
11892 matched_symbol.
11893 (Version_script_info::check_unmatched_names): New function.
11894 * script.h (class Version_script_info): Update declarations.
11895 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11896
9c4ae156
ILT
11897 * options.h (class General_options): Use DEFINE_bool_alias for
11898 allow_multiple_definition.
11899 * resolve.cc (Symbol_table::should_override): Don't test
11900 allow_multiple_definition.
11901
dde3f402
ILT
11902 PR 10980
11903 * options.h (class General_options): Add --cref.
11904 * main.cc (main): Print cref table if --cref. Don't close mapfile
11905 until after printing cref table.
11906 * cref.cc: Include "symtab.h".
11907 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11908 (Cref_table_compare::operator()): New function.
11909 (Cref_inputs::gather_cref): New function.
11910 (filecol): New static const.
11911 (Cref_inputs::print_cref): New function.
11912 (Cref::print_cref): New function.
11913 * cref.h: Include <cstdio>.
11914 (class Cref): Update declarations.
11915 * mapfile.h (Mapfile::file): New function.
11916 * object.h (class Object): Define Symbols. Declare virtual
11917 do_get_global_symbols.
11918 (Object::get_global_symbols): New function.
11919 * object.cc (Input_objects::add_object): Pass object to cref_ if
11920 --cref.
11921 (Input_objects::archive_start): Likewise.
11922 (Input_objects::archive_stop): Likewise.
11923 (Input_objects::print_cref): New function.
11924 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11925 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11926 --cref.
11927 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11928 function.
11929 * plugin.h (class Sized_pluginobj): Update declarations.
11930
8781f709
ILT
119312010-01-05 Ian Lance Taylor <iant@google.com>
11932
11933 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11934 to is_default_version. Rename insdef to insdefault.
11935 (Symbol_table::add_from_relobj): Rename def to is_default_version
11936 and local to is_forced_local.
11937 (Symbol_table::add_from_pluginobj): Likewise.
11938 (Symbol_table::add_from_dynobj): Likewise.
11939 (Symbol_table::define_special_symbol): Rename insdef to
11940 insdefault.
11941
fe35d28d
ILT
119422010-01-04 Ian Lance Taylor <iant@google.com>
11943
30bc8c46
ILT
11944 PR 10980
11945 * options.h (class General_options): Add
11946 --allow-multiple-definition and -z muldefs.
11947 * resolve.cc (Symbol_table::should_override): Don't warn about a
11948 multiple symbol definition if --allow-multiple-definition or -z
11949 muldefs.
11950
7eaea549
ILT
11951 PR 10980
11952 * options.h (class General_options): Add --add-needed and
11953 --copy-dt-needed-entries. Tweak --as-needed help entry.
11954 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11955 error if --copy-dt-needed-entries aka --add-needed is used and
11956 would cause a change in behaviour.
11957
fe35d28d
ILT
11958 PR 10980
11959 * options.h (class General_options): Add -G as a short version of
11960 --shared. Add no-op options -assert, -g, and -i.
11961
55a2bb35
ST
119622010-01-04 Sriraman Tallam <tmsriram@google.com>
11963
11964 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11965 check for .text or .gnu.linkonce.t sections.
11966 * icf.cc (Icf::find_identical_sections): Ditto.
11967 Change the detection for mangled function name within the section
11968 name.
11969 * icf.h (is_section_foldable_candidate): New function.
11970
719328e1
ILT
119712009-12-30 Ian Lance Taylor <iant@google.com>
11972
11973 PR 10980
11974 * options.h (class General_options): Permit two dashes with
11975 --retain-symbols-file.
11976
d7bb5745
ILT
119772009-12-30 Ian Lance Taylor <iant@google.com>
11978
403a15dd
ILT
11979 PR 10979
11980 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11981 don't put the file header and segment headers in the text
11982 segment.
11983
eda294df
ILT
11984 PR 10979
11985 * common.cc (Sort_commons::operator()): Stabilize sort when both
11986 entries are NULL.
11987 (Symbol_table::do_allocate_commons_list): When allocating common
11988 symbols, skip a symbol which is no longer common.
11989 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11990 an object before checking its type.
11991 * testsuite/common_test_2.c: New file.
11992 * testsuite/common_test_3.c: New file.
11993 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11994 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11995 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11996 (common_test_2_pic.o, common_test_2.so): New targets.
11997 (common_test_3_pic.o, common_test_3.so): New targets.
11998 * testsuite/Makefile.in: Rebuild.
11999
d7bb5745
ILT
12000 PR 10979
12001 * script.cc (read_input_script): If we see a new SECTIONS clause,
12002 and we have added an input section, give an error.
12003 * layout.h (class Layout): Add have_added_input_section function.
12004 Add have_added_input_section_ field.
12005 * layout.cc (Layout::Layout): Initialize
12006 have_added_input_section_.
12007 (Layout::layout): Set have_added_input_section_.
12008 (Layout::layout_eh_frame): Likewise.
12009
fc59c572
ILT
120102009-12-30 Ian Lance Taylor <iant@google.com>
12011
12012 PR 10931
12013 * options.h (class General_options): Add --sort-common option.
12014 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12015 * common.cc (Sort_common): Add sort_order parameter to
12016 constructor. Add sort_order_ field.
12017 (Sort_commons::operator): Check sort_order_.
12018 (Symbol_table::allocate_commons): Determine the sort order.
12019 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12020 Change all callers.
12021 (Symbol_table::do_allocate_commons_list): Likewise.
12022
1c74fab0
ILT
120232009-12-30 Ian Lance Taylor <iant@google.com>
12024
12025 PR 10916
12026 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12027 symbols from this object, don't change the visibility of an
12028 undefined symbol.
12029 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12030
6affe781
ILT
120312009-12-30 Ian Lance Taylor <iant@google.com>
12032
12033 PR 10861
12034 * script.h (class Version_script_info): Define Language enum.
12035 Update declarations. Define Glob, Exact, and Lookup types. Add
12036 new fields globals_, locals_, and is_finalized_.
12037 * script.cc: Various formatting fixes.
12038 (class Parser_closure): Change language_stack_ from a vector of
12039 std::string to one of Version_script_info::Language. Adjust all
12040 uses accordingly.
12041 (class Lazy_demangler): Remove.
12042 (struct Version_expression): Change language from std::string to
12043 Version_script_info::Language.
12044 (Version_script_info::Version_script_info): New function.
12045 (Version_script_info::~Version_script_info): Don't call clear.
12046 (Version_script_info::finalize): New function.
12047 (Version_script_info::build_lookup_tables): New function.
12048 (Version_script_info::build_expression_list_lookup): New
12049 function.
12050 (Version_script_info::get_symbol_version_helper): Rewrite to use
12051 lookup tables.
12052 (Version_script_info::print_expression_list): Adjust to use
12053 Version_script_info::Language.
12054 (script_push_lex_into_version_mode): Check that the version script
12055 has not been finalized.
12056 (version_script_push_lang): Change language string to
12057 Version_script_info::Language.
12058 * options.cc (Command_line::version_script): New function.
12059 * options.h (class General_options): Add finalize_dynamic_list
12060 function. Change version_script from declaration to definition.
12061 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12062 * testsuite/version_script.map: Remove duplicate def of foo.
12063 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12064 version_script.map.
12065 * testsuite/Makefile.in: Rebuild.
12066
818bf354
ILT
120672009-12-30 Ian Lance Taylor <iant@google.com>
12068
12069 PR 10843
12070 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12071 if the input symbol index is 0, make the output symbol index 0.
12072
ebcc8304
ILT
120732009-12-30 Ian Lance Taylor <iant@google.com>
12074
12075 PR 10670
12076 * options.h (class General_options): Add -x/--discard-all.
12077 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12078 --discard-all. If the local symbol needs a dynamic entry, check
12079 that before handling --discard-locals.
12080
176fe33f
ILT
120812009-12-30 Ian Lance Taylor <iant@google.com>
12082
bb321bb1
ILT
12083 PR 10450
12084 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12085 flags to PF_R.
12086 (Output_segment::add_output_section): Don't change the flags if
12087 the type is PT_TLS.
12088
176fe33f
ILT
12089 PR 10450
12090 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12091 GNU hash table if they need a dynamic value. Otherwise, don't add
12092 them if they are defined in a dynamic object or are forced local.
12093
e8cd95c7
ILT
120942009-12-29 Ian Lance Taylor <iant@google.com>
12095
1b81fb71
ILT
12096 PR 10450
12097 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12098 .gnu.hash table for a 32-bit target.
12099
8d6d383d
ILT
12100 PR 10450
12101 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12102 regular and a dynamic object only needs a dynamic symbol table
12103 entry if it is externally visible.
12104
e785ec03
ILT
12105 PR 10450
12106 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12107 constructor. Add global_offset_table_ field.
12108 (Target_i386::got_section): Set global_offset_table_.
12109 (Target_i386::do_finalize_sections): Set global_offset_table_
12110 size.
12111 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12112 in constructor. Add global_offset_table_ field.
12113 (Target_x86_64::got_section): Set global_offset_table_.
12114 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12115 size.
12116
1a2dff53
ILT
12117 * layout.cc (Layout::Layout): Initialize increase_relro_.
12118 (Layout::get_output_section): Add is_relro, is_last_relro, and
12119 is_first_non_relro parameters. Change all callers.
12120 (Layout::choose_output_section): Likewise.
12121 (Layout::add_output_section_data): Likewise.
12122 (Layout::make_output_section): Likewise.
12123 (Layout::set_segment_offsets): Clear increase_relro when using a
12124 linker script.
12125 * layout.h (class Layout): Add increase_relro method. Add
12126 increase_relro_ field. Update declarations.
12127 * output.cc (Output_section::Output_section): Initialize
12128 is_last_relro_ and is_first_non_relro_.
12129 (Output_segment::add_output_section): Group relro sections is
12130 do_sort is true. Handle is_last_relro and is_first_non_relro.
12131 (Output_segment::maximum_alignment): Remove relro handling.
12132 (Output_segment::set_section_addresses): Add increase_relro
12133 parameter. Change all callers. Add initial alignment to align
12134 relro sections on separate page. Remove old relro handling.
12135 (Output_segment::set_section_list_addresses): Remove in_relro
12136 parameter. Change all callers.
12137 (Output_segment::set_offset): Add increase parameter. Change all
12138 callers. Remove old relro handling.
12139 * output.h (class Output_section): Add new methods: is_last_relro,
12140 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12141 Add is_last_relro_ and is_first_non_relro_ fields.
12142 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12143 Create separate .got.plt section. Call increase_relro.
12144 * x86_64.cc (Target_x86_64::got_section): Likewise.
12145 * testsuite/relro_script_test.t: Add .got.plt.
12146
f0ba79e2
ILT
12147 PR 10450
12148 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12149 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12150 (Layout::finalize): Call set_dynamic_symbol_size.
12151 (Layout::set_dynamic_symbol_size): New function.
12152 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12153 set_dynamic_symbol_size.
12154
e8cd95c7
ILT
12155 PR 10450
12156 * output.h (class Output_section): Add is_entsize_zero_ field.
12157 * output.cc (Output_section::Output_section): Initialize
12158 is_entsize_zero_.
12159 (Output_section::set_entsize): If two different entsizes are
12160 requested, force it to zero.
12161 (Output_section::add_input_section): Set flags for .debug_str
12162 before updating section flags. Set entsize.
12163 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12164 and SHF_STRING if all input sections have those flags.
12165
3e1b9a8a
RÁE
121662009-12-29 Rafael Espindola <espindola@google.com>
12167
12168 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12169 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12170 reporting.
3e1b9a8a 12171
3dcad376
ST
121722009-12-29 Sriraman Tallam <tmsriram@google.com>
12173
12174 * options.cc (General_options::parse_version): Allow -v to exit
12175 without an error if there is nothing to link.
12176
084e2665
ILT
121772009-12-29 Ian Lance Taylor <iant@google.com>
12178
12179 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12180 using a version of gcc before 4.1.
12181 * configure: Rebuild.
12182
250acde3
CD
121832009-12-28 Chris Demetriou <cgd@google.com>
12184
12185 * attributes.cc (Output_attributes_section_data::do_write): Use
12186 std::vector::front rather than std::vector::data.
12187
99fff23b
ILT
121882009-12-28 Ian Lance Taylor <iant@google.com>
12189
12190 * symtab.h (class Symbol_table): Add enum Defined.
12191 * resolve.cc (Symbol_table::should_override): Add defined
12192 parameter. Change all callers. Test whether object is NULL
12193 before calling a method on it.
12194 (Symbol_table::report_resolve_problem): Add defined parameter.
12195 Change all callers.
12196 (Symbol_table::should_override_with_special): Likewise.
12197 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12198 parameter. Change all callers.
12199 (Symbol_table::do_define_in_output_data): Likewise.
12200 (Symbol_table::define_in_output_segment): Likewise.
12201 (Symbol_table::do_define_in_output_segment): Likewise.
12202 (Symbol_table::define_as_constant): Likewise.
12203 (Symbol_table::do_define_as_constant): Likewise.
12204 * script.h (class Symbol_assignment): Add is_defsym parameter to
12205 constructor; change all callers.
12206 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12207 parameter. Change all callers. Add is_defsym_ field.
12208 (class Parser_closure): Add parsing_defsym parameter to
12209 constructor; change all callers. Add parsing_defsym accessor
12210 function. Add parsing_defsym_ field.
12211
556bd683
ILT
122122009-12-28 Ian Lance Taylor <iant@google.com>
12213
12214 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12215 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12216
1782c879
ILT
122172009-12-23 Ian Lance Taylor <iant@google.com>
12218
12219 * i386.cc (Target_i386::do_calls_non_split): Recognize
12220 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12221 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12222 -fsplit-stack prologue when using %r11.
1782c879 12223
329ca2b1
ST
122242009-12-21 Sriraman Tallam <tmsriram@google.com>
12225
12226 * options.cc (General_options::parse_version): Make -v continue and do
12227 the link like GNU ld does.
12228
d675ff46
RÁE
122292009-12-17 Rafael Avila de Espindola <espindola@google.com>
12230
12231 * Makefile.am (CCFILES): Add timer.cc.
12232 (HFILES): Add timer.h.
12233 * configure.ac: Check for sysconf and times.
12234 * main.cc: include timer.h.
12235 (main): Use Timer instead of get_run_time.
12236 * timer.cc: New.
12237 * timer.h: New.
12238 * workqueue.cc: include timer.h.
12239 (Workqueue::find_and_run_task):
12240 Report user, sys and wall time.
12241 * Makefile.in: Regenerate.
12242 * config.in: Regenerate.
12243 * configure: Regenerate.
12244
d6344fb5
DK
122452009-12-16 Doug Kwan <dougkwan@google.com>
12246
12247 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12248 sections.
12249 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12250 relaxed input sections.
12251 * output.cc (Output_section::find_relaxed_input_section): Change
12252 return type to Output_relaxed_input_section pointer. Adjust code
12253 for new type of relaxed_input_section_map_.
12254 * output.h (Output_section::find_relaxed_input_section): Change
12255 return type to Output_relaxed_input_section pointer.
12256 (Output_section::Output_relaxed_input_section_by_input_section_map):
12257 New type.
12258 (Output_section::relaxed_input_section_map_): Change type to
12259 Output_section::Output_relaxed_input_section_by_input_section_map.
12260 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12261 input section.
12262
0e0d5469
ILT
122632009-12-15 Ian Lance Taylor <iant@google.com>
12264
12265 * layout.cc (Layout::create_shstrtab): Only write out after input
12266 sections if we are compressing debug sections.
12267
0649a889
ILT
122682009-12-15 Ian Lance Taylor <iant@google.com>
12269
12270 * archive.cc (Archive::add_symbols): Only look up a symbol without
12271 a version if there is, in fact, a version.
12272
2ea97941
ILT
122732009-12-14 Ian Lance Taylor <iant@google.com>
12274
12275 Revert -Wshadow changes, all changes from:
12276 2009-12-11 Doug Kwan <dougkwan@google.com>
12277 2009-12-11 Nick Clifton <nickc@redhat.com>
12278 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12279
b0eec2cc
DK
122802009-12-11 Doug Kwan <dougkwan@google.com>
12281
12282 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12283 due to -Wshadow.
12284 * attributes.cc (Object_attribute::size): Ditto.
12285 (Attributes_section_data::size): Ditto.
12286 (Attributes_section_data::Attributes_section_data): Ditto.
12287 (Output_attributes_section_data::do_write): Ditto.
12288 * attributes.h (Object_attribute::set_type): Ditto.
12289 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12290
91d6fa6a
NC
122912009-12-11 Nick Clifton <nickc@redhat.com>
12292
12293 * archive.cc: Fix shadowed variable warnings.
12294 * arm.cc: Likewise.
12295 * compressed_output.cc: Likewise.
12296 * compressed_output.h: Likewise.
12297 * configure: Likewise.
12298 * dwarf_reader.cc: Likewise.
12299 * dynobj.cc: Likewise.
12300 * dynobj.h: Likewise.
12301 * ehframe.cc: Likewise.
12302 * ehframe.h: Likewise.
12303 * errors.cc: Likewise.
12304 * expression.cc: Likewise.
12305 * fileread.cc: Likewise.
12306 * fileread.h: Likewise.
12307 * freebsd.h: Likewise.
12308 * i386.cc: Likewise.
12309 * icf.cc: Likewise.
12310 * incremental.h: Likewise.
12311 * layout.cc: Likewise.
12312 * layout.h: Likewise.
12313 * mapfile.cc: Likewise.
12314 * merge.cc: Likewise.
12315 * merge.h: Likewise.
12316 * object.cc: Likewise.
12317 * object.h: Likewise.
12318 * options.h: Likewise.
12319 * output.cc: Likewise.
12320 * output.h: Likewise.
12321 * parameters.cc: Likewise.
12322 * plugin.cc: Likewise.
12323 * powerpc.cc: Likewise.
12324 * reduced_debug_output.cc: Likewise.
12325 * reduced_debug_output.h: Likewise.
12326 * reloc.cc: Likewise.
12327 * reloc.h: Likewise.
12328 * resolve.cc: Likewise.
12329 * script-sections.cc: Likewise.
12330 * script.cc: Likewise.
12331 * script.h: Likewise.
12332 * sparc.cc: Likewise.
12333 * symtab.cc: Likewise.
12334 * symtab.h: Likewise.
12335 * target-select.cc: Likewise.
12336 * target-select.h: Likewise.
12337 * token.h: Likewise.
12338 * workqueue.cc: Likewise.
12339 * workqueue.h: Likewise.
12340 * x86_64.cc: Likewise.
12341
a0351a69
DK
123422009-12-10 Doug Kwan <dougkwan@google.com>
12343
12344 * arm.cc (attributes.h): New include.
12345 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12346 (Arm_relobj::~Arm_relobj): Delete object pointed by
12347 attributes_section_data_.
12348 (Arm_relobj::attributes_section_data): New method definition.
12349 (Arm_relobj::attributes_section_data_): New data member declaration.
12350 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12351 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12352 attributes_section_data_.
12353 (Arm_dynobj::attributes_section_data): New method definition.
12354 (Arm_dynobj::attributes_section_data_): New data member declaration.
12355 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12356 initialization value of may_use_blx_ to false.
2e702c99 12357 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12358 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12359 object attributes to compute results instead of hard-coding.
12360 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12361 Target_arm::get_secondary_compatible_arch,
12362 Target_arm::set_secondary_compatible_arch
12363 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12364 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12365 New method declarations.
12366 (Target_arm::get_aeabi_object_attribute): New method definition.
12367 (Target_arm::attributes_section_data_): New data member declaration.
12368 (read_arm_attributes_section): New template definition.
12369 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12370 (Arm_dynobj::do_read_symbols): Ditto.
12371 (Target_arm::do_finalize_sections): Merge attributes sections from
12372 input. Check for BLX use after attributes section merging.
12373 Fix __exidx_start and __exidx_end visibility. Create an
12374 .ARM.attributes section if necessary.
12375 (Target_arm::get_secondary_compatible_arch,
12376 Target_arm::set_secondary_compatible_arch,
12377 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12378 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12379 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12380 New method definitions.
12381
b59befec
ILT
123822009-12-09 Ian Lance Taylor <iant@google.com>
12383
12384 * plugin.cc (Plugin::load): Don't cast from void* to a function
12385 pointer.
12386
1276bc89
ILT
123872009-12-09 Ian Lance Taylor <iant@google.com>
12388
12389 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12390 information fields.
12391
2f2de248
L
123922009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12393
12394 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12395 Replace two_file_shared_1.so with two_file_shared_2.so.
12396 * testsuite/Makefile.in: Regenerated.
12397
4f787271
DK
123982009-12-08 Doug Kwan <dougkwan@google.com>
12399
12400 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12401 (HFILES): Add attributes.h and int_encoding.h.
12402 * Makefile.in: Regenerate.
12403 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12404 function definitions to int_encoding.cc
12405 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12406 prototypes to int_encoding.h
12407 * reduced_debug_output.cc (int_encoding.h): New include.
12408 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12409 function definitions to int_encoding.cc
12410 (insert_into_vector, read_from_pointer): Move template definitions to
12411 int_encoding.h
12412 * attributes.cc: New file.
12413 * attributes.h: New file.
12414 * int_encoding.cc: New file.
12415 * int_encoding.h: New file.
12416
20b52f1a
RÁE
124172009-12-07 Rafael Avila de Espindola <espindola@google.com>
12418
12419 PR gold/11055
12420 * incremental-dump.cc (dump_incremental_inputs): New.
12421 (main): Use dump_incremental_inputs.
12422
53d7974c
L
124232009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12424
12425 PR gold/10893
12426 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12427 checking elfcpp::STT_FUNC.
12428 (Target_i386::Relocate::relocate): Likewise.
12429 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12430
12431 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12432 symbols from shared libraries into normal FUNC symbols.
12433
12434 * symtab.h (Symbol): Add is_func and use it.
12435
05a352e6
DK
124362009-12-05 Doug Kwan <dougkwan@google.com>
12437
12438 * arm.cc (Target_arm::arm_info): Initialize new fields
12439 attributes_section and attributes_vendor.
12440 * i386.cc (Target_i386::i386_info): Same.
12441 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12442 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12443 fields attributes_section and attributes_vendor.
53d7974c 12444 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12445 * target.h (Target::attributes_section, Target::attributes_vendor,
12446 Target::is_attributes_section, Target::attribute_arg_type,
12447 Target::attributes_order): New method definitions.
12448 (Target::Target_info::attributes_section,
12449 Target::Target_info::attributes_vendor): New fields.
12450 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12451 virtual method definitions.
12452 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12453 attributes_section and attributes_vendor.
12454 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12455
f4e5969c
DK
124562009-12-05 Doug Kwan <dougkwan@google.com>
12457
12458 * arm.cc: Update comments about interworking and stub generation.
12459 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12460 considered as non-PIC.
12461 (Arm_relocate_functions::base_abs): Fix formatting.
12462 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12463 of function to use GOT entry address instead of offset.
12464 (Target_arm::Scan::global): Issue an error if a symbol would need a
12465 PLT does not get one because it is untyped. Remove code to create
12466 dynamic symbols for relative branches.
12467 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12468 takes unsigned integer instead of boolean.
12469
1abce4a6
L
124702009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12471
12472 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12473 (two_file_test_LDADD): Likewise.
12474 (common_test_1_LDADD): Likewise.
12475 (exception_test_LDADD) Likewise.
12476 (weak_test_LDADD): Likewise.
12477 (many_sections_test_LDADD): Likewise.
12478 (initpri1_LDADD): Likewise.
12479 (script_test_1_LDADD): Likewise.
12480 (script_test_2_LDADD): Likewise.
12481 (justsyms_LDADD): Likewise.
12482 (binary_test_LDADD): Likewise.
12483 (large_LDADD): Likewise.
12484 * testsuite/Makefile.in: Regenerated.
12485
adcf2816 124862009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12487
adcf2816
L
12488 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12489 (Symbol_table::override_with_special): Likewise.
12490 (Symbol_table::add_from_object): Likewise.
12491
28e67f5d
RÁE
124922009-12-04 Rafael Avila de Espindola <espindola@google.com>
12493
12494 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12495 Don't set the data_offset twice.
12496
ae10a101
RÁE
124972009-12-04 Rafael Avila de Espindola <espindola@google.com>
12498
12499 * testsuite/Makefile.in: Regenerate.
12500
f59f41f3
DK
125012009-12-03 Doug Kwan <dougkwan@google.com>
12502
12503 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12504 (Target_arm::do_finalize_sections): Add parameter for symbol table
12505 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12506 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12507 parameter for symbol table pointer.
12508 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12509 an additional parameter for a pointer to symbol table.
12510 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12511 parameter for a symbol table pointer.
12512 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12513 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12514 Ditto.
12515 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12516 parameter for a symbol table pointer.
12517
ca55d848
RÁE
125182009-12-03 Rafael Avila de Espindola <espindola@google.com>
12519
12520 * incremental.cc (Incremental_inputs_header)
12521 (Incremental_inputs_header_write, Incremental_inputs_entry)
12522 (Incremental_inputs_entry_write): Move ...
12523 * incremental.h (Incremental_inputs_header)
12524 (Incremental_inputs_header_write, Incremental_inputs_entry)
12525 (Incremental_inputs_entry_write): here.
12526
3aec4f9c
RÁE
125272009-12-02 Rafael Avila de Espindola <espindola@google.com>
12528
12529 * incremental.cc (make_sized_incremental_binary): Set the target.
12530 Error if it is incompatible.
12531 * output.h (Output_file): Add filename method.
12532
9c0ae74d
RÁE
125332009-12-02 Rafael Avila de Espindola <espindola@google.com>
12534
12535 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12536 from the get_* methods.
12537
a45500ae
RÁE
125382009-12-02 Rafael Avila de Espindola <espindola@google.com>
12539
12540 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12541 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12542 Write 0 for the data_offset of scripts.
12543
325e6408
RÁE
125442009-12-02 Rafael Avila de Espindola <espindola@google.com>
12545
12546 * testsuite/Makefile.am: Add the incremental_test.sh test.
12547 * testsuite/incremental_test.sh: New.
12548 * testsuite/incremental_test_1.c: New.
12549 * testsuite/incremental_test_2.c: New.
12550
954c3e2e
RÁE
125512009-12-01 Rafael Avila de Espindola <espindola@google.com>
12552
703d02da 12553 * incremental-dump.cc (main): Fix typos.
954c3e2e 12554
f8086623
RÁE
125552009-11-27 Rafael Avila de Espindola <espindola@google.com>
12556
12557 PR gold/11025
12558 * incremental-dump.cc (main): Use llu to print 64 bit values.
12559
3b0dd6ac
L
125602009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12561 H.J. Lu <hongjiu.lu@intel.com>
12562
12563 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12564 $(LIBDL).
12565 (incremental_dump_LDADD): Likewise.
12566 * Makefile.in: Regenerated.
12567
a6d1ef57 125682009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12569
a6d1ef57
DK
12570 Revert:
12571
12572 2009-11-25 Doug Kwan <dougkwan@google.com>
12573
12574 * arm.cc (Target_arm::Target_arm): Move method definition
12575 outside of class definition. Add code to handle
12576 --target1-rel, --target1-abs and --target2= options.
12577 (Target_arm::get_reloc_reloc_type): Change method to be
12578 non-static and const.
12579 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12580 New data member declaration.
12581 (Target_arm::Scan::local, Target_arm::Scan::global,
12582 Target_arm::Relocate::relocate,
12583 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12584 Adjust call to Target_arm::get_real_reloc_type.
12585 (Target_arm::get_real_reloc_type): Use command line options
12586 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12587 * options.h (--target1-rel, --target1-abs, --target2): New
12588 ARM-only options.
12589
50aeb7d4
DK
125902009-11-25 Doug Kwan <dougkwan@google.com>
12591
12592 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12593 class definition. Add code to handle --target1-rel, --target1-abs
12594 and --target2= options.
12595 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12596 and const.
12597 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12598 member declaration.
12599 (Target_arm::Scan::local, Target_arm::Scan::global,
12600 Target_arm::Relocate::relocate,
12601 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12602 call to Target_arm::get_real_reloc_type.
12603 (Target_arm::get_real_reloc_type): Use command line options to
12604 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12605 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12606 options.
12607
51938283
DK
126082009-11-25 Doug Kwan <dougkwan@google.com>
12609
12610 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12611 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12612 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12613 formatting.
12614 (Arm_relocate_functions::thm_call): Replace body with a call to
12615 Arm_relocate_functions::thumb_branch_common.
12616 (Arm_relocate_functions::thm_jump24,
12617 Arm_relocate_functions::thm_xpc22): New method definitions.
12618 (Arm_relocate_functions::thumb_branch_common): New method definition.
12619 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12620 operator.
12621 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12622 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12623
e2b8f3c4
RÁE
126242009-11-24 Rafael Avila de Espindola <espindola@google.com>
12625
12626 * Makefile.am: Build incremental-dump
12627 * Makefile.in: Regenerate.
12628 * incremental-dump.cc: New.
12629 * incremental.cc (Incremental_inputs_header_data,
12630 Incremental_inputs_entry_data): Move to incremental.h
12631 * incremental.h: (Incremental_inputs_header_data,
12632 Incremental_inputs_entry_data): Move from incremental.cc
12633
bcba9aec
RÁE
126342009-11-24 Rafael Avila de Espindola <espindola@google.com>
12635
12636 * incremental.cc (Incremental_inputs_header,
12637 Incremental_inputs_header_write, Incremental_inputs_entry,
12638 Incremental_inputs_entry_write): Add a typedef with the data type.
12639
7c3afe08
RÁE
126402009-11-24 Rafael Avila de Espindola <espindola@google.com>
12641
12642 * incremental.cc (Incremental_inputs_header,
12643 Incremental_inputs_header_write, Incremental_inputs_entry,
12644 Incremental_inputs_entry_write): Update comment about which
12645 type has the filed descriptions.
12646
d204b6e9
DK
126472009-11-15 Doug Kwan <dougkwan@google.com>
12648
12649 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12650 (Arm_relocate_functions::arm_branch_common): Change method defintion
12651 in class definition to a method declaration and update list of formal
12652 parameters.
12653 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12654 Arm_relocation_functions::jump24): Adjust call to
12655 Arm_relocate_functions::arm_branch_common. Update list of formal
12656 parameters.
12657 (Arm_relocate_functions::xpc25): New method definition.
12658 (Arm_relocate_functions::arm_branch_common): Move method defintion
12659 out from class definition. Use stubs for mode-switching and extending
12660 branch ranges.
12661 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12662 specially. Change code to enable use of stubs in ARM branches.
12663
43d12afe
DK
126642009-11-10 Doug Kwan <dougkwan@google.com>
12665
12666 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12667 in method declaration.
12668 (Target_arm::relocate_stub): New method declaration.
12669 (Target_arm::default_target): Change to return a pointer instead of
12670 a const reference.
12671 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12672 Target_arm::default_target.
12673 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12674 method definition.
12675 (Target_arm::relocate_section): Adjust view.
12676 (Target_arm::relocate_stub): New method definition.
12677
ac33a407
DK
126782009-11-10 Doug Kwan <dougkwan@google.com>
12679
12680 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12681 a format warning.
12682 * incremental.cc (open_incremental_binary): Initialized local
12683 variables to avoid warnings.
12684 * object.cc (make_elf_object): Ditto.
12685 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12686 a format warning.
e1df38aa 12687
88ee28e9
L
12688009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12689
12690 PR gold/10930
12691 * testsuite/plugin_test.c: Include "config.h".
12692
2daedcd6
DK
126932009-11-09 Doug Kwan <dougkwan@google.com>
12694
12695 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12696 (arm_symbol_value): Remove.
12697 (Arm_relocate_functions::arm_branch_common,
12698 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12699 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12700 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12701 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12702 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12703 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12704 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12705 Arm_relocate_functions::thm_mobw_abs_nc,
12706 Arm_relocate_functions::thm_mov_abs,
12707 Arm_relocate_functions::movw_prel_nc,
12708 Arm_relocate_functions::thm_movt_abs,
12709 Arm_relocate_functions::movt_prel,
12710 Arm_relocate_functions::thm_movw_prel_nc,
12711 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12712 (Target_arm::Relocate::relocate): Only decompose address into two
12713 parts if relocation type uses the thumb-bit and pass the actual
12714 bit instead of a flag indicating that the thumb-bit is used. Adjust
12715 calls to methods in Arm_relocate_functions for this change.
12716
1276bc89 127172009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12718
12719 PR 10925
12720 * reloc.cc: Instantiate
12721 Sized_relobj::initialize_input_to_output_maps and
12722 Sized_relobj:free_input_to_output_maps.
12723
e53ad1b5
ILT
127242009-11-06 Ian Lance Taylor <iant@google.com>
12725
12726 PR 10876
12727 * defstd.cc (in_segment): Set only_if_ref true for "end".
12728
eb44217c
DK
127292009-11-06 Doug Kwan <dougkwan@google.com>
12730
12731 * arm.cc (class Reloc_stub): Correct a comment.
12732 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12733 (Target_arm::scan_section_for_stubs): New method declaration.
12734 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12735 Change methods from private to protected.
12736 (Target_arm::do_may_relax): New method definition.
12737 (Target_arm::do_relax, Target_arm::group_sections,
12738 Target_arm::scan_reloc_for_stub,
12739 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12740 (Target_arm::arm_input_section_map_): New data member declaration.
12741 (Target_arm::scan_reloc_for_stub,
12742 Target_arm::scan_reloc_section_for_stubs,
12743 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12744 Target_arm::do_relax): New method definitions.
12745
5d329b7d
ILT
127462009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12747
12748 * configure.ac: Check for (struct stat)::st_mtim
12749 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12750 * config.in: Regenerate.
12751 * configure: Regenerate.
12752
96a0d71b
ILT
127532009-11-05 Ian Lance Taylor <iant@google.com>
12754
12755 PR 10910
12756 * output.cc (Output_segment::add_output_section): Add missing
12757 return statement.
12758
594c8e5e
ILT
127592009-11-04 Ian Lance Taylor <iant@google.com>
12760
12761 PR 10880
12762 * object.h (class Object): Add is_needed and set_is_needed
12763 methods. Add is_needed_ field. Make bool fields into bitfields.
12764 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12765 defined in a dynamic object and referenced by a regular object,
12766 set is_needed for the dynamic object.
12767 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12768 if the file is marked with as_needed and it is not needed.
12769
22b127cc
ILT
127702009-11-04 Ian Lance Taylor <iant@google.com>
12771
12772 PR 10887
12773 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12774 tags if data is discarded by linker script.
12775 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12776 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12777 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12778 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12779
f5c870d2
ILT
127802009-11-04 Ian Lance Taylor <iant@google.com>
12781
12782 * layout.cc (Layout::get_output_section): Add is_interp and
12783 is_dynamic_linker_section parameters. Change all callers.
12784 (Layout::choose_output_section): Likewise.
12785 (Layout::make_output_section): Likewise.
12786 (Layout::add_output_section_data): Add is_dynamic_linker_section
12787 parameter. Change all callers.
12788 * layout.h (class Layout): Update declarations.
12789 * output.h (class Output_section): Add is_interp, set_is_interp,
12790 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12791 Add is_interp_, is_dynamic_linker_section_ fields. Change
12792 generate_code_fills_at_write_ to a bitfield.
12793 * output.cc (Output_section::Output_sections): Initialize new
12794 fields.
12795 (Output_segment::add_output_section): Add do_sort parameter.
12796 Change all callers.
12797
1ae4d23b
ILT
127982009-11-03 Ian Lance Taylor <iant@google.com>
12799
12800 PR 10860
12801 * options.h (class General_options): Add --warn-common.
12802 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12803 merging two common symbols.
12804 (Symbol_table::should_override): Handle --warn-common when merging
12805 a common symbol with a defined symbol. Use report_resolve_problem
12806 for multiple definitions.
12807 (Symbol_table::report_resolve_problem): New function.
12808 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12809
55da9579
DK
128102009-11-03 Doug Kwan <dougkwan@google.com>
12811
12812 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12813 stub_factory_.
12814 (Target_arm::stub_factory): New method definition.
12815 (Target_arm::new_arm_input_section,
12816 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12817 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12818 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12819 New type definitions.
12820 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12821 member declarations.
12822 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12823 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12824 New method definitions.
12825
37a9ac43
ILT
128262009-11-03 Ian Lance Taylor <iant@google.com>
12827
12828 * options.h (class General_options): Add --warn_constructors.
12829
b3d6a3d4
ILT
128302009-11-03 Ian Lance Taylor <iant@google.com>
12831
12832 PR 10893
12833 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12834 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12835
934b01dd
ILT
128362009-11-03 Ian Lance Taylor <iant@google.com>
12837
12838 PR 10895
12839 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12840 --msgid-bugs-address.
12841 (install-pdf): New target.
12842 (install-data_yes): Look up one directory to find mkinstalldirs.
12843
03c1939b
L
128442009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12845
12846 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12847 tree.
12848
ebd95253
DK
128492009-10-30 Doug Kwan <dougkwan@google.com>
12850
12851 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12852
e9bbb538
DK
128532009-10-30 Doug Kwan <dougkwan@google.com>
12854
12855 * arm.cc (Stub_addend_reader): New struct template definition
12856 and partial specializations.
12857 (Stub_addend_reader::operator()): New method definition for a
12858 partially specialized template.
12859
d5b40221
DK
128602009-10-30 Doug Kwan <dougkwan@google.com>
12861
12862 * arm.cc (Arm_relobj::processor_specific_flags): New method
12863 definition.
12864 (Arm_relobj::do_read_symbols): New method declaration.
12865 (Arm_relobj::processor_specific_flags_): New data member declaration.
12866 (Arm_dynobj): New class definition.
12867 (Target_arm::do_finalize_sections): Add input_objects parameter.
12868 (Target_arm::do_adjust_elf_header): New method declaration.
12869 (Target_arm::are_eabi_versions_compatible,
12870 (Target_arm::merge_processor_specific_flags): New method declaration.
12871 (Target_arm::do_make_elf_object): New overloaded method definitions
12872 and declaration.
12873 (Arm_relobj::do_read_symbols): New method definition.
12874 (Arm_dynobj::do_read_symbols): Ditto.
12875 (Target_arm::do_finalize_sections): Add input_objects parameters.
12876 Merge processor-specific flags from all input objects.
12877 (Target_arm::are_eabi_versions_compatible,
12878 Target_arm::merge_processor_specific_flags,
12879 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12880 New method definitions.
12881 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12882 Input_objects pointer type parameter.
12883 * layout.cc (Layout::finalize): Pass input objects to target's.
12884 finalize_sections function.
12885 * output.cc (Output_file_header::do_sized_write): Set ELF file
12886 header's processor-specific flags.
12887 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12888 Input_objects pointer type parameter.
12889 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12890 * target.h (Input_objects): New forward class declaration.
12891 (Target::processor_specific_flags,
12892 Target::are_processor_specific_flags_sect): New method definitions.
12893 (Target::finalize_sections): Add input_objects parameter.
12894 (Target::Target): Initialize processor_specific_flags_ and
12895 are_processor_specific_flags_set_.
12896 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12897 parameter.
12898 (Target::set_processor_specific_flags): New method definition.
12899 (Target::processor_specific_flags_,
12900 Target::are_processor_specific_flags_set_): New data member
12901 declarations.
12902 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12903 Input_objects pointer type parameter.
12904
ebabffbd
DK
129052009-10-30 Doug Kwan <dougkwan@google.com>
12906
12907 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12908
ad0f2072
ILT
129092009-10-28 Ian Lance Taylor <iant@google.com>
12910
12911 * object.h (class Relobj): Drop options parameter from
12912 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12913 do_scan_relocs, do_relocate. Change all callers.
12914 (class Sized_relobj): Drop options parameters from
12915 do_gc_process_relocs, do_scan_relocs, do_relocate,
12916 do_relocate_sections, relocate_sections, emit_relocs_scan,
12917 emit_relocs_scan_reltype. Change all callers.
12918 (struct Relocate_info): Remove options field and all references to
12919 it.
12920 * reloc.h (class Read_relocs): Remove options constructor
12921 parameter and options_ field. Change all callers.
12922 (class Gc_process_relocs, class Scan_relocs): Likewise.
12923 (class Relocate_task): Likewise.
12924 * target-reloc.h (scan_relocs): Remove options parameter. Change
12925 all callers.
12926 (scan_relocatable_relocs): Likewise.
12927 * target.h (class Sized_target): Remove options parameter from
12928 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12929 all callers.
12930 * gc.h (gc_process_relocs): Remove options parameter. Change all
12931 callers.
12932 * arm.cc: Update functions to remove options parameters.
12933 * i386.cc: Likewise.
12934 * powerpc.cc: Likewise.
12935 * sparc.cc: Likewise.
12936 * x86_64.cc: Likewise.
12937 * testsuite/testfile.cc: Likewise.
12938
8ffa3667
DK
129392009-10-28 Doug Kwan <dougkwan@google.com>
12940
12941 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12942 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12943 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12944 New method definitions.
12945
40f36857
CC
129462009-10-28 Cary Coutant <ccoutant@google.com>
12947
12948 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12949 (Plugin::cleanup_done_): New member.
12950 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12951 (Plugin_manager::cleanup_done_): Remove.
12952 (Plugin_manager::add_input_file): Edit error message.
12953 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12954 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12955
2c849493
ILT
129562009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12957
12958 * fileread.cc: (File_read::View::~View): Use the new
12959 data_ownership_ filed.
12960 (File_read::~File_read): Dispose the new whole_file_view_.
12961 (File_read::open): Mmap the whole file if needed.
12962 (File_read::open): Use whole_file_view_ instead of contents_.
12963 (File_read::find_view): Use whole_file_view_ if applicable.
12964 (File_read::do_read): Use whole_file_view_ instead of contents_.
12965 (File_read::make_view): Use whole_file_view_ instead of contents_,
12966 update File_read::View::View call.
12967 (File_read::find_or_make_view): Update File_read::View::View
12968 call.
12969 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12970 remove contents_
12971 (File_read::View::Data_ownership): New enum.
12972 (File_read::View::View): Replace bool mapped_ with Data_ownership
12973 argument.
12974 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12975 (File_read::View::data_ownership_): New field.
12976 (File_read::contents_): Remove (replaced by whole_file_view_).
12977 (File_read::whole_file_view_): New field.
12978 * options.h (class General_options): Add --keep-files-mapped.
12979
24998053
CC
129802009-10-27 Cary Coutant <ccoutant@google.com>
12981
12982 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12983 * testsuite/Makefile.am (plugin_test_5): New test case.
12984 * testsuite/Makefile.in: Regenerate.
12985
72adc4fa
DK
129862009-10-25 Doug Kwan <dougkwan@google.com>
12987
12988 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12989 from private to protected to allow access by child class.
12990 (Sized_relobj::do_relocate_sections): New method declaration.
12991 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12992 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12993 Sized_relobj::relocate_sections. Instantiate template explicitly
12994 for different target sizes and endianity.
12995
07f508a2
DK
129962009-10-24 Doug Kwan <dougkwan@google.com>
12997
12998 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12999 (Arm_input_section::as_arm_input_section): New method.
13000 (Arm_output_section): New class definition.
13001 (Arm_output_section::create_stub_group,
13002 Arm_output_section::group_sections): New method definitions.
13003
10ad9fe5
DK
130042009-10-22 Doug Kwan <dougkwan@google.com>
13005
13006 * arm.cc (Arm_input_section): New class definition.
13007 (Arm_input_section::init, Arm_input_section:do_write,
13008 Arm_input_section::set_final_data_size,
13009 Arm_input_section::do_reset_address_and_file_offset): New method
13010 definitions.
13011
56ee5e00
DK
130122009-10-21 Doug Kwan <dougkwan@google.com>
13013
13014 * arm.cc (Stub_table, Arm_input_section): New forward class
13015 declarations.
13016 (Stub_table): New class defintion.
13017 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13018 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13019 New method definition.
13020
b569affa
DK
130212009-10-21 Doug Kwan <dougkwan@google.com>
13022
13023 * arm.cc: Update copyright comments.
13024 (Target_arm): New forward class template declaration.
13025 (Arm_address): New type.
13026 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13027 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13028 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13029 constants.
13030 (Insn_template): Same.
13031 (DEF_STUBS): New macro.
13032 (Stub_type): New enum type.
13033 (Stub_template): New class definition.
13034 (Stub): Same.
13035 (Reloc_stub): Same.
13036 (Stub_factory): Same.
13037 (Target_arm::Target_arm): Initialize may_use_blx_ and
13038 should_force_pic_veneer_.
13039 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13040 Target_arm::should_force_pic_veneer,
13041 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13042 Target_arm::using_thumb_only, Target_arm:;default_target): New
13043 method defintions.
13044 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13045 New data member declarations.
13046 (Insn_template::size, Insn_template::alignment): New method defintions.
13047 (Stub_template::Stub_template): New method definition.
13048 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13049 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13050 (Stub_factory::Stub_factory): New method definition.
13051 * gold.h (string_hash): New template.
13052 * output.h (Input_section_specifier::hash_value): Use
13053 gold::string_hash.
13054 (Input_section_specifier::string_hash): Remove.
13055 * stringpool.cc (Stringpool_template::string_hash): Use
13056 gold::string_hash.
13057
6c172549
DK
130582009-10-20 Doug Kwan <dougkwan@google.com>
13059
13060 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13061 symbols of relaxed input sections.
13062 * output.h (Output_section::find_relaxed_input_section): Make
13063 method public.
13064
c5617f2f
DK
130652009-10-16 Doug Kwan <dougkwan@google.com>
13066
13067 * dynobj.cc (Versions::Versions): Initialize version_script_.
13068 Only insert base version symbol definition for a shared object
13069 if version script defines any version versions.
13070 (Versions::define_base_version): New method definition.
13071 (Versions::add_def): Check that base version is not needed.
13072 (Versions::add_need): Define base version lazily.
13073 * dynobj.h (Versions::define_base_version): New method declaration.
13074 (Versions::needs_base_version_): New data member declaration.
13075 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13076 (check_DATA): Add no_version_test.stdout.
13077 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13078 New make rules.
13079 * testsuite/Makefile.in: Regenerate.
13080 * testsuite/no_version_test.c: New file.
13081 * testsuite/no_version_test.sh: Ditto.
13082
3c12dcdb
DK
130832009-10-16 Doug Kwan <dougkwan@google.com>
13084
13085 * expression.cc (class Segment_start_expression): New class definition.
13086 (Segment_start_expression::value): New method definition.
13087 (script_exp_function_segment_start): Return a new
13088 Segment_start_expression.
13089 * gold/script-c.h (script_saw_segment_start_expression): New function
13090 prototype.
13091 * script-sections.cc (Script_sections::Script_sections): Initialize
13092 SAW_SEGMENT_START_EXPRESSION_ to false.
13093 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13094 and -Tbbs options to specify section addresses if given in
13095 command line and no SEGMENT_START expression is seen in a script.
13096 * script-sections.h (Script_sections::saw_segment_start_expression,
13097 Script_sections::set_saw_segment_start_expression): New method
13098 definition.
13099 (Script_sections::saw_segment_start_expression_): New data member
13100 declaration.
13101 * script.cc (script_saw_segment_start_expression): New function.
13102 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13103 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13104 script_test_7.sh and script_test_8.sh.
13105 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13106 script_test_8.stdout.
13107 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13108 (script_test_6, script_test_6.stdout, script_test_7,
13109 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13110 * Makefile.in: Regenerate.
13111 * testsuite/script_test_6.sh: New file.
13112 * testsuite/script_test_6.t: Same.
13113 * testsuite/script_test_7.sh: Same.
13114 * testsuite/script_test_7.t: Same.
13115 * testsuite/script_test_8.sh: Same.
13116
64b1ae37
DK
131172009-10-16 Doug Kwan <dougkwan@google.com>
13118
13119 * output.cc (Output_segment::set_section_list_address): Cast
13120 expressions to unsigned long long type to avoid format warnings.
13121
661be1e2
ILT
131222009-10-15 Ian Lance Taylor <iant@google.com>
13123
12edd763 13124 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13125 dot assignment to script_sections_.
12edd763
ILT
13126 * script-sections.cc (Script_sections::add_dot_assignment):
13127 Initialize if necessary.
13128
68b6574b
ILT
13129 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13130 program headers with no load segment if there is a linker script.
13131
661be1e2
ILT
13132 * layout.cc (Layout::set_segment_offsets): Align the file offset
13133 to the segment aligment for -N or -n with no load segment.
13134 * output.cc (Output_segment::add_output_section): Don't crash if
13135 the first section is a TLS section.
13136 (Output_segment::set_section_list_addresses): Print an error
13137 message if the address moves backward in a linker script.
13138 * script-sections.cc
13139 (Output_section_element_input::set_section_addresses): Don't
13140 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13141 (Orphan_output_section::set_section_addresses): Likewise.
13142
f15f61a7
DK
131432009-10-15 Doug Kwan <dougkwan@google.com>
13144
13145 * layout.cc (Layout::finish_dynamic_section): Generate tags
13146 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13147 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13148 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13149
82bb573a
ILT
131502009-10-14 Ian Lance Taylor <iant@google.com>
13151
13152 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13153 fields.
13154 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13155 data_shdr fields of relinfo.
13156 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13157 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13158 R_386_TLS_LDO_32, adjust based on section flags.
13159 (Target_i386::Relocate::fix_up_ldo): Remove.
13160
374ad285
ILT
131612009-10-13 Ian Lance Taylor <iant@google.com>
13162
13163 Add support for -pie.
13164 * options.h (class General_options): Add -pie and
13165 --pic-executable.
13166 (General_options::output_is_position_independent): Test -pie.
13167 (General_options::output_is_executable): Return true if not shared
13168 and not relocatable.
13169 (General_options::output_is_pie): Remove.
13170 * options.cc (General_options::finalize): Reject incompatible uses
13171 of -pie.
13172 * gold.cc (queue_middle_tasks): A -pie link is not static.
13173 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13174 * symtab.cc (Symbol::final_value_is_known): Return false if
13175 output_is_position_independent.
13176 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13177 output_is_position_independent.
13178 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13179 output_is_position_independent.
13180 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13181 output_is_position_independent.
13182 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13183 two_file_pie_test.
13184 (basic_pie_test.o, basic_pie_test): New targets.
13185 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13186 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13187 (two_file_pie_test): New target.
13188 * testsuite/Makefile.in: Rebuild.
13189 * README: Remove note saying that -pie is not supported.
13190
c6585162
ILT
131912009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13192
13193 * options.h (class General_options): Add -init and -fini.
13194 * layout.cc (Layout::finish_dynamic_section): Emit
13195 given init and fini functions.
13196
032ce4e9
ST
131972009-10-13 Sriraman Tallam <tmsriram@google.com>
13198
13199 * gc.h (gc_process_relocs): Check if icf is enabled using new
13200 function.
13201 * gold.cc (queue_initial_tasks): Likewise.
13202 (queue_middle_tasks): Likewise.
13203 * object.cc (do_layout): Likewise.
13204 * symtab.cc (is_section_folded): Likewise.
13205 * main.cc (main): Likewise.
13206 * reloc.cc (Read_relocs::run): Likewise.
13207 (Sized_relobj::do_scan_relocs): Likewise.
13208 * icf.cc (is_function_ctor_or_dtor): New function.
13209 (Icf::find_identical_sections): Check if function is ctor or dtor when
13210 safe icf is chosen.
13211 * options.h (General_options::icf): Change option to be an enum.
13212 (Icf_status): New enum.
13213 (icf_enabled): New method.
13214 (icf_safe_folding): New method.
13215 (set_icf_status): New method.
13216 (icf_status_): New variable.
13217 * (options.cc) (General_options::finalize): Set icf_status_.
13218 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13219 icf_test and icf_keep_unique_test to use the --icf enum flag.
13220 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13221 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13222
f345227a
ST
132232009-10-12 Sriraman Tallam <tmsriram@google.com>
13224
13225 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13226 includes to gc.h and icf.h.
13227 * arm.cc: Include gc.h.
13228 * gold.cc: Likewise.
13229 * i386.cc: Likewise.
13230 * powerpc.cc: Likewise.
13231 * sparc.cc: Likewise.
13232 * x86_64.cc: Likewise.
13233 * gc.h: Include icf.h.
13234
1c7814ed
ILT
132352009-10-11 Ian Lance Taylor <iant@google.com>
13236
13237 * plugin.cc: Include "gold.h" before other header files.
13238
ae3b5189
CD
132392009-10-10 Chris Demetriou <cgd@google.com>
13240
13241 * options.h (Input_file_argument::Input_file_type): New enum.
13242 (Input_file_argument::is_lib_): Replace with...
13243 (Input_file_argument::type_): New member.
13244 (Input_file_argument::Input_file_argument): Take Input_file_type
13245 'type' rather than boolean 'is_lib' as second argument.
13246 (Input_file_argument::is_lib): Use type_.
13247 (Input_file_argument::is_searched_file): New function.
13248 (Input_file_argument::may_need_search): Handle is_searched_file.
13249 * options.cc (General_options::parse_library): Support -l:filename.
13250 (General_options::parse_just_symbols): Update for Input_file_argument
13251 changes.
13252 (Command_line::process): Likewise.
13253 * archive.cc (Archive::get_file_and_offset): Likewise.
13254 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13255 * script.cc (read_script_file, script_add_file): Likewise.
13256 * fileread.cc (Input_file::Input_file): Likewise.
13257 (Input_file::will_search_for): Handle is_searched_file.
13258 (Input_file::open): Likewise.
13259 * readsyms.cc (Read_symbols::get_name): Likewise.
13260 * testsuite/Makefile.am (searched_file_test): New test.
13261 * testsuite/Makefile.in: Regenerate.
13262 * testsuite/searched_file_test.cc: New file.
13263 * testsuite/searched_file_test_lib.cc: New file.
13264
f3048a1d
ILT
132652009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13266 Ian Lance Taylor <iant@google.com>
13267
13268 * descriptor.cc: Include <cstdio> and "binary-io.h".
13269 (Descriptors::open): Open the files in binary mode always.
13270 * script.cc (Lex::get_token): Treat \r as whitespace.
13271
d4780e57
ILT
132722009-10-09 Ian Lance Taylor <iant@google.com>
13273
13274 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13275
d9a893b8
ILT
132762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13277 Ian Lance Taylor <iant@google.com>
13278
13279 * configure.ac: Check for readv function also.
13280 * fileread.cc (readv): Define if not HAVE_READV.
13281 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13282 does not exist.
13283 * config.in: Regenerate.
13284 * configure: Regenerate.
13285
c0a62865
DK
132862009-10-09 Doug Kwan <dougkwan@google.com>
13287
13288 * layout.cc (Layout::make_output_section): Call target hook to make
13289 ordinary output section.
13290 (Layout::finalize): Adjust parameter list of call the
13291 Target::may_relax().
13292 * layout.h (class Layout::section_list): New method.
13293 * merge.h (Output_merge_base::entsize): Change visibility to public.
13294 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13295 New methods.
13296 (Output_merge_string::do_is_string): New method.
13297 * object.cc (Sized_relobj::do_setup): renamed from
13298 Sized_relobj::set_up.
13299 * object.h (Sized_relobj::adjust_shndx,
13300 Sized_relobj::initializ_input_to_output_maps,
13301 Sized_relobj::free_input_to_output_maps): Change visibilities to
13302 protected.
13303 (Sized_relobj::setup): Virtualize.
13304 (Sized_relobj::do_setup): New method declaration.
13305 (Sized_relobj::invalidate_section_offset,
13306 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13307 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13308 * options.cc (parse_int): New function.
13309 * options.h (parse_int): New declaration.
13310 (DEFINE_int): New macro.
13311 (stub_group_size): New option.
13312 * output.cc (Output_section::Output_section): Initialize memebers
13313 merge_section_map_, merge_section_by_properties_map_,
13314 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13315 (Output_section::add_input_section): Handled deferred code-fill
13316 generation and remove an old comment.
13317 (Output_section::add_relaxed_input_section): New method definition.
13318 (Output_section::add_merge_input_section): Use merge section by
13319 properties map to speed to search. Update merge section maps
13320 as appropriate.
13321 (Output_section::build_relaxation_map): New method definition.
13322 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13323 Same.
13324 (Output_section::relax_input_section): Renamed to
13325 Output_section::convert_input_sections_to_relaxed_sections and change
13326 interface to take a vector of pointers to relaxed sections.
13327 (Output_section::find_merge_section,
13328 Output_section::find_relaxed_input_section): New method definitions.
13329 (Output_section::is_input_address_mapped,
13330 Output_section::output_offset, Output_section::output_address):
13331 Use output section data maps to speed up searching.
13332 (Output_section::find_starting_output_address): Add comments.
13333 (Output_section::do_write,
13334 Output_section::write_to_postprocessing_buffer): Do code-fill
13335 generation as appropriate.
13336 (Output_section::get_input_sections): Invalidate relaxed input section
13337 map.
13338 (Output_section::restore_states): Adjust type of checkpoint .
13339 Invalidate relaxed input section map.
13340 * output.h (Output_merge_base): New class declaration.
13341 (Input_section_specifier): New class defintion.
13342 (class Output_relaxed_input_section) Change base class to
13343 Output_section_data_build.
13344 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13345 base class initializer.
13346 (Output_section::add_relaxed_input_section): New method declaration.
13347 (Output_section::Input_section): Change visibility to protected.
2e702c99 13348 (Output_section::Input_section::relobj,
c0a62865
DK
13349 Output_section::Input_section::shndx): Handle relaxed input sections.
13350 Output_section::input_sections) Change visibility to protected. Also
13351 define overload to return a non-const pointer.
13352 (Output_section::Merge_section_properties): New class defintion.
13353 (Output_section::Merge_section_by_properties_map,
13354 Output_section::Output_section_data_by_input_section_map,
13355 Output_section::Relaxation_map): New types.
13356 (Output_section::relax_input_section): Rename method to
13357 Output_section::convert_input_sections_to_relaxed_sections and change
13358 interface to take a vector of relaxed section pointers.
13359 (Output_section::find_merge_section,
13360 Output_section::find_relaxed_input_section,
13361 Output_section::build_relaxation_map,
13362 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13363 New method declarations.
13364 (Output_section::merge_section_map_
13365 Output_section::merge_section_by_properties_map_,
13366 Output_section::relaxed_input_section_map_,
13367 Output_section::is_relaxed_input_section_map_valid_,
13368 Output_section::generate_code_fills_at_write_): New data members.
13369 * script-sections.cc
13370 (Output_section_element_input::set_section_addresses): Call
13371 current_data_size and addralign methods of relaxed input sections.
13372 (Orphan_output_section::set_section_addresses): Call current_data_size
13373 and addralign methods of relaxed input sections.
13374 * symtab.cc (Symbol_table::compute_final_value): Extract template
13375 from the body of Symbol_table::sized_finalize_symbol.
13376 (Symbol_table::sized_finalized_symbol): Call
13377 Symbol_table::compute_final_value.
13378 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13379 (Symbol_table::compute_final_value): New templated method declaration.
13380 * target.cc (Target::do_make_output_section): New method defintion.
13381 * target.h (Target::make_output_section): New method declaration.
13382 (Target::relax): Add more parameters for input objects, symbol table
13383 and layout. Adjust call to do_relax.
13384 (Target::do_make_output_section): New method declaration.
13385 (Target::do_relax): Add parameters for input objects, symbol table
13386 and layout.
13387
d446d6c4
ILT
133882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13389
13390 * pread.c: Include stdio.h.
13391
bc06c745
ILT
133922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13393
13394 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13395 defined.
13396
75aea3d0
ILT
133972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13398
13399 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13400 Change read_shndx type to unsigned int.
13401 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13402 int.
13403 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13404 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13405 Change read_shndx type to unsigned int.
13406 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13407 int.
13408 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13409 * layout.cc (Layout::create_symtab_sections): Cast the result of
13410 local_symcount * symsize to off_t in the gold_assert.
13411
be8fcb75
ILT
134122009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13413
13414 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13415 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13416 R_ARM_BASE_ABS.
13417 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13418 (Arm_relocate_functions::thm_abs5): New function.
13419 (Arm_relocate_functions::abs12): New function.
13420 (Arm_relocate_functions::abs16): New function.
13421 (Arm_relocate_functions::base_abs): New function.
13422 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13423 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13424 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13425 R_ARM_BASE_ABS.
13426 (Scan::global): Likewise.
13427 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13428 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13429 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13430 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13431 R_ARM_BASE_ABS.
13432
c2a122b6
ILT
134332009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13434
13435 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13436 (Arm_relocate_functions::movt_prel): New function.
13437 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13438 (Arm_relocate_functions::thm_movt_prel): New function.
13439 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13440 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13441 (Scan::global, Relocate::relocate): Likewise.
13442 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13443
c4aa1e2d
ILT
134442009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13445
13446 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13447 Incremental_checker.
13448 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13449 unsigned int.
13450 (class Incremental_inputs_header): New class.
13451 (Incremental_inputs_header_writer): Edit comment.
13452 (Incremental_inputs_entry): New class.
13453 (Incremental_inputs_entry_writer): Edit comment.
13454 (Sized_incremental_binary::do_find_incremental_inputs_section):
13455 Add *strtab_shndx parameter, fill it.
13456 (Sized_incremental_binary::do_check_inputs): New method.
13457 (Incremental_checker::can_incrementally_link_output_file): Use
13458 Sized_incremental_binary::check_inputs.
13459 (Incremental_inputs::report_command_line): Save command line in
13460 command_line_.
13461 * incremental.h:
13462 (Incremental_binary::find_incremental_inputs_section): New
13463 method.
13464 (Incremental_binary::do_find_incremental_inputs_section): Add
13465 strtab_shndx parameter.
13466 (Incremental_binary::do_check_inputs): New pure virtual method.
13467 (Sized_incremental_binary::do_check_inputs): Declare.
13468 (Incremental_checker::Incremental_checker): Add incremental_inputs
13469 parameter, use it to initialize incremental_inputs_.
13470 (Incremental_checker::incremental_inputs_): New field.
13471 (Incremental_checker::command_line): New method.
13472 (Incremental_checker::inputs): New method.
13473 (Incremental_checker::command_line_): New field.
13474
c549a694
ILT
134752009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13476
13477 * incremental.cc: Include <cstdarg> and "target-select.h".
13478 (vexplain_no_incremental): New function.
13479 (explain_no_incremental): New function.
13480 (Incremental_binary::error): New method.
13481 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13482 method.
13483 (make_sized_incremental_binary): New function.
13484 (open_incremental_binary): New function.
13485 (can_incrementally_link_file): Add checks if output is ELF and has
13486 inputs section.
13487 * incremental.h: Include "elfcpp_file.h" and "output.h".
13488 (Incremental_binary): New class.
13489 (Sized_incremental_binary): New class.
13490 (open_incremental_binary): Declare.
13491 * object.cc (is_elf_object): Use
13492 elfcpp::Elf_recognizer::is_elf_file.
13493 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13494 * output.h (Output_file::filesize): New method.
13495
fd3c5f0b
ILT
134962009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13497
13498 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13499 New function.
13500 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13501 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13502 function.
13503 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13504 function.
13505 (Arm_relocate_functions::movw_abs_nc): New function.
13506 (Arm_relocate_functions::movt_abs): New function.
13507 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13508 (Arm_relocate_functions::thm_movt_abs): New function.
13509 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13510 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13511 (Scan::global): Likewise.
13512 (Relocate::relocate): Likewise.
13513 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13514
7f5309a5
ILT
135152009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13516
13517 * arm.cc (Arm_relocate_functions::got_prel) New function.
13518 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13519 (Relocate::relocate): Likewise.
13520 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13521
364c7fa5
ILT
135222009-10-06 Ian Lance Taylor <iant@google.com>
13523
13524 * options.h (class General_options): Define
13525 split_stack_adjust_size parameter.
13526 * object.h (class Object): Add uses_split_stack_ and
13527 has_no_split_stack_ fields. Add uses_split_stack and
13528 has_no_split_stack accessor functions. Declare
13529 handle_split_stack_section.
13530 (class Reloc_symbol_changes): Define.
13531 (class Sized_relobj): Define Function_offsets. Declare
13532 split_stack_adjust, split_stack_adjust_reltype, and
13533 find_functions.
13534 * object.cc (Object::handle_split_stack_section): New function.
13535 (Sized_relobj::do_layout): Call handle_split_stack_section.
13536 * dynobj.cc (Sized_dynobj::do_layout): Call
13537 handle_split_stack_section.
13538 * reloc.cc (Sized_relobj::relocate_sections): Call
13539 split_stack_adjust for executable sections in split_stack
13540 objects. Pass reloc_map to relocate_section.
13541 (Sized_relobj::split_stack_adjust): New function.
13542 (Sized_relobj::split_stack_adjust_reltype): New function.
13543 (Sized_relobj::find_functions): New function.
13544 * target-reloc.h: Include "object.h".
13545 (relocate_section): Add reloc_symbol_changes parameter. Change
13546 all callers.
13547 * target.h (class Target): Add calls_non_split method. Declare
13548 do_calls_non_split virtual method. Declare match_view and
13549 set_view_to_nop.
13550 * target.cc: Include "elfcpp.h".
13551 (Target::do_calls_non_split): New function.
13552 (Target::match_view): New function.
13553 (Target::set_view_to_nop): New function.
13554 * gold.cc (queue_middle_tasks): Give an error if mixing
13555 split-stack and non-split-stack objects with -r.
13556 * i386.cc (Target_i386::relocate_section): Add
13557 reloc_symbol_changes parameter.
13558 (Target_i386::do_calls_non_split): New function.
13559 * x86_64.cc (Target_x86_64::relocate_section): Add
13560 reloc_symbol_changes parameter.
13561 (Target_x86_64::do_calls_non_split): New function.
13562 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13563 parameter.
13564 * powerpc.cc (Target_powerpc::relocate_section): Add
13565 reloc_symbol_changes parameter.
13566 * sparc.cc (Target_sparc::relocate_section): Add
13567 reloc_symbol_changes parameter.
13568 * configure.ac: Call AM_CONDITIONAL for the default target.
13569 * configure: Rebuild.
13570 * testsuite/Makefile.am (TEST_AS): New variable.
13571 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13572 (check_DATA): Add split_i386 and split_x86_64 files.
13573 (SPLIT_DEFSYMS): Define.
13574 (split_i386_[1234n].o): New targets.
13575 (split_i386_[124]): New targets.
13576 (split_i386_[1234r].stdout): New targets.
13577 (split_x86_64_[1234n].o): New targets.
13578 (split_x86_64_[124]): New targets.
13579 (split_x86_64_[1234r].stdout): New targets.
13580 (MOSTLYCLEANFILES): Add new executables.
13581 * testsuite/split_i386.sh: New file.
13582 * testsuite/split_x86_64.sh: New file.
13583 * testsuite/split_i386_1.s: New file.
13584 * testsuite/split_i386_2.s: New file.
13585 * testsuite/split_i386_3.s: New file.
13586 * testsuite/split_i386_4.s: New file.
13587 * testsuite/split_i386_n.s: New file.
13588 * testsuite/split_x86_64_1.s: New file.
13589 * testsuite/split_x86_64_2.s: New file.
13590 * testsuite/split_x86_64_3.s: New file.
13591 * testsuite/split_x86_64_4.s: New file.
13592 * testsuite/split_x86_64_n.s: New file.
13593 * testsuite/testfile.cc (Target_test): Update relocation_section
13594 function.
13595 * testsuite/Makefile.in: Rebuild.
13596
e8a9fcda
ILT
135972009-10-06 Ian Lance Taylor <iant@google.com>
13598
13599 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13600 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13601 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13602 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13603 the address on ldo_addrs_.
13604 (Target_i386::Relocate::fix_up_ldo): New function.
13605
e99daf92
ILT
136062009-10-06 Rafael Espindola <espindola@google.com>
13607
13608 * plugin.cc (add_input_library): New.
13609 (Plugin::load): Add add_input_library to tv.
13610 (Plugin_manager::add_input_file): Add the is_lib argument.
13611 (add_input_file): Update call to Plugin_manager::add_input_file.
13612 (add_input_library): New.
13613 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13614
966d4097
DK
136152009-09-30 Doug Kwan <dougkwan@google.com>
13616
13617 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13618 symbol and call Symbol::may_need_copy_reloc to determine if
13619 a copy reloc is needed.
13620 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13621 nocopyreloc is given in command line.
13622 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13623 given in command line.
13624 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13625 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13626 of the removed Target_i386::may_need_copy_reloc.
13627 * options.h (copyreloc): New option with default value false.
13628 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13629 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13630 instead of the removed Target_powerpc::may_need_copy_reloc.
13631 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13632 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13633 instead of the removed Target_sparc::may_need_copy_reloc.
13634 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13635 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13636 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13637 instead of the removed Target_x86_64::may_need_copy_reloc.
13638
029ba973
ILT
136392009-09-30 Ian Lance Taylor <iant@google.com>
13640
13641 * object.h (class Object): Remove target_ field, and target,
13642 sized_target, and set_target methods.
13643 (Object::sized_target): Remove.
13644 (class Sized_relobj): Update declarations. Remove sized_target.
13645 * object.cc (Sized_relobj::setup): Remove target parameter.
13646 Change all callers.
13647 (Input_objects::add_object): Don't do anything with the target.
13648 (make_elf_sized_object): Add punconfigured parameter. Change all
13649 callers. Set or test parameter target.
13650 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13651 Change all callers.
13652 * parameters.cc (Parameters::set_target): Change parameter type to
13653 be non-const.
13654 (Parameters::default_target): Remove.
13655 (set_parameters_target): Change parameter type to be non-const.
13656 (parameters_force_valid_target): New function.
13657 (parameters_clear_target): New function.
13658 * parameters.h (class Parameters): Update declarations. Remove
13659 default_target method. Add sized_target and clear_target
13660 methods. Change target_ to be non-const.
13661 (set_parameters_target): Update declaration.
13662 (parameters_force_valid_target): Declare.
13663 (parameters_clear_target): Declare.
13664 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13665 as NULL if we aren't searching.
13666 (Add_symbols::run): Don't check for compatible target.
13667 * fileread.cc (Input_file::open_binary): Call
13668 parameters_force_valid_target.
13669 * gold.cc (queue_middle_tasks): Likewise.
13670 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13671 set_target on object.
13672 * dynobj.h (class Sized_dynobj): Update declarations.
13673 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13674 make_elf_object returns NULL.
13675 (Archive::include_member): Don't check whether object target is
13676 compatible.
13677 * output.cc (Output_section::add_input_section): Get target from
13678 parameters.
13679 (Output_section::relax_input_section): Likewise.
13680 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13681 parameters.
13682 (Sized_relobj::do_scan_relocs): Likewise.
13683 (Sized_relobj::relocate_sections): Likewise.
13684 * resolve.cc (Symbol_table::resolve): Likewise.
13685 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13686 parameter. Change all callers.
13687 (Symbol_table::add_from_object): Get target from parameters.
13688 (Symbol_table::add_from_relobj): Don't check object target.
13689 (Symbol_table::add_from_dynobj): Likewise.
13690 (Symbol_table::define_special_symbol): Get target from
13691 parameters.
13692 * symtab.h (class Symbol_table): Update declaration.
13693 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13694 parameter. Change all callers. Clear parameter target.
13695 (Binary_test): Test target here.
13696 * testsuite/object_unittest.cc (gold_testsuite): Remove
13697 target_test_pointer parameter. Change all callers.
13698 (Object_test): Test target here.
13699
a6a22b83
ILT
137002009-09-26 Ian Lance Taylor <iant@google.com>
13701
13702 * testsuite/initpri1.c: Don't try to use constructor priorities if
13703 compiling with gcc before 4.3.
13704
6a8f49fe
ILT
137052009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13706
13707 * testsuite/retain_symbols_file_test.sh (check_present): Change
13708 output file name to retain_symbols_file_test.stdout.
13709 (check_absent): Likewise.
13710
8c604651
CS
137112009-09-18 Craig Silverstein <csilvers@google.com>
13712
13713 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13714 * options.cc: Include <cerrno> and <fstream>.
13715 (General_options::finalize): Parse -retain-symbols-file tag.
13716 * options.h: New flag.
13717 (General_options): New method should_retain_symbol, new
13718 variable symbols_to_retain.
13719 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13720 should_retain_symbol map.
13721 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13722 * testsuite/Makefile.in: Regenerate.
13723 * testsuite/retain_symbols_file_test.sh: New file.
13724
ca58b19f
NC
137252009-09-18 Nick Clifton <nickc@redhat.com>
13726
13727 * po/es.po: Updated Spanish translation.
13728
20e6d0d6
DK
137292009-09-17 Doug Kwan <dougkwan@google.com>
13730
13731 * debug.h (DEBUG_RELAXATION): New constant.
13732 (DEBUG_ALL): Add DEBUG_RELAXATION.
13733 (debug_string_to_enum): Add relaxation debug option.
13734 * layout.cc
13735 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13736 Layout::Relaxation_debug_check::read_sections,
13737 Layout::Relaxation_debug_check::read_sections): New method definitions.
13738 (Layout::Layout): Initialize data members
13739 record_output_section_data_from_scrips_,
13740 script_output_section_data_list_ and relaxation_debug_check_.
13741 (Layout::save_segments, Layout::restore_segments,
13742 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13743 Layout::relaxation_loop_body): New method definitions.
13744 (Layout::finalize): Support relaxation. Move section layout code to
13745 Layout::relaxation_loop_body.
13746 (Layout::set_asection_address_from_script): Move code for orphan
13747 section placement out.
13748 (Layout::place_orphan_sections_in_script): New method definition.
13749 * layout.h (Output_segment_headers, Output_file_header):
13750 New forward class declarations.
13751 (Layout::~Layout): Define.
13752 (Layout::new_output_section_data_from_script): New method definition.
13753 (Layout::place_orphan_sections_in_script): New method declaration.
13754 (Layout::Segment_states): New type declaration.
13755 (Layout::save_segments, Layout::restore_segments,
13756 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13757 Layout::relaxation_loop_body): New method declarations.
13758 (Layout::Output_section_data_list): New type declaration.
13759 (Layout::Relaxation_debug_check): New class definition.
13760 (Layout::record_output_section_data_from_script_,
13761 Layout::script_output_section_data_list_, Layout::segment_states_,
13762 Layout::relaxation_debug_check_): New data members.
13763 * output.cc: (Output_section_headers::do_size): New method definition.
13764 (Output_section_headers::Output_section_headers): Move size
13765 computation to Output_section_headers::do_size.
13766 (Output_segment_headers::do_size): New method definition.
e1df38aa 13767 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13768 Output_file_header::do_size and call it.
13769 (Output_file_header::do_size): New method definition.
13770 (Output_data_group::Output_data_group): Adjust call to
13771 Output_section_data.
13772 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13773 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13774 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13775 RELAXED_INPUT_SECTION_CODE.
13776 (Output_section::Output_section): Initialize data member checkpoint_.
13777 (Output_section::~Output_section): Delete checkpoint object pointed
13778 by checkpoint_.
13779 (Output_section::add_input_section): Always add an Input_section if
13780 relaxing.
13781 (Output_section::add_merge_input_section): Add assert.
13782 (Output_section::relax_input_section): New method definition.
13783 (Output_section::set_final_data_size): Set load address to zero for
13784 an unallocated section.
13785 (Output_section::do_address_and_file_offset_have_reset_values):
13786 New method definition.
13787 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13788 Handle relaxed input section.
13789 (Output_section::sort_attached_input_sections): Checkpoint input
13790 section list lazily.
13791 (Output_section::get_input_sections): Change type of input_sections to
13792 list of Simple_input_section pointers. Checkpoint input section list
13793 lazily. Also handle relaxed input sections.
13794 (Output_section::add_input_section_for_script): Take a reference to
13795 a Simple_input_section object instead of Relobj pointer and section
13796 index as parameter. Handle relaxed input sections.
13797 (Output_section::save_states, Output_section::restore_states): New
13798 method definitions.
13799 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13800 (Output_data::is_data_size_fixed): New method definition.
13801 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13802 if it is fixed.
13803 (Output_data::address_and_file_offset_have_reset_values): New method
13804 definition.
13805 (Output_data::do_address_and_file_offset_have_reset_values): New method
13806 definition.
13807 (Output_data::set_data_size): Check that data size is not fixed.
13808 (Output_data::fix_data_size): New method definition.
13809 (Output_data::is_data_size_fixed_): New data member.
13810 (Output_section_headers::set_final_data_size): New method definition.
13811 (Output_section_headers::do_size): New method declaration.
13812 (Output_segment_headers::set_final_data_size): New method definition.
13813 (Output_segment_headers::do_size): New method declaration.
13814 (Output_file_header::set_final_data_size)::New method definition.
13815 (Output_file_header::do_size)::New method declaration.
13816 (Output_section_data::Output_section_data): Add new parameter
13817 is_data_size_fixed and use it to fix data size.
13818 (Output_data_const::Output_data_const): Adjust call to base class
13819 constructor and fix data size.
13820 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13821 base class constructor and fix data size.
13822 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13823 base class constructor and fix data size.
13824 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13825 class constructor and fix data size.
13826 (Output_data_group::set_final_data_size): New method definition.
13827 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13828 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13829 class constructor and fix data size.
13830 (Output_relaxed_input_section): New class definition.
13831 (Output_section::Simple_input_section): New class definition.
13832 (Output_section::get_input_sections): Adjust parameter list.
13833 (Output_section::add_input_section_for_script): Same.
13834 (Output_section::save_states, Output_section::restore_states,
13835 Output_section::do_address_and_file_offset_have_reset_values,
13836 (Output_section::Input_section::Input_section): Handle
13837 RELAXED_INPUT_SECTION_CODE. Add new overload for
13838 Output_relaxed_input_section.
13839 (Output_section::Input_section::is_input_section,
13840 Output_section::Input_section::set_output_section): Handle relaxed
13841 input section.
13842 (Output_section::Input_section::is_relaxed_input_section,
13843 Output_section::Input_section::output_section_data,
13844 Output_section::Input_section::relaxed_input_section): New method
13845 definitions.
13846 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13847 value.
13848 (Output_section::Input_section::u1_): Update comments.
13849 (Output_section::Input_section::u2_): Add new union member poris.
13850 (Output_section::Checkpoint_output_section): New classs definition.
13851 (Output_section::relax_input_section): New method declaration.
13852 (Output_section::checkpoint_): New data member.
13853 (Output_segment): Update comments.
13854 (Output_segment::Output_segment): Un-privatize copy constructor.
13855 (Output_segment::operator=): Un-privatize.
13856 * script-sections.cc (Output_section_element::Input_section_list):
13857 Change element type to Output_section::Simple_input_section.
13858 (Output_section_element_dot_assignment::set_section_addresses):
13859 Register output section data for relaxation clean up.
13860 (Output_data_exression::Output_data_expression): Adjust call to base
13861 constructor to fix data size.
13862 (Output_section_element_data::set_section_addresses): Register
13863 Output_data_expression object for relaxation clean up.
13864 (struct Input_section_info): Replace Relobj pointer and section index
13865 pair with Output_section::Simple_input_section and Convert struct to a
13866 class.
13867 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13868 Input_section_info data member to use accessors.
20e6d0d6
DK
13869 (Output_section_element_input::set_section_addresses): Use layout
13870 parameter. Adjust code to use Output_section::Simple_input_section
13871 and Input_secction_info classes. Register filler for relaxation
13872 clean up.
13873 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13874 and section index pair with Output_section::Simple_input_section
13875 class. Adjust code accordingly.
13876 (Phdrs_element::release_segment): New method definition.
13877 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13878 segment list.
13879 (Script_sections::release_segments): New method definition.
13880 * gold/script-sections.h (Script_sections::release_segments): New
13881 method declaration.
13882 * gold/target.h (Target::may_relax, Target::relax,
13883 Target::do_may_relax, Target::do_relax): New method definitions.
13884
5e445df6
ILT
138852009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13886
13887 * arm.cc (has_signed_unsigned_overflow): New function.
13888 (Arm_relocate_functions::abs8): New function.
13889 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13890 (Target_arm::Scan::global): Likewise.
13891 (Target_arm::relocate::relocate): Likewise.
13892 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13893 Likewise.
13894
8c604651 138952009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13896
13897 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13898 * testsuite/Makefile.in: Regenerate.
13899
1e9cc1c2
NC
139002009-09-11 Nick Clifton <nickc@redhat.com>
13901
13902 * po/gold.pot: Updated by the Translation project.
13903
6a89f575
CC
139042009-09-08 Cary Coutant <ccoutant@google.com>
13905
13906 * output.cc (Output_file::open): Add execute permission to empty file.
13907 * testsuite/Makefile.am (permission_test): New test.
13908 * testsuite/Makefile.in: Regenerate.
13909
fdcac5af
ILT
139102009-09-02 Ian Lance Taylor <iant@google.com>
13911
13912 * output.cc (Output_file::resize): Call map_no_anonymous rather
13913 than map.
13914
44453f85
ILT
139152009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13916
13917 * gold.cc: Include "incremental.h".
13918 (queue_initial_tasks): Call Incremental_checker methods.
13919 * incremental.cc: Include "output.h".
13920 (Incremental_checker::can_incrementally_link_output_file): New
13921 method.
13922 * incremental.h (Incremental_checker): New class.
13923
13924 * output.cc (Output_file::open_for_modification): New method.
13925 (Output_file::map_anonymous): Changed return type to bool. Record
13926 map in base_ field.
13927 (Output_file::map_no_anonymous): New method, broken out of map.
13928 (Output_file::map): Use map_no_anonymous and map_anonymous.
13929 * output.h (class Output_file): Update declarations.
13930
293c1386
CC
139312009-08-24 Cary Coutant <ccoutant@google.com>
13932
13933 * options.h (Command_line::Pre_options): New class.
13934 (Command_line::pre_options): New member.
13935 * options.cc (gold::options::ready_to_register): New variable.
13936 (One_option::register_option): Do nothing if not registering options.
13937 Assert if same short option registered twice.
13938 (General_options::General_options): Turn off option registration when
13939 done constructing.
13940 (Command_line::Pre_options::Pre_options): New constructor.
13941
f773f3d2
CC
139422009-08-24 Cary Coutant <ccoutant@google.com>
13943
06a73cfe
CC
13944 * options.h (General_options::no_keep_memory): Remove incorrect
13945 short option.
f773f3d2 13946
a15af8e2
RW
139472009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13948
13949 * Makefile.am (am__skiplex, am__skipyacc): New.
13950 * Makefile.in: Regenerate.
13951
c462b41b
RW
139522009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13953
14ec8efd
RW
13954 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13955 (INCLUDES): ... this.
13956 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13957 (AM_CPPFLAGS): Renamed from ...
13958 (INCLUDE): ... this.
13959 * Makefile.in, testsuite/Makefile.in: Regenerate.
13960
81ecdfbb
RW
13961 * Makefile.in: Regenerate.
13962 * aclocal.m4: Likewise.
13963 * config.in: Likewise.
13964 * configure: Likewise.
13965 * testsuite/Makefile.in: Likewise.
13966
c462b41b
RW
13967 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13968 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13969 * Makefile.in: Regenerate.
13970 * testsuite/Makefile.in: Regenerate.
13971
2da73f13
CC
139722009-08-19 Cary Coutant <ccoutant@google.com>
13973
13974 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13975 symbols in shared libraries overridden by hidden or internal symbols
13976 in the main program.
13977
2db70501
CD
139782009-08-19 Chris Demetriou <cgd@google.com>
13979
13980 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13981 checking source file names in error messages.
13982
f733487b
DK
139832009-08-18 Doug Kwan <dougkwan@google.com>
13984
13985 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13986 an elcpp::Ehdr as parameter. Adjust call to set_target.
13987 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13988 an elfcpp::Ehdr as parameter.
13989 * object.cc (Object::set_target): Remove the version that looks up
13990 a target and sets it.
13991 (Sized_relobj::setup): Take a Target object instead of
13992 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13993 (make_elf_sized_object): Find target and ask target to
13994 make an ELF object.
13995 * object.h: (Object::set_target): Remove the version that looks up
13996 a target and sets it.
13997 (Sized_relobj::setup): Take a Target object instead of
13998 an elfcpp:Ehdr as parameter.
13999 * target.cc: Include dynobj.h.
14000 (Target::do_make_elf_object_implementation): New.
2e702c99 14001 (Target::do_make_elf_object): New.
f733487b
DK
14002 * target.h (Target::make_elf_object): New template declaration.
14003 (Target::do_make_elf_object): New method declarations.
14004 (Target::do_make_elf_object_implementation): New template declaration.
14005
cc70f101
ILT
140062009-08-14 Ian Lance Taylor <iant@google.com>
14007
14008 * gold.h (FUNCTION_NAME): Define.
14009 (gold_unreachable): Use FUNCTION_NAME.
14010
ef5e0cb1
ST
140112009-08-12 Sriraman Tallam <tmsriram@google.com>
14012
14013 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14014 symbol in the --keep-unique list is not found.
14015
48c187ce
ST
140162009-08-12 Sriraman Tallam <tmsriram@google.com>
14017
14018 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14019 been maked as --keep-unique.
14020 (Icf::unfold_section): New function.
14021 * icf.h (Icf::unfold_section): New function.
14022 * options.h (General_options::keep_unique): New option.
14023 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14024 * testsuite/Makefile.in: Regenerate.
14025 * testsuite/icf_keep_unique_test.sh: New file.
14026 * testsuite/icf_keep_unique_test.cc: New file.
14027
645afe0c
CC
140282009-08-12 Cary Coutant <ccoutant@google.com>
14029
14030 PR 10471
14031 * resolve.cc (Symbol_table::resolve): Check for references from
14032 dynamic objects to hidden and internal symbols.
14033 * testsuite/Makefile.am (hidden_test.sh): New test.
14034 * testsuite/Makefile.in: Regenerate.
14035 * testsuite/hidden_test.sh: New script.
14036 * testsuite/hidden_test_1.c: New test source.
14037 * testsuite/hidden_test_main.c: New test source.
14038
11af873f
DK
140392009-08-11 Doug Kwan <dougkwan@google.com>
14040
14041 * arm.cc: Update comments.
14042 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14043 segment to locate the .ARM.exidx section if present.
14044
b9f7d72d
DK
140452009-08-09 Doug Kwan <dougkwan@google.com>
14046
14047 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14048 patch.
14049
ddd3c53c
ST
140502009-08-07 Sriraman Tallam <tmsriram@google.com>
14051 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14052 compiler warnings.
14053
27721062
ST
140542009-08-06 Sriraman Tallam <tmsriram@google.com>
14055
14056 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14057 valid tls_segment only for non-debug-section relocations.
14058 * testsuite/Makefile.am: Add gc_tls_test.
14059 * testsuite/Makefile.in: Regenerate.
14060 * testsuite/gc_tls_test.cc: New file.
14061 * testsuite/gc_tls_test.sh: New file.
14062
ef15dade 140632009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14064
ef15dade
ST
14065 * icf.cc: New file.
14066 * icf.h: New file.
14067 * Makefile.am (CCFILES): Add icf.cc.
14068 (HFILES): Add icf.h
14069 * Makefile.in: Regenerate.
14070 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14071 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14072 section, symbol and addend information for the relocs.
14073 * gold.cc (queue_middle_tasks): Call identical code folding.
14074 * gold.h: Add defines for multimap.
14075 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14076 to the call of finalize_local_symbols.
14077 * main.cc (main): Create object of class Icf.
14078 * object.cc (Sized_relobj::do_layout): Allow this function to be
14079 called twice during icf.
14080 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14081 to sections marked as identical by icf.
14082 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14083 when available.
14084 (Sized_relobj::do_section_entsize): New function.
14085 * object.h (Object::section_entsize): New function.
14086 (Object::do_section_entsize): New pure virtual function.
14087 (Relobj::finalize_local_symbols): Add new parameter.
14088 (Relobj::do_section_entsize): New function.
14089 * options.h (General_options::icf): New option.
14090 (General_options::icf_iterations): New option.
14091 (General_options::print_icf_sections): New option.
14092 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14093 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14094 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14095 icf.
14096 * symtab.cc (Symbol_table::is_section_folded): New function.
14097 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14098 to sections marked as identical by icf.
14099 * symtab.h (Symbol_table::set_icf): New function.
14100 (Symbol_table::icf): New function.
14101 (Symbol_table::is_section_folded): New function.
14102 (Symbol_table::icf_): New data member.
14103 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14104 * testsuite/Makefile.am: Add commands to build icf_test.
14105 * testsuite/Makefile.in: Regenerate.
14106 * testsuite/icf_test.sh: New file.
14107 * testsuite/icf_test.cc: New file.
14108
c3b65ac4
CD
141092009-07-24 Chris Demetriou <cgd@google.com>
14110
14111 * layout.cc (is_compressible_debug_section): Fix incorrect
14112 comment about compressed section names.
14113
1caf2c51
ILT
141142009-07-20 Ian Lance Taylor <ian@airs.com>
14115
14116 PR 10419
14117 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14118
1ef4d87f
ILT
141192009-07-16 Ian Lance Taylor <iant@google.com>
14120
14121 PR 10400
14122 * layout.h: #include <map>.
14123 (class Kept_section): Change from struct to class. Add accessors
14124 and setters. Add section size to Comdat_group mapping. Change
14125 Comdat_group to std::map. Add is_comdat_ field. Add
14126 linkonce_size field in union.
14127 (class Layout): Update declaration of find_or_add_kept_section.
14128 Don't declare find_kept_object.
14129 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14130 parameter. Add object, shndx, is_comdat, and is_group_name
14131 parameters. Change all callers. Adjust for new Kept_section.
14132 (Layout::find_kept_object): Remove.
14133 * object.cc (Sized_relobj::include_section_group): Update use of
14134 Kept_section. Rename secnum to shndx. Only record
14135 Kept_comdat_section if sections are the same size.
14136 (Sized_relobj::include_linkonce_section): Update use of
14137 Kept_section. Only record Kept_comdat_section if sections are the
14138 same size. Set size of linkonce section.
14139 (Sized_relobj::map_to_kept_section): Update call to
14140 get_kept_comdat_section.
14141 * object.h (class Sized_relobj): Rename fields in
14142 Kept_comdat_section to drop trailing underscores; change object
14143 field to Relobj*. Change Kept_comdat_section_table to store
14144 struct rather than pointer.
14145 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14146 Add kept_object and kept_shndx parameters. Change all callers.
14147 (Sized_relobj::get_kept_comdat_section): Change return type to
14148 bool. Add kept_object and kept_shndx parameters. Change all
14149 callers.
14150 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14151 Layout::find_or_add_kept_section.
14152
37c3b7b0
ILT
141532009-07-09 Ian Lance Taylor <iant@google.com>
14154
14155 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14156 Reserve space in the hash table.
14157
98fa85cb
ILT
141582009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14159
14160 * fileread.cc (File_read::get_mtime): New method.
14161 * fileread.h (Timespec): New structure.
14162 (File_read::get_mtime): New method.
14163 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14164 Renamed from timestamp_nsec.
14165 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14166 Elf_Xword.
e1df38aa 14167 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14168 timestamp_nsec.
e1df38aa 14169 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14170 (Incremental_inputs::report_obejct): Save mtime; style fix.
14171 (Incremental_inputs::report_script): Save mtime; style fix.
14172 (Incremental_inputs::finalize_inputs): Style fix.
14173 (Incremental_inputs::finalize): Style fix.
14174 (Incremental_inputs::create_input_section_data): Store inputs
14175 mtime.
14176 * incremental.h (Incremental_inputs::report_script): Add mtime
14177 argument.
14178 (Incremental_inputs::Input_info::Input_info): Intialize only one
14179 union member.
14180 (Incremental_inputs::Input_info::archive): Move to nameless
14181 union.
14182 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14183 (Incremental_inputs::Input_info::script): Move to nameless union.
14184 (Incremental_inputs::mtime): New field.
14185 * script.cc (read_input_script): Pass file mtime to
14186 Incremental_input.
14187 * script.h (Script_info::inputs): Style fix.
14188
c9d70757
ILT
141892009-07-01 Ian Lance Taylor <ian@airs.com>
14190
14191 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14192 instead of 32.
14193
9c547ec3
ILT
141942009-06-24 Ian Lance Taylor <iant@google.com>
14195
14196 PR 10156
14197 * layout.cc (Layout::choose_output_section): If we find an
14198 existing section, update the flags.
14199 (Layout::create_notes): New function, broken out of
14200 Layout::finalize.
14201 (Layout::finalize): Don't create note sections.
14202 (Layout::create_note): Don't crash if linker script discards
14203 section.
14204 (Layout::create_gold_note): Likewise.
14205 (Layout::create_build_id): Likewise. Don't set
14206 after_input_sections on the section.
14207 (Layout::create_executable_stack_info): Remove target parameter.
14208 Change caller.
14209 * layout.h (class Layout): Declare create_notes. Update
14210 declaration of create_executable_stack_info.
14211 * gold.cc (queue_middle_tasks): Call create_notes.
14212 * output.cc (Output_section::update_flags_for_input_section): Move
14213 here from output.h. If SHF_ALLOC flag is newly set, mark address
14214 invalid.
14215 * output.h (Output_data::mark_address_invalid): New function.
14216 (class Output_section): Only declare, not define,
14217 update_flags_for_input_section. Remove set_flags.
14218
55458500
ILT
142192009-06-24 Ian Lance Taylor <iant@google.com>
14220
14221 * script-sections.cc (Output_section_definition::
14222 set_section_addresses): Rename shadowing local load_address to
14223 laddr.
14224
1307d6cd
ILT
142252009-06-24 Ian Lance Taylor <iant@google.com>
14226
14227 PR 10244
14228 * reloc.cc (relocate_sections): Skip empty relocation sections.
14229
ec3f783e
ILT
142302009-06-23 Ian Lance Taylor <iant@google.com>
14231
14232 PR 10156
14233 * layout.cc (Layout::create_note): Use choose_output_section
14234 rather than make_output_section.
14235
459c9f1c
ILT
142362009-06-23 Ian Lance Taylor <iant@google.com>
14237
14238 PR 10237
14239 * options.cc (General_options::parse_V): Set printed_version_.
14240 (General_options::General_options): Initialize printed_version_.
14241 * options.h (class General_options): Add printed_version_ field.
14242 * gold.cc (queue_initial_tasks): If there are no input files,
14243 don't give a fatal error if we printed the version information.
14244 (queue_middle_tasks): If using -r with a shared object, give a
14245 fatal error rather than an ordinary error.
14246
1518dc8f
ILT
142472009-06-23 Ian Lance Taylor <iant@google.com>
14248
14249 PR 10219
14250 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14251 (Layout::make_output_section): Set have_stabstr_section_ if we see
14252 a .stab*str section.
14253 (Layout::finalize): Call link_stabs_sections.
14254 (Layout::link_stabs_sections): New file.
14255 * layout.h (class Layout): Add have_stabstr_section_ field.
14256 Declare link_stabs_sections.
14257
3d857b98
DK
142582009-06-23 Doug Kwan <dougkwan@google.com>
14259
14260 * Makefile.am (libgold_a_LIBADD): New.
14261 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14262 * Makefile.in: Regenerate.
3d857b98
DK
14263 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14264 * configure: Regenerate.
14265 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14266 * fileread.cc: Include sys/state.h
14267 * gold.h: Declare memmem and strndup if found missing.
14268 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14269
0639a6f6
ILT
142702009-06-23 Ian Lance Taylor <iant@google.com>
14271
14272 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14273 * configure: Rebuild.
14274
8d63875c
ILT
142752009-06-23 Ian Lance Taylor <iant@google.com>
14276
14277 PR 10147
14278 * object.cc (Object::section_contents): Don't try to get a view if
14279 the section has length zero.
14280 (Object::handle_gnu_warning_section): If the section is empty, use
14281 the name of the section as the warning.
14282
f7c8a183
ILT
142832009-06-23 Ian Lance Taylor <iant@google.com>
14284
14285 PR 10133
14286 * stringpool.h (class Stringpool_template): Add optimize_ field.
14287 (Stringpool_template::set_optimize): New function.
14288 * stringpool.cc (Stringpool_template::Stringpool_template):
14289 Initialize optimize_ field.
14290 (Stringpool_template::set_string_offsets): Test local optimize
14291 fild rather than parameter.
14292 * layout.cc (Layout::Layout): Call set_optimize on the section
14293 name stringpool.
14294
e6a307ba
ILT
142952009-06-22 Ian Lance Taylor <iant@google.com>
14296
14297 PR 10030
14298 * yyscript.y: Parse TARGET.
14299 * script.cc (script_set_target): New function.
14300 * script-c.h (script_set_target): Declare.
14301 * options.cc (General_options::string_to_object_format): Rename
14302 from string_to_object_format in anonymous namespace. Change
14303 callers.
14304 * options.h (class General_options): Declare
14305 string_to_object_format.
14306
3ee173de
ILT
143072009-06-22 Ian Lance Taylor <iant@google.com>
14308
14309 * script-sections.cc (Script_sections::create_segments): Don't put
14310 program headers in a PT_LOAD segment if -n or -N.
14311
143122009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14313
14314 PR 10141
14315 * options.h (class General_options): Add -z lazy and -z now. Sort
14316 -z options into alphabetical order.
14317 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14318
cd6739a1 143192009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14320
14321 * layout.cc (Layout::make_output_section): Call
14322 Target::new_output_section.
14323 (Layout::attach_allocated_section_to_segment): Put large section
14324 sections in a separate load segment with the large segment flag
14325 set.
14326 (Layout::segment_precedes): Sort large data segments after other
14327 load segments.
14328 (align_file_offset): New static function.
14329 (Layout::set_segment_offsets): Use align_file_offset.
14330 * output.h (class Output_section): Add is_small_section_ and
14331 is_large_section_ fields.
14332 (Output_section::is_small_section): New function.
14333 (Output_section::set_is_small_section): New function.
14334 (Output_section::is_large_section): New function.
14335 (Output_section::set_is_large_section): New function.
14336 (Output_section::is_large_data_section): New function.
14337 (class Output_segment): Add is_large_data_segment_ field.
14338 (Output_segment::is_large_data_segment): New function.
14339 (Output_segment::set_is_large_data_segment): New function.
14340 * output.cc (Output_section::Output_section): Initialize new
14341 fields.
14342 (Output_segment::Output_segment): Likewise.
14343 (Output_segment::add_output_section): Add assertion that large
14344 data sections always go in large data segments. Force small data
14345 sections to the end of the list of data sections. Force small BSS
14346 sections to the start of the list of BSS sections. For large BSS
14347 sections to the end of the list of BSS sections.
14348 * symtab.h (class Symbol): Declare is_common_shndx.
14349 (Symbol::is_defined): Check Symbol::is_common_shndx.
14350 (Symbol::is_common): Likewise.
14351 (class Symbol_table): Define enum Commons_section_type. Update
14352 declarations. Add small_commons_ and large_commons_ fields.
14353 * symtab.cc (Symbol::is_common_shndx): New function.
14354 (Symbol_table::Symbol_table): Initialize new fields.
14355 (Symbol_table::add_from_object): Put small and large common
14356 symbols in the right list.
14357 (Symbol_table::sized_finalized_symbol): Check
14358 Symbol::is_common_shndx.
14359 (Symbol_table::sized_write_globals): Likewise.
14360 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14361 common symbol lists. Don't call do_allocate_commons_list if the
14362 list is empty.
14363 (Symbol_table::do_allocate_commons_list): Remove is_tls
14364 parameter. Add comons_section_type parameter. Change all
14365 callers. Handle small and large common symbols.
14366 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14367 Symbol::is_common_shndx.
14368 * resolve.cc (symbol_to_bits): Likewise.
14369 * target.h (Target::small_common_shndx): New function.
14370 (Target::small_common_section_flags): New function.
14371 (Target::large_common_shndx): New function.
14372 (Target::large_common_section_flags): New function.
14373 (Target::new_output_section): New function.
14374 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14375 small_common_section_flags, and large_common_section_flags
14376 fields.
14377 (Target::do_new_output_section): New virtual function.
14378 * arm.cc (Target_arm::arm_info): Initialize new fields.
14379 * i386.cc (Target_i386::i386_info): Likewise.
14380 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14381 Likewise.
14382 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14383 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14384 (Target_x86_64::do_new_output_section): New function.
14385 * configure.ac: Define conditional MCMODEL_MEDIUM.
14386 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14387 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14388 (large_LDFLAGS): Define.
14389 * testsuite/large.c: New file.
14390 * testsuite/testfile.cc (Target_test::test_target_info):
14391 Initialize new fields.
14392 * configure, testsuite/Makefile.in: Rebuild.
14393
bb04269c
DK
143942009-06-05 Doug Kwan <dougkwan@google.com>
14395
14396 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14397 * Makefile.in: Regenerate.
bb04269c
DK
14398 * i386.cc (class Target_i386): Define new virtual method to
14399 override do_is_local_label_name in parent.
14400 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14401 local symbols if --discard-locals or -X is given.
14402 * options.h (class General_options): Declare new options
14403 '--discard-locals' and '-X' for discarding locals.
14404 * target.h (class Target): Define new methods is_local_label_name.
14405 Declare new virtual method do_is_local_label_name.
14406 * target.cc: New file.
14407 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14408 (check_SCRIPTS): Add discard_locals_test.sh.
14409 (check_DATA): Add discard_local_tests.syms.
14410 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14411 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14412 * testsuite/Makefile.in: Regenerate.
14413 * testsuite/discard_locals_test.c: New file.
14414 * testsuite/discard_locals_test.sh: Same.
14415
805bb01c
DK
144162009-06-05 Doug Kwan <dougkwan@google.com>
14417
14418 * object.cc (Sized_relobj::Sized_relobj): Initialize
14419 discarded_eh_frame_shndx_ to -1U.
14420 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14421 section.
14422 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14423 a discarded .eh_frame section.
14424 (Sized_relobj::do_finalize_local_symbols): Ditto.
14425 * object.h (class Sized_relobj): Declare new member
14426 discarded_eh_frame_shndx_.
14427 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14428 (local_labels_test.o, local_labels_test): New rules.
14429 * testsuite/Makefile.in: Regenerate.
14430
1dcd334d
DK
144312009-06-04 Doug Kwan <dougkwan@google.com>
14432
14433 * layout.cc (Layout::section_name_mapping): Add mapping for
14434 special ARM sections.
14435
96d49306
DK
144362009-06-03 Doug Kwan <dougkwan@google.com>
14437
14438 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14439 (utils::has_overflow): Same.
14440
dff16297
ILT
144412009-06-03 Ian Lance Taylor <iant@google.com>
14442
14443 * layout.cc (Layout::section_name_mapping): New array, replacing
14444 Layout::linkonce_mapping.
14445 (Layout::section_name_mapping_count): New variable, replacing
14446 Layout::linkonce_mapping_count.
14447 (Layout::linkonce_output_name): Remove.
14448 (Layout::output_section_name): Rewrite.
14449 * layout.h (class Layout): Rename Linkonce_mapping to
14450 Section_name_mapping, linkonce_mapping to section_name_mapping,
14451 linkonce_mapping_count to section_name_mapping_count. Don't
14452 declare linkonce_output_name.
14453
c121c671
DK
144542009-06-03 Doug Kwan <dougkwan@google.com>
14455
14456 * gold/arm.cc (namespace utils): New.
14457 (Target_arm::reloc_is_non_pic): Define new method.
14458 (class Arm_relocate_functions): New.
14459 (Target_arm::Relocate::relocate): Handle relocation types used by
14460 Android.
14461
07800fab
ILT
144622009-06-03 Ian Lance Taylor <iant@google.com>
14463
14464 * arm.cc (Target_arm::scan::global): Use || instead of |.
14465
c121c671
DK
144662009-06-02 Doug Kwan <dougkwan@google.com>
14467
14468 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14469 issued_non_pic_error_.
14470 (class Target_arm::Scan): Declare new method check_non_pic.
14471 Define new method symbol_needs_plt_entry.
14472 Declare new data member issued_non_pic_error_.
14473 (class Target_arm::Relocate): Declare new method
14474 should_apply_static_reloc.
14475 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14476 (Target_arm::Scan::check_non_pic): Define new method.
14477 (Target_arm::Scan::local): Handle a small subset of reloc types used
14478 by Android.
14479 (Target_arm::Scan::local): Same.
14480 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14481
b19b0c6d
ILT
144822009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14483
14484 * incremental.cc (Incremental_inputs::report_command_line): Filter
14485 out --incremental-* options.
14486
94cdfcff
DK
144872009-05-29 Doug Kwan <dougkwan@google.com>
14488
14489 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14490 template class.
14491 (class Target_arm): Update comment.
14492 (Target_arm::Target_arm): Initialize new data members GOT_,
14493 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14494 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14495 and Target_arm::rel_dyn_section.
14496 Declare new_enum Target_arm::Got_type.
14497 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14498 and DYNBSS_.
14499 Update commments for member do_dynsym_value.
14500 (Target_arm::got_size, Target_arm::plt_section,
14501 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14502 new methods inside class defintion.
14503 (Target_arm::got_section): Define new method.
14504 (Target_arm::rel_dyn_section): Same.
14505 (Output_data_plt_arm): New template class.
14506 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14507 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14508 (Output_data_plt_arm::add_entry): Same.
14509 (Output_data_plt_arm::first_plt_entry): Define new
14510 static data member for PLT instruction template.
14511 (Output_data_plt_arm::plt_entry): Same.
14512 (Output_data_plt_arm::do_write): Define new method.
14513 (Target_arm::make_plt_entry): Same.
14514 (Target_arm::do_finalize_sections): Same.
14515 (Target_arm::do_dynsym_value): Same.
14516
4a657b0d
DK
145172009-05-28 Doug Kwan <dougkwan@google.com>
14518
14519 * Makefile.am (TARGETSOURCES): Add arm.cc.
14520 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14521 * Makefile.in: Regenerate.
14522 * arm.cc: New file.
14523 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14524
e7ae8c36
DK
145252009-05-26 Doug Kwan <dougkwan@google.com>
14526
14527 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14528 (General_options::check_excluded_libs): Strip off directories in
14529 archive name before matching like GNU ld does.
14530 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14531 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14532 (exclude_libs_test_LDFLAGS): Add linker option
14533 -Wl,--exclude-libs,libexclude_libs_test_3
14534 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14535 an explicit archive without using -l.
14536 (alt/libexclude_libs_test_3.a): New make rule.
14537 * testsuite/Makefile.in: Regenerate.
14538 * testsuite/exclude_libs_test.c : Declare lib3_default().
14539 (main): Call it.
14540 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14541 * exclude_libs_test_3.c: New file.
14542
f12e7348
NC
145432009-05-26 Nick Clifton <nickc@redhat.com>
14544
14545 * po/id.po: New Indonesian translation.
14546 * po/gold.pot: Updated template file.
14547
4daadc0d
ST
145482009-05-22 Sriraman Tallam <tmsriram@google.com>
14549
e1df38aa 14550 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14551 gc_comdat_test files. Add -Wl,--gc-sections to build
14552 gc_comdat_test.
14553 * testsuite/Makefile.in: Regenerate.
14554 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14555
531813ad
ST
145562009-05-21 Sriraman Tallam <tmsriram@google.com>
14557
14558 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14559 kept comdat section was garbage collected.
14560 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14561 * testsuite/Makefile.in: Regenerate.
14562 * testsuite/gc_comdat_test.sh: New file.
14563 * testsuite/gc_comdat_test_1.cc: New file.
14564 * testsuite/gc_comdat_test_2.cc: New file.
14565
65514900
CC
145662009-05-19 Doug Kwan <dougkwan@google.com>
14567
14568 * archive.cc (Archive::Archive): Move constructor from archive.h
14569 to here. Initialize no_export_.
14570 (Archive::get_elf_object_for_member): Set no_export flag of object.
14571 * archive.h (Archive::Archive): Move constructor body to
14572 archive.cc.
14573 (Archive::no_export): New method.
14574 (Archive::no_export_): New field.
14575 * object.h (Object::Object): Initialize no_export_ to false.
14576 (Object::no_export, Object::set_no_export): New methods.
14577 (Object::no_export_): New field.
14578 * options.cc (General_options::parse_exclude_libs): New method.
14579 (General_options::check_excluded_libs) Same.
14580 * options.h (exclude_libs): New option.
14581 (General_options::check_excluded_libs): New method declaration.
14582 (General_options::excluded_libs_): New field.
14583 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14584 default or protected visibility if an object has no-export flag set.
14585 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14586 (check_SCRIPTS): Add exclude_libs_test.sh.
14587 (check_DATA): Add exclude_libs_test.syms.
14588 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14589 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14590 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14591 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14592 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14593 libexclude_libs_test_2.a): New rules.
14594 * testsuite/Makefile.in: Regenerate.
14595 * testsuite/exclude_libs_test.c: New file.
14596 * testsuite/exclude_libs_test.sh: Ditto.
14597 * testsuite/exclude_libs_test_1.c: Ditto.
14598 * testsuite/exclude_libs_test_2.c: Ditto.
14599
1b77ea50
ILT
146002009-05-15 Ian Lance Taylor <iant@google.com>
14601
14602 * configure.ac: Check for declarations for cases where libiberty.h
14603 checks HAVE_DECL_xxx.
14604 * configure, config.in: Rebuild.
14605
072fe7ce
ILT
146062009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14607
14608 * gold.h (Incremental_argument_list): Remove (invalid) forward
14609 declaration.
14610 * incremental.cc (Incremental_inputs::report_achive): New method.
14611 (Incremental_inputs::report_object): New method.
14612 (Incremental_inputs::report_script): New method.
14613 (Incremental_inputs::finalize_inputs): New method.
14614 (Incremental_inputs::finalize): Call finalize_inputs().
14615 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14616 Create inputs entries.
14617 * incremental.h (Incremental_input_type): New enum.
14618 (Incremental_inputs::Incremental_input): Initialize new fields.
14619 (Incremental_inputs::report_inputs): New method.
14620 (Incremental_inputs::report_achive): New method.
14621 (Incremental_inputs::report_object): New method.
14622 (Incremental_inputs::report_script): New method.
14623 (Incremental_inputs::finalize_inputs): New method.
14624 (Incremental_inputs::Input_info): New struct.
14625 (Incremental_inputs::Input_info_map): New typedef.
14626 (Incremental_inputs::lock_): New field.
14627 (Incremental_inputs::Inputs_): New field.
14628 (Incremental_inputs::Inputs_map): New field.
14629 * main.cc (main): Call Incremental_input::report_inputs.
14630 * options.h (Input_argument_list): Typedef moved from
14631 Input_arguments.
14632 (Input_file_group::Files): Remove, use ::Input_argument_list.
14633 (Input_file_group::Input_argument_list): Remove, use
14634 ::Input_argument_list.
14635 * plugin.cc (Plugin_manager::add_input_file): Add error in
14636 incremental build.
14637 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14638 functions.
14639 * script.cc (read_input_script): Call
14640 Incremental_input::report_script.
14641 * script.h (Script_info): New class.
14642
b0481b0b
ILT
146432009-04-27 Ian Lance Taylor <iant@google.com>
14644
14645 * x86_64.cc (do_adjust_output_section): Set entsize to
14646 plt_entry_size.
14647
b22a5a41 146482009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14649
14650 * output.cc (Output_file::close): After short writes, continue
14651 writing from the correct offset in the buffer being written.
14652
40fde488
CD
146532009-04-23 Chris Demetriou <cgd@google.com>
14654
14655 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14656 * configure: Regenerate.
14657 * config.in: Regenerate.
14658 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14659 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14660
3ce2c28e
ILT
146612009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14662
14663 * incremental.cc (Incremental_inputs_header_data): Renamed from
14664 Incremental_input_header_data.
14665 (Incremental_inputs_header_data::data_size): New field.
14666 (Incremental_inputs_header_data::put_input_file_count): Renamed
14667 from input_file_count.
14668 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14669 from command_line_offset.
14670 (Incremental_inputs_header_data::put_reserved): Renamed from
14671 put_reserved.
14672 (Incremental_inputs_entry_data): Renamed from
14673 Incremental_input_entry_data.
14674 (Incremental_inputs_entry_data::data_size): New field.
14675 (Incremental_inputs::report_command_line): New method.
14676 (Incremental_inputs::finalize): New method.
14677 (Incremental_inputs::create_incremental_inputs_data): New method.
14678 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14679 * incremental.h: New file.
14680 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14681 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14682 incremental builds.
703d02da 14683 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14684 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14685 (Layout::create_incremental_info_sections): New method.
14686 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14687 * main.cc (main): Notify Incremental_input of the command line.
14688
e55bde5e
ILT
146892009-04-01 Ian Lance Taylor <iant@google.com>
14690 Mikolaj Zalewski <mikolajz@google.com>
14691
14692 * gold.h (reserve_unordered_map): Define, three versions, one for
14693 each version of Unordered_map.
14694 * layout.cc (Layout::Layout): Remove options parameter. Add
14695 number_of_input_files parameter. Don't initialize options_.
14696 Initialize number_of_input_files_ and resized_signatures_. Move
14697 sections_are_attached_.
14698 (Layout::layout_group): Reserve space for group_signatures_.
14699 (Layout::find_or_add_kept_section): Change name parameter to be a
14700 reference. Resize signatures_ map when it gets large enough.
14701 (Layout::layout_eh_frame): Use parameters->options() instead of
14702 this->options_.
14703 (Layout::make_output_section): Likewise.
14704 (Layout::attach_allocated_section_to_segment): Likewise.
14705 (Layout::finalize, Layout::create_executable_stack): Likewise.
14706 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14707 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14708 * layout.h (class Layout): Update declarations. Remove options_
14709 field. Add number_of_input_files_ and resized_signatures_
14710 fields. Move sections_are_attached_ field.
14711 * main.cc (main): Pass number of input files to Layout
14712 constructor. Don't pass options.
14713
154b857c
ILT
147142009-03-30 Ian Lance Taylor <iant@google.com>
14715
14716 * ffsll.c (ffsll): Correct implementation.
14717
2f35ab9b
ILT
147182009-03-27 Ian Lance Taylor <iant@google.com>
14719
fd03461a
ILT
14720 * ffsll.c: New file.
14721 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14722 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14723 * ftruncate.c (ftruncate): Declare before definition.
14724 * mremap.c (mremap): Likewise.
14725 * pread.c (pread): Likewise.
14726 * configure, Makefile.in, config.in: Rebuild.
14727
2f35ab9b
ILT
14728 * mremap.c: New file.
14729 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14730 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14731 (mremap): Declare if HAVE_MREMAP is not defined.
14732 * configure, Makefile.in, config.in: Rebuild.
14733
33aea2fd
CC
147342009-03-27 Cary Coutant <ccoutant@google.com>
14735
14736 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14737 position independent.
14738 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14739 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14740
6d479619
CC
147412009-03-24 Cary Coutant <ccoutant@google.com>
14742
14743 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14744 an executable.
14745 (needs_dynamic_reloc): Likewise.
14746
afc06bb8
ILT
147472009-03-24 Ian Lance Taylor <iant@google.com>
14748
14749 * yyscript.y (file_cmd): Recognize EXTERN.
14750 (extern_name_list, extern_name_list_body): New nonterminals.
14751 * script.cc (script_add_extern): Define.
14752 * script-c.h (script_add_extern): Declare.
14753
f6060a4d
ILT
147542009-03-24 Rafael Avila de Espindola <espindola@google.com>
14755
14756 * object.cc (is_elf_object): Define.
14757 * object.h (is_elf_object): Declare.
14758 * archive.cc (Archive::get_elf_object_for_member): Call
14759 is_elf_object.
33aea2fd 14760 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14761
26736d8e
ILT
147622009-03-24 Elliott Hughes <enh@google.com>
14763
14764 * output.cc (Output_file::map_anonymous): Define.
14765 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14766 try an anonymous one. Report the size if the mmap fails.
14767 * output.h (class Output_file): Declare map_anonymous.
14768
22fd9730
ILT
147692009-03-24 Ian Lance Taylor <iant@google.com>
14770
14771 * target-select.cc (instantiate_target): Don't acquire the lock if
14772 the instantiated_target_ field has already been set.
14773
cb010894
ILT
147742009-03-23 Ian Lance Taylor <iant@google.com>
14775
7f055c20
ILT
14776 * gold-threads.h (class Initialize_lock): Define.
14777 * gold-threads.cc (class Initialize_lock_once): Define.
14778 (initialize_lock_control): New static variable.
14779 (initialize_lock_pointer): New static variable.
14780 (initialize_lock_once): New static function.
14781 (Initialize_lock::Initialize_lock): Define.
14782 (Initialize_lock::initialize): Define.
14783 * target-select.h: Include "gold-threads.h".
14784 (class Target_selector): Add lock_ and initialize_lock_ fields.
14785 Don't define instantiate_target, just declare it.
14786 * target-select.cc (Target_selector::Target_selector): Initialize
14787 new fields.
14788 (Target_selector::instantiate_target): Define.
14789 * descriptors.h: Include "gold-threads.h".
14790 (class Descriptors): Add initialize_lock_ field.
14791 * descriptors.cc (Descriptors::Descriptors): Initialize new
14792 field.
14793 (Descriptors::open): Use initialize_lock_ field
14794 * errors.h (class Errors): Add initialize_lock_ field.
14795 * errors.cc (Errors::Errors): Initialize new field.
14796 (Errors::initialize_lock): Use initialize_lock_ field.
14797 * powerpc.cc (class Target_selector_powerpc): Remove
14798 instantiated_target_ field. In do_recognize call
14799 instantiate_target rather than do_instantiate_target. In
14800 do_instantiate_target just allocate a new target.
14801 * sparc.cc (class Target_selector_sparc): Likewise.
14802
36959681
ILT
14803 * freebsd.h: New file.
14804 * i386.cc: Include "freebsd.h".
14805 (Target_i386): Derive from Target_freebsd rather than
14806 Sized_target.
14807 (Target_selector_i386): Derive from Target_selector_freebsd rather
14808 than Target_selector.
14809 * x86_64.cc: Include "freebsd.h".
14810 (Target_x86_64): Derive from Target_freebsd rather than
14811 Sized_target.
14812 (Target_selector_x86_64): Derive from Target_selector_freebsd
14813 rather than Target_selector.
14814 * target.h (class Target): Add adjust_elf_header and
14815 do_adjust_elf_header.
14816 * output.cc (Output_file_header:: do_sized_write): Call target
14817 adjust_elf_header routine.
14818 * configure.tgt: Set targ_osabi.
14819 * configure.ac: Define GOLD_DEFAULT_OSABI.
14820 * parameters.cc (Parameters::default_target): Pass
14821 GOLD_DEFAULT_OSABI to select_target.
14822 * target-select.h (class Target_selector): Make instantiate_target
14823 protected rather than private.
14824 * Makefile.am (HFILES): Add freebsd.h.
14825 * configure, Makefile.in, config.in: Rebuild.
14826
cb010894
ILT
14827 * merge.cc (do_add_input_section): Correct pend value. Change
14828 message about last entry not being null terminated from error to
14829 warning.
14830
0e879927
ILT
148312009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14832
14833 * incremental.cc: New file.
14834 * Makefile.am (CCFILES): Add incremental.cc.
14835 * Makefile.in: Rebuild.
14836
41105937
PP
148372009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14838
14839 * layout.cc (Layout::output_section_name): Preserve names
14840 of '.note.' sections.
e1df38aa 14841
60439920
ILT
148422009-03-19 Ian Lance Taylor <iant@google.com>
14843
14844 * descriptors.cc (Descriptors::open): Check that the options are
14845 valid before using them.
14846
0d371ad3
ILT
148472009-03-18 Ian Lance Taylor <iant@google.com>
14848
14849 * script-sections.h: Include <list>.
14850 (class Script_sections): Change Sections_elements from std::vector
14851 to std::list. Typedef public Elements_iterator. Add
14852 orphan_section_placement_, data_segment_align_start_, and
14853 saw_data_segment_align_ fields. Remove data_segment_align_index_
14854 field.
14855 * script-sections.cc (class Orphan_section_placement): New class.
14856 (class Sections_element): Add virtual functions is_relro and
14857 orphan_section_init. Remove virtual function place_orphan_here.
14858 (class Output_section_definition): Add is_relro and
14859 orphan_section_init. Remove place_orphan_here.
14860 (class Orphan_output_section): Likewise.
14861 (Script_sections::Script_sections): Update for field changes.
14862 (Script_sections::data_segment_align): Set saw_data_segment_align_
14863 and data_segment_align_start_, not data_segment_align_index.
14864 (Script_sections::data_segment_relro_end): Check
14865 saw_data_segment_align_. Use data_segment_align_start_ rather
14866 than data_segment_align_index_.
14867 (Script_sections::place_orphan): Rewrite to use
14868 Orphan_section_placement.
14869
9201d894
ILT
148702009-03-17 Ian Lance Taylor <iant@google.com>
14871
9c5b8369
ILT
14872 * archive.cc (Archive::add_symbols): Check for a version attached
14873 to the symbol name in the archive map.
14874 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14875 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14876 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14877 (ver_test_11.a): New target.
14878 * testsuite/Makefile.in: Rebuild.
14879
9201d894
ILT
14880 * configure.ac: Check for chsize and posix_fallocate. Replace
14881 ftruncate.
14882 * ftruncate.c: New file, from gnulib.
14883 * output.cc (posix_fallocate): Define dummy version if not
14884 HAVE_POSIX_FALLOCATE.
14885 (Output_file::map): Call posix_fallocate rather than lseek and
14886 write.
14887 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14888 * configure, Makefile.in, config.in: Rebuild.
14889
ef4ab7a8 148902009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14891
ef4ab7a8
PP
14892 * layout.h (Layout::create_note): Add section_name parameter.
14893 * layout.cc (Layout::create_note): Likewise.
14894 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14895
8c500701
ILT
148962009-03-17 Ian Lance Taylor <iant@google.com>
14897
e85b18e1
ILT
14898 * descriptors.cc: Include "options.h".
14899 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14900 (Descriptors::open): Always use O_CLOEXEC when opening a new
14901 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14902 then set FD_CLOEXEC.
14903
9efe6174
ILT
14904 * sparc.cc (class Target_sparc): Add has_got_section.
14905 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14906 make sure we have a GOT section.
14907
14908 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14909 (Target_sparc::Scan::local): Likewise.
14910 (Target_sparc::Scan::global): Likewise.
14911 (Target_sparc::Relocate::relocate): Likewise.
14912 (Target_sparc::Relocate::relocate_tls): Likewise.
14913
8c500701
ILT
14914 * symtab.cc (Symbol_table::define_default_version): New function,
14915 broken out of add_from_object.
14916 (Symbol_table::add_from_object): Call define_default_version.
14917 (Symbol_table::define_special_symbol): Add resolve_oldsym
14918 parameter. Change all callers. If the version for a symbol comes
14919 from a version script, resolve it with the symbol with the same
14920 name with no version. Also add the symbol without a version if
14921 appropriate.
14922 (do_define_in_output_data): If resolving with oldsym, don't delete
14923 sym.
14924 (do_define_in_output_segment): Likewise.
14925 (do_define_as_constant): Likewise.
14926 * symtab.h (class Symbol_table): Update declarations.
14927
f1ed28fb
ILT
149282009-03-13 Ian Lance Taylor <iant@google.com>
14929
15f8229b
ILT
14930 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14931 (Read_symbols::requeue): New function.
14932 (Read_symbols::do_read_symbols): If make_elf_object fails because
14933 the target type is not configured, and the file was searched for,
14934 issue a warning and retry with the next directory.
14935 (Add_symbols::run): If the file has an incompatible format, and
14936 it was searched for, requeue the Read_symbols task. On error,
14937 release the object.
14938 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14939 dirindex parameter to constructor. Change all callers. Declare
14940 incompatible_warning and requeue.
14941 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14942 input_argument_ and input_group_ fields. Add them to
14943 constructor. Change all callers.
14944 (class Read_script): Add dirindex_ field. Add it to constructor.
14945 Change all callers.
14946 * archive.cc (Archive::setup): Remove input_objects parameter.
14947 Change all callers.
14948 (Archive::get_file_and_offset): Likewise.
14949 (Archive::read_all_symbols): Likewise.
14950 (Archive::read_symbols): Likewise.
14951 (Archive::get_elf_object_for_member): Remove input_objects
14952 parameter. Add punconfigured parameter. Change all callers.
14953 (Archive::add_symbols): Change return type to bool. Check return
14954 value of include_member.
14955 (Archive::include_all_members): Likewise.
14956 (Archive::include_member): Change return type to bool. Return
14957 false if first included object has incompatible target. Set
14958 included_member_ field.
14959 (Add_archive_symbols::run): If add_symbols returns false, requeue
14960 Read_symbols task.
14961 * archive.h (class Archive): Add included_member_ field.
14962 Initialize it in constructor. Add input_file and searched_for
14963 methods. Update declarations.
14964 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14965 input_argument_ fields. Add them to constructor. Change all
14966 callers.
14967 * script.cc: Include "target-select.h".
14968 (class Parser_closure): Add skip_on_incompatible_target_ and
14969 found_incompatible_target_ fields. Add
14970 skip_on_incompatible_target parameter to constructor. Change all
14971 callers. Add methods skip_on_incompatible_target,
14972 clear_skip_on_incompatible_target, found_incompatible_target, and
14973 set_found_incompatible_target.
14974 (read_input_script): Add dirindex parameter. Change all callers.
14975 If parser finds an incompatible target, requeue Read_symbols
14976 task.
14977 (script_set_symbol): Clear skip_on_incompatible_target in
14978 closure.
14979 (script_add_assertion, script_parse_option): Likewise.
14980 (script_start_sections, script_add_phdr): Likewise.
14981 (script_check_output_format): New function.
14982 * script.h (read_input_script): Update declaration.
14983 * script-c.h (script_check_output_format): Declare.
14984 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14985 (ignore_cmd): Remove OUTPUT_FORMAT.
14986 * fileread.cc (Input_file::Input_file): Add explicit this.
14987 (Input_file::will_search_for): New function.
14988 (Input_file::open): Add pindex parameter. Change all callers.
14989 * fileread.h (class Input_file): Add input_file_argument method.
14990 Declare will_search_for. Update declarations.
14991 * object.cc (make_elf_object): Add punconfigured parameter.
14992 Change all callers.
14993 * object.h (class Object): Make input_file public. Add
14994 searched_for method.
14995 (make_elf_object): Update declaration.
14996 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14997 restart search.
14998 * dirsearch.h (class Dirsearch): Update declaration.
14999 * options.h (class General_options): Add --warn-search-mismatch.
15000 * parameters.cc (Parameters::is_compatible_target): New function.
15001 * parameters.h (class Parameters): Declare is_compatible_target.
15002 * workqueue.cc (Workqueue::add_blocker): New function.
15003 * workqueue.h (class Workqueue): Declare add_blocker.
15004
f1ed28fb
ILT
15005 * fileread.cc (Input_file::open): Remove options parameter.
15006 Change all callers.
15007 (Input_file::open_binary): Likewise.
15008 * script.cc (read_input_script): Likewise.
15009 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15010 options parameter from constructor. Change all callers.
15011 (class Read_script): Likewise.
15012 * fileread.h (class Input_file): Update declarations.
15013 * script.h (read_input_script): Update declaration.
15014
34dd024a
NC
150152009-03-10 Nick Clifton <nickc@redhat.com>
15016
15017 * po/es.po: New Spanish translation.
15018
6d71b17c
CC
150192009-03-06 Cary Coutant <ccoutant@google.com>
15020
15021 * options.cc (parse_short_option): Keep dash_z from registering itself.
15022
031cdbed
ILT
150232009-03-03 Ian Lance Taylor <iant@google.com>
15024
15025 PR 9918
15026 * target-reloc.h (relocate_section): Pass output_section to
15027 relocate.
15028 * i386.cc (Target_i386::should_apply_static_reloc): Add
15029 output_section parameter. Change all callers.
15030 (Target_i386::Relocate::relocate): Add output_section parameter.
15031 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15032 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15033 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15034 * testsuite/two_file_shared.sh: New script.
15035 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15036 (check_DATA): Add two_file_shared.dbg.
15037 (two_file_shared.dbg): New target.
15038 * testsuite/Makefile.in: Rebuild.
15039
15d5fa16
ILT
150402009-03-01 Ian Lance Taylor <iant@google.com>
15041
15042 * configure.ac: Check for byteswap.h.
15043 * configure: Rebuild.
15044 * config.in: Rebuild.
15045
8a4c0b0d
ILT
150462009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15047
15048 * layout.cc (Layout::find_or_add_kept_section): New function.
15049 (Layout::add_comdat): Removed.
15050 * layout.h (struct Kept_section): Move out of class Layout.
15051 Remove trailing underscores from field names. Add group_sections
15052 field. Rename group_ field to is_group. Change all uses.
15053 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15054 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15055 comdat_groups_ field.
15056 (Sized_relobj::include_section_group): Use
15057 find_or_add_kept_section and Kept_section::group_sections.
15058 (Sized_relobj::include_linkonce_section): Likewise.
15059 * object.cc (class Sized_relobj): Don't define Comdat_group or
15060 Comdat_group_table. Remove find_comdat_group and
15061 add_comdat_group. Remove comdat_groups_ field.
15062 * plugin.cc (include_comdat_group): Use
15063 Layout::find_or_add_kept_section.
15064
b4ecf66b
ILT
150652009-02-28 Ian Lance Taylor <iant@google.com>
15066
14359ca0
ILT
15067 * README: --gc-sections and map files are now supported. Document
15068 some build requirements.
15069
b4ecf66b
ILT
15070 PR 6992
15071 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15072 relocatable link set the value of the section symbol to zero.
15073 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15074 relocatable link don't include the section address in the local
15075 symbol value.
15076
0602e05a
ILT
150772009-02-27 Ian Lance Taylor <iant@google.com>
15078
fd9d194f
ILT
15079 PR 6811
15080 * options.h (class Search_directory): Add is_system_directory.
15081 (class General_options): Declare is_in_system_directory.
15082 * options.cc (get_relative_sysroot): Make static.
15083 (get_default_sysroot): Make static.
15084 (General_optoins::is_in_system_directory): New function.
15085 * fileread.cc (Input_file::is_in_system_directory): New function.
15086 * fileread.h (class Input_file): Declare is_in_system_directory.
15087 * object.h (class Object): Add is_in_system_directory.
15088 (class Input_objects): Remove system_library_directory_ field.
15089 * object.cc (Input_objects::add_object): Don't set
15090 system_library_directory_.
15091 (input_objects::found_in_system_library_directory): Remove.
15092 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15093 parameter. Change all callers.
15094 (Symbol_table::sized_write_globals): Likewise.
15095 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15096 Call Object::is_in_system_directory.
15097 * symtab.h (class Symbol_table): Update declarations.
15098
61edd21f
ILT
15099 PR 5990
15100 * descriptors.h (Open_descriptor): Add is_on_stack field.
15101 * descriptors.cc (Descriptors::open): If the descriptor is on the
15102 top of the stack, remove it. Initialize is_on_stack field.
15103 (Descriptors::release): Only add pod to stack if it is not on the
15104 stack already.
15105 (Descriptors::close_some_descriptor): Clear stack_next and
15106 is_on_stack fields.
15107
e29e076a
ILT
15108 PR 7091
15109 * output.cc (Output_section::find_starting_output_address): Rename
15110 from starting_output_address; add PADDR parameter; change return
15111 type.
15112 * output.h (class Output_section): Declare
15113 find_starting_output_address instead of starting_output_address.
15114 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15115 section symbol for which we can't find a merge section.
15116
0602e05a
ILT
15117 PR 9836
15118 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15119 hidden or internal, force the symbol to be local.
15120 * resolve.cc (Symbol::override_visibility): Define.
15121 (Symbol::override_base): Use override_visibility.
15122 (Symbol_table::resolve): Likewise.
15123 (Symbol::override_base_with_special): Likewise.
15124 (Symbol_table::override_with_special): If the visibility is hidden
15125 or internal, force the symbol to be local.
15126 * symtab.h (class Symbol): Add set_visibility and
15127 override_visibility.
15128 * testsuite/ver_test_1.sh: New file.
15129 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15130 (check_DATA): Add ver_test_1.syms.
15131 (ver_test_1.syms): New target.
15132 * testsuite/Makefile.in: Rebuild.
15133
401a9a73
CC
151342009-02-25 Cary Coutant <ccoutant@google.com>
15135
15136 * layout.cc (Layout::choose_output_section): Don't rename sections
15137 when using a linker script that has a SECTIONS clause.
15138 * Makefile.in: Regenerate.
15139
15140 * testsuite/Makefile.am (script_test_5.sh): New test case.
15141 * testsuite/Makefile.in: Regenerate.
15142 * testsuite/script_test_5.cc: New file.
15143 * testsuite/script_test_5.sh: New file.
15144 * testsuite/script_test_5.t: New file.
15145
f488e4b0
CC
151462009-02-13 Rafael Avila de Espindola <espindola@google.com>
15147
15148 * archive.cc (Archive::include_member): Update calls to add_symbols.
15149 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15150 the Layout argument.
15151 * dynobj.h (do_add_symbols): Add the Layout argument.
15152 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15153 Layout argument.
15154 * object.h (Object::add_symbols): Add the Layout argument.
15155 (Object::do_add_symbols): Add the Layout argument.
15156 (Sized_relobj::do_add_symbols): Add the Layout argument.
15157 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15158 Unify the two versions.
15159 (Add_plugin_symbols): Remove.
15160 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15161 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15162 (Add_plugin_symbols): Remove.
15163 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15164 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15165 (Add_symbols::run): Make it work with Pulginobj.
15166
89dd1680
ILT
151672009-02-06 Ian Lance Taylor <iant@google.com>
15168
15169 * object.cc (Sized_relobj::do_layout): Make info message start
15170 with lower case letter.
15171
266d0a74
ILT
151722009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15173
602b464e
ILT
15174 * binary.cc: Fix file comment.
15175
266d0a74
ILT
15176 * options.h (enum Incremental_disposition): Define.
15177 (class General_options): Add new options: --incremental,
15178 --incremental_changed, --incremental_unchanged,
15179 --incremental_unknown. Add incremental_disposition_ and
15180 implicit_incremental_ fields.
15181 (General_options::incremental_disposition): New function.
15182 (class Position_dependent_options): Add incremental_disposition
15183 option.
15184 (Position_dependent_options::copy_from_options): Set incremental
15185 dispositions.
15186 * options.cc (General_options::parse_incremental_changed): New
15187 function.
2e702c99
RM
15188 (General_options::parse_incremental_unchanged): New function.
15189 (General_options::parse_incremental_unknown): New function.
15190 (General_options::General_options): Initialize new fields
266d0a74 15191 incremental_disposition_ and implicit_incremental_.
2e702c99 15192 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15193 without --incremental.
15194
f073bbf7
CD
151952009-02-06 Chris Demetriou <cgd@google.com>
15196
15197 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15198 pointer and to report location as the file name associated with
15199 the symbol.
15200 (gold_undefined_symbol_at_location): New function to replace the
15201 old gold_undefined_symbol functionality.
15202 * target-reloc.h (relocate_section): Update to use
15203 gold_undefined_symbol_at_location.
15204 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15205 Call gold_undefined_symbol function rather than gold_error.
15206 * errors.h (Errors::undefined_symbol): Take location as a
15207 string, rather than calculating it from a relocation.
15208 * errors.cc (Errors::fatal): Print "fatal error:" before the
15209 formatted message.
15210 (Errors::error, Errors::error_at_location): Print "error: "
15211 before the formatted message.
15212 (Errors::undefined_symbol): Take location as a string, rather
15213 than calculating it from a relocation.
15214 (gold_undefined_symbol_at_location): New function akin to
15215 old gold_undefined_symbol, calculates location from relocation.
15216 (gold_undefined_symbol): Change to take only a Symbol pointer
15217 and to report location as the file name associated with the symbol.
15218 * testsuite/debug_msg.sh: Update for changed error messages.
15219 * testsuite/undef_symbol.sh: Likewise.
15220
8e94a90c
ILT
152212009-02-04 Duncan Sands <baldrick@free.fr>
15222
15223 PR 9812
15224 * reduced_debug_output.h
15225 (Output_reduced_debug_abbrev_section::failed): Use format for
15226 gold_warning.
15227 (Output_reduced_debug_info_section::faild): Likewise.
15228
88a0e15b
ILT
152292009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15230
15231 * script.cc (Lazy_demangler): New class.
2e702c99 15232 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15233 symbol only once.
15234
5efc7cd2
CC
152352009-01-29 Cary Coutant <ccoutant@google.com>
15236
15237 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15238 to __tls_get_addr.
15239 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15240
e0ebcf42
ILT
152412009-01-28 Ian Lance Taylor <iant@google.com>
15242
5efc7cd2 15243 * version.cc (version_string): Bump to 1.9.
75fe7426 15244
e0ebcf42
ILT
15245 * gold.h: Include <cstring> and <stdint.h>.
15246 * version.cc: Include <cstdio>.
15247 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15248 warning.
15249 * reduced_debug_output.cc (insert_into_vector): Rename from
15250 Insert_into_vector; change all callers. Use Swap_unaligned to
15251 avoid aliasing issue; remove union since it is unnecessary.
15252
8e2813be 152532009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15254
15255 * Makefile.am (CCFILES): Add gc.cc.
15256 (HFILES): Add gc.h.
15257 * Makefile.in: Regenerate.
15258 * gold.cc (Gc_runner): New class.
15259 (queue_initial_tasks): Call garbage collection related tasks
15260 when corresponding options are invoked.
15261 (queue_middle_gc_tasks): New function.
15262 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15263 processed early before laying out sections during garbage collection.
15264 * gold.h (queue_middle_gc_tasks): New function.
15265 (is_prefix_of): Move from "layout.cc".
15266 * i386.cc (Target_i386::gc_process_relocs): New function.
15267 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15268 * main.cc (main): Create object of class "Garbage_collection".
15269 * object.cc (Relobj::copy_symbols_data): New function.
15270 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15271 (Sized_relobj::do_layout): Allow this function to be called twice
15272 during garbage collection and defer layout of section during the
6d03d481
ST
15273 first call.
15274 * object.h (Relobj::get_symbols_data): New function.
15275 (Relobj::is_section_name_included): New function.
15276 (Relobj::copy_symbols_data): New function.
15277 (Relobj::set_symbols_data): New function.
15278 (Relobj::get_relocs_data): New function.
15279 (Relobj::set_relocs_data): New function.
15280 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15281 (Relobj::gc_process_relocs): New function.
15282 (Relobj::do_gc_process_relocs): New pure virtual function.
15283 (Relobj::sd_): New data member.
15284 (Sized_relobj::is_output_section_offset_invalid): New function.
15285 (Sized_relobj::do_gc_process_relocs): New function.
15286 * options.h (General_options::gc_sections): Modify to not be a no-op.
15287 (General_options::print_gc_sections): New option.
15288 * plugin.cc (Plugin_finish::run): Remove function call to
15289 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15290 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15291 * reloc.cc (Read_relocs::run): Add task to process relocs and
15292 determine unreferenced sections when doing garbage collection.
15293 (Gc_process_relocs): New class.
15294 (Sized_relobj::do_gc_process_relocs): New function.
15295 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15296 sections that are garbage collected.
15297 * reloc.h (Gc_process_relocs): New class.
15298 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15299 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15300 symbols whose corresponding sections are garbage collected.
15301 (Symbol_table::Symbol_table): Add new parameter for the garbage
15302 collection object.
15303 (Symbol_table::gc_mark_undef_symbols): New function.
15304 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15305 (Symbol_table::gc_mark_dyn_syms): New function.
15306 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15307 as garbage.
15308 (Symbol_table::add_from_object): Likewise.
15309 (Symbol_table::add_from_relobj): When building shared objects, do not
15310 treat externally visible symbols as garbage.
15311 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15312 table information for static and relocatable links.
15313 * symtab.h (Symbol_table::set_gc): New function.
15314 (Symbol_table::gc): New function.
15315 (Symbol_table::gc_mark_undef_symbols): New function.
15316 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15317 (Symbol_table::gc_mark_dyn_syms): New function.
15318 (Symbol_table::gc_): New data member.
e1df38aa 15319 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15320 function.
15321 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15322 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15323
3b293544
CF
153242009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15325
15326 * options.h (General_options::gc_sections): Define as a no-op for now.
15327 (General_options::no_keep_memory): Ditto.
15328 (General_options::Bshareable): Define.
15329 * options.cc (General_options::finalize): Honor -Bshareable.
15330
83d22aa8
AS
153312009-01-20 Andreas Schwab <schwab@suse.de>
15332
15333 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15334 read the value in the contents, since we don't use it. Use the
15335 template endianness when writing.
15336 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15337
cd536b21
AS
153382009-01-19 Andreas Schwab <schwab@suse.de>
15339
15340 * configure.tgt (powerpc64-*): Fix targ_obj.
15341
99e9a495
ILT
153422009-01-15 Ian Lance Taylor <iant@google.com>
15343
15344 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15345 local symbols when stripping all symbols.
15346
bbbfea06
CC
153472009-01-14 Cary Coutant <ccoutant@google.com>
15348
99e9a495 15349 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15350
0f7c0701
CC
153512009-01-14 Cary Coutant <ccoutant@google.com>
15352
15353 * archive.cc (Archive::get_elf_object_for_member): Remove call
15354 to File_read::claim_for_plugin.
15355 * descriptors.cc (Descriptors::open): Remove reference to
15356 is_claimed.
15357 (Descriptors::claim_for_plugin): Remove.
15358 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15359 (Descriptors::is_claimed): Remove.
15360 (claim_descriptor_for_plugin): Remove.
15361 * fileread.cc (File_read::claim_for_plugin): Remove.
15362 * fileread.h (File_read::claim_for_plugin): Remove.
15363 (File_read::descriptor): Reopen descriptor if necessary.
15364 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15365 (Plugin_manager::all_symbols_read): Add task parameter. Change
15366 all callers.
15367 (Plugin_manager::get_input_file): New function.
15368 (Plugin_manager::release_input_file): New function.
15369 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15370 corresponding data member.
15371 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15372 and pass to base constructor. Change all callers.
15373 (get_input_file, release_input_file): New functions.
15374 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15375 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15376 (Plugin_manager::all_symbols_read): Add task parameter.
15377 (Plugin_manager::get_input_file): New function.
15378 (Plugin_manager::release_input_file): New function.
15379 (Plugin_manager::task_): New data member.
15380 (Pluginobj::Pluginobj): Add filesize parameter.
15381 (Pluginobj::filename): New function.
15382 (Pluginobj::descriptor): New function.
15383 (Pluginobj::filesize): New function.
15384 (Pluginobj::filesize_): New data member.
15385 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15386 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15387 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15388
15389 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15390 with archive libraries.
15391 * testsuite/Makefile.in: Regenerate.
15392 * testsuite/plugin_test.c (struct sym_info): New type.
15393 (get_input_file, release_input_file): New static variables.
15394 (onload): Capture new transfer vector entries.
15395 (claim_file_hook): Stop reading at end of file according to filesize.
15396 Factor out parsing of readelf output into separate function.
15397 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15398 APIs and get the source file name from the symbol table. Convert
15399 source file name to corresponding object file name. Print info
15400 message when adding new input files.
15401 (parse_readelf_line): New function.
15402 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15403 * testsuite/plugin_test_2.sh: Likewise.
15404 * testsuite/plugin_test_3.sh: Likewise.
15405 * testsuite/plugin_test_4.sh: New test case.
15406
62a6d109
ILT
154072009-01-07 Ian Lance Taylor <iant@google.com>
15408
15409 * version.cc (version_string): Bump to 1.8.
15410
483620e8
CC
154112008-12-23 Cary Coutant <ccoutant@google.com>
15412
15413 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15414 * plugin.cc (Plugin_manager::finish): Rename as
15415 layout_deferred_objects. Move cleanup to separate function.
15416 (Plugin_manager::cleanup): New function.
15417 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15418 separately.
15419 * plugin.h (Plugin_manager::finish): Rename as
15420 layout_deferred_objects.
15421 (Plugin_manager::cleanup): New function.
15422 (Plugin_manager::cleanup_done): New field.
15423
d66a9eb3
CC
154242008-12-23 Cary Coutant <ccoutant@google.com>
15425
15426 * plugin.cc (is_visible_from_outside): New function.
15427 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15428 so we don't return "IR only" status for exported symbols or -r links.
15429
15430 * testsuite/Makefile.am (plugin_test_3): New test case.
15431 * testsuite/Makefile.in: Regenerate.
15432 * testsuite/plugin_test_3.sh: New file.
15433
5995b570
CC
154342008-12-22 Cary Coutant <ccoutant@google.com>
15435
15436 * object.cc (Sized_relobj::layout_section): New function.
15437 (Sized_relobj::do_layout): Defer layout of input sections until after
15438 plugin has provided replacement files.
15439 (Sized_relobj::do_layout_deferred_sections): New function.
15440 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15441 (Relobj::layout_deferred_sections): New function.
15442 (Relobj::do_layout_deferred_sections): New function.
15443 (Sized_relobj::do_layout_deferred_sections): New function.
15444 (Sized_relobj::layout_section): New function.
15445 (Sized_relobj::Deferred_layout): New structure.
15446 (Sized_relobj::deferred_layout_): New field.
15447 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15448 Change all callers. Layout deferred sections.
15449 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15450 references.
15451 (Plugin_hook::run): Move code from do_plugin_hook inline.
15452 (Plugin_hook::do_plugin_hook): Remove.
15453 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15454 (Plugin_manager::finish): Renamed, was cleanup.
15455 (Plugin_manager::should_defer_layout): New function.
15456 (Plugin_manager::add_deferred_layout_object): New function.
15457 (Plugin_manager::Deferred_layout_list): New type.
15458 (Plugin_manager::deferred_layout_objects_): New field.
15459 (Plugin_hook::do_plugin_hook): Remove.
15460
ee769c88
ILT
154612008-12-17 Ian Lance Taylor <iant@google.com>
15462
15463 * options.h (class General_options): Add --no case for
15464 --export-dynamic.
15465
abc8dcba
CC
154662008-12-16 Cary Coutant <ccoutant@google.com>
15467
15468 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15469 vector.
15470 (Plugin_manager::claim_file): Create plugin object even if
15471 plugin did not call the add_symbols callback.
15472 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15473 asking for more symbols than were added.
15474 * testsuite/Makefile.am (plugin_test_1): Add test case with
15475 no global symbols.
15476 (empty.syms): New target.
15477 * testsuite/Makefile.in: Regenerate.
15478 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15479 message. Don't call add_symbols if no globals.
15480 (all_symbols_read_hook): Don't provide replacement for empty
15481 claimed file.
15482
b0074644
ILT
154832008-12-12 Ian Lance Taylor <iant@google.com>
15484
68943102
ILT
15485 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15486 r_type == 0 for a local symbol with r_sym == 0.
15487 (scan_relocatable_relocs): Pass r_sym to
15488 local_non_section_strategy.
15489 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15490 r_sym parameter.
15491
b0074644
ILT
15492 * configure.ac: Update test for TLS descriptors: they are
15493 supported as of glibc 2.9.
15494 * configure: Rebuild.
15495
c2508178
ILT
154962008-12-11 Ian Lance Taylor <iant@google.com>
15497
15498 PR 7091
15499 * target-reloc.h (Default_scan_relocatable_relocs): For each
15500 function, map r_type == 0 to RELOC_DISCARD.
15501
2756a258
CC
155022008-12-10 Cary Coutant <ccoutant@google.com>
15503
15504 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15505 object to override a kept COMDAT group from a plugin object.
15506
bb6f53d3
ILT
155072008-12-09 Ian Lance Taylor <iant@google.com>
15508
fbc558e1
ILT
15509 PR 7088
15510 * yyscript.y (file_cmd): Handle INPUT.
15511
bb6f53d3
ILT
15512 * testsuite/initpri1.c: Change all declarations to be full
15513 prototypes by adding void, to avoid compiler warnings.
15514
4674ecfc
CC
155152008-12-05 Rafael Avila de Espindola <espindola@google.com>
15516
15517 * options.cc (General_options::parse_plugin_opt): New.
15518 (General_options::add_plugin): The argument now is just the filename.
15519 (General_options::add_plugin_option): New.
15520 * options.h (plugin_opt): New.
15521 (add_plugin): Change argument name.
15522 (add_plugin_option): New.
15523 * plugin.cc (Plugin::load): Don't parse the plugin option.
15524 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15525 (Plugin::add_option): New.
15526 (Plugin::args_): Change type.
15527 (Plugin::filename_): New.
15528 (Plugin_manager::add_plugin_option): New.
15529 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15530 * testsuite/Makefile.in: Regenerate.
15531
fd06b4aa
CC
155322008-12-05 Cary Coutant <ccoutant@google.com>
15533
15534 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15535 Handle --strip-lto-sections option.
15536 * options.h (strip_lto_sections): New option.
15537
6c52134c
CC
155382008-12-01 Cary Coutant <ccoutant@google.com>
15539
15540 * plugin.cc (ld_plugin_message): Change format parameter to const.
15541 Fix mismatch between new[] and delete.
15542
a45248e0
CC
155432008-11-14 Cary Coutant <ccoutant@google.com>
15544
15545 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15546 instead of -1U.
15547
c82fbeee
CS
155482008-11-05 Craig Silverstein <csilvers@google.com>
15549
15550 * options.cc (General_options::parse_dynamic_list): New function.
15551 * options.h (General_options): New flags dynamic_list,
15552 dynamic_list_data, dynamic_list_cpp_new, and
15553 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15554 (General_options::in_dynamic_list): New function.
15555 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15556 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15557 (Lex::can_continue_name): Likewise.
15558 (yylex): Likewise.
15559 (read_script_file): New parameter script_options.
15560 (read_dynamic_list): New function.
15561 (Script_options::define_dynamic_list): New function.
15562 (dynamic_list_keyword_parsecodes): New variable.
15563 (dynamic_list_keywords): New variable.
15564 * script.h (Script_options::define_dynamic_list): New function
15565 prototype.
15566 (read_dynamic_list): New function prototype.
15567 * symtab.cc (strprefix): New macro.
15568 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15569 dynamic_list_data, dynamic_list_cpp_new, and
15570 dynamic_list_cpp_typeinfo.
15571 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15572 (dynamic_list_expr): New rule.
15573 (dynamic_list_nodes): Likewise.
15574 (dynamic_list_node): Likewise.
15575 * testsuite/Makefile.am (dynamic_list): New test.
15576 * testsuite/Makefile.in: Regenerated.
15577 * testsuite/dynamic_list.t: New file.
15578 * testsuite/dynamic_list.sh: New file.
15579
e0bb29a5
CS
155802008-11-05 Craig Silverstein <csilvers@google.com>
15581
15582 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15583 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15584 (t11_last): Likewise.
15585 * testsuite/ver_test_6.c (main): Likewise.
15586
4e1e25e0
CC
155872008-10-07 Cary Coutant <ccoutant@google.com>
15588
15589 * options.c (General_options::finalize): Add check for -static and
15590 -shared.
15591 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15592 is not empty.
15593
92f03fcb
CC
155942008-10-02 Cary Coutant <ccoutant@google.com>
15595
15596 * plugin.cc (make_sized_plugin_object): Fix conditional
15597 compilation to work when not all targets are enabled.
15598
fbd8a257
CC
155992008-09-29 Cary Coutant <ccoutant@google.com>
15600
15601 * archive.cc (Archive::get_file_and_offset): Use filename instead
15602 of name to get library path.
15603 (Archive::include_member): Unlock external member of a thin archive.
15604
15605 * testsuite/Makefile.am (TEST_AR): New variable.
15606 (thin_archive_test_1): New test.
15607 (thin_archive_test_2): New test.
81636b3f
CC
15608 * testsuite/Makefile.in: Regenerate.
15609 * testsuite/thin_archive_main.cc: New file.
15610 * testsuite/thin_archive_test_1.cc: New file.
15611 * testsuite/thin_archive_test_2.cc: New file.
15612 * testsuite/thin_archive_test_3.cc: New file.
15613 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15614
eff45813
CC
156152008-09-29 Cary Coutant <ccoutant@google.com>
15616
15617 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15618 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15619 instead of -1U.
15620 (Sized_relobj::do_finalize_local_symbols): Likewise.
15621 (Sized_relobj::map_to_kept_section): Likewise.
15622 * object.h (Sized_relobj::invalid_address): New constant.
15623 (Sized_relobj::do_output_section_offset): Check for invalid_address
15624 and return -1ULL.
15625 * output.cc (Output_reloc::local_section_offset): Use constant
15626 invalid_address instead of -1U.
15627 (Output_reloc::get_address): Likewise.
15628 (Output_section::output_address): Change -1U to -1ULL.
15629 * output.h (Output_reloc::invalid_address): New constant.
15630 * reloc.cc (Sized_relobj::write_sections): Use constant
15631 invalid_address instead of -1U.
15632 (Sized_relobj::relocate_sections): Likewise.
15633 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15634 values for merge sections.
15635 * target-reloc.h (relocate_for_relocatable): Use constant
15636 invalid_address instead of -1U.
15637
89fc3421
CC
156382008-09-19 Cary Coutant <ccoutant@google.com>
15639
15640 Add plugin functionality for link-time optimization (LTO).
15641 * configure.ac (plugins): Add --enable-plugins option.
15642 * configure: Regenerate.
15643 * config.in: Regenerate.
15644 * Makefile.am (LIBDL): New variable.
15645 (CCFILES): Add plugin.cc.
15646 (HFILES): Add plugin.h.
15647 (ldadd_var): Add LIBDL.
15648 * Makefile.in: Regenerate.
15649
15650 * archive.cc: Include "plugin.h".
15651 (Archive::setup): Don't preread archive symbols when using a plugin.
15652 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15653 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15654 files.
15655 (Archive::include_member): Add symbols from plugin objects.
15656 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15657 * descriptors.cc (Descriptors::open): Check for file descriptors
15658 abandoned by plugins.
15659 (Descriptors::claim_for_plugin): New function.
15660 * descriptors.h (Descriptors::claim_for_plugin): New function.
15661 (Open_descriptor::is_claimed): New field.
15662 (claim_descriptor_for_plugin): New function.
15663 * fileread.cc (File_read::claim_for_plugin): New function.
15664 * fileread.h (File_read::claim_for_plugin): New function.
15665 (File_read::descriptor): New function.
15666 * gold.cc: Include "plugin.h".
15667 (queue_initial_tasks): Add task to call plugin hooks for generating
15668 new object files.
15669 * main.cc: Include "plugin.h".
15670 (main): Load plugin libraries.
15671 * object.h (Pluginobj): Declare.
15672 (Object::pluginobj): New function.
15673 (Object::do_pluginobj): New function.
15674 (Object::set_target): New function.
15675 * options.cc: Include "plugin.h".
15676 (General_options::parse_plugin): New function.
15677 (General_options::General_options): Initialize plugins_ field.
15678 (General_options::add_plugin): New function.
15679 * options.h (Plugin_manager): Declare.
15680 (General_options): Add --plugin option.
15681 (General_options::has_plugins): New function.
15682 (General_options::plugins): New function.
15683 (General_options::add_plugin): New function.
15684 (General_options::plugins_): New field.
15685 * plugin.cc: New file.
15686 * plugin.h: New file.
15687 * readsyms.cc: Include "plugin.h".
15688 (Read_symbols::do_read_symbols): Check for archive before checking
15689 for ELF file. Call plugin hooks to claim files.
15690 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15691 from a real object file; force override when processing replacement
15692 files.
15693 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15694 (Symbol::init_base_object): Likewise.
15695 (Symbol::init_base_output_data): Likewise.
15696 (Symbol::init_base_output_segment): Likewise.
15697 (Symbol::init_base_constant): Likewise.
15698 (Symbol::init_base_undefined): Likewise.
15699 (Symbol::output_section): Assert that object is not a plugin.
15700 (Symbol_table::add_from_pluginobj): New function.
15701 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15702 undefined.
15703 (Symbol_table::sized_write_globals): Likewise.
15704 (Symbol_table::add_from_pluginobj): Instantiate template.
15705 * symtab.h (Sized_pluginobj): Declare.
15706 (Symbol::in_real_elf): New function.
15707 (Symbol::set_in_real_elf): New function.
15708 (Symbol::in_real_elf_): New field.
15709 (Symbol_table::add_from_pluginobj): New function.
15710
15711 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15712 (LIBDL): New variable.
15713 (LDADD): Add LIBDL.
15714 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15715 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15716 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15717 (MOSTLYCLEANFILES): Likewise.
15718 * testsuite/Makefile.in: Regenerate.
15719 * testsuite/plugin_test.c: New file.
15720 * testsuite/plugin_test_1.sh: New file.
15721 * testsuite/plugin_test_2.sh: New file.
15722
de31bda5
ILT
157232008-09-16 Ian Lance Taylor <iant@google.com>
15724
9c2d0ef9
ILT
15725 * target-reloc.h (relocate_section): Check whether a symbol is
15726 defined by the ABI before reporting an undefined symbol error.
15727 * target.h (Target::is_defined_by_abi): Make parameter const.
15728 (Target::do_is_defined_by_abi): Likewise.
15729 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15730 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15731 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15732 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15733 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15734 * testsuite/Makefile.in: Rebuild.
15735
de31bda5
ILT
15736 * fileread.cc (make_view): Add casts to avoid warning.
15737
9fa33bee
AO
157382008-09-16 Alexandre Oliva <aoliva@redhat.com>
15739
15740 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15741 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15742
183fd0e3
AO
157432008-09-16 Alexandre Oliva <aoliva@redhat.com>
15744
15745 * options.h (General_options::output_is_executable): New.
15746 (General_options::output_is_pie): New.
15747 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15748 for shared libraries.
15749 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15750
7be8330a
CD
157512008-09-11 Chris Demetriou <cgd@google.com>
15752
15753 * options.h (origin): New -z option.
15754 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15755 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15756 in DT_FLAGS_1.
15757
a9caad02
CC
157582008-09-05 Cary Coutant <ccoutant@google.com>
15759
15760 * fileread.cc (File_read::make_view): Add check for attempt to map
15761 beyond end of file.
15762
ae6dce4d
CC
157632008-09-05 Cary Coutant <ccoutant@google.com>
15764
15765 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15766 explicit instantiations.
15767
d7ab2a47
KVH
157682008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15769
15770 PR gold/6858
15771 * options.cc (General_options::finalize): Allow undefined symbols
15772 in shlibs if linking -shared.
15773
15774 PR gold/6859
15775 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15776 symbols as not needing a dynsym entry.
15777
1e52a9c1
CS
157782008-08-20 Craig Silverstein <csilvers@google.com>
15779
15780 * fileread.cc (File_read::open): Do not lock the file unless it
15781 was successfully opened.
15782
d85c80a3
CC
157832008-08-14 Cary Coutant <ccoutant@google.com>
15784
15785 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15786 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15787 * testsuite/tls_test.cc (struct int128): 128-bit struct
15788 for testing TLS relocs with non-zero addend.
15789 (v12): New TLS variable.
15790 (t12): New test.
15791 (t_last): Add check for v12.
15792 * testsuite/tls_test.h (t12): New function.
15793 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15794
2d924fd9
ILT
157952008-08-13 Ian Lance Taylor <iant@google.com>
15796
15797 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15798 set tls_segment_ or relro_segment_.
15799 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15800 when appropriate.
15801 * output.h (Output_section::clear_is_relro): New function.
15802 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15803 sections specially even when output_data_ is empty.
15804 (Output_segment::maximum_alignment): When first section is relro,
15805 only force alignment for PT_LOAD segments.
15806 * script.cc (script_data_segment_align): New function.
15807 (script_data_segment_relro_end): New function.
15808 * script-c.h (script_data_segment_align): Declare.
15809 (script_data_segment_relro_end): Declare.
15810 * script-sections.h (class Script_sections): Declare
15811 data_segment_align and data_segment_relro_end. Add fields
15812 segment_align_index_ and saw_relro_end_.
15813 * script-sections.cc (class Sections_element): Add set_is_relro
15814 virtual function. Add new bool* parameter to place_orphan_here.
15815 Add get_output_section virtual function.
15816 (class Output_section_definition): Add set_is_relro. Add new
15817 bool* parameter to place_orphan_here. Add get_output_section.
15818 Add is_relro_ field.
15819 (Output_section_definition::Output_section_definition): Initialize
15820 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15821 and is_relro_ fields.
15822 (Output_section_definition::place_orphan_here): Add is_relro
15823 parameter.
15824 (Output_section_definition::set_section_addresses): Set relro for
15825 output section.
15826 (Output_section_definition::alternate_constraint): Likewise.
15827 (class Orphan_output_section): Add new bool* parameter to
15828 place_orphan_here. Add get_output_section.
15829 (Orphan_output_section::place_orphan_here): Add is_relro
15830 parameter.
15831 (Script_sections::Script_sections): Initialize
15832 data_segment_align_index_ and saw_relro_end_.
15833 (Script_sections::data_segment_align): New function.
15834 (Script_sections::data_segment_relro_end): New function.
15835 (Script_sections::place_orphan): Set or clear is_relro.
15836 (Script_sections::set_section_addresses): Force alignment of first
15837 TLS section.
15838 * yyscript.y (exp): Call script_data_segment_align and
15839 script_data_segment_relro_end.
15840 * testsuite/relro_script_test.t: New file.
15841 * testsuite/relro_test.cc (using_script): Declare.
15842 (t1, t2): Test using_script.
15843 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15844 (relro_script_test_SOURCES): Define.
15845 (relro_script_test_DEPENDENCIES): Define.
15846 (relro_script_test_LDFLAGS): Define.
15847 (relro_script_test_LDADD): Define.
15848 (relro_script_test.so): New target.
15849 * testsuite/Makefile.in: Rebuild.
15850
f827c9a9
CC
158512008-08-06 Cary Coutant <ccoutant@google.com>
15852
15853 * archive.cc (Archive::total_archives, Archive::total_members)
15854 (Archive::total_members_loaded): New variables.
15855 (Archive::setup): Add parameter. Add option to preread
15856 archive symbols.
15857 (Archive::read_armap): Add counter.
15858 (Archive::get_file_and_offset): New function.
15859 (Archive::get_elf_object_for_member): New function.
15860 (Archive::read_all_symbols): New function.
15861 (Archive::read_symbols): New function.
15862 (Archive::add_symbols): Add counters.
15863 (Archive::include_all_members): Use armap to find members if it's
15864 already built.
15865 (Archive::include_member): Skip reading symbols if already read.
15866 Factored code into Archive::get_file_and_offset and
15867 Archive::get_elf_object_for_member. Changed call to
15868 Mapfile::report_include_archive_member.
15869 (Archive::print_stats): New function.
15870 * archive.h: Declare Object and Read_symbols_data classes.
15871 (Archive::Archive): Add initializers for new members.
15872 (Archive::setup): Add parameter.
15873 (Archive::print_stats): New function.
15874 (Archive::total_archives, Archive::total_members)
15875 (Archive::total_members_loaded): New variables.
15876 (Archive::get_file_and_offset): New function.
15877 (Archive::get_elf_object_for_member): New function.
15878 (Archive::read_all_symbols): New function.
15879 (Archive::read_symbols): New function.
15880 (Archive::Archive_member): New class.
15881 (Archive::members_): New member.
15882 (Archive::num_members_): New member.
15883 * main.cc: Include archive.h.
15884 (main): Call Archive::print_stats.
15885 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15886 archive parameter; member_name is now the fully-decorated name.
15887 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15888 * options.h: (General_options): Add --preread-archive-symbols option.
15889 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15890 Archive::setup.
15891
de4c45bd
ILT
158922008-08-04 Ian Lance Taylor <iant@google.com>
15893
15894 * symtab.h (Symbol::use_plt_offset): New function.
15895 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15896 * powerpc.cc (Relocate::relocate): Likewise.
15897 * sparc.cc (Relocate::relocate): Likewise.
15898 * x86_64.cc (Relocate::relocate): Likewise.
15899 * testsuite/weak_plt.sh: New test.
15900 * testsuite/weak_plt_main.cc: New test.
15901 * testsuite/weak_plt_shared.cc: New test.
15902 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15903 (check_PROGRAMS): Add weak_plt.
15904 (check_DATA): Add weak_plt_shared.so.
15905 (weak_plt_main_pic.o, weak_plt): New targets.
15906 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15907 * testsuite/Makefile.in: Rebuild.
15908
15909 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15910 gcctestdir/ld.
15911 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15912 * testsuite/Makefile.in: Rebuild.
15913
323ee3f4
AM
159142008-08-04 Alan Modra <amodra@bigpond.net.au>
15915
15916 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15917 * Makefile.in: Regenerate.
15918 * po/POTFILES.in: Regenerate.
15919
7c07ecec
ILT
159202008-07-29 Ian Lance Taylor <iant@google.com>
15921
15922 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15923 symbols before other symbols.
15924 * testsuite/script_test_2.cc (test_addr): Declare.
15925 (test_addr_alias): Declare.
15926 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15927 values.
7c07ecec
ILT
15928 * testsuite/script_test_2.t: Define test_addr_alias and
15929 test_addr.
15930
5778530e
ILT
159312008-07-24 Ian Lance Taylor <iant@google.com>
15932
2a00e4fb
ILT
15933 PR 5990
15934 * descriptors.cc: New file.
15935 * descriptors.h: New file.
15936 * gold-threads.h (class Hold_optional_lock): New class.
15937 * fileread.cc: Include "descriptors.h".
15938 (File_read::~File_read): Release descriptor rather than closing
15939 it.
15940 (File_read::open) [file]: Call open_descriptor rather than open.
15941 Set is_descriptor_opened_.
15942 (File_read::open) [memory]: Assert that descriptor is not open.
15943 (File_read::reopen_descriptor): New function.
15944 (File_read::release): Release descriptor.
15945 (File_read::do_read): Make non-const. Reopen descriptor.
15946 (File_read::read): Make non-const.
15947 (File_read::make_view): Reopen descriptor.
15948 (File_read::do_readv): Likewise.
15949 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15950 Update declarations.
15951 * layout.cc: Include "descriptors.h".
15952 (Layout::create_build_id): Use open_descriptor rather than open.
15953 * output.cc: Include "descriptors.h".
15954 (Output_file::open): Use open_descriptor rather than open.
15955 * archive.cc (Archive::const_iterator): Change Archive to be
15956 non-const.
15957 (Archive::begin, Archive::end): Make non-const.
15958 (Archive::count_members): Likewise.
15959 * archive.h (class Archive): Update declarations.
15960 * object.h (Object::read): Make non-const.
15961 * Makefile.am (CCFILES): Add descriptors.cc.
15962 (HFILES): Add descriptors.h.
15963 * Makefile.in: Rebuild.
15964
801647d1
ILT
15965 PR 6716
15966 * gold.h: Always include <clocale>. Add Solaris workarounds
15967 following code in binutils/sysdep.h.
15968
5edd166e
ILT
15969 PR 6048
15970 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15971 this->eh_frame_hdr_ is NULL before using it.
15972
c89ad728
ILT
15973 * dynobj.cc (Versions::Versions): Update comment.
15974
aa86f06b
ILT
15975 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15976 the base version name.
15977
5778530e
ILT
15978 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15979 array size plus one.
15980 (Stringpool_template::set_string_offsets): Subtract one from key
15981 before using it as an array index.
15982 (Stringpool_template::get_offset_with_length): Likewise.
15983 (Stringpool_template::write_to_buffer): Likewise.
15984 * stringpool.h (Stringpool_template::get_offset_from_key):
15985 Likewise.
15986
057ead22
ILT
159872008-07-23 Ian Lance Taylor <iant@google.com>
15988
7f649c59
ILT
15989 PR 6658
15990 * object.h (Merged_symbol_value::value): Do our best to handle a
15991 negative addend.
15992
057ead22
ILT
15993 PR 6647
15994 * script.cc (Version_script_info::get_versions): Don't add empty
15995 version tag to return value.
15996 (Version_script_info::get_symbol_version_helper): Change return
15997 type to bool. Add pversion parameter. Change all callers.
15998 (script_register_vers_node): Don't require a non-NULL tag.
15999 * script.h (class Version_script_info): Update declarations.
16000 (Version_script_info::get_symbol_version): Change return type to
16001 bool. Add version parameter. Change all callers.
16002 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
16003 handling. Handle an empty version from a version script.
16004 (Symbol_table::define_special_symbol): Likewise.
16005 * testsuite/ver_test_10.script: New file.
16006 * testsuite/ver_test_10.sh: New file.
16007 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
16008 (check_DATA): Add ver_test_10.syms.
16009 (ver_test_10.syms, ver_test_10.so): New target.
16010 * testsuite/Makefile.in: Rebuild.
16011
58e54ac2
CD
160122008-07-23 Simon Baldwin <simonb@google.com>
16013
16014 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16015 to zero for undefined symbols from dynamic libraries.
16016
95d14cd3
ILT
160172008-07-23 Ian Lance Taylor <iant@google.com>
16018
16019 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16020 Change all callers.
16021 * symtab.h (class Symbol_table): Update declaration.
16022 * testsuite/ver_test_9.cc: New file.
16023 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16024 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16025 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16026 (ver_test_9.so, ver_test_9.o): New targets.
16027 * testsuite/Makefile.in: Rebuild.
16028
92de84a6
ILT
160292008-07-22 Ian Lance Taylor <iant@google.com>
16030
34810851
ILT
16031 * options.h (class General_options): Define --check-sections.
16032 * layout.cc (Layout::set_segment_offsets): Handle
16033 --check-sections.
16034
af6156ef
ILT
16035 * options.h (class General_options): Define -n/--nmagic and
16036 -N/--omagic.
16037 * options.cc (General_options::finalize): For -n/--nmagic or
16038 -N/--omagic, set -static.
16039 * layout.cc (Layout::attach_allocated_section_to_segment): If
16040 -N/--omagic, don't put read-only and read-write sections in
16041 different segments.
16042 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16043 finding a read-only segment.
16044 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16045 don't set the minimum segment alignment to the common page size,
16046 and don't set the file offset to the address modulo the page size.
16047 * script-sections.cc (Script_sections::create_segments): If
16048 -n/--omagic, don't put read-only and read-write sections in
16049 different segments.
16050
92de84a6
ILT
16051 * cref.cc: New file.
16052 * cref.h: New file.
16053 * options.h (class General_options): Add --print-symbol-counts.
16054 * main.cc (main): Issue defined symbol report if requested.
16055 * archive.cc (Archive::interpret_header): Make into a const member
16056 function.
16057 (Archive::add_symbols): Call Input_objects::archive_start and
16058 archive_stop.
16059 (Archive::const_iterator): Define new class.
16060 (Archive::begin, Archive::end): New functions.
16061 (Archive::include_all_members): Rewrite to use iterator.
16062 (Archive::count_members): New function.
16063 * archive.h (class Archive): Update declarations.
16064 (Archive::filename): New function.
16065 * object.cc: Include "cref.h".
16066 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16067 (Sized_relobj::do_get_global_symbol_counts): New function.
16068 (Input_objects::add_object): Add object to cross-referencer.
16069 (Input_objects::archive_start): New function.
16070 (Input_objects::archive_stop): New function.
16071 (Input_objects::print_symbol_counts): New function.
16072 * object.h: Declare Cref and Archive.
16073 (Object::get_global_symbol_counts): New function.
16074 (Object::do_get_global_symbol_counts): New pure virtual function.
16075 (class Sized_relobj): Add defined_count_ field. Update
16076 declarations.
16077 (class Input_objects): Add cref_ field. Update constructor.
16078 Update declarations.
16079 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16080 defined_count_.
16081 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16082 symbol counts.
16083 (Sized_dynobj::do_get_global_symbol_counts): New function.
16084 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16085 defined_count_. Update declarations. Define Symbols typedef.
16086 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16087 parameter. Change all callers.
16088 (Symbol_table::add_from_dynobj): Add sympointers and defined
16089 parameters. Change all callers.
16090 * symtab.h (class Symbol_table): Update declarations.
16091 * Makefile.am (CCFILES): Add cref.cc.
16092 (HFILES): Add cref.h.
16093 * Makefile.in: Rebuild.
16094
3f7c5e1d
CD
160952008-07-22 Simon Baldwin <simonb@google.com>
16096
16097 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16098 to zero when writing undefined symbols.
16099
e0b64032
ILT
161002008-07-22 Ian Lance Taylor <iant@google.com>
16101
16102 * output.cc (Output_section::add_input_section): Don't try to
16103 merge empty merge sections.
16104
096b02cf
CS
161052008-07-21 Craig Silverstein <csilvers@google.com>
16106
16107 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16108 Include symbol version in error message.
cd536b21 16109
1d1f116d
CD
161102008-07-20 Chris Demetriou <cgd@google.com>
16111
cd536b21 16112 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16113 (RANDOM_SEED_CFLAGS): New substituted variable.
16114 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16115 * configure: Rebuild.
16116 * Makefile.in: Likewise.
16117 * testsuite/Makefile.in: Likewise.
16118
a18f591e
ILT
161192008-07-18 Ian Lance Taylor <iant@google.com>
16120
16121 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16122 where we see NAME/NULL and NAME/VERSION as separate symbols.
16123 * testsuite/ver_test_main.cc (main): Call t4.
16124 (t4, t4_2a): Define.
16125 * testsuite/ver_test_2.cc (t4_2): Define.
16126 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16127 * testsuite/ver_test_4.cc (t4_2a): Define.
16128 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16129 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16130
c6e3f6ed
ILT
161312008-07-17 Ian Lance Taylor <iant@google.com>
16132
16133 * dynobj.cc (Versions::add_def): If we give an error about a
16134 missing version, go ahead and create the version anyhow.
16135
ef9beddf
ILT
161362008-07-10 Ian Lance Taylor <iant@google.com>
16137
16138 Handle output sections with more than 0x7fffffff bytes.
16139 * object.h (class Relobj): Change map_to_output_ to
16140 output_sections_, and just keep a section pointer. Change all
16141 uses. Move comdat group support to Sized_relobj.
16142 (Relobj::is_section_specially_mapped): Remove.
16143 (Relobj::output_section): Remove poff parameter. Change all
16144 callers.
16145 (Relobj::output_section_offset): New function.
16146 (Relobj::set_section_offset): Rewrite.
16147 (Relobj::map_to_output): Remove.
16148 (Relobj::output_sections): New function.
16149 (Relobj::do_output_section_offset): New pure virtual function.
16150 (Relobj::do_set_section_offset): Likewise.
16151 (class Sized_relobj): Add section_offsets_ field. Add comdat
16152 group support from Relobj. Update declarations.
16153 (Sized_relobj::get_output_section_offset): New function.
16154 (Sized_relobj::do_output_section_offset): New function.
16155 (Sized_relobj::do_set_section_offset): New function.
16156 * object.cc (Relobj::output_section_address): Remove.
16157 (Sized_relobj::Sized_relobj): Initialize new fields.
16158 (Sized_relobj::include_section_group): Cast find_kept_object to
16159 Sized_relobj.
16160 (Sized_relobj::include_linkonce_section): Likewise.
16161 (Sized_relobj::do_layout): Use separate arrays for output section
16162 and output offset.
16163 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16164 output_sections.
16165 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16166 output_sections and section_offsets.
16167 (Sized_relobj::write_local_symbols): Likewise.
16168 (map_to_kept_section): Compute output address directly.
16169 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16170 output_sections and section_offsets.
16171 (Sized_relobj::write_sections): Likewise.
16172 (Sized_relobj::relocate_sections): Likewise.
16173 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16174 * output.h (class Output_reloc): Update declarations. Change
16175 u2_.relobj to Sized_relobj*.
16176 (class Output_data_reloc): Change add functions to use
16177 Sized_relobj*.
16178 * output.cc (Output_reloc::Output_reloc): Change relobj to
16179 Sized_relobj*.
16180 (Output_reloc::local_section_offset): Change return type to
16181 Elf_Addr. Use get_output_section_offset.
16182 (Output_reloc::get_address): Likewise.
16183 (Output_section::is_input_address_mapped): Don't call
16184 is_section_specially_mapped.
16185 (Output_section::output_offset): Likewise.
16186 (Output_section::output_address): Likewise.
16187 (Output_section::starting_output_address): Likewise.
16188 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16189 parameter to Sized_relobj*.
16190 (Copy_relocs::need_copy_reloc): Likewise.
16191 (Copy_relocs::save): Likewise.
16192 * copy-relocs.h (class Copy_relocs): Update declarations.
16193 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16194 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16195 * target-reloc.h (relocate_for_relocatable): Change
16196 offset_in_output_section type to Elf_Addr. Change code that uses
16197 it as well.
16198 * layout.cc (Layout::layout): Always set *off.
16199 * mapfile.cc (Mapfile::print_input_section): Use
16200 output_section_offset.
16201 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16202 Sized_relobj*.
16203 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16204 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16205 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16206
5cb66f97
ILT
162072008-07-03 Ian Lance Taylor <iant@google.com>
16208
16209 * layout.cc (Layout::include_section): Do not discard unrecognized
16210 SHT_STRTAB sections.
16211
afe47622
CS
162122008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16213
16214 * script.cc (Lex::can_continue_name): Make '?' allowable in
16215 version-script names.
16216 * testsuite/version_script.map: Change glob pattern to use '?'
16217
5adf9721
ILT
162182008-06-30 Manish Singh <yosh@gimp.org>
16219
16220 PR 6585
16221 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16222 Correct typo.
16223
e6fde208
ILT
162242008-06-30 Ian Lance Taylor <iant@google.com>
16225
16226 PR 6660
16227 PR 6682
16228 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16229 versions]: Don't try to read the value in the contents, since we
16230 don't use it. Use the template endianness when writing.
16231
3f2e6a2d
CC
162322008-06-25 Cary Coutant <ccoutant@google.com>
16233
16234 * fileread.cc (File_read::make_view): Assert on zero-length view.
16235 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16236 symbol table when there are no symbols to read.
16237
c43d3a48
CS
162382008-06-23 Craig Silverstein <csilvers@google.com>
16239
16240 * version.cc (version_string): Bump to 1.7
16241
5f494ea0
CS
162422008-06-18 Craig Silverstein <csilvers@google.com>
16243
16244 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16245 constant 0xFFFF to type Valtype.
16246 (Powerpc_relocate_functions::rel16_ha): Likewise.
16247
c42e122e
ILT
162482008-06-17 Ian Lance Taylor <iant@google.com>
16249
f34787f8
ILT
16250 * output.h (Output_section::Input_section): Initialize p2align_ to
16251 zero for Output_section_data constructors.
16252 (Output_section::Input_section::addralign): If not an input
16253 section, return the alignment of the Output_section_data.
16254 * testsuite/copy_test.cc: New file.
16255 * testsuite/copy_test_1.cc: New file.
16256 * testsuite/copy_test_2.cc: New file.
16257 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16258 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16259 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16260 (copy_test_1_pic.o, copy_test_1.so): New targets.
16261 (copy_test_2_pic.o, copy_test_2.so): New targets.
16262 * testsuite/Makefile.in: Rebuild.
16263
c42e122e
ILT
16264 * script-sections.cc (Script_sections::place_orphan): Initialize
16265 local variable exact.
16266
ce3ac18a
DE
162672008-06-13 David Edelsohn <edelsohn@gnu.org>
16268
16269 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16270
42cacb20
DE
162712008-06-12 David Edelsohn <edelsohn@gnu.org>
16272 David S. Miller <davem@davemloft.net>
16273
16274 * powerpc.cc: New file.
16275 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16276 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16277 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16278 * Makefile.in: Rebuild.
16279
7b308235
ILT
162802008-06-09 Ian Lance Taylor <iant@google.com>
16281
16282 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16283 <exception>.
16284 (throwing, orig_terminate): New static variables.
16285 (terminate_handler): New static function.
16286 (t2): Set terminate handler.
16287
f0b886e3
ILT
162882008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16289
16290 PR 6584
cd536b21 16291 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16292 alignment.
16293
3e90f135
CC
162942008-05-30 Cary Coutant <ccoutant@google.com>
16295
16296 * archive.cc (Archive::include_all_members) Correct to step
16297 over symbol table and extended name table in thin archives.
16298
e09ad04a
ILT
162992008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16300
16301 PR 6407
16302 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16303 calculation.
16304
62b01cb5
ILT
163052008-05-28 Caleb Howe <cshowe@google.com>
16306
16307 * reduced_debug_output.cc: New file.
16308 * reduced_debug_output.h: New file.
92de84a6 16309 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16310 * options.cc (General_options::finalize): Add strip_debug_non_line
16311 to the strip heirarchy.
16312 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16313 fields.
16314 * layout.cc: Include "reduced_debug_output.h".
16315 (Layout::Layout): Initialize new fields.
16316 (line_only_debug_sections): New static array.
16317 (is_lines_only_debug_sections): New static inline function.
16318 (Layout::include_section): Handle --strip-debug-non-line.
16319 (Layout::make_output_section): If --strip-debug-non-line, build
16320 new output sections for .debug_abbrev and .debug_info.
16321 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16322 gold. Warn about possible overflow.
16323 (read_signed_LEB_128): Likewise.
16324 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16325 (read_signed_LEB_128): Declare.
16326 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16327 (HFILES): Add reduced_debug_output.h.
16328 * Makefile.in: Rebuild.
16329
7d9e3d98
ILT
163302008-05-21 Ian Lance Taylor <iant@google.com>
16331
16332 * mapfile.cc: New file.
16333 * mapfile.h: New file.
16334 * options.h (class General_options): Add -M/--print-map and -Map.
16335 * options.cc (General_options::finalize): Make -M equivalent to
16336 -Map -.
16337 * main.cc: Include <cstdio> and "mapfile.h".
16338 (main): Open mapfile if requested.
16339 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16340 constructor. Change caller.
16341 (queue_initial_tasks): Add mapfile parameter. Change caller.
16342 (queue_middle_tasks): Likewise.
16343 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16344 declarations.
16345 * archive.cc: Include "mapfile.h".
16346 (Archive::add_symbols): Add mapfile parameter. Change all
16347 callers. Pass mapfile, symbol, and reason to include_member.
16348 (Archive::include_all_members): Add mapfile parameter. Change all
16349 callers.
16350 (Archive::include_member): Add mapfile, sym, and why parameters.
16351 Change all callers. Report inclusion to map file.
16352 * archive.h: Include "fileread.h".
16353 (class Archive): Update declarations.
16354 (Archive::file): New const method.
16355 (class Add_archive_symbols): Add mapfile_ field. Update
16356 constructor. Change all callers.
16357 * readsyms.h (class Read_symbols): Likewise.
16358 (class Finish_group): Likewise.
16359 (class Read_script): Likewise.
16360 * common.cc: Include "mapfile.h".
16361 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16362 all callers.
16363 (Symbol_table::do_allocate_commons): Likewise.
16364 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16365 symbol allocation to mapfile.
16366 * common.h (class Allocate_commons_task): Add mapfile_ field.
16367 Update constructor. Change all callers.
16368 * symtab.h (class Symbol_table): Update declarations.
16369 * layout.cc: Include "mapfile.h".
16370 (Layout_task_runner::run): Print information to mapfile.
16371 (Layout::create_gold_note): Change Output_data_fixed_space to
16372 Output_data_zero_fill.
16373 (Layout::create_build_id): Likewise.
16374 (Layout::print_to_mapfile): New function.
16375 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16376 constructor. Change caller.
16377 (class Layout): Declare print_to_mapfile.
16378 * output.cc (Output_section::Input_section::print_to_mapfile): New
16379 function.
16380 (Output_section::add_input_section): If producing a map, always
16381 add to input_sections_ list.
16382 (Output_section::do_print_to_mapfile): New function.
16383 (Output_segment::print_sections_to_mapfile): New function.
16384 (Output_segment::print_section_list_to_mapfile): New function.
16385 * output.h: Include "mapfile.h".
16386 (Output_data::print_to_mapfile): New function.
16387 (Output_data::do_print_to_mapfile): New virtual function.
16388 (Output_segment_headers::do_print_to_mapfile): New function.
16389 (Output_file_header::do_print_to_mapfile): New function.
16390 (Output_data_const::do_print_to_mapfile): New function.
16391 (class Output_data_const_buffer): Add map_name_ field. Update
16392 constructor. Change all callers. Add do_print_to_mapfile
16393 function.
16394 (class Output_data_fixed_space): Likewise.
16395 (class Output_data_space): Likewise.
16396 (class Output_data_zero_fill): New class.
16397 (Output_data_strtab::do_print_to_mapfile): New function.
16398 (Output_data_reloc_base::do_print_to_mapfile): New function.
16399 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16400 (Output_data_group::do_print_to_mapfile): New function.
16401 (Output_data_got::do_print_to_mapfile): New function.
16402 (Output_data_dynamic::do_print_to_mapfile): New function.
16403 (Output_symtab_xindex::do_print_to_mapfile): New function.
16404 (class Output_section): Declare do_print_to_mapflie. Declare
16405 print_to_mapfile in Input_section.
16406 (class Output_segment): Declare new functions.
16407 * object.h (Sized_relobj::symbol_count): New function.
16408 * script-sections.cc
16409 (Output_section_element_dot_assignment::set_section_addresses):
16410 Change Output_data_fixed_space to Output_data_zero_fill.
16411 (Output_data_expression::do_print_to_mapfile): New function.
16412 * script.cc (read_input_script): Add mapfile parameter. Change
16413 all callers.
16414 * script.h (read_input_script): Update declaration.
16415 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16416 (Eh_frame::do_print_to_mapfile): New function.
16417 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16418 (Output_merge_string::do_print_to_mapfile): New function.
16419 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16420 function.
16421 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16422 function.
16423 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16424 function.
16425 * Makefile.am (CCFILES): Add mapfile.cc.
16426 (HFILES): Add mapfile.h.
16427 * Makefile.in: Rebuild.
16428
9f1d377b
ILT
164292008-05-19 Ian Lance Taylor <iant@google.com>
16430
16431 * options.h (class General_options): Add -z relro.
16432 * layout.cc (Layout::Layout): Initialize relro_segment_.
16433 (Layout::add_output_section_data): Return the output section.
16434 (Layout::make_output_section): Rcognize relro sections and mark
16435 them appropriately.
16436 (Layout::attach_allocated_section_to_segment): Put relro sections
16437 in a PT_GNU_RELRO segment.
16438 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16439 section as relro.
16440 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16441 PT_TLS segments.
16442 (Layout::linkonce_mapping): Map d.rel.ro.local to
16443 .data.rel.ro.local.
16444 (Layout::output_section_name): Us .data.rel.ro.local for any
16445 section which begins with that.
16446 * layout.h (class Layout): Update add_output_section_data
16447 declaration. Add relro_segment_ field.
16448 * output.cc (Output_section::Output_section): Initialize is_relro_
16449 and is_relro_local_ fields.
16450 (Output_segment::add_output_section): Group relro sections.
16451 (Output_segment::is_first_section_relro): New function.
16452 (Output_segment::maximum_alignment): If there is a relro section,
16453 align the segment to the common page size.
16454 (Output_segment::set_section_addresses): Track whether we are
16455 looking at relro sections. If the last section is a relro
16456 section, align to the common page size.
16457 (Output_segment::set_section_list_addresses): Add in_relro
16458 parameter. Change all callers. Align to the page size when
16459 moving from relro to non-relro section.
16460 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16461 segment.
16462 * output.h (class Output_section): Add is_relro_ and
16463 is_relro_local_ fields.
16464 (Output_section::is_relro): New function.
16465 (Output_section::set_is_relro): New function.
16466 (Output_section::is_relro_local): New function.
16467 (Output_section::set_is_relro_local): New function.
16468 (class Output_segment): Update declarations.
16469 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16470 * sparc.cc (Target_sparc::got_section): Likewise.
16471 * x86_64.cc (Target_x86_64::got_section): Likewise.
16472 * testsuite/relro_test_main.cc: New file.
16473 * testsuite/relro_test.cc: New file.
16474 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16475 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16476 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16477 (relro_test.so, relro_test_pic.o): New targets.
16478 * testsuite/Makefile.in: Rebuild.
16479
a984ee1d
ILT
164802008-05-16 Ian Lance Taylor <iant@google.com>
16481
01676dcd
ILT
16482 * output.cc (Output_segment::add_output_section): Remove front
16483 parameter.
16484 * output.h (class Output_segment): Remove
16485 add_initial_output_section and overloaded add_output_section.
16486 Update declaration of remaining add_output_section.
16487 * layout.cc (Layout::create_interp): Call add_output_section
16488 rather than add_initial_output_section.
16489 (Layout::finish_dynamic_section): Likewise.
16490
497897f9
ILT
16491 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16492 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16493 know the dynamic type.
16494 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16495 field. Initialize it in constructor.
16496 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16497 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16498 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16499 reloc.
16500
a984ee1d
ILT
16501 * output.cc (Output_reloc::get_address): Change return type to
16502 Elf_Addr.
16503 * output.h (class Output_reloc): Update get_address declaration.
16504 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16505 for section addresses.
16506
55ba0940
ILT
165072008-05-09 Ian Lance Taylor <iant@google.com>
16508
16509 PR 6493
16510 * gold.cc (gold_nomem): Use return value of write.
16511
75517b77
ILT
165122008-05-08 Ian Lance Taylor <iant@google.com>
16513
16514 * symtab.c (Symbol::init_base_output_data): Add version
16515 parameter. Change all callers.
16516 (Symbol::init_base_output_segment): Likewise.
16517 (Symbol::init_base_constant): Likewise.
16518 (Symbol::init_base_undefined): Likewise.
16519 (Sized_symbol::init_output_data): Likewise.
16520 (Sized_symbol::init_output_segment): Likewise.
16521 (Sized_symbol::init_constant): Likewise.
16522 (Sized_symbol::init_undefined): Likewise.
16523 (Symbol_table::do_define_in_output_data): If the new symbol has a
16524 version, mark it as the default.
16525 (Symbol_table::do_define_in_output_segment): Likewise.
16526 (Symbol_table::do_define_as_constant): Likewise.
16527 * symtab.h (class Symbol): Update declarations.
16528 (class Sized_symbol): Likewise.
16529 * resolve.cc (Symbol::override_version): New function.
c42e122e 16530 (Symbol::override_base): Call override_version.
75517b77
ILT
16531 (Symbol::override_base_with_special): Likewise.
16532 * testsuite/ver_script_8.script: New file.
16533 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16534 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16535 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16536 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16537
f1f70eae
ILT
165382008-05-06 Ian Lance Taylor <iant@google.com>
16539
f3e9c5c5
ILT
16540 PR 6049
16541 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16542 functions.
16543 (class General_options): Remove existing --undefined, and add
16544 --no-undefined instead. Add new --undefined as synonym for -u.
16545 * archive.cc (Archive::add_symbols): Check whether symbol was
16546 named with -u.
16547 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16548 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16549 all uses. Add IS_UNDEFINED. Update declarations to split
16550 different versions of init_base. Declare init_base_undefined.
16551 (Symbol::is_defined): Handle IS_UNDEFINED.
16552 (Symbol::is_undefined): Likewise.
16553 (Symbol::is_weak_undefined): Call is_undefined.
16554 (Symbol::is_absolute): Handle IS_CONSTANT.
16555 (class Sized_symbol): Update declarations to split different
16556 versions of init. Declare init_undefined.
16557 (class Symbol_table): Declare new functions.
16558 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16559 Change all callers.
16560 (Symbol::init_base_output_data): Likewise.
16561 (Symbol::init_base_output_segment): Likewise.
16562 (Symbol::init_base_constant): Likewise.
16563 (Symbol::init_base_undefined): New function.
16564 (Sized_symbol::init_object): Rename from init. Change all
16565 callers.
16566 (Sized_symbol::init_output_data): Likewise.
16567 (Sized_symbol::init_output_segment): Likewise.
16568 (Sized_symbol::init_constant): Likewise.
16569 (Sized_symbol::init_undefined): New function.
16570 (Symbol_table::add_undefined_symbols_from_command_line): New
16571 function.
16572 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16573 function.
16574 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16575 (Symbol::output_section): Likewise.
16576 (Symbol::set_output_section): Likewise.
16577 (Symbol_table::sized_finalize_symbol): Likewise.
16578 (Symbol_table::sized_write_globals): Likewise.
16579 * resolve.cc (Symbol_table::should_override): Likewise.
16580 (Symbol::override_base_with_special): Likewise.
16581
8bdcdf2c
ILT
16582 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16583 symbol, change it to have default visibility.
16584 * testsuite/protected_1.cc: New file.
16585 * testsuite/protected_2.cc: New file.
16586 * testsuite/protected_3.cc: New file.
16587 * testsuite/protected_main_1.cc: New file.
16588 * testsuite/protected_main_2.cc: New file.
16589 * testsuite/protected_main_3.cc: New file.
16590 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16591 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16592 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16593 (protected_1.so): New target.
16594 (protected_1_pic.o, protected_2_pic.o): New targets.
16595 (protected_3_pic.o): New target.
16596 (check_PROGRAMS): Add protected_2.
16597 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16598 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16599 * testsuite/Makefile.in: Rebuild.
16600
2b706932
ILT
16601 * options.h (DEFINE_var): Add set_user_set_##varname__.
16602 (DEFINE_bool_alias): New macro.
16603 (class General_options): Define -Bstatic using DEFINE_bool_alias
16604 rather than DEFINE_special. Add --undefined as an alias for -z
16605 defs.
16606 * options.cc (General_options::parse_Bstatic): Remove.
16607
d82a5bcc
ILT
16608 * options.h (class General_options): Add --fatal-warnings.
16609 * main.cc (main): Implement --fatal-warnings.
16610 * errors.h (Errors::warning_count): New function.
16611
f1f70eae
ILT
16612 * options.h (class General_options): Add -Bsymbolic-functions.
16613 * symtab.h (Symbol::is_preemptible): Check for
16614 -Bsymbolic-functions.
16615
8825ac63
ILT
166162008-05-05 Ian Lance Taylor <iant@google.com>
16617
d98bc257
ILT
16618 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16619 as noVARNAME rather than no-VARNAME.
16620 (class General_options): Add option -z combreloc.
16621 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16622 get_address.
16623 (Output_reloc::sort_before) [SHT_REL]: New function.
16624 (Output_reloc::sort_before) [SHT_RELA]: New function.
16625 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16626 Sort_relocs_comparison.
16627 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16628 parameter. Change all callers.
16629 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16630 sort_relocs parameter. Change all callers.
16631 * output.cc (Output_reloc::get_address): New function, broken out
16632 of write_rel.
16633 (Output_reloc::write_rel): Call it.
16634 (Output_reloc::compare): New function.
16635 (Output_data_reloc_base::do_write): Optionally sort relocs.
16636
60b2b4e7
ILT
16637 * configure.ac: If targ_extra_obj is set, link it in.
16638 * configure.tgt: Initialize all variables.
16639 (x86_64*): Set targ_extra_obj and targ_extra_size.
16640 * configure: Rebuild.
16641
8825ac63
ILT
16642 * object.cc (Sized_relobj::include_section_group): Adjust section
16643 indexes read from group data. Build vector to pass to
16644 layout_group.
16645 * layout.cc (Layout::layout_group): Add flags and shndxes
16646 parameters. Remove contents parameter. Change caller. Update
16647 explicit instantiations.
16648 * layout.h (class Layout): Update layout_group declaration.
16649 * output.cc (Output_data_group::Output_data_group): Add flags and
16650 input_shndxes parameters. Remove contents parameter. Change
16651 caller.
16652 (Output_data_group::do_write): Change input_sections_ to
16653 input_shndxes_.
16654 * output.h (class Output_data_group): Update constructor
16655 declaration. Rename input_sections_ to input_shndxes_.
16656 * testsuite/many_sections_test.cc: Add template.
16657
e94cf127
CC
166582008-04-30 Cary Coutant <ccoutant@google.com>
16659
4418b2d5
CC
16660 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16661
e94cf127
CC
16662 * layout.cc (Layout::include_section): Refactored check for debug
16663 info section.
16664 (Layout::add_comdat): Add new parameters. Change type
16665 of signature parameter. Add object and shndx to signatures table.
16666 (Layout::find_kept_object): New function.
16667 * layout.h: Include <cstring>.
16668 (Layout::is_debug_info_section): New function.
16669 (Layout::add_comdat): Add new parameters.
16670 (Layout::find_kept_object): New function.
16671 (Layout::Kept_section): New struct.
16672 (Layout::Signatures): Change type of map range.
16673 * object.cc (Relobj::output_section_address): New function.
16674 (Sized_relobj::include_section_group): Add new parameters. Change
16675 calls to Layout::add_comdat. Change to build table of kept comdat
16676 groups and table mapping discarded sections to kept sections.
16677 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16678 (Sized_relobj::do_layout): Change calls to include_section_group and
16679 include_linkonce_section.
16680 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16681 value to zero when section is discarded.
16682 (Sized_relobj::map_to_kept_section): New function.
16683 * object.h (Relobj::output_section_address): New function.
16684 (Relobj::Comdat_group): New type.
16685 (Relobj::find_comdat_group): New function.
16686 (Relobj::Comdat_group_table): New type.
16687 (Relobj::Kept_comdat_section): New type.
16688 (Relobj::Kept_comdat_section_table): New type.
16689 (Relobj::add_comdat_group): New function.
16690 (Relobj::set_kept_comdat_section): New function.
16691 (Relobj::get_kept_comdat_section): New function.
16692 (Relobj::comdat_groups_): New field.
16693 (Relobj::kept_comdat_sections_): New field.
16694 (Symbol_value::input_value): Update comment.
16695 (Sized_relobj::map_to_kept_section) New function.
16696 (Sized_relobj::include_linkonce_section): Add new parameter.
16697 * target-reloc.h (Comdat_behavior): New type.
16698 (get_comdat_behavior): New function.
16699 (relocate_section): Add code to map a discarded section to the
16700 corresponding kept section when applying a relocation.
16701
e4e5049b
CS
167022008-04-30 Craig Silverstein <csilvers@google.com>
16703
16704 * dwarf_reader.cc (next_generation_count): New static var.
16705 (Addr2line_cache_entry): New struct.
16706 (addr2line_cache): New static var.
16707 (Dwarf_line_info::one_addr2line): Added caching.
16708 (Dwarf_line_info::clear_addr2line_cache): New function.
16709 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16710 cache-size parameter.
16711 (Dwarf_line_info::one_addr2line_cache): New function.
16712 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16713 new cache-size argument to one_addr2line(), and clear cache.
16714
d09e9154
CC
167152008-04-28 Cary Coutant <ccoutant@google.com>
16716
16717 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16718 R_386_PC8 relocations.
16719
7ef73768
ILT
167202008-04-23 Ian Lance Taylor <iant@google.com>
16721
55438702
ILT
16722 * object.cc (Sized_relobj::include_section_group): Check for
16723 invalid section group.
16724
c165fb93
ILT
16725 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16726 header size.
16727
7ef73768
ILT
16728 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16729 than read for file header.
16730 * archive.cc (Archive::include_member): Likewise.
16731
6194aaab
L
167322008-04-23 Paolo Bonzini <bonzini@gnu.org>
16733
16734 * aclocal.m4: Regenerate.
16735 * configure: Regenerate.
16736
d491d34e
ILT
167372008-04-19 Ian Lance Taylor <iant@google.com>
16738
5ea2bac6
ILT
16739 * version.cc (version_string): Bump to 1.6.
16740
7bc3e21a
ILT
16741 * testsuite/Makefile.am (many_sections_r_test): New target.
16742 (many_sections_r_test_SOURCES): Remove.
16743 (many_sections_r_test_DEPENDENCIES): Remove.
16744 (many_sections_r_test_LDFLAGS): Remove.
16745 (many_sections_r_test_LDADD): Remove.
16746
7fcd3aa9
ILT
16747 * object.cc (Sized_relobj::do_add_symbols): Always pass
16748 local_symbol_count_ to add_from_relobj.
16749
4c94d6ae
ILT
16750 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16751 every thousand variables.
16752 * testsuite/Makefile.in: Rebuild.
16753
d491d34e
ILT
16754 * object.cc (Xindex::initialize_symtab_xindex): New function.
16755 (Xindex::read_symtab_xindex): New function.
16756 (Xindex::sym_xindex_to_shndx): New function.
16757 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16758 available.
16759 (Sized_relobj::do_initialize_xindex): New function.
16760 (Sized_relobj::do_read_symbols): Adjust section links.
16761 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16762 parameter. Change all callers.
16763 (Sized_relobj::include_section_group): Adjust section links and
16764 symbol section indexes.
16765 (Sized_relobj::do_layout): Adjust section links.
16766 (Sized_relobj::do_count_local_symbols): Adjust section links and
16767 symbol section indexes.
16768 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16769 ordinary and special symbols.
16770 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16771 dynsym_xindex parameters. Change all callers. Adjust section
16772 links. Use SHN_XINDEX when needed.
16773 (Sized_relobj::get_symbol_location_info): Adjust section links.
16774 Don't get fooled by special symbols.
16775 * object.h (class Xindex): Define.
16776 (class Object): Add xindex_ parameter. Declare virtual functoin
16777 do_initialize_xindex.
16778 (Object::adjust_sym_shndx): New function.
16779 (Object::set_xindex): New protected function.
16780 (class Symbol_value): Add is_ordinary_shndx_ field.
16781 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16782 (Symbol_value::value): Assert ordinary section.
16783 (Symbol_value::initialize_input_to_output_map): Likewise.
16784 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16785 Change all callers.
16786 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16787 all callers.
16788 (class Sized_relobj): Update declarations.
16789 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16790 parameter. Change all callers.
16791 (Sized_relobj::adjust_shndx): New function.
16792 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16793 field.
16794 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16795 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16796 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16797 (Sized_dynobj::read_dynsym_section): Adjust section links.
16798 (Sized_dynobj::read_dynamic): Likewise.
16799 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16800 section links.
16801 (Sized_dynobj::do_initialize_xindex): New function.
16802 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16803 do_initialize_xindex.
16804 (Sized_dynobj::adjust_shndx): New function.
16805 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16806 dynsym_xindex_ fields.
16807 (Layout::finalize): Add a call to set_section_indexes before
16808 creating the symtab sections.
16809 (Layout::set_section_indexes): Don't do anything if the section
16810 already has a section index.
16811 (Layout::create_symtab_sections): Add shnum parameter. Change
16812 caller. Create .symtab_shndx section if needed.
16813 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16814 caller.
16815 (Layout::allocated_output_section_count): New function.
16816 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16817 needed.
16818 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16819 fields. Update declarations.
16820 (Layout::symtab_xindex): New function.
16821 (Layout::dynsym_xindex): New function.
16822 (class Write_symbols_task): Add layout_ field.
16823 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16824 Change caller.
16825 * output.cc (Output_section_headers::Output_section_headers): Add
16826 shstrtab_section parameter. Change all callers.
16827 (Output_section_headers::do_sized_write): Store overflow values
16828 for section count and section string table section index in
16829 section header zero.
16830 (Output_file_header::do_sized_write): Check for overflow of
16831 section count and section string table section index.
16832 (Output_symtab_xindex::do_write): New function.
16833 (Output_symtab_xindex::endian_do_write): New function.
16834 * output.h (class Output_section_headers): Add shstrtab_section_.
16835 Update declarations.
16836 (class Output_symtab_xindex): Define.
16837 (Output_section::has_out_shndx): New function.
16838 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16839 field.
16840 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16841 Change all callers.
16842 (Sized_symbol::init): Likewise.
16843 (Symbol::output_section): Check for ordinary symbol.
16844 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16845 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16846 callers.
16847 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16848 Change all callers. Simplify handling of symbols from sections
16849 not included in the link.
16850 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16851 distinction.
16852 (Weak_alias_sorter::operator()): Assert that symbols are
16853 ordinary.
16854 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16855 distinction.
16856 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16857 parameters. Change all callers.
16858 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16859 symbol distinction. Use SHN_XINDEX when needed.
16860 (Symbol_table::write_section_symbol): Add symtab_xindex
16861 parameter. Change all callers.
16862 (Symbol_table::sized_write_section_symbol): Likewise. Use
16863 SHN_XINDEX when needed.
16864 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16865 declarations.
16866 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16867 (Symbol::is_defined): Check is_ordinary.
16868 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16869 (Symbol::is_absolute, Symbol::is_common): Likewise.
16870 (class Sized_symbol): Update declarations.
16871 (class Symbol_table): Update declarations.
16872 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16873 parameters. Change all callers.
16874 (Sized_symbol::override): Likewise.
16875 (Symbol_table::override): Likewise.
16876 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16877 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16878 is_ordinary, and orig_st_shndx parameters. Change all callers.
16879 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16880 to be in an ordinary section.
16881 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16882 object and is_ordinary parameters. Change all callers.
16883 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16884 Change all callers. Don't add undefined or non-ordinary symbols
16885 to reloc_map_.
16886 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16887 Change all callers.
16888 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16889 declarations.
16890 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16891 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16892 (Sized_relobj::relocate_sections): Likewise.
16893 * target-reloc.h (scan_relocs): Adjust section symbol index.
16894 (scan_relocatable_relocs): Likewise.
16895 * i386.cc (Scan::local): Check for ordinary symbols.
16896 * sparc.cc (Scan::local): Likewise.
16897 * x86_64.cc (Scan::local): Likewise.
16898 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16899 to symbol_section_and_value.
16900 * testsuite/many_sections_test.cc: New file.
16901 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16902 (check_PROGRAMS): Add many_sections_test.
16903 (many_sections_test_SOURCES): Define.
16904 (many_sections_test_DEPENDENCIES): Define.
16905 (many_sections_test_LDFLAGS): Define.
16906 (BUILT_SOURCES): Add many_sections_define.h.
16907 (many_sections_define.h): New target.
16908 (BUILT_SOURCES): Add many_sections_check.h.
16909 (many_sections_check.h): New target.
16910 (check_PROGRAMS): Add many_sections_r_test.
16911 (many_sections_r_test_SOURCES): Define.
16912 (many_sections_r_test_DEPENDENCIES): Define.
16913 (many_sections_r_test_LDFLAGS): Define.
16914 (many_sections_r_test_LDADD): Define.
16915 (many_sections_r_test.o): New target.
16916 * testsuite/Makefile.in: Rebuild.
16917
c5818ff1
CC
169182008-04-17 Cary Coutant <ccoutant@google.com>
16919
16920 * errors.cc (Errors::info): New function.
16921 (gold_info): New function.
16922 * errors.h (Errors::info): New function.
16923 * gold.h (gold_info): New function.
16924 * object.cc (Input_objects::add_object): Print trace output.
16925 * options.cc (options::parse_set): New function.
16926 (General_options::parse_wrap): Deleted.
16927 (General_options::General_options): Deleted initializer.
16928 * options.h (options::String_set): New typedef.
16929 (options::parse_set): New function.
16930 (DEFINE_set): New macro.
16931 (General_options::wrap): Changed to use DEFINE_set. Changed
16932 callers of any_wrap_symbols and is_wrap_symbol.
16933 (General_options::trace, General_options::trace_symbol):
16934 New options.
16935 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16936 (General_options::wrap_symbols_): Deleted.
16937 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16938
b5be4a7c
DM
169392008-04-17 David S. Miller <davem@davemloft.net>
16940
16941 * options.cc (General_options::parse_V): New function.
16942 * options.h: Add entries for -V and -Qy.
16943
155a0dd7
ILT
169442008-04-17 Ian Lance Taylor <iant@google.com>
16945
16946 * common.cc (Symbol_table::allocate_commons): Remove options
16947 parameter. Change caller.
16948 (Symbol_table::do_allocate_commons): Remove options parameter.
16949 Change caller. Just call do_allocate_commons_list twice.
16950 (Symbol_table::do_allocate_commons_list): New function, broken out
16951 of do_allocate_commons.
16952 * common.h (class Allocate_commons_task): Remove options_ field.
16953 Update constructor.
16954 * symtab.cc (Symbol_table::Symbol_table): Initialize
16955 tls_commons_.
16956 (Symbol_table::add_from_object): Put TLS common symbols on
16957 tls_commons_ list.
16958 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16959 which are IN_OUTPUT_DATA.
16960 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16961 allocate_commons and do_allocate_commons declarations. Declare
16962 do_allocate_commons_list.
16963 * gold.cc (queue_middle_tasks): Update creation of
16964 Allocate_commons_task to not pass options.
16965 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16966 (TLS_TEST_C_FLAGS): New variable.
16967 (tls_test_c_pic.o): New target.
16968 (tls_test_shared.so): Link in tls_test_c_pic.o.
16969 (tls_test_c_pic_ie.o): New target.
16970 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16971 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16972 (tls_test_c.o): New target.
16973 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16974 (tls_pic_test_LDADD): Likewise.
16975 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16976 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16977 (tls_test_c_gnu2.o): New target.
16978 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16979 tls_test_c_gnu2.o.
16980 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16981 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16982 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16983 * testsuite/tls_test.cc: Include "config.h".
16984 (t_last): Call t11_last.
16985 * testsuite/tls_test.h (t11, t11_last): Declare.
16986 * testsuite/tls_test_c.c: New file.
16987 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16988 * configure.ac: Check for OpenMP support.
16989 * configure, config.in, Makefile.in: Rebuild.
16990 * testsuite/Makefile.in: Rebuild.
16991
edfbb029
CC
169922008-04-16 Cary Coutant <ccoutant@google.com>
16993
16994 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16995 (Target_i386::tls_base_symbol_defined_): New field.
16996 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16997 (Target_i386::Scan::global): Likewise.
16998 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16999 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
17000 (Target_x86_64::tls_base_symbol_defined_): New field.
17001 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
17002 (Target_x86_64::Scan::global): Likewise.
17003
f3c69fca
CC
170042008-04-16 Cary Coutant <ccoutant@google.com>
17005
17006 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
17007 (Symbol::needs_plt_entry): Allow weak undefined symbols.
17008 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17009 building shared libraries.
17010 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17011 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17012 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17013 * testsuite/Makefile.in: Rebuild.
17014 * testsuite/weak_undef.h: New file.
17015 * testsuite/weak_undef_file1.cc: Add extra test cases.
17016 * testsuite/weak_undef_file2.cc: Likewise.
17017 * testsuite/weak_undef_test.cc: Likewise.
17018
7c414435
DM
170192008-04-16 David S. Miller <davem@davemloft.net>
17020
32b769e1
DM
17021 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17022 Add issued_non_pic_error_ field. Declare check_non_pic.
17023 (Target_sparc::Scan::check_non_pic): New function.
17024 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17025 (Target_sparc::Scan::global): Likewise.
17026
11936fb1
DM
17027 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17028 * configure: Rebuild.
17029
7c414435
DM
17030 * options.h (DEFINE_enable): New macro.
17031 (new_dtags): New enable option.
17032 (initfirst, interpose, loadfltr, nodefaultlib,
17033 nodelete, nodlopen, nodump): New -z options.
17034 * layout.cc (Layout:finish_dynamic_section): If new
17035 dtags enabled, emit DT_RUNPATH. Also, emit a
17036 DT_FLAGS_1 containing any specified -z flags.
17037
85c7bf8b
ILT
170382008-04-16 Ian Lance Taylor <iant@google.com>
17039
12c0daef
ILT
17040 * copy-relocs.cc: New file.
17041 * copy-relocs.h: New file.
17042 * reloc.cc: Remove Copy_relocs code.
17043 * reloc.h: Likewise.
17044 * reloc-types.h (struct Reloc_types) [both versions]: Add
17045 get_reloc_addend_noerror.
17046 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17047 variants of add_global which take an addend which must be zero.
17048 * i386.cc: Include "copy-relocs.h".
17049 (class Target_i386): Change type of copy_relocs_ to variable,
17050 update initializer.
17051 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17052 Change all callers.
17053 (Target_i386::do_finalize_sections): Change handling of
17054 copy_relocs_.
17055 * sparc.cc: Include "copy-relocs.h".
17056 (class Target_sparc): Change type of copy_relocs_ to variable,
17057 update initializer.
17058 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17059 Change all callers.
17060 (Target_sparc::do_finalize_sections): Change handling of
17061 copy_relocs_.
17062 * x86_64.cc: Include "copy-relocs.h".
17063 (class Target_x86_64): Change type of copy_relocs_ to variable,
17064 update initializer.
17065 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17066 class. Change all callers.
17067 (Target_x86_64::do_finalize_sections): Change handling of
17068 copy_relocs_.
17069 * Makefile.am (CCFILES): Add copy-relocs.cc.
17070 (HFILES): Add copy-relocs.h.
17071
4f4995b6
ILT
17072 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17073
85c7bf8b
ILT
17074 * testsuite/script_test_4.sh: Permit leading zeroes.
17075
4f2a9edd
ILT
170762008-04-15 Ian Lance Taylor <iant@google.com>
17077
e6188289
ILT
17078 * script-sections.cc (Script_sections::create_segments): Use
17079 header_size_adjustment even when there is enough room for the
17080 headers.
17081 * testsuite/script_test_4.sh: New file.
17082 * testsuite/script_test_4.t: New file.
17083 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17084 (check_DATA): Add script_test_4.stdout.
17085 (MOSTLYCLEANFILES): Likewise.
17086 (script_test_4): New target.
17087 (script_test_4.stdout): New target.
17088 * testsuite/Makefile.in: Rebuild.
17089
4f2a9edd
ILT
17090 * sparc.cc: Add definitions for Output_data_plt_sparc class
17091 constants.
17092
f5314dd5
DM
170932008-04-14 David S. Miller <davem@davemloft.net>
17094
17095 * sparc.cc: New file.
17096 * Makefile.am (TARGETSOURCES): Add sparc.cc
17097 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17098 * configure.tgt: Document targ_extra_size and
17099 targ_extra_big_endian. Add entries for sparc-* and
17100 sparc64-*.
17101 * configure.ac: Handle targ_extra_size and
17102 targ_extra_big_endian.
17103 * Makefile.in: Rebuild.
17104 * configure: Likewise.
17105 * po/POTFILES.in: Likewise.
17106 * po/gold.pot: Likewise.
17107
154e0e9a
ILT
171082008-04-14 Ian Lance Taylor <iant@google.com>
17109
17110 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17111 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17112 in the name/type/flags to section mapping. Don't call
17113 allocate_output_section.
17114 (Layout::choose_output_section): Change parameter from adjust_name
17115 to is_input_section. Don't permit input sections after sections
17116 are attached to segments. Don't call allocate_output_section.
17117 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17118 not write_enable_output_section.
17119 (Layout::make_output_section): Don't push to
17120 unattached_section_list_ nor call attach_to_segment. Call
17121 attach_section_to_segment if sections are attached.
17122 (Layout::attach_sections_to_segments): New function.
17123 (Layout::attach_section_to_segment): New function.
17124 (Layout::attach_allocated_section_to_segment): Rename from
17125 attach_to_segment. Remove flags parameter.
17126 (Layout::allocate_output_section): Remove function.
17127 (Layout::write_enable_output_section): Remove function.
17128 * layout.h (class Layout): Update for above changes. Add new
17129 field sections_are_attached_.
17130 * output.h (Output_section::update_flags_for_input_section): New
17131 function.
17132 * output.cc (Output_section::add_input_section): Call
17133 update_flags_for_input_section.
17134 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17135
009a67a2
CC
171362008-04-11 Cary Coutant <ccoutant@google.com>
17137
17138 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17139 thought unnecessary.
17140 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17141
759b1a24
ILT
171422008-04-11 Ian Lance Taylor <iant@google.com>
17143
17144 * output.h (class Output_section_data): Remove inline definition
17145 of set_addralign.
17146 * output.cc (Output_section_data::set_addralign): New function.
17147
c2b45e22
CC
171482008-04-11 Cary Coutant <ccoutant@google.com>
17149
17150 Add support for TLS descriptors for i386 and x86_64.
17151 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17152 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17153 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17154 GOT_TYPE_TLS_DESC.
17155 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17156 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17157 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17158 relocations.
17159 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17160 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17161 Fix problem with initial-exec relocations.
17162 (Target_i386::Relocate::relocate_tls): Likewise.
17163 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17164 relaxation.
17165 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17166 support for section-plus-offset dynamic table entries.
17167 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17168 (Output_data_dynamic::Dynamic_entry): Add support for
17169 section-plus-offset dynamic table entries.
17170 (Output_data_dynamic::Classification): Likewise.
17171 (Output_data_dynamic::classification_): Renamed offset_.
17172 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17173 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17174 (Target_x86_64::make_plt_section): New function.
17175 (Target_x86_64::reserve_tlsdesc_entries): New function.
17176 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17177 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17178 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17179 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17180 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17181 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17182 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17183 add extra PLT entry for TLS descriptors.
17184 (Output_data_plt_x86_64::got_): New field.
17185 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17186 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17187 fields.
17188 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17189 descriptors.
17190 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17191 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17192 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17193 R_386_TLS_DESC_CALL relocations.
17194 (Target_x86_64::Scan::global): Likewise.
17195 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17196 for TLS descriptors.
17197 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17198 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17199 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17200 GD-to-IE relaxation.
17201 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17202 and TLS_DESCRIPTORS.
17203 * Makefile.in: Rebuild.
17204 * configure: Rebuild.
17205 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17206 (tls_test_shared2.so): New target.
17207 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17208 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17209 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17210 (tls_shared_gd_to_ie_test_LDADD): New variable.
17211 (tls_shared_gnu2_gd_to_ie_test): New target.
17212 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17213 New targets.
17214 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17215 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17216 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17217 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17218 (tls_shared_gnu2_test): New target.
17219 (tls_test_gnu2_shared.so): New target.
17220 (tls_shared_gnu2_test_SOURCES): New variable.
17221 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17222 (tls_shared_gnu2_test_LDFLAGS): New variable.
17223 (tls_shared_gnu2_test_LDADD): New variable.
17224 * testsuite/Makefile.in: Rebuild.
17225 * testsuite/Makefile.
17226
83bfb6b7
ILT
172272008-04-11 Ian Lance Taylor <iant@google.com>
17228
17229 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17230 justsyms.t.
17231 * testsuite/Makefile.in: Rebuild.
17232
17233 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17234 long.
17235 * testsuite/script_test_2.cc (main): Adjust test.
17236
706e1f5e
ILT
172372008-04-11 David S. Miller <davem@davemloft.net>
17238 Ian Lance Taylor <iant@google.com>
17239
17240 * options.h (General_options): Add entries for '-Y' and
17241 '-relax'.
17242 * options.cc (General_options:finalize): If -Y was used, add those
17243 entries to the library path instead of the default "/lib" and
17244 "/usr/lib".
17245
7c98e6bb
DM
172462008-04-11 David S. Miller <davem@davemloft.net>
17247
17248 * testsuite/justsyms.t: Start at 0x100.
17249 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17250 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17251 long.
17252 * testsuite/script_test_2.cc: Adjust string and section length
17253 checks.
7c98e6bb 17254
99a37bfd
ILT
172552008-04-09 Ian Lance Taylor <iant@google.com>
17256
2cefc357
ILT
17257 PR gold/5996
17258 * script-sections.cc (Sections_element::allocate_to_segment): Add
17259 orphan parameter.
17260 (Output_section_definition::allocate_to_segment): Likewise.
17261 (Orphan_output_section::allocate_to_segment): Likewise.
17262 (Script_sections::attach_sections_using_phdrs_clause): Don't
17263 propagate non-PT_LOAD segments to orphan sections.
17264 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17265 readelf rather than objdump.
17266 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17267 .interp section and PT_INTERP segment are the same size.
17268 * testsuite/Makefile.in: Rebuild.
17269
99a37bfd
ILT
17270 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17271 aliases for symbols defined in the same object.
17272 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17273 (weak_alias_test_SOURCES): New variable.
17274 (weak_alias_test_DEPENDENCIES): New variable.
17275 (weak_alias_test_LDFLAGS): New variable.
17276 (weak_alias_test_LDADD): New variable.
17277 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17278 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17279 (weak_alias_test_3.o): New target.
17280 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17281 * testsuite/weak_alias_test_main.cc: New file.
17282 * testsuite/weak_alias_test_1.cc: New file.
17283 * testsuite/weak_alias_test_2.cc: New file.
17284 * testsuite/weak_alias_test_3.cc: New file.
17285
780e49c5
ILT
172862008-04-08 Ian Lance Taylor <iant@google.com>
17287
cdb0b8f5
ILT
17288 * options.h (class General_options): Add --noinhibit-exec option.
17289 * main.cc (main): Check --noinhibit-exec.
17290
0864d551
ILT
17291 * options.h (class General_options): Define --wrap as a special
17292 option. Add wrap_symbols_ field.
17293 (General_options::any_wrap_symbols): New function.
17294 (General_options::is_wrap_symbol): New function.
17295 * options.cc (General_options::parse_wrap): New function.
17296 (General_options::General_options): Initialize wrap_symbols_.
17297 * symtab.cc (Symbol_table::wrap_symbol): New function.
17298 (Symbol_table::add_from_object): Handle --wrap.
17299 * symtab.h (class Symbol_table): Declare wrap_symbol.
17300 * target.h (Target::wrap_char): New function.
17301 (Target::Target_info): Add wrap_char field.
17302 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17303 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17304 * testsuite/testfile.cc (Target_test::test_target_info):
17305 Likewise.
17306
789aa6de
ILT
17307 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17308 there is one.
17309
2c38906f
ILT
17310 * layout.h (class Layout): Add added_eh_frame_data_ field.
17311 * layout.cc (Layout::Layout): Initialize new field.
17312 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17313 output section until we find a section we merged successfully.
17314 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17315 that the size be non-zero.
17316
780e49c5
ILT
17317 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17318 qualifier.
17319
7fcd0256
ILT
173202008-04-08 Craig Silverstein <csilvers@google.com>
17321
17322 * configure.ac: Export new conditional variable HAVE_ZLIB.
17323 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17324 on HAVE_ZLIB.
17325 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17326 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17327
6835af53
ILT
173282008-04-07 Ian Lance Taylor <iant@google.com>
17329
e24f324c
ILT
17330 * version.cc (version_string): Set to "1.5".
17331
a036edd8
ILT
17332 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17333 Add issued_non_pic_error_ field. Declare check_non_pic.
17334 (Target_x86_64::Scan::check_non_pic): New function.
17335 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17336 (Target_x86_64::Scan::global): Likewise.
17337
624f8810
ILT
17338 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17339 addend parameter. Change caller. Handle merge sections.
17340 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17341 Address to Addend. Don't add in the result of
17342 local_section_offset, pass down the addend and use the returned
17343 value.
17344 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17345 Update declarations of local_section_offset and symbol_value.
17346 * testsuite/two_file_test_1.cc (t18): New function.
17347 * testsuite/two_file_test_2.cc (f18): New function.
17348 * testsuite/two_file_test_main.cc (main): Call t18.
17349 * testsuite/two_file_test.h (t18, f18): Declare.
17350
6835af53
ILT
17351 * configure.ac: Don't test for objdump, c++filt, or readelf.
17352 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17353 conditionals.
17354 (TEST_READELF): New variable.
17355 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17356 (check_PROGRAMS): Add two_file_strip_test.
17357 (two_file_strip_test): New target.
17358 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17359 (two_file_same_shared_strip_test_SOURCES): New variable.
17360 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17361 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17362 (two_file_same_shared_strip_test_LDADD): New variable.
17363 (two_file_shared_strip.so): New target.
17364 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17365 (ver_test_5.syms, ver_test_7.syms): Likewise.
17366 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17367 (strip_test_3.stdout): Use TEST_OBJDUMP.
17368 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17369
86925eef
CC
173702008-04-04 Cary Coutant <ccoutant@google.com>
17371
17372 * symtab.h (Symbol::is_weak_undefined): New function.
17373 (Symbol::is_strong_undefined): New function.
17374 (Symbol::is_absolute): New function.
17375 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17376 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17377 absolute symbols.
17378 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17379 (weak_undef_test): New target.
17380 * testsuite/Makefile.in: Rebuild.
17381 * testsuite/weak_undef_file1.cc: New file.
17382 * testsuite/weak_undef_file2.cc: New file.
17383 * testsuite/weak_undef_test.cc: New file.
17384
126f3ece
ILT
173852008-04-03 Craig Silverstein <csilvers@google.com>
17386
17387 * compressed_output.h (class Output_compressed_section): Use
17388 unsigned buffer.
17389 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17390 add zlib header.
17391 (zlib_compressed_suffix): Removed.
17392 (Output_compressed_section::set_final_data_size): Use unsigned
17393 buffers.
17394 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17395 Fix linker invocation.
17396 (flagstest_o_specialfile_and_compress_debug_sections):
17397 Likewise.
17398 * testsuite/Makefile.in: Regenerated.
17399
deae2a14
DM
174002008-04-02 David S. Miller <davem@davemloft.net>
17401
17402 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17403 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17404
70752818
ILT
174052008-04-02 Craig Silverstein <csilvers@google.com>
17406
17407 * TODO: New file.
17408
39d0cb0e
ILT
174092008-04-02 Ian Lance Taylor <iant@google.com>
17410
17411 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17412 parameters. Update for new key type to views_. Change all
17413 callers.
17414 (File_read::read): Adjust for byteshift in returned view.
17415 (File_read::add_view): New function, broken out of
17416 find_and_make_view.
17417 (File_read::make_view): New function, broken out of
17418 find_and_make_view.
17419 (File_read::find_or_make_view): Add offset and aligned
17420 parameters. Rewrite accordingly. Change all callers.
17421 (File_read::get_view): Add offset and aligned parameters. Adjust
17422 for byteshift in return value.
17423 (File_read::get_lasting_view): Likewise.
17424 * fileread.h (class File_read): Update declarations.
17425 (class File_read::View): Add byteshift_ field. Add byteshift to
17426 constructor. Add byteshift method.
17427 * archive.h (Archive::clear_uncached_views): New function.
17428 (Archive::get_view): Add aligned parameter. Change all callers.
17429 * object.h (Object::get_view): Add aligned parameter. Change all
17430 callers.
17431 (Object::get_lasting_view): Likewise.
17432
17433 * fileread.cc (File_read::release): Don't call clear_views if
17434 there are multiple objects.
17435 * fileread.h (File_read::clear_uncached_views): New function.
17436 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17437 on the archive.
17438
a1207466
CC
174392008-03-31 Cary Coutant <ccoutant@google.com>
17440
17441 Add thin archive support.
17442 * archive.cc (Archive::armagt): New const.
17443 (Archive::setup): Remove task parameter and calls to unlock.
17444 (Archive::unlock_nested_archives): New function.
17445 (Archive::read_header): Add nested_off parameter. Change
17446 all callers.
17447 (Archive::interpret_header): Likewise.
17448 (Archive::include_all_members): Change to handle thin
17449 archives.
17450 (Archive::include_member): Likewise.
17451 * archive.h (Archive::Archive): Add new parameters and
17452 initializers.
17453 (Archive::armagt): New const.
17454 (Archive::setup): Remove task parameter.
17455 (Archive::unlock_nested_archives): New function.
17456 (Archive::read_header): Add nested_off parameter.
17457 (Archive::interpret_header): Likewise.
17458 (Archive::Nested_archive_table): New typedef.
17459 (Archive::is_thin_archive_): New field.
17460 (Archive::nested_archives_): New field.
17461 (Archive::options_): New field.
17462 (Archive::dirpath_): New field.
17463 (Archive::task_): New field.
17464 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17465 for thin archives. Pass additional parameters to
17466 Archive::Archive. Unlock the archive file after calling
17467 Archive::setup.
cd536b21 17468
479f6503
ILT
174692008-03-29 Ian Lance Taylor <iant@google.com>
17470
686c8caf
ILT
17471 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17472 version symbol to be local.
17473 * testsuite/ver_test_4.sh: New file.
17474 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17475 (check_DATA): Add ver_test_4.syms.
17476 (ver_test_4.syms): New target.
17477 * testsuite/Makefile.in: Rebuild.
17478
ab794b6b
ILT
17479 * output.cc
17480 (Output_section::Input_section_sort_entry::has_priority): New
17481 function.
17482 (Output_section::Input_section_sort_entry::match_file_name): New
17483 function.
17484 (Output_section::Input_section_sort_entry::match_section_name):
17485 Remove.
17486 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17487 Remove.
17488 (Output_section::Input_section_sort_entry::match_section_file):
17489 Remove.
17490 (Output_section::Input_section_sort_compare::operator()): Rewrite
17491 using new Input_section_sort_entry functions. Sort crtbegin and
17492 crtend first. Sort sections with no priority before sections with
17493 a priority.
17494 * testsuite/initpri1.c (d3): Check j != 4.
17495 (cd5): New constructor/destructor function.
17496 (main): Check j != 2.
17497
479f6503
ILT
17498 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17499 new symbol when resolving, don't call set_is_default.
17500 * testsuite/ver_test_7.cc: New file.
17501 * testsuite/ver_test_7.sh: New file.
17502 * testsuite/Makefile.am (ver_test_7.so): New target.
17503 (ver_test_7.o): New target.
17504 (check_SCRIPTS): Add ver_test_7.sh.
17505 (check_DATA): Add ver_test_7.syms.
17506 (ver_test_7.syms): New target.
17507
2fd32231
ILT
175082008-03-28 Ian Lance Taylor <iant@google.com>
17509
17510 * layout.cc (Layout::layout): If we see an input section with a
17511 name that needs sorting, set the must_sort flag for the output
17512 section.
17513 (Layout::make_output_section): If the name of the output section
17514 indicates that it might require sorting, set the may_sort flag.
17515 * output.h (Output_section::may_sort_attached_input_sections): New
17516 function.
17517 (Output_section::set_may_sort_attached_input_sections): New
17518 function.
17519 (Output_section::must_sort_attached_input_sections): New
17520 function.
17521 (Output_section::set_must_sort_attached_input_sections): New
17522 function.
17523 (class Output_section): Declare Input_section_sort_entry. Define
17524 Input_section_sort_compare. Declare
17525 sort_attached_input_sections. Add new fields:
17526 may_sort_attached_input_sections_,
17527 must_sort_attached_input_sections_,
17528 attached_input_sections_are_sorted_.
17529 * output.cc (Output_section::Output_section): Initialize new
17530 fields.
17531 (Output_section::add_input_section): Add an entry to
17532 input_sections_ if may_sort or must_sort are true.
17533 (Output_section::set_final_data_size): Call
17534 sort_attached_input_sections if necessary.
17535 (Output_section::Input_section_sort_entry): Define new class.
17536 (Output_section::Input_section_sort_compare::operator()): New
17537 function.
17538 (Output_section::sort_attached_input_sections): New function.
17539 * configure.ac: Check whether the compiler supports constructor
17540 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17541 * testsuite/initpri1.c: New file.
17542 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17543 CONSTRUCTOR_PRIORITY.
17544 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17545 (initpri1_LDFLAGS): New variable.
17546 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17547
18e6b24e
ILT
175482008-03-27 Ian Lance Taylor <iant@google.com>
17549
49bdd526
ILT
17550 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17551 * testsuite/common_test_1.c: New file.
17552 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17553 (common_test_1_SOURCES): New variable.
17554 (common_test_1_DEPENDENCIES): New variable.
17555 (common_test_1_LDFLAGS): New variable.
17556
18e6b24e
ILT
17557 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17558 and commons_ correctly when NAME/VERSION does not override
17559 NAME/NULL.
17560 * testsuite/ver_test_6.c: New file.
17561 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17562 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17563 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17564
04bf7072
ILT
175652008-03-26 Ian Lance Taylor <iant@google.com>
17566
5871526f
ILT
17567 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17568 of an undefined symbol from a version script.
17569 * testsuite/Makefile.am (ver_test_5.so): New target.
17570 (ver_test_5.o): New target.
17571 (check_SCRIPTS): Add ver_test_5.sh.
17572 (check_DATA): Add ver_test_5.syms.
17573 (ver_test_5.syms): New target.
17574 * testsuite/ver_test_5.cc: New file.
17575 * testsuite/ver_test_5.script: New file.
17576 * testsuite/ver_test_5.sh: New file.
17577 * Makefile.in, testsuite/Makefile.in: Rebuild.
17578
04bf7072
ILT
17579 PR gold/5986
17580 Fix problems building gold with gcc 4.3.0.
17581 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17582 (gold_error_at_location, gold_warning_at_location): Use it.
17583 * configure.ac: Check whether we can compile and use a template
17584 function with a printf attribute.
17585 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17586 when jumping over bytes.
17587 * object.cc: Instantiate Object::read_section_data.
17588 * debug.h: Include <cstring>
17589 * dwarf_reader.cc: Include <algorithm>
17590 * main.cc: Include <cstring>.
17591 * options.cc: Include <cstring>.
17592 * output.cc: Include <cstring>.
17593 * script.cc: Include <cstring>.
17594 * script.h: Include <string>.
17595 * symtab.cc: Include <cstring> and <algorithm>.
17596 * target-select.cc: Include <cstring>.
17597 * version.cc: Include <string>.
17598 * testsuite/testmain.cc: Include <cstdlib>.
17599 * configure, config.in: Rebuild.
17600
874c5b28
ILT
176012008-03-25 Ian Lance Taylor <iant@google.com>
17602
819d6c3a
ILT
17603 * options.cc: Include "../bfd/bfdver.h".
17604 (options::help): Print bug reporting address.
17605
f4b2c6f5
ILT
17606 * version.cc (print_version): Adjust output for current value of
17607 BFD_VERSION_STRING.
17608
17609 * NEWS: New file.
17610
e96caa79
ILT
17611 * options.cc (options::help): Print list of supported targets.
17612 * target-select.h: Include <vector>.
17613 (class Target_selector): Make machine_, size_, and is_big_endian_
17614 fields const. Add bfd_name_ and instantiated_target_ fields.
17615 (Target_selector::Target_selector): Add bfd_name parameter.
17616 (Target_selector::recognize): Make non-virtual, call
17617 do_recognize.
17618 (Target_selector::recognize_by_name): Make non-virtual, call
17619 do_recognize_by_name.
17620 (Target_selector::supported_names): New function.
17621 (Target_selector::bfd_name): New function.
17622 (Target_selector::do_instantiate_target): New pure virtual
17623 function.
17624 (Target_selector::do_recognize): New virtual function.
17625 (Target_selector::do_recognize_by_name): New virtual function.
17626 (Target_selector::instantiate_target): New private function.
17627 (supported_target_names): Declare.
17628 * target-select.cc (Target_selector::Target_selector): Update for
17629 new parameter and fields.
17630 (select_target_by_name): Check that the name matches before
17631 calling recognize_by_name.
17632 (supported_target_names): New function.
17633 * i386.cc (class Target_selector_i386): Update Target_selector
17634 constructor call. Remove recognize and recognize_by_name. Add
17635 do_instantiate_target.
17636 * x86_64.cc (class Target_selector_x86_64): Likewise.
17637 * testsuite/testfile.cc (class Target_selector_test): Update for
17638 changes to Target_selector.
17639
874c5b28
ILT
17640 * README: Rewrite, with some notes on unsupported features.
17641
0a65a3a7
CC
176422008-03-24 Cary Coutant <ccoutant@google.com>
17643
17644 * i386.cc (Target_i386::Got_type): New enum declaration.
17645 (Target_i386::Scan::local): Updated callers of Output_data_got
17646 member functions.
17647 (Target_i386::Scan::global): Likewise.
17648 (Target_i386::Relocate::relocate): Likewise.
17649 (Target_i386::Relocate::relocate_tls): Likewise.
17650 * object.h (Got_offset_list): New class.
17651 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17652 (Sized_relobj::local_got_offset): Likewise.
17653 (Sized_relobj::set_local_got_offset): Likewise.
17654 (Sized_relobj::local_has_tls_got_offset): Removed.
17655 (Sized_relobj::local_tls_got_offset): Removed.
17656 (Sized_relobj::set_local_tls_got_offset): Removed.
17657 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17658 * output.cc (Output_data_got::add_global): Added got_type parameter.
17659 (Output_data_got::add_global_with_rel): Likewise.
17660 (Output_data_got::add_global_with_rela): Likewise.
17661 (Output_data_got::add_global_pair_with_rel): New function.
17662 (Output_data_got::add_global_pair_with_rela): New function.
17663 (Output_data_got::add_local): Added got_type parameter.
17664 (Output_data_got::add_local_with_rel): Likewise.
17665 (Output_data_got::add_local_with_rela): Likewise.
17666 (Output_data_got::add_local_pair_with_rel): New function.
17667 (Output_data_got::add_local_pair_with_rela): New function.
17668 (Output_data_got::add_global_tls): Removed.
17669 (Output_data_got::add_global_tls_with_rel): Removed.
17670 (Output_data_got::add_global_tls_with_rela): Removed.
17671 (Output_data_got::add_local_tls): Removed.
17672 (Output_data_got::add_local_tls_with_rel): Removed.
17673 (Output_data_got::add_local_tls_with_rela): Removed.
17674 * output.h (Output_data_got::add_global): Added got_type parameter.
17675 (Output_data_got::add_global_with_rel): Likewise.
17676 (Output_data_got::add_global_with_rela): Likewise.
17677 (Output_data_got::add_global_pair_with_rel): New function.
17678 (Output_data_got::add_global_pair_with_rela): New function.
17679 (Output_data_got::add_local): Added got_type parameter.
17680 (Output_data_got::add_local_with_rel): Likewise.
17681 (Output_data_got::add_local_with_rela): Likewise.
17682 (Output_data_got::add_local_pair_with_rel): New function.
17683 (Output_data_got::add_local_pair_with_rela): New function.
17684 (Output_data_got::add_global_tls): Removed.
17685 (Output_data_got::add_global_tls_with_rel): Removed.
17686 (Output_data_got::add_global_tls_with_rela): Removed.
17687 (Output_data_got::add_local_tls): Removed.
17688 (Output_data_got::add_local_tls_with_rel): Removed.
17689 (Output_data_got::add_local_tls_with_rela): Removed.
17690 * resolve.cc (Symbol::override_base_with_special): Removed
17691 reference to has_got_offset_ field.
17692 * symtab.cc (Symbol::init_fields): Replaced initialization
17693 of got_offset_ with got_offsets_. Removed initialization
17694 of has_got_offset_
53fcba31 17695 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17696 (Symbol::got_offset): Likewise.
17697 (Symbol::set_got_offset): Likewise.
17698 (Symbol::has_tls_got_offset): Removed.
17699 (Symbol::tls_got_offset): Removed.
17700 (Symbol::set_tls_got_offset): Removed.
17701 (Symbol::got_offset_): Removed.
17702 (Symbol::tls_mod_got_offset_): Removed.
17703 (Symbol::tls_pair_got_offset_): Removed.
17704 (Symbol::got_offsets_): New field.
17705 (Symbol::has_got_offset): Removed.
17706 (Symbol::has_tls_mod_got_offset): Removed.
17707 (Symbol::has_tls_pair_got_offset): Removed.
17708 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17709 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17710 member functions.
17711 (Target_x86_64::Scan::global): Likewise.
17712 (Target_x86_64::Relocate::relocate): Likewise.
17713 (Target_x86_64::Relocate::relocate_tls): Likewise.
17714
bd52eafb
BE
177152008-03-25 Ben Elliston <bje@au.ibm.com>
17716
17717 * yyscript.y: Fix spelling error in comment.
17718
8b105e34
ILT
177192008-03-24 Ian Lance Taylor <iant@google.com>
17720
8ed814a9
ILT
17721 * options.h (class General_options): Define build_id option.
17722 * layout.h (class Layout): Declare write_build_id, create_note,
17723 create_build_id. Add build_id_note_ member.
17724 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17725 "libiberty.h", "md5.h", "sha1.h".
17726 (Layout::Layout): Initialize eh_frame_data_,
17727 eh_frame_hdr_section_, and build_id_note_.
17728 (Layout::finalize): Call create_build_id.
17729 (Layout::create_note): New function, broken out of
17730 Layout::create_gold_note.
17731 (Layout::create_gold_note): Call create_note.
17732 (Layout::create_build_id): New function.
17733 (Layout::write_build_id): New function.
17734 (Close_task_runner::run): Call write_build_id.
17735
8b105e34
ILT
17736 * x86_64.cc: Correct license to GPLv3.
17737
086a1841
ILT
177382008-03-23 Ian Lance Taylor <iant@google.com>
17739
17740 * options.cc: Include "demangle.h".
17741 (parse_optional_string): New function.
17742 (parse_long_option): Handle takes_optional_argument.
17743 (parse_short_option): Update dash_z initializer. Handle
17744 takes_optional_argument.
17745 (General_options::General_options): Initialize do_demangle_.
17746 (General_options::finalize): Set do_demangle_. Handle demangling
17747 style.
17748 * options.h (parse_optional_string): Declare.
17749 (struct One_option): Add optional_arg field. Update constructor.
17750 Update call constructor calls. Add takes_optional_argument
17751 function.
17752 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17753 (DEFINE_optional_string): Define.
17754 (General_options::demangle): Change from DEFINE_bool to
17755 DEFINE_optional_string.
17756 (General_options::no_demangle): New function.
17757 (General_options::do_demangle): New function.
17758 (General_options::set_do_demangle): New function.
17759 (General_options::execstack_status_): Move definition to end of
17760 class definition.
17761 (General_options::static_): Likewise.
17762 (General_options::do_demangle_): New field.
17763 * object.cc (big_endian>::get_symbol_location_info): Call
17764 Options::do_demangle, not Options::demangle.
17765 * symtab.cc (demangle): Likewise.
17766
cbb93e63
ILT
177672008-03-22 Ian Lance Taylor <iant@google.com>
17768
17769 * gold.h: Include <cstddef> and <sys/types.h>
17770 * options.h: Include <cstring>.
17771
ec531623
ILT
177722008-03-21 Ian Lance Taylor <iant@google.com>
17773
17774 * Added source code to GNU binutils.
752937aa 17775\f
b90efa5b 17776Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17777
17778Copying and distribution of this file, with or without modification,
17779are permitted in any medium without royalty provided the copyright
17780notice and this notice are preserved.
17781
17782Local Variables:
17783mode: change-log
17784left-margin: 8
17785fill-column: 74
17786version-control: never
17787End:
This page took 1.24445 seconds and 4 git commands to generate.