Automatic date update in version.in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
358de988
L
12015-09-02 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR gold/18886
4 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
5 shared libraries into normal FUNC symbols.
6 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
7 symbols aren't from shared libraries.
8
d49044c7
AM
92015-09-02 Alan Modra <amodra@gmail.com>
10
11 PR 18878
12 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
13 (Target_powerpc::Branch_info::make_stub): Determine whether long
14 branch stub is for save/restore function.
15 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
16 (Stub_table): Add need_save_res_.
17 (Stub_table:clear_stubs): Clear need_save_res_.
18 (Stub_table:set_address_and_size): Add save/restore section size.
19 (Stub_table::add_long_branch_entry): Add save_res param. Set
20 need_save_res_, but don't add space for save/restore stubs.
21 (Stub_table::find_long_branch_entry): Return offset to local copy
22 of save/restore func.
23 (Stub_table::do_write): Don't output save/restore stubs. Instead
24 copy the save/restore functions.
25 (Output_data_save_res:contents): New accessor.
26 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
27
7c61d651
CC
282015-08-25 Cary Coutant <ccoutant@gmail.com>
29
30 PR gold/18847
31 * script-sections.cc (Memory_region::set_address): New method.
32 (Script_sections::find_memory_region): Add explicit_only parameter.
33 (Output_section_definition::set_section_addresses): Handle case where
34 script specifies both address and vma region.
35 * script-sections.h (Script_sections::find_memory_region): Add
36 explicit_only parameter.
37
4bfacfd3
CC
382015-08-25 Cary Coutant <ccoutant@gmail.com>
39
40 PR gold/18859
41 * object.cc (Input_objects::add_object): Store objects in a map,
42 indexed by soname; update as-needed flag when necessary.
43 * object.h (Object::clear_as_needed): New method.
44 (Input_objects::so_names_): Change from set to map.
45
1757d35c
CC
462015-08-25 Cary Coutant <ccoutant@gmail.com>
47
48 PR gold/14746
49 * expression.cc (Expression::Expression_eval_info): Add
50 is_valid_pointer field.
51 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
52 Adjust all callers.
53 (Addr_expression::value_from_output_section): Check whether address
54 is valid.
55 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
56 if evaluation failed due to address that is not yet valid.
57 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
58 parameter.
59
3ac0a36c
CC
602015-08-25 Cary Coutant <ccoutant@gmail.com>
61
62 PR gold/18866
63 PR gold/18703
64 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
65
9215b98b
AM
662015-08-20 Alan Modra <amodra@gmail.com>
67
68 PR gold/18846
69 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
70 Subtract os->address() from addend.
71 * powerpc.cc (relocate_relocs): Likewise.
72
40fc1451
SD
732015-08-12 Simon Dardis <simon.dardis@imgtec.com>
74
75 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
76 lazy_stub_normal_1, lazy_stub_normal_1_n64,
77 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
78 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
79 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
80 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
81 of 'addu/daddu'.
82
37a42ee9
L
832015-07-27 H.J. Lu <hongjiu.lu@intel.com>
84
85 * configure: Regenerated.
86
ab3b14b0
DK
872015-07-26 Doug Kwan <dougkwan@google.com>
88
89 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
90 disassembler output format.
91
cdb06167
HS
922015-07-23 Ian Coolidge <icoolidge@google.com>
93 Plumb --pic-veneer option for gold.
94
95 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
96 generation.
97 * options.h (General_options): Add --pic-veneer option.
98
5b2af7dd
L
992015-07-22 H.J. Lu <hongjiu.lu@intel.com>
100
101 PR gold/18663
102 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
103 script_test_1a.cc script_test_1b.cc.
104 (script_test_11_r.o): Replace script_test_11.o with
105 script_test_11a.o script_test_11b.o.
106 (script_test_11.o): Removed.
107 (script_test_11a.o): New.
108 (script_test_11b.o): Likewise.
109 * testsuite/Makefile.in: Regenerated.
110 * testsuite/script_test_1.h: New file.
111 * testsuite/script_test_1b.cc: Likewise.
112 * testsuite/script_test_11.h: Likewise.
113 * testsuite/script_test_11b.c: Likewise.
114 * testsuite/script_test_1.cc: Renamed to ...
115 * testsuite/script_test_1a.cc: This.
116 Include "script_test_1.h".
117 (main): Call check_int and check_ptr.
118 * testsuite/script_test_11.c: Renamed to ...
119 * testsuite/script_test_11a.c: This.
120 Include "script_test_11.h".
121 (main): Call ptr_equal.
122
cd78ea77
L
1232015-07-22 H.J. Lu <hongjiu.lu@intel.com>
124
125 PR gold/18628
126 * testsuite/ifuncdep2.c (global): Change protected to hidden.
127 * testsuite/ifuncmod1.c (global): Likewise.
128 * testsuite/ifuncmod5.c (global): Likewise.
129
f945ba50
AM
1302015-07-22 Alan Modra <amodra@gmail.com>
131
132 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
133
5417c94d
CC
1342015-07-21 Cary Coutant <ccoutant@gmail.com>
135
136 PR gold/18548
137 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
138 forced local symbol even when oldsym != NULL.
139 (Symbol_table::do_define_in_output_segment): Likewise.
140 (Symbol_table::do_define_as_constant): Likewise.
141
cb5cf5e2
CC
1422015-07-21 Cary Coutant <ccoutant@gmail.com>
143
b8c6c5ef 144 PR gold/18698
cb5cf5e2
CC
145 * archive.cc (Library_base::should_include_member): Don't use entry
146 point for relocatable links, or if target is not yet valid.
147 * parameters.cc (Parameters::entry): Check target_valid().
148
0ef3814f
HS
1492015-07-20 Han Shen <shenhan@google.com>
150
151 Optimize erratum 843419 fix.
152
153 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
154 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
155 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
156 (E843419_stub): New sub-class of Erratum_stub.
157 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
158 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
159 (AArch64_relobj::create_erratum_stub): Add 1 argument.
160 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
161
2bca0377
HS
1622015-07-20 Han Shen <shenhan@google.com>
163
164 Fix arm elf header flags wrt hardfp bit.
165
166 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
167
f54f5e31
L
1682015-07-20 H.J. Lu <hongjiu.lu@intel.com>
169
170 PR gold/18689
171 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
172 from input group section for relocatable link.
173 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
174 (check_DATA): Add pr18689.stdout.
175 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
176 (pr18689.stdout): New rule.
177 (pr18689a.o): Likewise.
178 (pr18689b.o): Likewise.
179 (pr18689.o): Likewise.
180 * testsuite/pr18689.c: New file.
181 * testsuite/pr18689.sh: Likewise.
182 * testsuite/Makefile.in: Regenerated.
183
c20ceeb2
YW
1842015-07-20 Yiran Wang <yiran@google.com>
185 Cary Coutant <ccoutant@gmail.com>
186
187 PR gold/15574
188 * resolve.cc (Symbol_table): Remove warning about references
189 from shared objects to hidden symbols.
190 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
191 * testsuite/Makefile.in: Regenerate.
192 * testsuite/hidden_test.sh: Check dynamic symbol table; update
193 expected error messages.
194
19a7fe52
L
1952015-07-14 H.J. Lu <hongjiu.lu@intel.com>
196
197 * compressed_output.cc (Output_compressed_section::set_final_data_size):
198 Make --compress-debug-sections=zlib the same as
199 --compress-debug-sections=zlib-gabi.
200 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
201 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
202 ".zdebug_".
203 * testsuite/Makefile.in: Regenerated.
204
fb8b9dbc
L
2052015-07-12 H.J. Lu <hongjiu.lu@intel.com>
206
207 PR gold/18322
208 * compressed_output.cc (zlib_compress): Add argument for
209 compression header size. Set header size to compression header
210 size if it isn't 0. Don't write out the zlib header here.
211 (Output_compressed_section::set_final_data_size): Support
212 zlib-gnu and zlib-gabi compressions. Pass compression header
213 size to zlib_compress and write out compression header. Set
214 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
215 clear the SHF_COMPRESSED bit
216 * options.h (compress_debug_sections): Add zlib-gnu and
217 zlib-gabi.
218 * output.h (Output_section::set_flags): New.
219 * testsuite/Makefile.am (check_PROGRAMS): Add
220 flagstest_compress_debug_sections_none,
221 flagstest_compress_debug_sections_gnu and
222 flagstest_compress_debug_sections_gabi.
223 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
224 flagstest_compress_debug_sections.stdout,
225 flagstest_compress_debug_sections.cmp,
226 flagstest_compress_debug_sections.check,
227 flagstest_compress_debug_sections_gnu.stdout,
228 flagstest_compress_debug_sections_gnu.cmp,
229 flagstest_compress_debug_sections_gnu.check,
230 flagstest_compress_debug_sections_gabi.stdout,
231 flagstest_compress_debug_sections_gabi.cmp and
232 flagstest_compress_debug_sections_gabi.check.
233 (flagstest_compress_debug_sections_none): New.
234 (flagstest_compress_debug_sections_none.stdout): Likewise.
235 (flagstest_compress_debug_sections.stdout): Likewise.
236 (flagstest_compress_debug_sections.check): Likewise.
237 (flagstest_compress_debug_sections.cmp): Likewise.
238 (flagstest_compress_debug_sections_gnu): Likewise.
239 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
240 (flagstest_compress_debug_sections_gnu.check): Likewise.
241 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
242 (flagstest_compress_debug_sections_gabi): Likewise.
243 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
244 (flagstest_compress_debug_sections_gnu.check): Likewise.
245 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
246 * testsuite/Makefile.in: Regenerated.
247
48058663
L
2482015-07-12 H.J. Lu <hongjiu.lu@intel.com>
249
250 PR gold/18321
251 * compressed_output.h (decompress_input_section): Add arguments
252 for ELF class, big endian and sh_flags.
253 * compressed_output.cc (decompress_input_section): Likewise.
254 Support the SHF_COMPRESSED section.
255 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
256 functions.
257 * plugin.h (Pluginobj): Likewise.
258 * layout.cc (Layout::get_output_section_flags): Also clear the
259 SHF_COMPRESSED bit.
260 * object.h (Compressed_section_info): Add flag to store sh_flags.
261 (Object): Add pure virtual elfsize and is_big_endian member
262 functions.
263 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
264 prefix here.
265 (build_compressed_section_map): Check SHF_COMPRESSED for
266 uncompressed size. Store sh_flags in Compressed_section_info.
267 Pass size, big_endian and sh_flags to decompress_input_section.
268 Skip the ".debug"/".zdebug" prefix when passing section name to
269 need_decompressed_section.
270 (Sized_relobj_file<size, big_endian>::do_find_special_section):
271 Don't check ".zdebug_*" sections.
272 (Object::decompressed_section_contents): Pass ELF class, big
273 endian and sh_flags to decompress_input_section.
274 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
275 Likewise.
276 * testsuite/Makefile.am (check_DATA): Add
277 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
278 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
279 gdb_index_test_2_gabi.stdout.
280 (debug_msg_cdebug_gabi.o): New.
281 (odr_violation1_cdebug_gabi.o): Likewise.
282 (odr_violation2_cdebug_gabi.o): Likewise.
283 (debug_msg_cdebug_gabi.err): Likewise.
284 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
285 (gdb_index_test_cdebug_gabi.o): Likewise.
286 (gdb_index_test_2_gabi): Likewise.
287 (gdb_index_test_2_gabi.stdout): Likewise.
288 * testsuite/gdb_index_test_2_gabi.sh: New file.
289 * testsuite/Makefile.in: Regenerated.
290
73854cdd
HS
2912015-07-09 Han Shen <shenhan@google.com>
292
293 Use "gold_info" instead of "gold_warning" for erratum fix.
294
295 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
296 'gold_info'.
297 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
298
61163dfa
HS
2992015-07-09 Han Shen <shenhan@google.com>
300
301 Drop missing symbol warning for arm/aarch64.
302
303 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
304 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
305 symbol warning.
306
b91deca9
HS
3072015-07-07 Han Shen <shenhan@google.com>
308
309 Make gold aarch64 accept long form of mapping symbols.
310
311 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
312 of mapping symbols.
313
15162bef
DK
3142015-06-29 Doug Kwan <dougkwan@google.com>
315
316 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
317 at address expected by test.
318 * testsuite/arm_cortex_a8_b.s: Ditto.
319 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
320 * testsuite/arm_cortex_a8_bl.s: Ditto.
321 * testsuite/arm_cortex_a8_blx.s: Ditto.
322 * testsuite/arm_cortex_a8_local.s: Ditto.
323 * testsuite/arm_fix_v4bx.s: Ditto.
324 * testsuite/arm_unaligned_reloc.s: Ditto.
325 * testsuite/thumb_bl_out_of_range.s: Ditto.
326 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
327 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 328
56b06706
HS
3292015-06-29 Han Shen <shenhan@google.com>
330
331 Patch for erratum 843419 internal error.
332
72f4393d
L
333 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
334 (Erratum_stub::update_erratum_insn): New method.
335 (Stub_table::relocate_stubs): Modified to place relocated insn.
336 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 337
2f0c79aa
HS
3382015-06-12 Han Shen <shenhan@google.com>
339
340 Fix erratum 835769.
341
72f4393d
L
342 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
343 defintion outside class definition.
344 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
345 (AArch64_insn_utilities::aarch64_op31): New member.
346 (AArch64_insn_utilities::aarch64_ra): New member.
347 (AArch64_insn_utilities::aarch64_mac): New member.
348 (AArch64_insn_utilities::aarch64_mlxl): New member.
349 (ST_E_835769): New global enum member.
350 (Stub_table::relocate_stubs): Add 835769 handler.
351 (Stub_template_repertoire::Stub_template_repertoire): Install new
352 stub type.
353 (AArch64_relobj::scan_errata): This func is renamed from
354 scan_erratum_843419.
355 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
356 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
357 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
358 (Target_aarch64::scan_erratum_835769_span): New method.
359 (Target_aarch64::create_erratum_stub): New method.
360 (Target_aarch64::is_erratum_835769_sequence): New method.
361 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
362 code into create_erratum_stub.
363 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 364
5d7908e0
CC
3652015-06-11 Cary Coutant <ccoutant@gmail.com>
366
367 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
368 outside class body.
369 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
370
dd68f8fa
CC
3712015-06-11 Cary Coutant <ccoutant@gmail.com>
372
373 PR gold/17731
374 * layout.cc (corresponding_uncompressed_section_name): New function.
375 (Layout::choose_output_section): Call it.
376 * layout.h (corresponding_uncompressed_section_name): New function.
377 * script-sections.cc (Input_section_info::set_section_name): Check
378 for compressed debug section (.zdebug style).
379
a3a0c391
JY
3802015-06-11 Jing Yu <jingyu@google.com>
381
382 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
383 * testsuite/Makefile.in: Regenerate.
384
970cdef2
DI
3852015-06-11 Davide Italiano <dccitaliano@gmail.com>
386
387 * gold.h (is_cident): Correct typo.
388
a48d0c12
HS
3892015-06-10 Han Shen <shenhan@google.com>
390 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
391
392 Now fixing for 843419 is fully functional.
393
394 The first part of the erratum fix CL is here -
395 https://sourceware.org/ml/binutils/2015-04/msg00229.html
396
397 * aarch64.cc(global enum): New constants representing stub types.
398 (Stub_template): New POD struct.
399 (Stub_template_repertoire): New class.
400 (Stub_base): New class.
401 (Erratum_stub): New class.
402 (Reloc_stub): Refactored to be a subclass of Stub_base.
403 (Reloc_stub::Stub_type): Removed.
404 (Reloc_stub::offset): Moved to Stub_base.
405 (Reloc_stub::set_offset): Moved to Stub_base.
406 (Reloc_stub::destination_address): Moved to Stub_base.
407 (Reloc_stub::set_destination_address): Moved to Stub_base.
408 (Reloc_stub::reset_destination_address): Moved to Stub_base.
409 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
410 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
411 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
412 (Reloc_stub::write): Moved to Stub_base.
413 (Reloc_stub::invalid_offset): Moved to Stub_base.
414 (Reloc_stub::invalid_address): Moved to Stub_base.
415 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
416 (Reloc_stub::stub_insns_): Moved to Stub_base.
417 (Reloc_stub::offset_): Moved to Stub_base.
418 (Reloc_stub::destination_address_): Moved to Stub_base.
419 (Stub_table::The_aarch64_relobj): New typedef.
420 (Stub_table::The_erratum_stub): New typedef.
421 (Stub_table::The_erratum_stub_less): New typedef.
422 (Stub_table::The_erratum_stub_set): New typedef.
423 (Stub_table::The_erratum_stub_set_iter): New typedef.
424 (Stub_table::empty): Added emptiness testing for erratum stubs.
425 (Stub_table::add_erratum_stub): New method to add an erratum stub.
426 (Stub_table::find_erratum_stub): New method.
427 (Stub_table::find_erratum_stubs_for_input_section): New method.
428 (Stub_table::erratum_stub_address): New method.
429 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
430 (Stub_table::do_addralign): Modified to handle erratum stubs.
431 (Stub_table::erratum_stubs_): New member.
432 (Stub_table::erratum_stub_size_): New member.
433 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
434 (Stub_table::do_write): Modified to handle erratum stubs.
435 (AArch64_relobj::The_erratum_stub): New typedef.
436 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
437 (AArch64_relobj::fix_errata): New method.
438 (Target_aarch64::The_reloc_stub_type): Removed.
439 (Target_aarch64::The_erratum_stub): New typede.
440 (AArch64_relocate_functions::construct_b): New method.
441
1e1b2efc
NC
4422015-06-08 Nick Clifton <nickc@redhat.com>
443
444 * po/fr.po: New French Translation.
445
b8cf5075
CC
4462015-06-07 Cary Coutant <ccoutant@gmail.com>
447
448 PR gold/18288
449 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
450 callers. Don't use STT_COMMON to check for common symbols.
451 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
452 symbol that's not in a common section.
453 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
454 common symbols.
455
bdd2d2b7
CC
4562015-06-04 Cary Coutant <ccoutant@gmail.com>
457
458 PR gold/18200
459 * Makefile.am (diststuff): Add target.
460 * Makefile.in: Regenerate.
461
cd3c333f
CC
4622015-06-04 Cary Coutant <ccoutant@gmail.com>
463
464 PR gold/17498
465 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
466 temporary locals in merge sections.
467 * options.cc (General_options::parse_discard_all): New method.
468 (General_options::parse_discard_locals): New method.
469 (General_options::parse_discard_none): New method.
470 (General_options::General_options): Initialize discard_locals_.
471 * options.h (--discard-all): Convert to special option.
472 (--discard-locals): Likewise.
473 (--discard-none): New option.
474 (General_options::discard_all): New method.
475 (General_options::discard_locals): New method.
476 (General_options::discard_sec_merge): New method.
477 (General_options::Discard_locals): New enum.
478 (General_options::discard_locals_): New data member.
479
8086551f
CC
4802015-06-03 Cary Coutant <cary@google.com>
481
482 * script-sections.cc (Script_sections::Script_sections): Initialize
483 segments_created_.
484 (Script_sections::create_note_and_tls_segments): Set flag when
485 segments are created.
486 (Script_sections::expected_segment_count): Count PT_INTERP.
487 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
488 segments are created.
489 * script-sections.h (Script_sections::segments_created_): New data
490 member.
491
374082df
CC
4922015-06-03 Cary Coutant <ccoutant@gmail.com>
493
494 PR gold/15370
495 * script-sections.cc
496 (Output_section_element_input::set_section_addresses): When there
497 are several patterns with no sort spec, put all sections in the same
498 bin.
499 * testsuite/Makefile.am (script_test_12): New testcase.
500 (script_test_12i): New testcase.
501 * testsuite/Makefile.in: Regenerate.
502 * testsuite/script_test_12.t: New test linker script.
503 * testsuite/script_test_12i.t: New test linker script.
504 * testsuite/script_test_12a.c: New test source file.
505 * testsuite/script_test_12b.c: New test source file.
506
775ed62e
CC
5072015-06-02 Cary Coutant <ccoutant@gmail.com>
508
509 * nacl.h (Sniff_file): Switch parameters to get_view to get an
510 aligned view.
511
9c7fe3c5
CC
5122015-06-03 Cary Coutant <ccoutant@gmail.com>
513
72f4393d
L
514 PR gold/17819
515 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
516 separate task to schedule the build id computation.
517 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
518 add Output_file and offset.
519 (Hash_task::run): Get and release the input views.
520 (Hash_task::is_runnable): Always return NULL (always runnable).
521 (Layout::queue_build_id_tasks): Remove.
522 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
523 parameters; use them instead of class members.
524 (Build_id_task_runner::run): New function.
525 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
526 to write_build_id.
527 * layout.h (Layout::queue_build_id_tasks): Remove.
528 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
529 parameters.
530 (Layout::array_of_hashes_): Remove.
531 (Layout::size_of_array_of_hashes_): Remove.
532 (Layout::input_view_): Remove.
533 (Build_id_task_runner): New class.
534 (Close_task_runner::Close_task_runner): Add array_of_hashes and
535 size_of_hashes parameters.
536 (Close_task_runner::array_of_hashes_): New data member.
537 (Close_task_runner::size_of_hashes_): New data member.
538 * testsuite/Makefile.am
539 (flagstest_compress_debug_sections_and_build_id_tree): New test.
540 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 541
400f8944
RÁE
5422015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
543
544 * merge.cc (get_input_merge_map): Update for data structure change.
545 (get_or_make_input_merge_map): Update for data structure change.
546 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
547 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
548
bbec1a5d
AM
5492015-05-16 Alan Modra <amodra@gmail.com>
550
551 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
552 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
553 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
554 (lis_0): Rename from lis_0_0.
555
efc6fa12
CC
5562015-04-29 Cary Coutant <cary@google.com>
557 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
558
559 * gc.h (Garbage_collection::is_section_garbage): Change Object*
560 to Relobj*.
561 (Garbage_collection::add_reference): Likewise.
562 (Garbage_collection::gc_process_relocs): Likewise. Don't push
563 object/shndx pair onto *secvec for dynamic objects. Don't follow
564 relocations pointing to dynamic objects for GC.
565 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
566 (Icf::unfold_section): Likewise.
567 (Icf::is_section_folded): Likewise.
568 (Icf::get_folded_section): Likewise.
569 * icf.h: (Icf::get_folded_section): Likewise.
570 (Icf::unfold_section): Likewise.
571 (Icf::is_section_folded): Likewise.
572 (Icf::section_has_function_pointers): Likewise.
573 (Icf::set_section_has_function_pointers): Likewise.
574 * object.h (Section_id): Likewise.
575 (Const_section_id): Likewise.
576 * output.cc (Output_section::update_section_layout): Likewise.
577 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
578 Likewise.
579 * plugin.cc (update_section_order): Likewise.
580 (unique_segment_for_sections): Likewise.
581 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
582 (Target_powerpc::do_gc_add_reference): Likewise.
583 (Target_powerpc::gc_process_relocs): Likewise.
584 (Target_powerpc::do_gc_add_reference): Likewise.
585 * symtab.cc (Symbol_table::is_section_folded): Likewise.
586 (Symbol_table::gc_mark_symbol): Likewise.
587 * symtab.h: (Symbol_table::is_section_folded): Likewise.
588 * target.h: (Sized_target::gc_add_reference): Likewise.
589 (Sized_target::do_gc_add_reference): Likewise.
590
f9d3ecaa
NC
5912015-04-29 Nick Clifton <nickc@redhat.com>
592
593 * po/fi.po: Updated Finnish translation.
594
faa2211d
AM
5952015-04-28 Alan Modra <amodra@gmail.com>
596
597 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
598 than unsigned int for find_global_entry result temp. Compare
599 against invalid_address.
600 (Target_powerpc::do_plt_address_for_global): Likewise.
601 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
602 on plt call stub existence for debug info. Do assert for plt
603 and global entry stub existence if an alloc section.
604
6ec65f28
AM
6052015-04-28 Alan Modra <amodra@gmail.com>
606
607 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
608 on missing global entry stub due to bogus debug info.
609
7a2a1c79
HS
6102015-04-27 Han Shen <shenhan@google.com>
611
612 * options.h (--fix-cortex-a53-843419): Rename option.
613 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
614 option.
615 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
616
cfbf0e3c
RÁE
6172015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
618
619 PR gold/18327
620 * output.cc (Output_section::is_input_address_mapped): Assume a missing
621 entry is mapped.
622 * testsuite/Makefile.am: Add the eh_test test.
623 * testsuite/Makefile.in: Regenerate.
624 * testsuite/eh_test_a.cc: New test.
625 * testsuite/eh_test_b.cc: New test.
626
6ec65f28
AM
6272015-04-23 Sriraman Tallam <tmsriram@google.com>
628
a100d66f
ST
629 * options.h (--weak-unresolved-symbols): New option.
630 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
631 binding to weak with new option.
632 * symtab.h (is_weak_undefined): Check for new option.
633 (is_strong_undefined): Check for new option.
634 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
635 * testsuite/Makefile.in: Regenerate.
636 * testsuite/weak_unresolved_symbols_test.cc: New file.
637
4b889c30
IC
6382015-04-20 Ian Coolidge <icoolidge@google.com>
639
640 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
641 GNU_UNIQUE.
642
4277535c
RÁE
6432015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
644
645 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
646 push_back.
647 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
648 * object.cc (Sized_relobj_file::do_layout): Use push_back.
649 * powerpc.cc (process_gc_mark): Use push_back.
650 (Target_powerpc::do_gc_mark_symbol): Use push_back.
651 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
652
7a2a1c79 6532015-04-16 Han Shen <shenhan@google.com>
5019d64a 654
6ec65f28
AM
655 * aarch64.cc (AArch64_insn_utilities): New utility class.
656 (AArch64_relobj::Mapping_symbol_position): New struct.
657 (AArch64_relobj::Mapping_symbol_info): New typedef.
658 (AArch64_relobj::do_count_local_symbols): New function overriding
659 parent's implementation.
660 (AArch64_relobj::mapping_symbol_info_): New member
661 (AArch64_relobj::scan_erratum_843419): New method.
662 (Target_aarch64::scan_erratum_843419_span): New method.
663 (Target_aarch64::is_erratum_843419_sequence): New method.
664 * options.h (fix_cortex_a53): New option.
5019d64a 665
a6a17750
CC
6662015-04-09 Cary Coutant <ccoutant@google.com>
667
668 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
669 in a PIE link.
670 * testsuite/Makefile.am (tls_pie_test.sh): New test.
671 * testsuite/Makefile.in: Regenerate.
672 * testsuite/tls_pie_test.sh: New.
673
437ddf0c
CC
6742015-04-09 Cary Coutant <ccoutant@google.com>
675
676 * debug.h (DEBUG_LOCATION): New.
677 (DEBUG_ALL): Include DEBUG_LOCATION.
678 (debug_string_to_enum): Add DEBUG_LOCATION.
679 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
680 output to print correct context.
681 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
682 up to 4 more locations at the beginning of the function.
683 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
684 result before sorting list of line numbers.
685 * testsuite/debug_msg.sh: Allow range of line numbers for
686 canonical results on optimized code.
687
24491327
HS
6882015-04-07 HC Yen <hc.yen@mediatek.com>
689
690 Add AArch32 support for gold linker.
691 gold/
692 * arm.cc: Add V8 arch combine table.
693
7fa5525f
RÁE
6942015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
695
696 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
697
5368dcf2
RÁE
6982015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
699
700 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
701 to find by using the return value of insert.
702
9dbb4b02
RÁE
7032015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
704
705 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
706 constructor call.
707
1fa29f10
IT
7082015-04-06 Ilya Tocar <ilya.tocar@intel.com>
709
710 PR gold/17641
711 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
712 (Target_x86_64::Scan::local): Don't create GOT entry, when we
713 can convert mov to lea.
714 (Target_x86_64::Scan::global): Ditto.
715 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
716 %reg to lea foo(%rip), %reg if possible.
717 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
718 * testsuite/x86_64_mov_to_lea1.s: New.
719 * testsuite/x86_64_mov_to_lea2.s: Ditto.
720 * testsuite/x86_64_mov_to_lea3.s: Ditto.
721 * testsuite/x86_64_mov_to_lea4.s: Ditto.
722 * testsuite/x86_64_mov_to_lea.sh: Ditto.
723
39f3de7c
L
7242015-04-02 H.J. Lu <hongjiu.lu@intel.com>
725
726 * configure: Regenerated.
727
c4fc4724
IT
7282015-04-01 Ilya Tocar <ilya.tocar@intel.com>
729
730 PR gold/17640
731 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
732 (Target_i386::Scan::local): Don't create GOT entry, when we
733 can convert GOT to GOTOFF.
734 (Target_i386::Scan::global): Ditto.
735 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
736 lea foo@GOTOFF(%reg), %reg if possible.
737 * testsuite/Makefile.am (i386_mov_to_lea): New test.
738 * testsuite/i386_mov_to_lea1.s: New.
739 * testsuite/i386_mov_to_lea2.s: Ditto.
740 * testsuite/i386_mov_to_lea3.s: Ditto.
741 * testsuite/i386_mov_to_lea4.s: Ditto.
742 * testsuite/i386_mov_to_lea5.s: Ditto.
743 * testsuite/i386_mov_to_lea.sh: Ditto.
744
918357b9
L
7452015-04-01 H.J. Lu <hongjiu.lu@intel.com>
746
747 * Makefile.am (ZLIB): New.
748 (ZLIBINC): Likewise.
749 (AM_CFLAGS): Add $(ZLIBINC).
750 (AM_CXXFLAGS): Likewise.
751 (ldadd_varldadd_var): Add $(ZLIB).
752 (incremental_dump_LDADD): Likewise.
753 (dwp_LDADD): Likewise.
754 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
755 <zlib.h>.
756 (zlib_compress): Don't check HAVE_ZLIB_H.
757 (zlib_decompress): Likewise.
758 * options.h (compress_debug_sections): Likewise.
759 * configure.ac (AM_CONDITIONAL): Removed.
760 * testsuite/Makefile.am (ZLIB): New.
761 (LDADD): Add $(ZLIB).
762 Don't check HAVE_ZLIB.
763 * Makefile.in: Regenerated.
764 * config.in: Likewise.
765 * configure: Likewise.
766 * testsuite/Makefile.in: Likewise.
767
6b0ad2eb
JY
7682015-03-30 Jing Yu <jingyu@google.com>
769
770 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
771 TLSLD_ADD_DTPREL_LO12_NC.
772 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
773 _TLS_MODULE_BASE_ point to the start of tls segment.
774 (Target_aarch64::optimize_tls_reloc): Add cases for
775 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
776 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
777 (Target_aarch64::Scan::local): Likewise.
778 (Target_aarch64::Scan::global): Likewise.
779 (Target_aarch64::Relocate::relocate): Likewise.
780 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
781 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
782 relocations.
783
0916f9e7
RÁE
7842015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
785
786 * merge.cc (Object_merge_map::add_mapping): call
787 Object_merge_map::Input_merge_map::add_mapping.
788 (Object_merge_map::Input_merge_map::add_mapping): New.
789 (Output_merge_data::do_add_input_section): Call
790 get_or_make_input_merge_map before a loop.
791 (Output_merge_string<Char_type>::finalize_merged_data): Call
792 get_or_make_input_merge_map before a loop.
793 * merge.h (Object_merge_map): Make Input_merge_map public.
794 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
795 (Relobj::get_or_create_merge_map): New.
796 * object.h (Relobj::get_or_create_merge_map): New.
797
282c9750
AM
7982015-03-24 Alan Modra <amodra@gmail.com>
799
800 PR 18147
801 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
802 relocation errors for branches to strong undefined symbols.
803
67f95b96
RÁE
8042015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
805
806 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
807 (Object_merge_map::is_merge_section_for): Remove.
808 (Object_merge_map::find_merge_section): New.
809 * merge.h (Object_merge_map::is_merge_section_for): Remove.
810 (Object_merge_map::find_merge_section): New.
811 (Object_merge_map::get_input_merge_map): Add a const version.
812 * object.cc (Relobj::is_merge_section_for): Remove.
813 (Relobj::find_merge_section): New.
814 * object.h (Relobj::is_merge_section_for): Remove.
815 (Relobj::find_merge_section): New.
816 * output.cc
817 (Output_section::Input_section::is_merge_section_for): Remove.
818 (Output_section::add_merge_input_section): Don't call
819 add_merge_input_section.
820 (Output_section::find_merge_section): Return const. Use
821 object->find_merge_section.
822 (Output_section::build_lookup_maps): Don't build a map for
823 merge sections.
824 (Output_section::is_input_address_mapped): Return false if
825 section is not found.
826 (Output_section::find_starting_output_address): Use
827 find_merge_section instead of is_merge_section_for.
828 (Output_section::add_script_input_section): Don't build a map for
829 merge sections.
830 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
831 (Output_section_lookup_maps::find_merge_section): Remove.
832 (Output_section_lookup_maps::add_merge_input_section) Remove.
833 (Output_section::find_merge_section): Return const.
834
152f7024
CC
8352015-03-22 Cary Coutant <cary@google.com>
836
837 PR gold/18106
838 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
839 non-SIB form of lea, with nop after the call.
840
bccffdfd
CC
8412015-03-21 Cary Coutant <cary@google.com>
842
843 PR gold/14217
844 * output.cc (Output_segment::is_first_section_relro): Don't ignore
845 .tdata section.
846 (Output_segment::set_section_addresses): Don't align size of relro
847 segment for .tbss.
848
1c582fe7
CC
8492015-03-21 Cary Coutant <cary@google.com>
850
851 PR gold/18010
852 * stringpool.cc (Stringpool_template): Don't optimize if section
853 alignment is greater than sizeof(char).
854
410da591
CC
8552015-03-21 Cary Coutant <cary@google.com>
856
857 PR gold/18048
858 * script-c.h (script_include_directive): Add first_token parameter.
859 * script.cc (script_include_directive): Add first_token parameter, and
860 pass it to read_script_file.
861 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
862 (PARSING_MEMORY_DEF): New tokens.
863 (top): Add new productions for INCLUDE files.
864 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
865 Pass PARSING_LINKER_SCRIPT to script_include_directive.
866 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
867 (section_cmd): Pass PARSING_SECTION_CMDS.
868 (file_or_sections_cmd): Remove.
869 (memory_def): Pass PARSING_MEMORY_DEF.
870 * testsuite/Makefile.am (memory_test_2): New test.
871 * testsuite/Makefile.in: Regenerate.
872 * testsuite/memory_test_inc.t: New script file.
873 * testsuite/memory_test_inc_1.t.src: New script file.
874 * testsuite/memory_test_inc_2.t.src: New script file.
875 * testsuite/memory_test_inc_3.t.src: New script file.
876
0d5bbdb0
CC
8772015-03-21 Cary Coutant <cary@google.com>
878
879 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
880 (Sized_relobj_dwo::setup): Build compressed section map.
881 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
882 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
883 section map.
884 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
885 compressed_sections_ field.
886 (build_compressed_section_map): Take Object instead of
887 Sized_relobj_file parameter; add decompress_if_needed parameter.
888 (Sized_relobj_file::do_find_special_sections): Store compressed
889 section map in parent Object.
890 (Sized_relobj_file::do_decompressed_section_contents): Move
891 implementation to Object::decompressed_section_contents.
892 (Sized_relobj_file::do_discard_decompressed_sections): Move
893 implementation to Object::discard_decompressed_sections.
894 * object.h (build_compressed_section_map): Declare.
895 (Object::Object): Add compressed_sections_ field.
896 (Object::section_is_compressed): Move implementation here.
897 (Object::decompressed_section_contents): De-virtualize.
898 (Object::discard_decompressed_sections): De-virtualize.
899 (Object::do_section_is_compressed): Delete.
900 (Object::do_decompressed_section_contents): Delete.
901 (Object::set_compressed_sections): New method.
902 (Object::compressed_sections): New method.
903 (Object::compressed_sections_): New data member.
904 (Compressed_section_info, Compressed_section_map): Move to top of file.
905 (Sized_relobj_file::do_section_is_compressed): Delete.
906 (Sized_relobj_file::do_decompressed_section_contents): Delete.
907 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
908 (Sized_relobj_file::compressed_sections_): Move to Object class.
909
bd9e0d46
CC
9102015-03-21 Cary Coutant <ccoutant@google.com>
911
912 PR gold/18152
913 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
914 deferred objects.
915
943c8b43
CC
9162015-03-11 Cary Coutant <ccoutant@google.com>
917
918 * options.cc (General_options::finalize): Don't allow -z relro
919 with incremental linking.
920 * testsuite/Makefile.am (incremental_test): Add -z norelro.
921 (incremental_test_2): Likewise.
922 (incremental_test_3): Likewise.
923 (incremental_test_4): Likewise.
924 (incremental_test_5): Likewise.
925 (incremental_test_6): Likewise.
926 (incremental_copy_test): Likewise.
927 (incremental_common_test_1): Likewise.
928 (incremental_comdat_test_1): Likewise.
929 * testsuite/Makefile.in: Regenerate.
930
e1663197
CC
9312015-03-09 Cary Coutant <ccoutant@google.com>
932
933 PR gold/14675
934 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
935 return enum indicating whether .eh_frame section is empty, optimizable,
936 unrecognized, or an end marker. Adjust explicit instantiations.
937 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
938 (Eh_frame::add_ehframe_input_section): Change return type.
939 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
940 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
941 to the .eh_frame output section until we see the end marker.
942 (Layout::finalize_eh_frame_section): New.
943 * layout.h: (Layout::finalize_eh_frame_section): New.
944
beb8418f
L
9452015-03-05 H.J. Lu <hongjiu.lu@intel.com>
946
947 * output.cc (Relobj::initialize_input_to_output_map<size>):
948 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
949
48c73428
CC
9502015-03-04 Cary Coutant <ccoutant@google.com>
951
952 * parameters.cc (Parameters::set_target_once): Call
953 Target::select_as_default_target just once from here...
954 (set_parameters_target): ...instead of from here.
955
9562015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
957
958 * ehframe.cc (Cie::set_output_offset): Pass in and use a
959 Output_section_data instead of a Merge_map.
960 (Eh_frame::Eh_frame): Don't initialize merge_map_.
961 (Eh_frame::read_cie): Use add_merge_mapping instead of
962 Merge_map::add_mapping.
963 (Eh_frame::read_fde): Ditto.
964 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
965 (Eh_frame::do_output_offset): Use merge_output_offset istead of
966 merge_map_->get_output_offset.
967 (Eh_frame::do_is_merge_section_for): Delete.
968 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
969 instead of a Merge_map.
970 (Cie::set_output_offset): Pass in a Output_section_data instead of a
971 Merge_map.
972 (Eh_frame::do_is_merge_section_for): Delete.
973 (Eh_frame::merge_map_): Delete.
974 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
975 and use a Output_section_data instead of a Merge_map.
976 (Object_merge_map::add_mapping): Ditto.
977 (Object_merge_map::get_output_offset): Remove the merge_map argument.
978 (Object_merge_map::is_merge_section_for): Pass in and use a
979 Output_section_data instead of a Merge_map.
980 (Merge_map): Delete.
981 (Output_merge_base::do_output_offset): Use merge_output_offset instead
982 of merge_map_.get_output_offset.
983 (Output_merge_base::do_is_merge_section_for): Delete.
984 (Output_merge_data::do_add_input_section): Use
985 object->add_merge_mapping instead of add_mapping.
986 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
987 * merge.h (Merge_map): Delete forward declaration.
988 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
989 instead of a Merge_map.
990 (Object_merge_map::get_output_offset): Remove the merge_map argument.
991 (Object_merge_map::is_merge_section_for): Pass in and use a
992 Output_section_data instead of a Merge_map.
993 (Input_merge_map::Object_merge_map::merge_map): Replace with
994 output_data.
995 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
996 Output_section_data instead of a Merge_map.
997 (Merge_map): Delete.
998 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
999 (Output_merge_base::do_is_merge_section_for): Delete.
1000 (Output_merge_base::add_mapping): Delete.
1001 (Output_merge_base::merge_map_): Delete.
1002 * object.cc (Relobj::initialize_input_to_output_map): New.
1003 (Relobj::initialize_input_to_output_map): New.
1004 (Relobj::merge_output_offset): New.
1005 (Relobj::is_merge_section_for): New.
1006 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1007 bits.
1008 * object.h (Relobj::merge_map): Delete.
1009 (initialize_input_to_output_map): New.
1010 (set_merge_map): Delete.
1011 (add_merge_mapping): New.
1012 (merge_output_offset): New.
1013 (is_merge_section_for): New.
1014 * output.cc (Output_section::Input_section::is_merge_section_for):
1015 Use object->is_merge_section_for.
1016 * output.h (Output_section_data::is_merge_section_for): Delete.
1017 (Output_section_data::do_is_merge_section_for): Delete.
1018 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1019 Use object->initialize_input_to_output_map.
1020 (Merged_symbol_value<size>::value_from_output_section): Use
1021 object->merge_output_offset.
1022
48c73428 10232015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1024 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1025
1026 * output.cc (Output_section::add_merge_input_section): Do not
1027 attempt to merge sections with an entsize of 0.
1028
48c73428 10292015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1030
1031 * attributes.h (class Output_attributes_section_data ): Add
1032 do_print_to_mapfile function.
1033
ec86f434
AM
10342015-02-24 Alan Modra <amodra@gmail.com>
1035
1036 PR 18010
1037 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1038 complain if value is not a multiple of four.
1039 (Target_powerpc::Relocate::relocate): Correct handling of
1040 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1041
be66981e
L
10422015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1043
1044 * configure.ac (default_size): Set to 32 for x32.
1045 * configure: Regenerated.
1046
e3ee8ed4
AM
10472015-02-18 Alan Modra <amodra@gmail.com>
1048
1049 PR 17954
1050 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1051 visibility.
1052
3a935c6c
RÁE
10532015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1054
1055 * gc.h (Garbage_collection::add_reference): Don't use find.
1056
e0a1e121
RÁE
10572015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1058
1059 * object.cc (write_local_symbols): avoid std::vector copy.
1060
45a4fb1a
RÁE
10612015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1062
1063 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1064
2d9afefe
MW
10652015-02-09 Mark Wielaard <mjw@redhat.com>
1066
1067 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1068 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1069
e9c1bdad
CC
10702015-02-16 Cary Coutant <ccoutant@google.com>
1071
1072 PR gold/13577
1073 PR gold/16992
1074 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1075 DF_SYMBOLIC if --dynamic-list option is used.
1076 * options.cc (General_options::finalize): --dynamic-list is not
1077 mutually exclusive with -Bsymbolic.
1078 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1079 listed in --dynamic-list.
1080 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1081 -Bsymbolic-functions.
1082 * testsuite/Makefile.in: Regenerate.
1083
0ed4b0bf
CC
10842015-02-16 Cary Coutant <ccoutant@google.com>
1085
1086 PR gold/17971
1087 * incremental.cc: Remove redundant include of "output.h".
1088
1a920511
JY
10892015-02-12 Jing Yu <jingyu@google.com>
1090
1091 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1092 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1093 New relocation.
1094 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1095 TLSLE_MOVW_* relocations.
1096 (Target_aarch64::Scan::global): Likewise.
1097 (Target_aarch64::Relocate::relocate): Likewise.
1098 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1099 for new TLSLE_MOVW_* relocations.
1100
07f107f3
WN
11012015-02-11 Will Newton <will.newton@linaro.org>
1102
1103 PR gold/13321
1104 * arm.cc (Target_arm::make_plt_section): Create an ARM
1105 state mapping symbol at the start of the PLT.
1106
e051a5b5
L
11072015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1108
1109 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1110 Replace two_file_shared_2.so with two_file_shared_1.so.
1111 * testsuite/Makefile.in: Regenerated.
1112
dddcc5b9
AM
11132015-02-09 Alan Modra <amodra@gmail.com>
1114
1115 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1116 plugin_test_thin.a and defsym_test.
1117 * testsuite/Makefile.in: Regenerate.
1118
b39b8b9d
RÁE
11192015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1120
1121 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1122 body.
1123
b66d1c52
CC
11242015-02-04 Peter Collingbourne <pcc@google.com>
1125
1126 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1127 forwarding symbols when computing symbol resolution info for plugins.
1128 * plugin.h (Plugin_manager::symtab): New method.
1129 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1130
23081de0
CC
11312015-02-03 Cary Coutant <ccoutant@google.com>
1132 Peter Collingbourne <pcc@google.com>
1133
1134 PR gold/15660
1135 * archive.cc (Thin_archive_object_unlocker): New class.
1136 (Archive::include_member): Unlock external members of thin archives.
1137 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1138 (plugin_test_2): Likewise.
1139 (plugin_test_3): Likewise.
1140 (plugin_test_4): Likewise.
1141 (plugin_test_5): Likewise.
1142 (plugin_test_6): Likewise.
1143 (plugin_test_7): Likewise.
1144 (plugin_test_8): Likewise.
1145 (plugin_test_9): Likewise.
1146 (plugin_test_10): Likewise.
1147 (plugin_test_11): New test case.
1148 * testsuite/Makefile.in: Regenerate.
1149 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1150 file to decide whether to claim file.
1151 (all_symbols_read_hook): Likewise.
1152 * testsuite/plugin_test_1.sh: Adjust expected output.
1153 * testsuite/plugin_test_2.sh: Likewise.
1154 * testsuite/plugin_test_3.sh: Likewise.
1155 * testsuite/plugin_test_6.sh: Likewise.
1156 * testsuite/plugin_test_tls.sh: Likewise.
1157 * testsuite/plugin_test_11.sh: New testcase.
1158
11592015-02-03 Cary Coutant <ccoutant@google.com>
1160
1161 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1162 file descriptors when debugging enabled. Add debug output.
1163 (Descriptors::release): Add debug output.
1164 (Descriptors::close_some_descriptor): Likewise.
1165 (Descriptors::close_all): Likewise.
1166 * fileread.cc (File_read::lock): Likewise.
1167 (File_read::unlock): Likewise.
1168
24dd5808
CC
11692015-02-02 Cary Coutant <ccoutant@google.com>
1170
1171 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1172 executable output file.
1173
fa89cc82
HS
11742015-01-22 Han Shen <shenhan@google.com>
1175
1176 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1177 (Target_arm::do_plt_address_for_global): New method.
1178 (Target_arm::do_plt_address_for_local): New method.
1179 (Target_arm::rel_irelative_section): New method.
1180 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1181 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1182 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1183 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1184 (Target_arm::Scan::check_non_pic): Add ifunc support.
1185 (Target_arm::Scan::local): Add ifunc support.
1186 (Target_arm::Scan::global): Add ifunc support.
1187 (Target_arm::make_plt_section): New method.
1188 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1189 (Target_arm::make_local_ifunc_plt_entry): New method.
1190 (Target_arm::got_irelative_): New member.
1191 (Target_arm::rel_irelative_): New member.
1192 (Target_arm::got_section): Add creation for got_irelative_.
1193 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1194 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1195 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1196 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1197 (Output_data_plt_arm::IRelative_data): New type.
1198 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1199 (Output_data_plt_arm::add_entry): Add more parameters.
1200 (Output_data_plt_arm::add_relocation): New method.
1201 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1202 (Output_data_plt_arm::rel_irelative): New method.
1203 (Output_data_plt_arm::entry_count): Modified.
1204 (Output_data_plt_arm::address_for_global): New method.
1205 (Output_data_plt_arm::address_for_local): New method.
23081de0 1206gold/
fa89cc82
HS
1207 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1208 (Output_data_plt_arm::insert_irelative_data): New method.
1209 (Output_data_plt_arm::irelative_rel_): New member.
1210 (Output_data_plt_arm::got_): New member.
1211 (Output_data_plt_arm::got_irelative_): New member.
1212 (Output_data_plt_arm::irelative_count_): New member.
1213 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1214 (Output_data_plt_arm::irelative_data_vec_): New member.
1215 (Output_data_plt_arm::do_write): Write out irelative entries.
1216 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1217 more parameters to ctor.
1218 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1219 more parameters to ctor.
1220 * output.h (Output_data_reloc::add_local_relative): New method.
1221 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1222
0f81d3f0
AM
12232015-01-29 Alan Modra <amodra@gmail.com>
1224
1225 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1226 and GOT_TLSGD to LE optimization.
1227
65d92137
CC
12282015-01-28 Cary Coutant <ccoutant@google.com>
1229
1230 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1231 for undef TLS symbols.
1232 (Target_x86_64::Relocate::relocate_tls): Likewise.
1233 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1234
5485698a
CC
12352015-01-25 Cary Coutant <ccoutant@google.com>
1236
1237 * output.cc (Output_segment::set_section_addresses): Fix calculation
1238 of size of relro segment.
1239
b01a4b04
AM
12402015-01-22 Alan Modra <amodra@gmail.com>
1241
1242 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1243 condition for need of ifunc plt entry.
1244 (Target_powerpc::Scan::global <got relocs>): Likewise.
1245
3d0064a9
CC
12462015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1247
1248 * mips.cc (reloc_high): Add r_sym.
1249 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1250 reloc_high constructor.
1251 (Mips_relocate_functions::relgot16_local): Likewise.
1252 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1253 r_type to decide whether LO16 matches HI16.
1254 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1255 rello16 and relgot16_local.
1256
a5cd8f05
CC
12572015-01-09 Cary Coutant <ccoutant@google.com>
1258
1259 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1260 unless alignment is larger than page size.
1261
4fc1b9d4
L
12622015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1263 Cary Coutant <ccoutant@google.com>
1264
1265 PR gold/17729
1266 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1267 (DEFAULT_TARGET_X32): Set for x32.
1268 * x86_64.cc (cmp_insn_32): New.
1269 (lea_r10_insn_32): Likewise.
1270 (lea_r11_insn_32): Likewise.
1271 (cmp_insn_64): Likewise.
1272 (lea_r10_insn_64): Likewise.
1273 (lea_r11_insn_64): Likewise.
1274 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1275 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1276 (check_DATA): Add split_x32 files.
1277 (split_x32_[1234n].o): New targets.
1278 (split_x32_[124]): New targets.
1279 (split_x32_[1234r].stdout): New targets.
1280 * testsuite/split_x32.sh: New file.
1281 * testsuite/split_x32_1.s: Likewise.
1282 * testsuite/split_x32_2.s: Likewise.
1283 * testsuite/split_x32_3.s: Likewise.
1284 * testsuite/split_x32_4.s: Likewise.
1285 * testsuite/split_x32_n.s: Likewise.
1286 * configure: Regenerated.
1287 * testsuite/Makefile.in: Likewise.
1288
e749cab8
L
12892015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1290
1291 PR gold/17809
1292 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1293 x32.
1294
af759df0
AM
12952015-01-02 Alan Modra <amodra@gmail.com>
1296
1297 * version.cc (print_version): Just print current year.
1298 * dwp.cc (print_version): Likewise.
1299
b90efa5b
AM
13002015-01-01 Alan Modra <amodra@gmail.com>
1301
1302 Update year range in copyright notice of all files.
1303
f12d1e8a
AM
13042014-12-25 Alan Modra <amodra@gmail.com>
1305
1306 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1307 new enums.
1308 (Target_arm::merge_object_attributes, ): Likewise.
1309
5c294fee
TG
13102014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1311
1312 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1313 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1314 AEABI_VFP_args_vfp to check that.
1315 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1316 value and replace hardcoded values by enum values.
1317
e30880c2
CC
13182014-12-22 Cary Coutant <ccoutant@google.com>
1319
1320 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1321
bd040da1
L
13222014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1323
1324 PR gold/14608
1325 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1326 to "return i * i * 3;".
1327
e02a4046
CC
13282014-12-16 Cary Coutant <ccoutant@google.com>
1329
1330 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1331 (Mapfile::print_output_data): Use current_data_size() to avoid
1332 assert for sections requiring postprocessing; if address is not valid,
1333 print 0.
1334 (Mapfile::print_output_section): Use current_data_size(); print note
1335 that addresses and sizes are before compression.
1336
add6016b
L
13372014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1338
1339 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1340 Cast current_group_size to unsigned long when reporting error.
1341
0bf32ea9
JY
13422014-12-10 Jing Yu <jingyu@google.com>
1343
1344 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1345 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1346 Update error message.
1347 (Target_aarch64::do_relax): Use absolute value of option
1348 stub_group_size. Replace local variable with class member
1349 stub_group_size_.
1350
cbcb23fa
AM
13512014-12-04 Alan Modra <amodra@gmail.com>
1352
1353 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1354 addend of PLTREL24 reloc when not generating a plt stub. Make
1355 max_branch_offset an "Address".
fbad6518 1356 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1357 (Target_powerpc::Relocate::relocate): Likewise.
1358
1611bc4a
AM
13592014-12-04 Alan Modra <amodra@gmail.com>
1360
1361 PR 17670
1362 * symtab.cc (Symbol::set_undefined): Remove assertion.
1363 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1364 on symbols defined in discarded sections, instead return false.
1365 Rearrange params, update all callers.
1366 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1367 branches to syms in discarded sections.
1368 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1369 undefined and flag as discarded.
1370 (Target_powerpc::Relocate::relocate): Localize variable.
1371
4759c34e
L
13722014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1373
1374 PR gold/17675
1375 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1376 * testsuite/Makefile.in: Regenerated.
1377
1f98a074
AM
13782014-12-03 Alan Modra <amodra@gmail.com>
1379
1380 PR 17566
1381 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1382 when adding dynamic relocations against section symbols.
1383
fb257835
DI
13842014-12-01 Dimitry Ivanov <dimitry@google.com>
1385
1386 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1387 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1388 * options.h (General_options): New -z option (global).
1389
d8e60314
CC
13902014-12-01 Cary Coutant <ccoutant@google.com>
1391
1392 PR gold/17578
1393 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1394 is given.
1395 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1396 given but some inputs require executable stack.
1397
982bbd97
CC
13982014-11-26 Cary Coutant <ccoutant@google.com>
1399
1400 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1401 .debug_str_offsets; strip .debug_gnu_pubnames and
1402 .debug_gnu_pubtypes.
1403 (lines_only_debug_sections): Strip all four new sections.
1404
bb779192
HS
14052014-11-26 Jing Yu <jingyu@google.com>
1406
1407 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1408 register to be x0 when to relax TLSDESC_LD64_LO12.
1409
a3e60ddb
AM
14102014-11-26 Alan Modra <amodra@gmail.com>
1411
1412 * powerpc.cc (struct Stub_table_owner): New.
1413 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1414 unsigned int vector. Update all references.
1415 (powerpc_relobj::set_stub_table): Take an unsigned int param
1416 rather than a Stub_table. Update callers.
1417 (Powerpc_relobj::clear_stub_table): New function.
1418 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1419 stub_group_size_ vars.
1420 (Target_powerpc::new_stub_table): Delete.
1421 (max_branch_delta): New function, extracted from..
1422 (Target_powerpc::Relocate::relocate): ..here..
1423 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1424 status on whether stub created successfully.
1425 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1426 default sizing to..
1427 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1428 reduce on relax failure.
1429 (Target_powerpc::group_sections): Add "no_size_errors" param.
1430 Use stub_group_size_. Set up group info in a temp vector,
1431 before building Stub_table vector. Account for input sections
1432 possibly already converted to relaxed sections.
1433 (Stub_table::init): Delete. Merge into..
1434 (Stub_table::Stub_table): ..here.
1435 (Stub_table::can_reach_stub): New function.
1436 (Stub_table::add_plt_call_entry): Add "from" parameter and
1437 return true iff stub could be reached.
1438 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1439 param too.
1440 (Stub_table::clear_stubs): Add "all" param.
1441
a20605cf
AM
14422014-11-26 Alan Modra <amodra@gmail.com>
1443
1444 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1445 (Target_powerpc::group_sections): Use it.
1446
43b64deb
CC
14472014-11-25 Cary Coutant <ccoutant@google.com>
1448
1449 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1450 (Binary_to_elf::write_symbol): Add st_size parameter.
1451 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1452
c924eb67
CC
14532014-11-25 Cary Coutant <ccoutant@google.com>
1454
1455 PR gold/17639
1456 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1457 (Sized_relobj_file::do_layout): Handle deferred sections properly
1458 during GC pass 1. Don't add reloc sections to deferred list twice.
1459 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1460 (Sized_relobj_file::is_deferred_layout_): New data member.
1461
9d585188
L
14622014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1463
1464 PR gold/17619
1465 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1466 Check PC-relative offset overflow in PLT entry.
1467
3ffaac20
AM
14682014-11-21 Alan Modra <amodra@gmail.com>
1469
1470 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1471 for undefined weaks.
1472
0cfb0717
AM
14732014-11-20 Alan Modra <amodra@gmail.com>
1474
1475 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1476 from --stub-group-size parameter divided by 1024.
1477 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1478 template parameter. Update all uses.
1479 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1480 has_stub_value. Set for long branches. Don't report overflow for
1481 branch to undefined weak symbols. Print info message on
1482 overflowing branch to stub.
1483
f9dffbf0
AM
14842014-11-20 Alan Modra <amodra@gmail.com>
1485
1486 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1487
e88ba8d5
L
14882014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1489
1490 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1491 entry for R_X86_64_GOTPLT64.
1492 (Target_x86_64<size>::Relocate::relocate): Update comments for
1493 R_X86_64_GOTPLT64.
1494
d37ffe25
ED
14952014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1496
1497 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1498 * plugin.h: add lock definition
1499
9726c3c1
HS
15002014-10-29 Han Shen <shenhan@google.com>
1501 Jing Yu <jingyu@google.com>
1502
1503 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1504 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1505 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1506 Symbol::TLS_REF.
1507 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1508 method.
1509 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1510 (Target_aarch64::tls_ld_to_le): New method.
1511 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1512 for 64bit targets.
1513 (Output_data_plt_aarch64::irelative_rel_): New data member.
1514 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1515 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1516 (Output_data_plt_aarch64::add_relocation): New method.
1517 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1518 offset. Add got_irelative size to got size.
1519 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1520 type string with the new typename.
1521 (AArch64_relocate_functions::update_adr): Replace parameter x with
1522 immed.
1523 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1524 (AArch64_relocate_functions::reloc_common): New method.
1525 (AArch64_relocate_funcsions::rela_general): Extract common part out
1526 into reloc_common method.
1527 (AArch64_relocate_functions::rela_general): Likewise.
1528 (AArch64_relocate_functions::pcrela_general): Likewise.
1529 (AArch64_relocate_functions::adr): New method.
1530 (AArch64_relocate_functions::adrp): Calculate immed before calling
1531 update_adr.
1532 (AArch64_relocate_functions::adrp): Likewise.
1533 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1534 comparing x to 0. Calculate immed from ~x when x < 0.
1535 (Target_aarch64::optimize_tls_reloc): Add new cases for
1536 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1537 TLSLD_MOVW_DTPREL_G0_NC.
1538 (Target_aarch64::possible_function_pointer_reloc): Implement this
1539 method.
1540 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1541 comment.
1542 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1543 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1544 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1545 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1546 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1547 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1548 (Target_aarch64::make_plt_entry): Call add_entry with two more
1549 parameters.
1550 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1551 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1552 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1553 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1554 (Target_aarch64::Relocate::relocate_tls): Add cases for
1555 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1556 TLSLD_MOVW_DTPREL_G0_NC.
1557 * testsuite/icf_safe_so_test.cc: Correct test comment.
1558 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1559
80272b8c
AM
15602014-10-22 Alan Modra <amodra@gmail.com>
1561
1562 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1563 thread_starter.
1564
998a69f4
AS
15652014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1566
1567 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1568
aed56ec5
CC
15692014-10-17 Cary Coutant <ccoutant@google.com>
1570
1571 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1572 Add "typename" keyword.
1573
bb779192 15742014-10-15 Han Shen <shenhan@google.com>
72f4393d 1575 Jing Yu <jingyu@google.com>
83a01957
HS
1576
1577 Patch for gold aarch64 backend to support relaxation.
1578 * aarch64-reloc.def: Change format.
1579 * aarch64.cc (class Reloc_stub): New class.
1580 (class Stub_table): New class.
1581 (class AArch64_relobj): New class.
1582 (class AArch64_input_section): New class.
1583 (class AArch64_output_section): New class.
1584 (Target_aarch64::new_stub_table): New method.
1585 (Target_aarch64::new_aarch64_input_section): New method.
1586 (Target_aarch64::find_aarch64_input_section): New method.
1587 (Target_aarch64::scan_section_for_stubs): New method.
1588 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1589 (Target_aarch64::relocate_stub): New method.
1590 (Target_aarch64::current_target): New method.
1591 (Target_aarch64::do_make_elf_object): New method.
1592 (Target_aarch64::do_may_relax): New method.
1593 (Target_aarch64::do_relax): New method.
1594 (Target_aarch64::group_sections): New method.
1595 (Target_aarch64::scan_reloc_for_stub): New method.
1596 (Target_aarch64::do_make_output_section): New method.
1597 (Target_aarch64::stub_tables_): New data member.
1598 (Target_aarch64::aarch64_input_section_map_): New data member.
1599 (AArch64_relocate_functions::maybe_apply_stub): New method.
1600
db4c9594
CC
16012014-09-30 Cary Coutant <ccoutant@google.com>
1602
1603 PR gold/17432
1604 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1605
cd6da036
KC
16062014-09-30 Kito Cheng <kito@0xlab.org>
1607
1608 PR gold/13597
1609 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1610 hash table before sysv-style hash table.
1611
5f772412
ST
16122014-09-29 Sriraman Tallam <tmsriram@google.com>
1613
1614 * options.h (--pic-executable): Add negative to alias to -no-pie.
1615
5efeedf6
CC
16162014-09-26 Cary Coutant <ccoutant@google.com>
1617
1618 PR gold/16773
1619 * object.cc (Sized_relobj_file): Compute value of section symbols
1620 for TLS sections the same as TLS symbols.
1621
1707f183
CC
16222014-09-25 Cary Coutant <ccoutant@google.com>
1623
1624 PR gold/17432
1625 * resolve.cc (Symbol_table::resolve): Override common placeholder
1626 symbols, but adjust sizes.
1627 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1628 symbols to common lists.
1629
00cac886
AM
16302014-09-24 Alan Modra <amodra@gmail.com>
1631
1632 * po/POTFILES.in: Regenerate.
1633
635aa30e 16342014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1635 Cary Coutant <ccoutant@google.com>
635aa30e 1636
71b9b91b 1637 PR gold/14860
635aa30e
CC
1638 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1639 on input_sections_blocker.
1640 * layout.cc (Write_sections_task::locks): Unblock
1641 input_sections_blocker_.
1642 * layout.h (Write_sections_task::Write_sections_task): Add
1643 input_sections_blocker.
1644 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1645 to DEPENDENCIES.
1646 * testsuite/Makefile.in: Regenerate.
1647
c0c71592
RÁE
16482014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1649
1650 * testsuite/Makefile.am (plugin_test_10): New test.
1651 * testsuite/Makefile.in: Regenerate
1652 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1653 * testsuite/plugin_test_10.sh: New file.
1654
6168c2a1
RÁE
16552014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1656
1657 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1658 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1659 during the replacement phase.
1660
3a531937
JY
16612014-09-17 Han Shen <shenhan@google.com>
1662 Jing Yu <jingyu@google.com>
1663
1664 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1665 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1666 * aarch64.cc (Target_aarch64): Add data members
1667 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1668 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1669 constructor.
1670 (Target_aarch64::do_reloc_symbol_index): New method.
1671 (Target_aarch64::do_reloc_addend): New method.
1672 (Target_aarch64::add_tlsdesc_info): New method.
1673 (Target_aarch64::do_dynsym_value): New method.
1674 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1675 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1676 (Target_aarch64::make_data_plt): Add new parameters: got,
1677 got_irelative. Pass them to do_make_data_plt.
1678 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1679 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1680 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1681 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1682 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1683 (Target_aarch64::got_tlsdesc_section): New method.
1684 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1685 (Target_aarch64::define_tls_base_symbol): New method.
1686 (Target_aarch64::reserve_tlsdesc_entries): New method.
1687 (Target_aarch64::got_mod_index_entry): New method.
1688 (Target_aarch64::rela_tlsdesc_section): New method.
1689 (Target_aarch64::rela_irelative_section): New method.
1690 (Target_aarch64::Tlsdesc_info): New struct.
1691 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1692 relocations and tlsdesc relocations.
1693 (Target_aarch64::optimize_tls_reloc): Implement method.
1694 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1695 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1696 in constructor.
1697 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1698 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1699 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1700 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1701 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1702 (Output_data_plt_aarch64::rela_irelative): New method.
1703 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1704 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1705 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1706 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1707 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1708 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1709 (Output_data_plt_aarch64_standard): New member variables:
1710 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1711 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1712 New parameter: got, got_irelative.
1713 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1714 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1715 (Output_data_plt_aarch64::do_write): Replace got_address with
1716 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1717 (AArch64_relocate_functions::update_movnz): New method.
1718 (AArch64_relocate_functions): Correct format.
1719 (AArch64_relocate_functions::movnz): New method.
1720 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1721 before the switch. Add new cases to switch.
00cac886 1722 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1723 tlsgd tlsdesc cases.
1724 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1725 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1726 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1727 Call reloc_name_in_error_message to print unsupported reloc.
1728 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1729 make_data_plt.
1730 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1731 relocs. Fill in some more dynamic tags.
1732 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1733 Skip call tls_get_addr when tlsgd is relaxed.
1734 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1735 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1736 tlsdesc->ie relaxation.
1737
62661c93
SS
17382014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1739
1740 * mips.cc (Target_mips_nacl): New class.
1741 (Target_selector_mips_nacl): New class.
1742 (target_selector_mips32): Rename from target_selector_mips32be and use
1743 Target_selector_mips_nacl instead of Target_selector_mips.
1744 (target_selector_mips32el): Rename from target_selector_mips32 and use
1745 Target_selector_mips_nacl instead of Target_selector_mips.
1746 (target_selector_mips64): Rename from target_selector_mips64be and use
1747 Target_selector_mips_nacl instead of Target_selector_mips.
1748 (target_selector_mips64el): Rename from target_selector_mips64 and use
1749 Target_selector_mips_nacl instead of Target_selector_mips.
1750 (Target_mips::mips_info): Add const attribute.
1751
54674d38
CC
17522014-09-02 Cary Coutant <ccoutant@google.com>
1753
1754 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1755 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1756 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1757 (Sized_incr_dynobj::do_section_name): Likewise.
1758 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1759 (Sized_incr_dynobj::do_section_name): Likewise.
1760 * object.h (Object::section_name): Likewise.
1761 (Object::do_section_name): Likewise.
1762 (Sized_relobj_file::do_section_name): Likewise.
1763 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1764 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1765
9860cbcf
CC
17662014-09-02 Cary Coutant <ccoutant@google.com>
1767
1768 PR gold/17005
1769 * ehframe.cc (Fde::write): Add output_offset parameter.
1770 (Cie::write): Likewise.
1771 (Eh_frame::set_final_data_size): Account for offset within output
1772 section.
1773 (Eh_frame::do_sized_write): Likewise.
1774 * ehframe.h (Fde::write): Add output_offset parameter.
1775 (Cie::write): Likewise.
1776 * output.cc (Output_section::Input_section_sort_entry): Remove
1777 section_has_name_; add output_section_name parameter. Use
1778 output section name for non-input sections.
1779 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1780 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1781 (Output_section::Input_section_sort_compare): Remove logic for
1782 sections without names.
1783 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1784 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1785 Likewise.
1786 (Output_section::Input_section_sort_section_name_compare): Likewise.
1787
8e33481e
HS
17882014-08-29 Han Shen <shenhan@google.com>
1789 Jing Yu <jingyu@google.com>
1790
1791 * aarch64-reloc-property.cc
1792 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1793 reference reloc property in the table.
1794 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1795 3 other entries.
1796 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1797 2 new overloaded methods.
1798 (Output_data_got_aarch64::do_write): Add code to write out
1799 static relocs.
1800 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1801 static relocs.
1802 (Output_data_got_aarch64::static_relocs): New vector to
1803 hold static relocs.
1804 (Target_aarch64::TCB_SIZE): New const static memeber.
1805 (Target_aarch64::tcb_size): New method.
1806 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1807 (Target_aarch64::Relocate::relocate_tls): New method.
1808 (Target_aarch64::Scan::local): Add code handling new reloc types.
1809 (Target_aarch64::Scan::global): Add code handling new reloc types.
1810
81233653
ST
18112014-08-13 Sriraman Tallam <tmsriram@google.com>
1812
1813 * options.h (-no-pie): Add option.
1814
9363c7c3
JY
18152014-08-08 Jing Yu <jingyu@google.com>
1816 Han Shen <shenhan@google.com>
1817
1818 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1819 (DEFFILES): add aarch64-reloc.def.
1820 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1821 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1822 * Makefile.in: Regenerate.
1823 * aarch64-reloc-property.cc: New file.
1824 * aarch64-reloc-property.h: New file.
1825 * aarch64-reloc.def: New file.
1826 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1827 with tab to make the format consistent.
1828 (Output_data_got_aarch64::symbol_table_): New method.
1829 (Target_aarch64::do_plt_address_for_global): New method.
1830 (Target_aarch64::do_plt_address_for_local): New method.
1831 (Target_aarch64::do_select_as_default_target): New method.
1832 (Target_aarch64::do_make_data_plt): New method.
1833 (Target_aarch64::make_data_plt): New method.
1834 (Output_data_plt_aarch64::has_irelative_section): New method.
1835 (Output_data_plt_aarch64::address_for_global): New method.
1836 (Output_data_plt_aarch64::address_for_local): New method.
1837 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1838 (Output_data_plt_aarch64::add_entry): Implement contents.
1839 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1840 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1841 the got_pov entry to plt0.
1842 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1843 Implement contents.
1844 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1845 (AArch64_howto): New struct.
1846 (aarch64_howto[]): New static const array.
1847 (AArch64_relocate_functions): New class.
1848 (Target_aarch64::Scan::get_reference_flags): Remove method.
1849 (Target_aarch64::Scan::local): Implement to support a few relocations.
1850 (Target_aarch64::Scan::global): Implement to support a few relocations.
1851 (Target_aarch64::make_plt_section): Implement contents.
1852 (Target_aarch64::make_plt_entry): Implement contents.
1853 (Target_aarch64::do_finalize_sections): Implement contents.
1854 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1855 (Target_aarch64::relocate_section): Implement contents.
1856
ad9fe6c1
AM
18572014-08-06 Alan Modra <amodra@gmail.com>
1858
1859 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1860
7cd4e5b7
AM
18612014-08-06 Alan Modra <amodra@gmail.com>
1862
1863 PR 13227
1864 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1865
5ad9b0a7
ST
18662014-07-21 Sriraman Tallam <tmsriram@google.com>
1867
1868 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1869 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1870
e051745c
CC
18712014-07-08 Cary Coutant <ccoutant@google.com>
1872
1873 * expression.cc (struct Expression::Expression_eval_info): Add
1874 new fields type_pointer, vis_pointer, and nonvis_pointer.
1875 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1876 nonvis_pointer parameters. Adjust all calls.
1877 (Symbol_expression::value): Update type, visibility, and nonvis bits
1878 in caller.
1879 * script.cc (Symbol_assignment::sized_finalize): Update type,
1880 visibility, and remaining st_other bits for new symbol.
1881 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1882 vis_pointer, and nonvis_pointer parameters.
1883 * symtab.h (Symbol::set_type): New method.
1884
1885 * testsuite/Makefile.am (defsym_test): New test.
1886 * testsuite/Makefile.in: Regenerate.
1887 * testsuite/defsym_test.c: New file.
1888 * testsuite/defsym_test.sh: New file.
1889
f35c4853
CC
18902014-07-08 Cary Coutant <ccoutant@google.com>
1891
1892 PR gold/15639
1893 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1894 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1895 (Sized_dynobj::base_read_symbols): ...new method.
1896 * object.h (Sized_relobj_file::base_read_symbols): New method.
1897 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1898 (Sized_relobj_file::base_read_symbols): ...new method.
1899 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1900 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1901 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1902
2900af2d
AM
19032014-07-04 Alan Modra <amodra@gmail.com>
1904
1905 * po/POTFILES.in: Regenerate.
1906
053a4d68
JY
19072014-07-02 Jing Yu <jingyu@google.com>
1908
1909 * aarch64.cc: New file
1910 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1911 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1912 * Makefile.in: Regenerate.
1913 * configure.tgt: Add entries for aarch64*.
1914 * configure.ac: Likewise.
1915 * configure: Likewise.
1916
7b549045
AM
19172014-06-27 Alan Modra <amodra@gmail.com>
1918
1919 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1920
cb818dbf
CC
19212014-06-24 Cary Coutant <ccoutant@google.com>
1922
1923 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1924 sections.
1925 (Dwo_file::sized_read_unit_index): Likewise.
1926
9810d34d
SS
19272014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1928
1929 * mips.cc: New file.
1930 * Makefile.am (TARGETSOURCES): Add mips.cc
1931 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1932 * configure.tgt: Add entries for mips*.
1933 * configure.ac: Likewise.
1934 * Makefile.in: Regenerate.
1935 * configure: Likewise.
1936
9baa787b
CC
19372014-06-09 Cary Coutant <ccoutant@google.com>
1938
1939 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1940 unit_length is within section bounds.
1941
8f89af0a
CC
19422014-06-09 Cary Coutant <ccoutant@google.com>
1943
1944 PR gold/16980
1945 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1946 map.
1947
a47622ac
AM
19482014-06-07 Alan Modra <amodra@gmail.com>
1949
1950 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1951
4320c691
CC
19522014-06-06 Cary Coutant <ccoutant@google.com>
1953
1954 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1955 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1956 (Dwarf_pubnames_table::read_header): Likewise.
1957 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1958 .debug_gnu_pubtypes.
1959
270c9937
JB
19602014-06-05 Joel Brobecker <brobecker@adacore.com>
1961
1962 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1963 * Makefile.in, configure: Regenerate.
1964
397998fc
AM
19652014-06-03 Alan Modra <amodra@gmail.com>
1966
1967 * powerpc.cc (addis_12_2): Define.
1968 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1969
61f5c66f
AM
19702014-06-03 Alan Modra <amodra@gmail.com>
1971
1972 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1973 st_other output.
1974
f6971787
AM
19752014-06-02 Alan Modra <amodra@gmail.com>
1976
1977 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1978 Only ignore relocs on ELFv1.
1979 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1980
f6fb8322
CC
19812014-05-30 Cary Coutant <ccoutant@google.com>
1982
1983 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1984 * testsuite/Makefile.in: Regenerate.
1985 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1986
c23dd342
L
19872014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1988
1989 PR gold/16945
1990 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1991 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1992
5fe7ffdc
AM
19932014-05-15 Alan Modra <amodra@gmail.com>
1994
1995 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1996 Compare FDE contents with DW_CFA_nop rather than 0.
1997
a82bef93
ST
19982014-05-13 Sriraman Tallam <tmsriram@google.com>
1999
2000 * symtab.h (may_need_copy_reloc): Remove check for position independent
2001 code.
2002 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2003 position independence before pc absolute may_need_copy_reloc call.
2004 Add check for executable output befor pc relative may_need_copy_reloc
2005 call.
2006 * i386.cc: Ditto.
2007 * arm.cc: Ditto.
2008 * sparc.cc: Ditto.
2009 * tilegx.cc: Ditto.
2010 * powerpc.cc: Add check for no position independence before
2011 may_need_copy_reloc calls.
2012 * testsuite/pie_copyrelocs_test.cc: New file.
2013 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2014 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2015 * Makefile.in: Regenerate.
a82bef93 2016
53c66605
ML
20172014-05-08 Martin Liška <mliska@suse.cz>
2018
2019 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2020
57b2284c
CC
20212014-05-06 Cary Coutant <ccoutant@google.com>
2022
2023 PR gold/16900
2024 * i386.cc (Output_data_got_plt_i386): New class.
2025 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2026 parameter. Change all callers.
2027 (Output_data_plt_i386::layout_): Remove.
2028 (Output_data_plt_i386::got_plt_): Change type.
2029 (Target_i386::got_plt_): Change type. Change all references.
2030 (Target_i386::got_section): Create instance of new class.
2031 (Output_data_got_plt_i386::do_write): New function.
2032 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2033 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2034 parameter. Change all callers.
2035 (Output_data_plt_x86_64::layout_): Remove.
2036 (Output_data_plt_x86_64::got_plt_): Change type.
2037 (Target_x86_64::got_plt_): Change type. Change all references.
2038 (Target_x86_64::got_section): Create instance of new class.
2039 (Output_data_got_plt_x86_64::do_write): New function.
2040 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2041 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2042 class.
2043
6b97515d 20442014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2045
6b97515d
CC
2046 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2047 if we have pubnames/pubtypes.
2048
d1bddd3c
CC
20492014-05-02 Cary Coutant <ccoutant@google.com>
2050
5fe7ffdc
AM
2051 * defstd.cc (in_segment): Define __ehdr_start here...
2052 * layout.cc (Layout::finalize): ...Instead of here. Set the
2053 output segment when known.
2054 * resolve.cc (Symbol::override_base_with_special): Remember
2055 the original binding.
2056 * symtab.cc (Symbol::set_output_segment): New function.
2057 (Symbol::set_undefined): New function.
2058 * symtab.h (Symbol::is_weak_undefined): Check original undef
2059 binding.
2060 (Symbol::is_strong_undefined): New function.
2061 (Symbol::set_output_segment): New function.
2062 (Symbol::set_undefined): New function.
2063 * target-reloc.h (is_strong_undefined): Remove.
2064 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2065 Check for hidden undefs.
2066 (relocate_section): Call Symbol::is_strong_undefined.
2067
2068 * testsuite/Makefile.am (ehdr_start_test_1)
2069 (ehdr_start_test_2, ehdr_start_test_3)
2070 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2071 * testsuite/Makefile.in: Regenerate.
2072 * testsuite/ehdr_start_def.cc: New source file.
2073 * testsuite/ehdr_start_test.cc: New source file.
2074 * testsuite/ehdr_start_test.t: New linker script.
2075 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2076
7849f6d8
CC
20772014-04-23 Cary Coutant <ccoutant@google.com>
2078
bf2cc635 2079 PR gold/16870
7849f6d8
CC
2080 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2081
99fd8cff
CC
20822014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2083
2084 * layout.cc (Layout::include_section): Allow a target to decide
2085 whether to include a section.
2086 * target.h (Target::should_include_section): New function.
2087 (Target::do_should_include_section): New function.
2088
91f43acd
CC
20892014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2090
2091 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2092 inline into ...
2093 (Copy_relocs::emit): ... here.
2094 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2095 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2096 (Copy_reloc_entry::entries_): Change from private to protected.
2097
c4eb27e1
ST
20982014-04-02 Sriraman Tallam <tmsriram@google.com>
2099
2100 * icf.cc (get_section_contents): Replace copies of reloc
2101 vectors with const references.
2102
ae447ddd
CC
21032014-04-02 Cary Coutant <ccoutant@google.com>
2104
2105 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2106 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2107 * configure: Regenerate.
2108 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2109 -fno-use-linker-plugin.
2110 (LINK1, CXXLINK1): Add it to the link command.
2111 * testsuite/Makefile.in: Regenerate.
2112
fa47fa92
AM
21132014-03-12 Alan Modra <amodra@gmail.com>
2114
2115 * Makefile.in: Regenerate.
2116
9b12c500
CC
21172014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2118
2119 * symtab.h (Symbol::set_nonvis): New function.
2120
beacaa96
CC
21212014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2122
2123 * symtab.cc (Sized_symbol<32>::init_output_data):
2124 Instantiate the template.
2125 (Sized_symbol<64>::init_output_data): Likewise.
2126
800d9823
CC
21272014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2128
2129 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2130 adjust dynamic symbol value.
2131 * target.h (Target::adjust_dyn_symbol): New function.
2132 (Target::do_adjust_dyn_symbol): New function.
2133
918fc1f8 21342014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2135
918fc1f8
CC
2136 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2137 Get the value of DYNAMIC_CUSTOM dynamic entry.
2138 * output.h (Output_data_dynamic::add_custom): New function.
2139 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2140 dynamic entry.
2141 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2142 * target.h (Target::dynamic_tag_custom_value): New function.
2143 (Target::do_dynamic_tag_custom_value): New function.
2144
98ff9231
CC
21452014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2146
2147 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2148 dynsym indexes.
2149 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2150 (Target::do_has_custom_set_dynsym_indexes): New function.
2151 (Target::set_dynsym_indexes): New function.
2152 (Target::do_set_dynsym_indexes): New function.
2153
b80eed39
AM
21542014-03-07 Alan Modra <amodra@gmail.com>
2155
2156 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2157 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2158 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2159 (Powerpc_relocate_functions::has_overflow_bitfield,
2160 overflowed): Use the above.
2161 (Target_powerpc::Relocate::relocate): Correct overflow checking
2162 for a number of relocations. Modify overflow test for 16-bit
2163 fields in instructions to signed/unsigned according to whether
2164 the field takes a signed or unsigned value.
2165
4b95cf5c
AM
21662014-03-05 Alan Modra <amodra@gmail.com>
2167
2168 Update copyright years.
2169
45965137
AM
21702014-03-05 Alan Modra <amodra@gmail.com>
2171
2172 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2173 R_PPC64_ADDR64_LOCAL.
2174 (Target_powerpc::Relocate::relocate): Likewise.
2175
2c80b753
AM
21762014-03-03 Alan Modra <amodra@gmail.com>
2177
2178 * dwp.cc (print_version): Update copyright year to current.
2179
c1c69e83
AM
21802014-02-10 Alan Modra <amodra@gmail.com>
2181
2182 * po/gold.pot: Regenerate.
2183
dd0c4e70
CC
21842014-02-06 Cary Coutant <ccoutant@google.com>
2185
2186 Fix problem where -u is ignored when a weak undef is seen.
2187
2188 * archive.cc (Library_base::should_include_member): Reorder
2189 code to check for -u option if a weak undef has already been seen.
2190 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2191 * testsuite/Makefile.in: Regenerate.
2192 * testsuite/weak_undef_file3.cc: New file.
2193 * testsuite/weak_undef_file4.cc: New file.
2194 * testsuite/weak_undef_test_2.cc: New file.
2195
1a221d3d
CC
21962014-02-05 Cary Coutant <ccoutant@google.com>
2197
2198 Fix issues with gold undefined symbol diagnostics.
2199
2200 PR binutils/15435
2201 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2202 check to here.
2203 * target-reloc.h (is_strong_undefined): New function.
2204 (relocate_section): Move undef vtable symbol check from here.
2205 Check for is_strong_undefined.
2206
e889f0a4 22072014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2208
e889f0a4
CC
2209 Fix problems with the --dynamic-list option.
2210
2211 PR gold/13577
2212 * options.cc (General_options::parse_dynamic_list):
2213 Set have_dynamic_list_.
2214 (General_options::General_options): Initialize have_dynamic_list_.
2215 (General_options::finalize): Turn off -Bsymbolic and
2216 -Bsymbolic-functions if --dynamic-list provided.
2217 * options.h (General_options::have_dynamic_list): New function.
2218 (General_options::have_dynamic_list_): New data member.
2219 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2220 correctly.
5fe7ffdc 2221
e889f0a4
CC
2222 PR gold/16530
2223 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2224 in --dynamic-list, mark it.
5fe7ffdc 2225
e889f0a4
CC
2226 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2227 (dynamic_list_2): New test case.
2228 * testsuite/Makefile.in: Regenerate.
2229 * testsuite/dynamic_list_2.cc: New file.
2230 * testsuite/dynamic_list_2.t: New file.
2231 * testsuite/dynamic_list_lib1.cc: New file.
2232 * testsuite/dynamic_list_lib2.cc: New file.
2233 * testsuite/gc_dynamic_list_test.c: New file.
2234 * testsuite/gc_dynamic_list_test.sh: New file.
2235 * testsuite/gc_dynamic_list_test.t: New file.
2236
ec673e64
CC
22372014-01-28 Cary Coutant <ccoutant@google.com>
2238
2239 Add .gdb_index version 7 support.
2240
2241 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2242 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2243 debug sections.
2244 (Dwarf_ranges_table::read_ranges_table): Likewise.
2245 (Dwarf_pubnames_table::read_section): Check for GNU-style
2246 sections, and for compressed debug sections.
2247 (Dwarf_pubnames_table::read_header): Compute end address of table.
2248 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2249 for end of list by offset, not by offset == 0.
2250 (Dwarf_info_reader::do_read_string_table): Check for compressed
2251 debug sections.
2252 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2253 Initialize new data members.
2254 (Dwarf_pubnames_table::next_name): return flag_byte.
2255 (Dwarf_pubnames_table::end_of_table_): New data member.
2256 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2257 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2258 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2259 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2260 read skeleton type unit DIEs.
2261 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2262 (Gdb_index::do_write): Write flag_byte.
2263 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2264 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2265 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2266 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2267
221fd5d5
L
22682014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2269
2270 * version.cc (print_version): Update copyright year to 2014.
2271
6c09fb0b
ILT
22722013-12-19 Dimitry Andric <dimitry@andric.com>
2273
2274 * stringpool.cc (Stringpool_template::reserve): Add
2275 HAVE_UNORDERED_MAP case.
2276 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2277
8356f2d0
CC
22782013-12-18 Cary Coutant <ccoutant@google.com>
2279
2280 * configure.ac: Check for <unordered_set> and <unordered_map>.
2281 * config.in: Regenerate.
2282 * configure: Regenerate.
2283 * system.h: Use <unordered_set> and <unordered_map> if available.
2284
f2c7d7ee
RM
22852013-12-10 Roland McGrath <mcgrathr@google.com>
2286
2287 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2288 with $(INSTALL_PROGRAM_ENV).
2289 * Makefile.in: Regenerate.
2290
6632e8cc
CC
22912013-11-22 Cary Coutant <ccoutant@google.com>
2292
2293 * configure.ac: Add check for which library is needed for
2294 dlopen.
2295 * configure: Regenerate.
2296
0c075858
CC
22972013-11-22 Cary Coutant <ccoutant@google.com>
2298
2299 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2300 assembler.
2301 * testsuite/Makefile.in: Regenerate.
2302
f49fe902
L
23032013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2304
2305 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2306 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2307 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2308 (Target_x86_64<size>::Scan::local): Likewise.
2309 (Target_x86_64<size>::Scan::global): Likewise.
2310 (Target_x86_64<size>::Relocate::relocate): Likewise.
2311 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2312 Likewise.
2313 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2314 R_X86_64_PC32_BND.
2315
2316 * testsuite/Makefile.am (check_PROGRAMS): Add
2317 exception_x86_64_bnd_test.
2318 (exception_x86_64_bnd_test_SOURCES): New macro.
2319 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2320 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2321 (exception_x86_64_bnd_test_LDADD): Likewise.
2322 (exception_x86_64_bnd_1.o): New rule.
2323 (exception_x86_64_bnd_2.o): Likewise.
2324 * testsuite/Makefile.in: Regenerated.
2325
9055360d
AM
23262013-11-15 Alan Modra <amodra@gmail.com>
2327
2328 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2329 accessor.
2330 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2331 Only call ppc64_local_entry_offset for 64-bit. Restrict
2332 symval_for_branch lookup to ELFv1.
2333 (Stub_table::add_plt_call_entry): Use unsigned int off.
2334 (Output_data_glink::Address, invalid_address): New.
2335 (Output_data_glink::add_eh_frame): Move out of line. Add
2336 support for ELFv2.
2337 (Output_data_glink::add_global_entry, find_global_entry,
2338 global_entry_address): New functions.
2339 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2340 ge_size): New variables.
2341 (Output_data_glink::set_final_data_size): Add global entry
2342 stub sizing.
2343 (Output_data_glink::do_write): Write global entry stubs.
2344 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2345 parameter. Return true for ELFv2. Adjust callers.
2346 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2347 ELFv1. Similarly for ifunc and dynamic relocation processing
2348 specific to ELFv1. Recognize that symbols are defined on
2349 their plt entries for ELFv2.
2350 (Target_powerpc::symval_for_branch): Assert if called for
2351 ELFv2 or ppc32.
2352 (Target_powerpc::Relocate::relocate): Use global entry plt
2353 stub for symbol value if such exists on ELFv2.
2354 (Target_powerpc::Relocate::relocate): Don't call
2355 symval_for_branch when ELFv2. Do adjust for local entry
2356 offset when ELFv2.
2357 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2358 plt stub for ELFv2.
2359 (Target_powerpc::do_plt_address_for_global): Similarly.
2360
cafdd569
CC
23612013-11-14 Cary Coutant <ccoutant@google.com>
2362
2363 Revert patch -- this did not fix the problem, and there is
2364 no race there.
2365
2366 2013-11-14 Cary Coutant <ccoutant@google.com>
2367
2368 PR gold/14860
2369 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2370 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2371 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2372 updating fde_offsets_.
2373 (Eh_frame_hdr::lock_): New data member.
2374
94e49e16
CC
23752013-11-14 Cary Coutant <ccoutant@google.com>
2376
2377 * dwp.cc (Dwo_file_entry): New type.
2378 (File_list): Use Dwo_file_entry.
2379 (Dwo_file::verify): New function.
2380 (Dwo_file::verify_dwo_list): New function.
2381 (Dwo_file::sized_verify_dwo_list): New function.
2382 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2383 list.
2384 (Dwp_options): New enum type.
2385 (dwp_options): Add --verify-only.
2386 (usage): Likewise.
2387 (main): Likewise.
2388 * dwp.h (gold_info): Add declaration.
2389
7cdd7d57
CC
23902013-11-14 Cary Coutant <ccoutant@google.com>
2391
2392 PR gold/14860
2393 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2394 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2395 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2396 updating fde_offsets_.
2397 (Eh_frame_hdr::lock_): New data member.
2398
1d946cb3
CC
23992013-11-06 Cary Coutant <ccoutant@google.com>
2400
2401 PR gold/15758
2402 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2403 before reloc sections.
2404
4f65b40e
AM
24052013-11-04 Alan Modra <amodra@gmail.com>
2406
2407 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2408 (Symbol::needs_dynamic_reloc): Test new flag.
2409 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2410 (Target_powerpc::Scan::get_reference_flags): Add target param.
2411 Return FUNC_DESC_ABI for 64-bit ELFv1.
2412 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2413 call.
2414 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2415 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2416
908794a9
CC
24172013-10-31 Cary Coutant <ccoutant@google.com>
2418
2419 Restore support for dwp v2 DWARF package file format.
2420
2421 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2422 tu_length parameter. Adjust all callers.
2423 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2424 * dwp.cc: Include dwarf.h.
2425 (Section_bounds): New struct type.
2426 (Unit_set): New struct type.
2427 (Dwo_file::Dwo_file): Initialize new data member.
2428 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2429 Combine and rename to...
2430 (Dwo_file::read_unit_index): ...this.
2431 (Dwo_file::sized_read_compunit_index)
2432 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2433 (Dwo_file::sized_read_unit_index): ...this.
2434 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2435 parameters; add section_id parameter.
2436 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2437 (Dwo_file::add_unit_set): ...this.
2438 (Dwo_file::shndx_map_): Remove.
2439 (Dwo_file::sect_offsets_): New data member.
2440 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2441 (Dwp_output_file::add_section): Rename to...
2442 (Dwp_output_file::add_contribution): ...this.
2443 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2444 (Dwp_output_file::add_tu_set): Likewise.
2445 (Dwp_output_file::Contribution): New type.
2446 (Dwp_output_file::Section::contributions): New data member.
2447 (Dwp_output_file::Cu_or_tu_set): Remove.
2448 (Dwp_output_file::Section::Section): New ctor.
2449 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2450 (Dwp_output_file::Dwp_index::Section_table): New type.
2451 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2452 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2453 parameter.
2454 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2455 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2456 (Dwp_output_file::Dwp_index::section_table): New member function.
2457 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2458 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2459 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2460 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2461 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2462 (Dwp_output_file::Dwp_index::section_table_): New data member.
2463 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2464 (Dwp_output_file::add_output_section): New member function.
2465 (Dwp_output_file::write_new_section): New member function.
2466 (Dwp_output_file::write_contributions): New member function.
2467 (Dwp_output_file::section_id_map_): New data member.
2468 (class Dwo_id_info_reader): Remove.
2469 (class Unit_reader): New class.
2470 (get_dwarf_section_name): New function.
2471 (Dwo_file::read_executable): Adjust initializations of class data.
2472 (Dwo_file::read): Add support for v2 package file format.
2473 (Dwo_file::read_unit_index): Likewise.
2474 (Dwo_file::sized_read_unit_index): Likewise.
2475 (Dwo_file::copy_section): Likewise.
2476 (Dwo_file::add_unit_set): Likewise.
2477 (Dwp_output_file::add_output_section): Likewise.
2478 (Dwp_output_file::add_contribution): Likewise.
2479 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2480 for empty slot.
2481 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2482 file format.
2483 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2484 slot.
2485 (Dwp_output_file::initialize): Remove unused function.
2486 (Dwp_output_file::finalize): Add support for v2 package file format.
2487 (Dwp_output_file::write_index): Likewise.
2488 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2489 function prototype.
2490
2500c017
CC
24912013-10-31 Cary Coutant <ccoutant@google.com>
2492
2493 * configure.ac: Fix check for -fmerge-constants.
2494 * configure.ac: Regenerate.
2495
dd0845d7
RM
24962013-10-30 Roland McGrath <mcgrathr@google.com>
2497
2498 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2499 Correct 9-byte nop sequence to match what the assembler generates.
2500
b4f7960d
AM
25012013-10-30 Alan Modra <amodra@gmail.com>
2502
2503 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2504 ppc64_local_entry_offset, ppc64_local_entry_offset,
2505 do_read_symbols): New functions.
2506 (Powerpc_relobj::e_flags_, st_other_): New vars.
2507 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2508 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2509 (Powerpc_relobj::e_flags_): New var.
2510 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2511 and adjust for ELFv2.
2512 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2513 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2514 (Powerpc_dynobj::do_find_special_sections): Likewise.
2515 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2516 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2517 to ELFv2 local entry.
2518 (Target_powerpc::do_relax): No thread safe barriers needed for
2519 ELFv2.
2520 (Output_data_plt_powerpc::initial_plt_entry_size_,
2521 plt_entry_size): Delete. Replace all uses with
2522 first_plt_entry_offset() and plt_entry_size().
2523 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2524 reserved_size parm. Update callers.
2525 (Output_data_plt_powerpc::entry_count): Update.
2526 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2527 and use Target_powerpc::first_plt_entry_offset().
2528 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2529 rename to plt_entry_size.
2530 (Output_data_plt_powerpc::add_ifunc_entry,
2531 add_local_ifunc_entry): Adjust reloc for ELFv2.
2532 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2533 (glink_eh_frame_fde_64v2): New.
2534 (Stub_table::plt_call_size): Support ELFv2 sizing.
2535 (Output_data_glink::add_eh_frame): Use the new FDE.
2536 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2537 (Stub_table::do_write): Write ELFv2 stubs and glink.
2538 (Target_powerpc::Relocate::relocate): Replaces nop after call
2539 with ld 2,24(1) and adjust local offset destination for ELFv2.
2540
f9c6b907
AM
25412013-10-30 Alan Modra <amodra@gmail.com>
2542
2543 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2544 (Target_powerpc::Scan::global, local): Likewise.
2545 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2546 on all ppc64 @h and @ha relocs.
2547
e84fe78f
AM
25482013-10-14 Alan Modra <amodra@gmail.com>
2549
2550 * output.h (Output_data_got::add_constant): Tidy.
2551 (Output_data_got::add_constant_pair): New function.
2552 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2553 methods used so as to first call reserve_ent().
2554
679e4abf
RM
25552013-10-11 Roland McGrath <mcgrathr@google.com>
2556
44dcb735
RM
2557 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2558 add_got_entry and add_got_entry_pair.
2559
13323c49
RM
2560 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2561 (HAVE_PUBNAMES): Likewise.
2562 * configure: Regenerate.
2563
1496b446
RM
2564 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2565 * testsuite/Makefile.in: Regenerate.
2566
cc84c10b
RM
2567 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2568 Remove const from declaration.
2569 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2570 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2571 * output.h (Output_file_header): Remove const from member target_
2572 and corresponding constructor argument.
2573 * output.cc (Output_file_header::Output_file_header): Update prototype.
2574 (Output_file_header::do_sized_write): Use this->target_ in place
2575 of parameters()->target().
2576
52f66a2c
RM
2577 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2578
2b64b551
RM
2579 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2580 * configure: Regenerate.
2581 * Makefile.in: Regenerate.
2582 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2583 * testsuite/merge_string_literals_2.c: Likewise.
2584 * testsuite/Makefile.am
2585 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2586 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2587 literal -fmerge-constants.
2588 * testsuite/Makefile.in: Regenerate.
2589
43819297
RM
2590 * i386.cc (Target_i386): Remove unused member dynbss_.
2591 * arm.cc (Target_arm): Likewise.
2592 * powerpc.cc (Target_powerpc): Likewise.
2593 * sparc.cc (Target_sparc): Likewise.
2594 * tilegx.cc (Target_tilegx): Likewise.
2595 * x86_64.cc (Target_x86_64): Likewise.
2596 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2597 type_signature_, type_offset_.
2598 * plugin.h (Plugin_hook): Remove unused member layout_.
2599 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2600 mapfile_.
2601 (Read_member): Remove unused members input_objects_, symtab_,
2602 mapfile_, layout_.
2603 (Check_library): Remove unused member symtab_.
2604 * archive.h (Lib_group): Remove unused member lib_.
2605 * archive.cc (Lib_group::Lib_group): Update initializer.
2606 * incremental.h (Incremental_binary): Remove unused member target_.
2607 (Incremental_script_entry): Removed unused member script_.
2608 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2609 * icf.h (Icf): Remove unused member num_tracked_relocs.
2610
39d9ead7
RM
2611 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2612 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2613 its only use.
2614 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2615
679e4abf
RM
2616 * archive.h: Use struct rather than class for forward declaration
2617 of Read_symbols_data.
2618
54de2ea6
CC
26192013-10-07 Cary Coutant <ccoutant@google.com>
2620
2621 PR gold/16010
2622 * testsuite/Makefile.am (icf_test): Fix dependencies.
2623 (icf_safe_test): Likewise.
2624 (icf_safe_so_test): Likewise.
2625 (large_symbol_alignment): Add empty _LDADD rule.
2626 * testsuite/Makefile.in: Regenerate.
2627
b14016f0
L
26282013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2629
2630 PR gold/15927
2631 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2632 relocation for R_X86_64_32 on x32.
2633
eb426534
RM
26342013-08-27 Roland McGrath <mcgrathr@google.com>
2635
2636 * output.cc (Output_segment::set_section_addresses): Take new
2637 Target* argument. If target->isolate_execinstr() and the segment
2638 is executable and starts at a target->abi_pagesize() boundary,
2639 pad its end out to a target->abi_pagesize() boundary with code fill.
2640 * output.h (Output_segment::set_section_addresses): Update decl.
2641 * layout.h (Layout::check_output_data_for_reset_values): Take new
2642 argument RELAX_OUTPUTS.
2643 (Layout): New member relax_output_list_.
2644 (Layout::add_relax_output): New method.
2645 * layout.cc (Layout::Layout): Update constructor.
2646 (Layout::reset_relax_output): New method.
2647 (Layout::clean_up_after_relaxation): Call it.
2648 (Layout::prepare_for_relaxation): Update caller.
2649 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2650 Call reset_relax_output before re-processing segments for
2651 isolate_execinstr case.
2652 (Layout::write_data): Handle relax_output_list_.
2653 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2654 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2655
9aff4b7a
NC
26562013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2657
2658 PR binutils/15834
2659 * object.h: Fix typos.
2660
93f8221c
RM
26612013-08-16 Roland McGrath <mcgrathr@google.com>
2662
2663 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2664 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2665
e44c3715
CC
26662013-08-07 Cary Coutant <ccoutant@google.com>
2667
2668 Revert support for v2 DWP files:
2669
2670 2013-03-01 Cary Coutant <ccoutant@google.com>
2671
2672 Add dwp support for v2 DWARF package file format.
2673 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2674 tu_length parameter. Adjust all callers.
2675 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2676 * dwp.cc: Include dwarf.h.
2677 (Section_bounds): New struct type.
2678 (Unit_set): New struct type.
2679 (Dwo_file::Dwo_file): Initialize new data member.
2680 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2681 Combine and rename to...
2682 (Dwo_file::read_unit_index): ...this.
2683 (Dwo_file::sized_read_compunit_index)
2684 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2685 (Dwo_file::sized_read_unit_index): ...this.
2686 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2687 parameters; add section_id parameter.
2688 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2689 (Dwo_file::add_unit_set): ...this.
2690 (Dwo_file::shndx_map_): Remove.
2691 (Dwo_file::sect_offsets_): New data member.
2692 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2693 (Dwp_output_file::add_section): Rename to...
2694 (Dwp_output_file::add_contribution): ...this.
2695 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2696 (Dwp_output_file::add_tu_set): Likewise.
2697 (Dwp_output_file::Contribution): New type.
2698 (Dwp_output_file::Section::contributions): New data member.
2699 (Dwp_output_file::Cu_or_tu_set): Remove.
2700 (Dwp_output_file::Section::Section): New ctor.
2701 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2702 (Dwp_output_file::Dwp_index::Section_table): New type.
2703 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2704 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2705 parameter.
2706 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2707 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2708 (Dwp_output_file::Dwp_index::section_table): New member function.
2709 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2710 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2711 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2712 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2713 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2714 (Dwp_output_file::Dwp_index::section_table_): New data member.
2715 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2716 (Dwp_output_file::add_output_section): New member function.
2717 (Dwp_output_file::write_new_section): New member function.
2718 (Dwp_output_file::write_contributions): New member function.
2719 (Dwp_output_file::section_id_map_): New data member.
2720 (class Dwo_id_info_reader): Remove.
2721 (class Unit_reader): New class.
2722 (get_dwarf_section_name): New function.
2723 (Dwo_file::read_executable): Adjust initializations of class data.
2724 (Dwo_file::read): Add support for v2 package file format.
2725 (Dwo_file::read_unit_index): Likewise.
2726 (Dwo_file::sized_read_unit_index): Likewise.
2727 (Dwo_file::copy_section): Likewise.
2728 (Dwo_file::add_unit_set): Likewise.
2729 (Dwp_output_file::add_output_section): Likewise.
2730 (Dwp_output_file::add_contribution): Likewise.
2731 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2732 for empty slot.
2733 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2734 file format.
2735 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2736 slot.
2737 (Dwp_output_file::initialize): Remove unused function.
2738 (Dwp_output_file::finalize): Add support for v2 package file format.
2739 (Dwp_output_file::write_index): Likewise.
2740 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2741 function prototype.
2742
c6905c28
CC
27432013-07-31 Cary Coutant <ccoutant@google.com>
2744
2745 * object.cc (Sized_relobj::do_output_section_address): New function.
2746 (Sized_relobj): Instantiate explicitly.
2747 * object.h (Object::output_section_address): New function.
2748 (Object::do_output_section_address): New function.
2749 (Sized_relobj::do_output_section_address): New function.
2750 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2751
27522013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2753 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2754
2755 * parameters.cc (Parameters::entry): Return target-specific entry
2756 symbol name.
2757 * target.h (Target::entry_symbol_name): New function.
2758 (Target_info::entry_symbol_name): New data member.
2759
2760 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2761 * i386.cc (Target_i386::i386_info): Likewise.
2762 (Target_i386_nacl::i386_nacl_info): Likewise.
2763 * sparc.cc (Target_sparc::sparc_info): Likewise.
2764 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2765 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2766 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2767 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2768
234d4ab8
SA
27692013-07-22 Sterling Augustine <saugustine@google.com>
2770
2771 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2772 Convert parameter shndx to local variable. Add parameters symtab
2773 and symtab_size. Scan over section names. Find relocation
2774 section corresponding to current section. Create and initialize
2775 reloc_mapper_ and reloc_type_.
2776 (Dwarf_pubnames_table::read_header): Add assertion. Change
2777 unit_length to off_t. Initialize member unit_length_. Fill in field
2778 cu_offset_.
2779 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2780 Initialize new fields unit_length_ and cu_offset_.
2781 (Dwarf_pubnames_table::read_section): Update prototype.
2782 (Dwarf_pubnames_table::cu_offset): New member function.
2783 (Dwarf_pubnames_table::subsection_size): Likewise.
2784 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2785 New fields.
2786 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2787 member functions public.
2788 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2789 Update comment. Rework logic. Move repeated parts to...
2790 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2791 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2792 pubtypes_table_, and stmt_list_offset.
2793 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2794 Gdb_index::find_pubtype_offset,
2795 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2796 (Gdb_index::pubnames_read): Update prototype and rework logic.
2797 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2798 Forward declare.
2799 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2800 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2801 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2802 Gdb_index::map_pubtable_to_dies):
2803 Declare functions.
2804 (Gdb_index::pubnames_read): Update declaration.
2805 (Gdb_index::Pubname_offset_map): New type.
2806 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2807 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2808 Gdb_index::stmt_list_offset): Declare.
2809 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2810 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2811 Gdb_index::pubtypes_offset_): Remove.
2812
a3ed37d8
RM
28132013-07-19 Roland McGrath <mcgrathr@google.com>
2814
2815 * options.h (General_options): Add -Trodata-segment option.
2816 * parameters.cc (Parameters::check_rodata_segment): New function.
2817 (Parameters::set_target_once): Call it.
2818 * parameters.h (Parameters): Declare it (private member function).
2819 * layout.cc (load_seg_unusable_for_headers): New function, broken
2820 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2821 then validate rodata segment rather than text segment.
2822 (relaxation_loop_body): Call that.
2823 (is_text_segment): New function. Don't admit a non-executable
2824 segment if TARGET->isolate_execinstr().
2825 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2826
eb5b4ded
CC
28272013-07-15 Shawn Landden <shawnlandden@gmail.com>
2828
2829 PR gold/15070
2830 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2831 * nacl.h (Sniff_file::View::View): Request aligned view.
2832
4d5effb9
CC
28332013-07-11 Cary Coutant <ccoutant@google.com>
2834
2835 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2836 correct BRLT entry size.
2837
ba8ca3e7
AM
28382013-07-03 Alan Modra <amodra@gmail.com>
2839
2840 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2841 comment.
2842
267257d2
CC
28432013-07-01 Cary Coutant <ccoutant@google.com>
2844
2845 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2846 reloc_type_.
2847 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2848 (Dwarf_ranges_table::lookup_reloc): New function.
2849 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2850 reloc_type_.
2851 (Dwarf_ranges_table::lookup_reloc): New function.
2852 (Dwarf_ranges_table::reloc_type_): New data member.
2853
06f30c9d
CC
28542013-06-27 Jing Yu <jingyu@google.com>
2855
2856 PR gold/15662
2857 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2858 function.
2859 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2860 (Target_powerpc::do_relax): Call the above.
2861
a2d7bf59
AM
28622013-06-27 Cary Coutant <ccoutant@google.com>
2863
2864 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2865 on garbage collected .opd section.
2866
28672013-06-27 Alan Modra <amodra@gmail.com>
2868
2869 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2870 is non-zero.
2871 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2872 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2873
32364e50
CC
28742013-06-14 Cary Coutant <ccoutant@google.com>
2875
2876 * resolve.cc (Symbol::override_base): Don't override st_type
2877 from plugin placeholder symbols.
2878 (Symbol_table::resolve): Likewise.
2879 (Symbol_table::should_override): Don't complain about TLS mismatch
2880 if the TO symbol is a plugin placeholder.
2881 * testsuite/Makefile.am (plugin_test_tls): New test.
2882 * testsuite/Makefile.in: Regenerate.
2883 * testsuite/plugin_test_tls.sh: New test script.
2884 * testsuite/two_file_test_2_tls.cc: New test source.
2885 * testsuite/two_file_test_tls.cc: New test source.
2886
7fb47cc9
CC
28872013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2888
2889 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2890 the maximum segment alignment is larger than the page size.
2891 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2892 correctly aligns the symbols with large alignemnt.
2893 * testsuite/Makefile.in: Regenerate.
2894 * testsuite/large_symbol_alignment.cc: New file.
2895
6934001a
CC
28962013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2897 Sriraman Tallam <tmsriram@google.com>
2898
2899 * options.h (sort_section): New option.
2900 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2901 Rename from Input_section_sort_section_name_special_ordering_compare.
2902 (Input_section_sort_section_name_compare): New struct.
2903 * output.cc (Output_section::Input_section_sort_section_name_compare::
2904 operator()): New function.
2905 (Output_section::sort_attached_input_sections): Use new sort function
2906 for .text if --sort-section=name is specified.
2907 * layout.cc (Layout::make_output_section):
2908 Add sorting by name when --sort-section=name is specified.
2909 * testsuite/Makefile.am (text_section_grouping): Test option
2910 --sort-section=name.
2911 * testsuite/Makefile.in: Regenerate.
2912 * testsuite/section_sorting_name.cc: New file.
2913 * testsuite/section_sorting_name.sh: New file.
2914
93acabad
CC
29152013-05-21 Cary Coutant <ccoutant@google.com>
2916
2917 * symtab.h (Symbol::is_cxx_vtable): New function.
2918 * target-reloc.h (relocate_section): Check for vtable symbol.
2919 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2920 * testsuite/Makefile.in: Regenerate.
2921 * testsuite/missing_key_func.cc: New test source.
2922 * testsuite/missing_key_func.sh: New test script.
2923
60e8b3fc
CC
29242013-05-21 Cary Coutant <ccoutant@google.com>
2925
2b64b551
RM
2926 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2927 type of enclosing symbol.
2928 (Relocate_info::location): Check symbol type when describing symbol.
2929 * object.h (Symbol_location_info): Remove unused line_number;
2930 add enclosing_symbol_type.
2931 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2932
9df9de2c
CC
29332013-05-13 Cary Coutant <ccoutant@google.com>
2934
2b64b551
RM
2935 * configure.ac: Export DEFAULT_TARGET.
2936 * configure: Regenerate.
2937 * Makefile.in: Regenerate.
2938 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2939 * testsuite/Makefile.in: Regenerate.
2940 * testsuite/debug_msg.sh: Delete duplicate tests.
2941 Don't check undef_int error message match for powerpc where the
2942 source file and line number aren't available.
9df9de2c 2943
bbc5ae17
RM
29442013-05-10 Roland McGrath <mcgrathr@google.com>
2945
2946 * options.h (General_options): Add --rosegment-gap option.
2947 * options.cc (finalize): --rosegment-gap implies --rosegment.
2948 * layout.cc (set_segment_offsets): Let user option override
2949 target->rosegment_gap().
2950
0c6e6c39
RM
29512013-05-10 Roland McGrath <mcgrathr@google.com>
2952
2953 * options.h (General_options): Remove leading space from help
2954 messages for -nostdlib and --rosegment.
2955
cde7cb01
MR
29562013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2957
2958 PR ld/15365
2959 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2960
f31ae5b8
AM
29612013-05-03 Alan Modra <amodra@gmail.com>
2962
2963 * merge.cc (Output_merge_string::do_add_input_section): Correct
2964 scan for number of strings. Rename vars to avoid shadowing.
2965 Include missing terminator in input_size_.
2966
d3a7cd45
L
29672013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2968
2969 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2970 Restore empty string handling.
2971
6ad3daba
CC
29722013-05-01 Cary Coutant <ccoutant@google.com>
2973
2974 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2975 uninitialized warning.
2976
e31908b6
CC
29772013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2978
2979 * output.cc (Output_section::add_merge_input_section): Allow
2980 to merge sections if the alignment is more than character size.
2981 * merge.h (Output_merge_string::Output_merge_string): Remove
2982 assert.
2983 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2984 only not-null strings. Check the alignment of strings.
2985 * stringpool.h
2986 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2987 alignment as the argument.
2988 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2989 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2990 Align non-zero length strings according to the addralign_.
2991 (Stringpool_template<Stringpool_char>::set_string_offsets):
2992 Updating offsets according to the given alignment.
2993 * testsuite/Makefile.am (text_section_grouping): Test if string
2994 literals are getting merged.
2995 * testsuite/Makefile.in: Regenerate.
2996 * testsuite/merge_string_literals_1.c: New file.
2997 * testsuite/merge_string_literals_2.c: Ditto.
2998 * testsuite/merge_string_literals.sh: Ditto.
2999
0e804863
ILT
30002013-04-26 Ian Lance Taylor <iant@google.com>
3001
3002 * target-reloc.h (relocate_section): If the reloc offset is out of
3003 range, pass VIEW as NULL to relocate.relocate.
3004 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3005 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3006 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3007 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3008 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3009 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3010
e7c5ea40
CC
30112013-04-26 Geoff Pike <gpike@chromium.org>
3012
3013 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3014 * layout.cc (Hash_task): New class.
3015 (Layout::queue_build_id_tasks): New function.
3016 (Layout::write_build_id): Handle single-thread portion of build ID
3017 computation. (In some cases, all of it is single-threaded.) Replace
3018 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3019 functionality in fewer lines of code.
3020 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3021 * options.h (General_options): make "--build-id" default to tree
3022 rather than sha1. Add two new options related to --build-id=tree:
3023 --build-id-chunk-size-for-treehash and
3024 --build-id-min-file-size-for-treehash.
3025 * Makefile.am: add testing of --build-id=tree and related new options
3026 (these tests will be invoked by "make check").
3027 * Makefile.in: Regenerate.
3028
49926cd0
AM
30292013-04-25 Alan Modra <amodra@gmail.com>
3030
3031 * configure.tgt: Add powerpcle and powerpc64le.
3032
a4034750
AM
30332013-04-22 Alan Modra <amodra@gmail.com>
3034
3035 PR gold/15355
3036 * layout.cc (Layout::segment_precedes): Allow more than one
3037 segment with the same type and flags.
3038
e79c84aa
CC
30392013-04-15 Cary Coutant <ccoutant@google.com>
3040
3041 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3042 allocate space in file for BSS sections.
3043
2199fbe7
CC
30442013-04-15 Cary Coutant <ccoutant@google.com>
3045
3046 * script-sections.cc (Orphan_output_section): Reset address
3047 to zero after each orphaned section for relocatable links.
3048
502e8a84
CC
30492013-04-15 Cary Coutant <ccoutant@google.com>
3050
a4034750
AM
3051 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3052 section starting address for relocatable link.
3053 * testsuite/Makefile.am (script_test_11): New test.
3054 * testsuite/Makefile.in: Regenerate.
3055 * testsuite/script_test_11.c: New source file.
3056 * testsuite/script_test_11.t: New linker script.
502e8a84 3057
0cfdc767
AM
30582013-04-13 Alan Modra <amodra@gmail.com>
3059
3060 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3061 owner when sections are not adjacent and exceed group size.
3062 (Target_powerpc::group_sections): Handle corner case.
3063 (Target_powerpc::Branch_info::make_stub): Handle case where
3064 stub table doesn't exist due to branches in non-exec sections.
3065 (Target_powerpc::Relocate::relocate): Likewise.
3066
6830ee24
AM
30672013-04-11 Alan Modra <amodra@gmail.com>
3068
3069 PR gold/15354
3070 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3071 .branch_lt to match bfd ld. Adjust comments throughout file.
3072
54a3d865
ILT
30732013-04-04 Ian Lance Taylor <iant@google.com>
3074
3075 GCC PR c++/56840
3076 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3077 sections before checking whether they are included in the link.
3078
9993ba11
ST
30792013-03-29 Sriraman Tallam <tmsriram@google.com>
3080
3081 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3082 object before calling the plugin claim_file handler. Pass the elf
3083 object of the archive to the plugin. Delete the elf object if the
3084 plugin claims the file.
3085
ebacd51e
AM
30862013-03-21 Alan Modra <amodra@gmail.com>
3087
3088 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3089 segment when omagic.
3090
117be58f
AM
30912013-03-21 Alan Modra <amodra@gmail.com>
3092
3093 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3094 comparison warning.
3095 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3096 uninitialized" warning.
3097
32e2b61d
AM
30982013-03-20 Alan Modra <amodra@gmail.com>
3099
3100 * symtab.h (Symbol::clear_version): New function.
3101 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3102 is_needed by weak references. Clear version for symbols defined
3103 in as-needed objects that are not needed.
3104
b3ccdeb5
AM
31052013-03-15 Alan Modra <amodra@gmail.com>
3106
3107 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3108 static and public. Add report_err param. Return false for data refs.
3109 (Target_powerpc::rela_dyn_section): New overloaded function.
3110 (Target_powerpc::plt_, iplt_): Elucidate.
3111 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3112 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3113 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3114 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3115 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3116 push_branch and make_plt_entry for ifunc syms when
3117 reloc_needs_plt_for_ifunc.
3118 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3119 for ifunc unless reloc_needs_plt_for_ifunc.
3120
ad3d8a2f
AM
31212013-03-15 Alan Modra <amodra@gmail.com>
3122
3123 * gc.h (gc_process_relocs): Don't look through function descriptors.
3124 * icf.cc (get_section_contents): Do so here instead.
3125
4d9aa155
AM
31262013-03-13 Alan Modra <amodra@gmail.com>
3127
3128 * powerpc.cc (is_branch_reloc): Forward declare.
3129 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3130 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3131 false for 64-bit, true for 32-bit non-branch relocs.
3132 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3133 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3134 nm output.
3135 (icf_safe_test): Generate linker map file as well as nm output.
3136 (icf_safe_so_test): Likewise.
3137 * testsuite/Makefile.in: Regenerate.
3138 * testsuite/icf_test.sh: Parse linker map file to determine
3139 section folding.
3140 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3141 * testsuite/icf_safe_so_test.sh: Likewise.
3142 (X86_32_or_ARM_specific_safe_fold): Merge into..
3143 (arch_specific_safe_fold): ..this.
3144 (X86_64_specific_safe_fold): Delete unused function.
3145
57420c20
AM
31462013-03-12 Alan Modra <amodra@gmail.com>
3147
3148 * gc.h (gc_process_relocs): Look through function descriptors
3149 to determine shndx, symvalue and addend used by ICF. Tidy
3150 variable duplication.
3151
dc3714f3
AM
31522013-03-11 Alan Modra <amodra@gmail.com>
3153
3154 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3155 * layout.cc (Layout_task_runner::run): ..to here.
3156 * symtab.h (struct Symbol_location): Extract from..
3157 (class Symbol_table): ..here.
3158 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3159 * target.h (class Target): Add function_location and
3160 do_function_location functions.
3161 (class Sized_target): Add do_function_location.
3162 * object.h (class Sized_relobj_file): Move find_shdr..
3163 (class Object): ..to here.
3164 * object.cc: Likewise. Update to suit. Instantiate.
3165 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3166 * powerpc.cc (class Powerpc_dynobj): New.
3167 (Target_powerpc::do_function_location): New function.
3168 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3169 (Powerpc_dynobj::do_read_symbols): New function.
3170 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3171
956b03bb
ILT
31722013-03-08 Ian Lance Taylor <iant@google.com>
3173
3174 * options.cc (General_options::string_to_object_format): Accept
3175 "default".
3176
4bead2d5
AM
31772013-03-08 Alan Modra <amodra@gmail.com>
3178
3179 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3180 pointer to Post_fde.
3181 (struct Post_fde): Move definition to here..
3182 * ehframe.cc (struct Post_fde): ..from here.
3183 (Cie::write): Don't alloc Post_fde.
3184 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3185
02e60bf7
AM
31862013-03-07 Alan Modra <amodra@gmail.com>
3187
3188 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3189 relocation referencing .LC0.
3190 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3191
8343f03a
AM
31922013-03-07 Alan Modra <amodra@gmail.com>
3193
3194 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3195 always_inline. Add assembly for powerpc to avoid GOT.
3196
3366d57c
AM
31972013-03-07 Alan Modra <amodra@gmail.com>
3198
3199 * testsuite/script_test_10.sh: Don't test .bss section
3200 header number.
3201
6c77229c
AM
32022013-03-06 Alan Modra <amodra@gmail.com>
3203
3204 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3205 (Target_powerpc::symval_for_branch): Add symtab param. Update
3206 all callers. Handle folded sections.
3207 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3208 to Powerpc_relobj.
3209 (Global_symbol_visitor_opd::operator()): Likewise.
3210
a39e4af6
AM
32112013-03-04 Alan Modra <amodra@gmail.com>
3212
3213 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3214 * testsuite/Makefile.in: Regenerate.
3215
d5834edb
CC
32162013-03-01 Cary Coutant <ccoutant@google.com>
3217
3218 Add dwp support for v2 DWARF package file format.
3219 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3220 tu_length parameter. Adjust all callers.
3221 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3222 * dwp.cc: Include dwarf.h.
3223 (Section_bounds): New struct type.
3224 (Unit_set): New struct type.
3225 (Dwo_file::Dwo_file): Initialize new data member.
3226 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3227 Combine and rename to...
3228 (Dwo_file::read_unit_index): ...this.
3229 (Dwo_file::sized_read_compunit_index)
3230 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3231 (Dwo_file::sized_read_unit_index): ...this.
3232 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3233 parameters; add section_id parameter.
3234 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3235 (Dwo_file::add_unit_set): ...this.
3236 (Dwo_file::shndx_map_): Remove.
3237 (Dwo_file::sect_offsets_): New data member.
3238 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3239 (Dwp_output_file::add_section): Rename to...
3240 (Dwp_output_file::add_contribution): ...this.
3241 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3242 (Dwp_output_file::add_tu_set): Likewise.
3243 (Dwp_output_file::Contribution): New type.
3244 (Dwp_output_file::Section::contributions): New data member.
3245 (Dwp_output_file::Cu_or_tu_set): Remove.
3246 (Dwp_output_file::Section::Section): New ctor.
3247 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3248 (Dwp_output_file::Dwp_index::Section_table): New type.
3249 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3250 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3251 parameter.
3252 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3253 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3254 (Dwp_output_file::Dwp_index::section_table): New member function.
3255 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3256 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3257 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3258 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3259 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3260 (Dwp_output_file::Dwp_index::section_table_): New data member.
3261 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3262 (Dwp_output_file::add_output_section): New member function.
3263 (Dwp_output_file::write_new_section): New member function.
3264 (Dwp_output_file::write_contributions): New member function.
3265 (Dwp_output_file::section_id_map_): New data member.
3266 (class Dwo_id_info_reader): Remove.
3267 (class Unit_reader): New class.
3268 (get_dwarf_section_name): New function.
3269 (Dwo_file::read_executable): Adjust initializations of class data.
3270 (Dwo_file::read): Add support for v2 package file format.
3271 (Dwo_file::read_unit_index): Likewise.
3272 (Dwo_file::sized_read_unit_index): Likewise.
3273 (Dwo_file::copy_section): Likewise.
3274 (Dwo_file::add_unit_set): Likewise.
3275 (Dwp_output_file::add_output_section): Likewise.
3276 (Dwp_output_file::add_contribution): Likewise.
3277 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3278 for empty slot.
3279 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3280 file format.
3281 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3282 slot.
3283 (Dwp_output_file::initialize): Remove unused function.
3284 (Dwp_output_file::finalize): Add support for v2 package file format.
3285 (Dwp_output_file::write_index): Likewise.
3286 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3287 function prototype.
3288
a68a081d
CC
32892013-03-01 Cary Coutant <ccoutant@google.com>
3290
3291 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3292 function into class definition in header file.
3293 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3294 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3295 New function.
3296 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3297
9d5781f8
AM
32982013-02-28 Alan Modra <amodra@gmail.com>
3299
3300 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3301 * target.cc (Target::do_plt_fde_location): New function.
3302 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3303 accessor function, and constructor param.
3304 (struct Post_fde, Post_fdes): Declare.
3305 (Cie::write): Add post_fdes param.
3306 * ehframe.cc (Fde::write): Use plt_fde_location.
3307 (struct Post_fde): Define.
3308 (Cie::write): Stash FDEs added post merge mapping.
3309 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3310 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3311 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3312 other FDEs.
3313 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3314 (Target_powerpc::has_glink): New function.
3315 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3316 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3317 glink_eh_frame_fde_32, default_fde): New data.
3318 (Stub_table::eh_frame_added_): New var.
3319 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3320 Make const.
3321 (Stub_table::add_eh_frame): New function.
3322 (Output_data_glink::add_eh_frame): New function.
3323 (Target_powerpc::make_glink_section): Call add_eh_frame.
3324
214383dd
ILT
33252013-02-15 Ian Lance Taylor <iant@google.com>
3326
3327 * options.h (DEFINE_uint64_alias): Define.
3328 (class General_options): Add -Ttext-segment as an alias for
3329 -Ttext.
3330
91c2b899
AM
33312013-02-15 Alan Modra <amodra@gmail.com>
3332
3333 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3334 (Stub_table::do_write): ..here, two places.
3335 (Stub_table::plt_call_size): Use it here too.
3336
20e2a8aa
ILT
33372013-02-11 Ian Lance Taylor <iant@google.com>
3338
3339 * descriptors.cc (Descriptors::close_all): New function.
3340 * descriptors.h (class Descriptors): Declare close_all.
3341 (close_all_descriptors): New inline function.
3342 * plugin.cc: Include "descriptors.h".
3343 (Plugin_manager::cleanup): Call close_all_descriptors.
3344
8952bc69
AM
33452013-02-06 Alan Modra <amodra@gmail.com>
3346
3347 * README: Update coding style link.
3348
29bd8b6b
CC
33492013-01-28 Cary Coutant <ccoutant@google.com>
3350
a4034750
AM
3351 * dwp.cc (File_list): New typedef.
3352 (Dwo_name_info_reader): New class.
3353 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3354 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3355 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3356 (Dwo_file::read_executable): New function.
3357 (Dwo_file::read): Move common setup code to ...
3358 (Dwo_file::make_object): ... here.
3359 (dwp_options): Add --exec/-e.
3360 (usage): Likewise.
3361 (main): Likewise.
29bd8b6b 3362
c6ac678d
ST
33632013-01-24 Sriraman Tallam <tmsriram@google.com>
3364
3365 * layout.cc (Layout::layout): Check for option text_reorder.
3366 (Layout::make_output_section): Ditto.
3367 * options.h (text_reorder): New option.
3368 * output.cc (Input_section_sort_compare): Remove special ordering
3369 of section names.
3370 (Output_section::
3371 Input_section_sort_section_name_special_ordering_compare::
3372 operator()): New function.
3373 (Output_section::sort_attached_input_sections): Use new sort function
3374 for .text.
3375 * output.h (Input_section_sort_section_name_special_ordering_compare):
3376 New struct.
3377 * testsuite/Makefile.am (text_section_grouping): Test option
3378 --no-text-reorder
3379 * testsuite/Makefile.in: Regenerate.
3380 * testsuite/text_section_grouping.sh: Check order of functions without
3381 default text reordering.
3382
50701cc1
MF
33832013-01-18 Mike Frysinger <vapier@gentoo.org>
3384
3385 * options.h (General_options): Change default to true for new_dtags.
3386
b1b00fcc
MF
33872013-01-18 Mike Frysinger <vapier@gentoo.org>
3388
3389 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3390 when enable_new_dtags is false. Only add DT_RUNPATH when
3391 enable_new_dtags is true.
3392
ec5b8187
AM
33932013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3394
3395 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3396 used in declaration and definition consistent.
3397 (Target_powerpc::symval_for_branch): Ditto.
3398
a880d4c4
ST
33992013-01-16 Sriraman Tallam <tmsriram@google.com>
3400
3401 * testsuite/plugin_final_layout.cc: Fix comment.
3402
7c381248
ST
34032013-01-16 Sriraman Tallam <tmsriram@google.com>
3404
3405 * layout.cc (Layout::layout): Do not do default sorting for
3406 text sections when section ordering is specified.
3407 (make_output_section): Ditto.
3408 * testsuite/plugin_final_layout.cc: Name the function sections
3409 to catch reordering issues.
3410
e2458743
AM
34112013-01-15 Alan Modra <amodra@gmail.com>
3412
3413 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3414 plt-thread-safe.
3415
431ed302
AM
34162013-01-15 Alan Modra <amodra@gmail.com>
3417
3418 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3419 * testsuite/Makefile.in: Regenerate.
3420
0ec6429b
AM
34212013-01-14 Alan Modra <amodra@gmail.com>
3422
3423 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3424 * testsuite/Makefile.in: Regenerate.
3425
0bf402d5
ILT
34262013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3427
36af3926 3428 PR bfd/14430
0bf402d5
ILT
3429 Fix mingw gold build with plugins enabled
3430 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3431 * configure.ac: Export DLOPEN_LIBS and add headers check.
3432 * plugin.cc: Handle non-dlfcn case.
3433 * Makefile.in: Regenerate.
3434 * config.in: Regenerate.
3435 * configure: Regenerate.
3436 * testsuite/Makefile.in: Regenerate.
3437
9e9143bc
ST
34382013-01-09 Sriraman Tallam <tmsriram@google.com>
3439
3440 * output.h (sort_attached_input_sections): Change to be public.
3441 * script-sections.cc
3442 (Output_section_definition::set_section_addresses): Sort
3443 attached input sections according to section order before linker
3444 script assigns section addresses.
3445 (Orphan_output_section::set_section_addresses): Sort
3446 attached input sections according to section order before linker
3447 script assigns section addresses.
3448 * Makefile.am (final_layout.sh): Use a simple linker script to
3449 check if section ordering still works.
3450 * Makefile.in: Regenerate.
3451
679af368
ILT
34522013-01-09 Ben Cheng <bccheng@google.com>
3453
3454 * arm.cc (Target_arm::attributes_accept_div): New function.
3455 (Target_arm::attributes_forbid_div): New function.
3456 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3457 attribute using the same new functions as what bfd/elf32_arm.c
3458 does.
3459
3136a00e
CC
34602013-01-07 Cary Coutant <ccoutant@google.com>
3461
3462 PR gold/14993
3463 * output.cc (Output_section::add_input_section): For incremental
3464 updates, don't track input sections that are allocated from patch
3465 space.
3466
f2a6224b
L
34672013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3468 Ian Lance Taylor <iant@google.com>
3469
3470 PR gold/14897
3471 * configure.ac (--enable-ld): Removed.
3472 (install_as_default): Set to yes only for --enable-gold=default
3473 or --disable-ld.
3474 * configure: Regenerated.
3475
4f46f626
L
34762013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3477
3478 * options.h (General_options): Add -fuse-ld= for GCC linker
3479 option compatibility.
3480
26e4ef59
CC
34812013-01-04 Cary Coutant <ccoutant@google.com>
3482
3483 * configure.ac: Fix typo restoring CXXFLAGS.
3484 * configure: Regenerate.
3485
3d587466
CC
34862013-01-04 Cary Coutant <ccoutant@google.com>
3487
4f46f626
L
3488 * testsuite/Makefile.am (CXXLINK_S): New macro.
3489 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3490 * testsuite/Makefile.in: Regenerate.
3d587466 3491
44db6695
L
34922013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3493
3494 * version.cc (print_version): Update copyright year to 2013.
3495
edcac0c1
ILT
34962012-12-20 Ian Lance Taylor <iant@google.com>
3497
3498 * layout.cc (Layout::special_ordering_of_input_section): New
3499 function.
3500 (Layout::layout): If input section requires special ordering, must
3501 sort input sections.
3502 (Layout::make_output_section): May sort .text input sections.
3503 (Layout::is_section_name_prefix_grouped): Remove.
3504 * layout.h (class Layout): Declare
3505 special_ordering_of_input_section. Don't declare
3506 is_section_name_prefix_grouped.
3507 * output.cc (Output_section::add_input_section): Revert last
3508 change.
3509 (Output_section::Input_section_sort::match_file_name): Don't crash
3510 if called on output section data.
3511 (Output_section::Input_section_sort_compare): Sort based on
3512 special ordering.
3513 (Output_section::Input_section_sort_section_order_index_compare):
3514 Revert last patch.
3515 (Output_section::sort_attached_input_sections): Likewise.
3516
28f2a4ac
ST
35172012-12-18 Sriraman Tallam <tmsriram@google.com>
3518
edcac0c1 3519 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3520 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3521 * output.cc (Output_section::add_input_section): Check if section
3522 name contains special prefix. Keep input sections to sort such
3523 sections.
3524 (Output_section::Input_section_sort_section_order_index_compare
3525 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3526 (Output_section::sort_attached_input_sections): Add condition to
3527 Input_section_entry constructor call.
28f2a4ac
ST
3528 * testsuite/Makefile.am (text_section_grouping): New test.
3529 * testsuite/Makefile.in: Regenerate.
3530 * testsuite/text_section_grouping.cc: New file.
3531 * testsuite/text_section_grouping.sh: New file.
3532
5bf135a7
NC
35332012-12-17 Nick Clifton <nickc@redhat.com>
3534
3535 * Makefile.am: Add copyright notice.
3536 * NEWS: Likewise.
3537 * README: Likewise.
3538 * configure.ac: Likewise.
3539 * ftruncate.c: Likewise.
3540 * Makefile.in: Regenerate.
3541
59965708
CC
35422012-12-14 Cary Coutant <ccoutant@google.com>
3543
a4034750
AM
3544 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3545 --no-as-needed flag.
3546 (exception_separate_shared_12_test): Likewise.
3547 (incremental_copy_test): Likewise.
3548 * testsuite/Makefile.in: Regenerate.
59965708 3549
2a77e2ab
CC
35502012-12-14 Cary Coutant <ccoutant@google.com>
3551
3552 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3553 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3554
e3deeb9c
AM
35552012-12-12 Alan Modra <amodra@gmail.com>
3556
3557 * powerpc.cc (class Track_tls): New.
3558 (class Relocate, class Scan): Inherit Track_tls.
3559 (Target_powerpc::Scan::local, global): Track tls optimization
3560 and avoid creating plt entry for __tls_get_addr if all uses
3561 are optimized away.
3562 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3563
d8f5a274
AM
35642012-12-12 Alan Modra <amodra@gmail.com>
3565
3566 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3567 Replace no_toc_optimize with toc_optimize.
3568 * output.h (Output_section::input_sections): Provide non-const variant.
3569 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3570 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3571 accessors.
3572 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3573 (class Sort_toc_sections): New.
3574 (Target_powerpc::do_finalize_sections): Sort toc sections.
3575 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3576
4c8a1de1
RM
35772012-12-10 Roland McGrath <mcgrathr@google.com>
3578
3579 * testsuite/binary_unittest.cc (read_all): New function.
3580 (Sized_binary_test): Use it instead of ::read.
3581 * fileread.cc (do_read): Don't assume pread always reads the whole
3582 amount in a single call.
3583
edc27beb
AM
35842012-12-10 Alan Modra <amodra@gmail.com>
3585
3586 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3587 Set EM_PPC64 or EM_PPC here.
3588 (Target_selector_powerpc::do_recognize): Delete.
3589
906b9150
AM
35902012-12-10 Alan Modra <amodra@gmail.com>
3591
3592 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3593 stub_table_.
3594 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3595
418c15ae
RM
35962012-12-07 Roland McGrath <mcgrathr@google.com>
3597
3598 * testsuite/binary_unittest.cc (Sized_binary_test):
3599 Use open_descriptor rather than ::open.
3600
decdd3bc
AM
36012012-12-07 Alan Modra <amodra@gmail.com>
3602
3603 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3604 typedef and invalid_address constant.
3605 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3606 instantiate constants.
3607
db399005
ILT
36082012-12-06 Roland McGrath <mcgrathr@google.com>
3609
3610 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3611 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3612 * aclocal.m4: Regenerate.
3613 * configure: Regenerate.
3614 * Makefile.in: Regenerate.
3615 * testsuite/Makefile.in: Regenerate.
3616
aba6bc71
AM
36172012-12-07 Alan Modra <amodra@gmail.com>
3618
3619 * options.h (General_options): Add no_toc_optimize.
3620 * powerpc.cc (ok_lo_toc_insn): New function.
3621 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3622
9e69ed50
AM
36232012-12-06 Alan Modra <amodra@gmail.com>
3624
3625 * options.h (General_options): Add plt_align, plt_static_chain,
3626 plt_thread_safe. Update stub_group_size help text.
3627 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3628 for new plt_thread_safe_ var.
3629 (use_plt_offset): Correct comments.
3630 (Target_powerpc::do_relax): Look for thread creation symbols to
3631 determine default plt_thread_safe value. Clear plt call stubs
3632 as well as branch stubs each iteration.
3633 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3634 insn constants.
3635 (l, hi, ha, write_insn): Move earlier.
3636 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3637 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3638 plt stubs too.
3639 (Stub_table::update_size): Adjust.
3640 (Stub_table::prev_size, set_prev_size): Delete.
3641 (Stub_table::stub_align): Let --plt-align affect result.
3642 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3643 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3644 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3645 (Stub_table::do_write): Support more stub variants.
3646
f43ba157
AM
36472012-12-04 Alan Modra <amodra@gmail.com>
3648
3649 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3650 (Target_powerpc::do_define_standard_symbols): New function.
3651
34171bc5
AM
36522012-12-03 Alan Modra <amodra@gmail.com>
3653
3654 * output.h: Formatting, whitespace.
3655
dc9589e9 36562012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3657
3658 * layout.h (Layout::get_executable_sections): Declare.
3659 * layout.cc (Layout::get_executable_sections): New function.
3660 * arm.cc (Target_arm::group_sections): Use it.
3661 (Arm_output_section::group_sections): Delete now redundant test.
3662 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3663 param to handle relative relocs.
3664 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3665 (Output_data_reloc::add_absolute): Adjust.
3666 (Output_data_reloc::add_relative): New function.
3667 (Output_data::reset_data_size): New function.
3668 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3669 (Output_section::set_addralign): New function.
3670 (Output_section::checkpoint_set_addralign): New function.
3671 (Output_section::clear_section_offsets_need_adjustment): New function.
3672 (Output_section::input_sections): Make public.
3673 * powerpc.cc (class Output_data_brlt_powerpc): New.
3674 (class Stub_table, class Stub_control): New.
3675 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3676 stub_table_, set_stub_table, stub_table): New vectors and accessor
3677 functions.
3678 (Target_powerpc::do_may_relax, do_relax, push_branch,
3679 new_stub_table, stub_tables, brlt_section, group_sections,
3680 add_branch_lookup_table, find_branch_lookup_table,
3681 write_branch_lookup_table, make_brlt_section): New functions.
3682 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3683 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3684 branch_info_): New vars.
3685 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3686 make call stubs here.
3687 (Output_data_glink): Remove all call stub handling from this class.
3688 (Target_powerpc::Scan::local, global): Save interesting branch
3689 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3690 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3691 functions on final link.
3692 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3693 Handle long branch destinations too.
3694 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3695 do_plt_address_for_local): Adjust lookup of plt call stubs.
3696
627b30b7
AM
36972012-11-30 Alan Modra <amodra@gmail.com>
3698
3699 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3700 relocs against protected symbols when building 32-bit shared libs.
3701
40b469d7
AM
37022012-11-30 Alan Modra <amodra@gmail.com>
3703
3704 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3705 param. Call got_section() to make .got. Update all callers
3706 and their callers and so on.
3707
bb66a627
AM
37082012-11-30 Alan Modra <amodra@gmail.com>
3709
3710 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3711 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3712 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3713 value if it already exists.
3714
d2cf1c6c
L
37152012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3716
3717 PR gold/14858
3718 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3719
edccdf7c
RM
37202012-11-14 Roland McGrath <mcgrathr@google.com>
3721
3722 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3723 than bfc instruction for data sandboxing.
3724
6febeb74
AM
37252012-11-08 Alan Modra <amodra@gmail.com>
3726
3727 * po/POTFILES.in: Regenerate.
3728
0a6f1bf2
AM
37292012-11-05 Alan Modra <amodra@gmail.com>
3730
3731 * configure.ac: Apply 2012-09-10 change to config.in here.
3732 * configure: Regenerate.
3733
26a4e9cb
AM
37342012-11-05 Alan Modra <amodra@gmail.com>
3735
3736 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3737 (struct Opd_ent): Use "Address" rather than "Offset".
3738 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3739 (Target_powerpc::got_section): Make public.
3740 (Target_powerpc::scan_relocs): Move code setting symbols..
3741 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3742 Create _SDA_BASE_ only when referenced.
3743
cc928013
RM
37442012-11-02 Roland McGrath <mcgrathr@google.com>
3745
3746 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3747 from last change.
3748
50ed5eb1
RM
37492012-11-01 Roland McGrath <mcgrathr@google.com>
3750
62fe925a
RM
3751 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3752 for offset_in_output_section parameter.
3753 (Sized_target::relocate_special_relocatable): Likewise.
3754 * arm.cc (Target_arm::relocate_relocs): Likewise.
3755 (Target_arm::relocate_special_relocatable): Likewise.
3756 * i386.cc (Target_i386::relocate_relocs): Likewise.
3757 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3758 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3759 * target-reloc.h (relocate_relocs): Likewise.
3760 * testsuite/testfile.cc (Target_test): Likewise.
3761 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3762 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3763
3764 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3765 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3766
3767 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3768 parameter, which is unused in the [!F_SETFD] case.
3769
50ed5eb1
RM
3770 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3771 SYMNDX to off_t before comparing it to this->data_size().
3772 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3773 * incremental.cc (Output_section_incremental_inputs::do_write):
3774 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3775
2cadc0bf
RM
3776 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3777
3bfcb652
NC
37782012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3779
3780 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3781 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3782 in EABI_VER5.
3783
c1a8d56e
CC
37842012-10-29 Cary Coutant <ccoutant@google.com>
3785
3786 * dwp.cc (usage): Add file and exit status parameters;
3787 add --help and --version options.
3788 (print_version): New function.
3789 (main): Add --help and --version options.
3790
b2490a7b
L
37912012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3792
3793 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3794 final_layout_sequence.txt.
3795 * testsuite/Makefile.in: Regenerated.
3796
aa543512
L
37972012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3798
3799 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3800 COMPILE generated by automake.
3801 (LINK1): Likewise.
3802 (CXXCOMPILE1): Likewise.
3803 (CXXLINK1): Likewise.
3804 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3805 (LINK): Likewise.
3806 (CXXCOMPILE): Likewise.
3807 (CXXLINK): Likewise.
3808 * testsuite/Makefile.in: Regenerated.
3809
d361fafb
L
38102012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3811
3812 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3813 on bad fwrite return.
3814
598c7410
L
38152012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3816
3817 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3818 on val.
3819
35c813e2
CC
38202012-10-23 Cary Coutant <ccoutant@google.com>
3821
3822 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3823 * testsuite/Makefile.in: Regenerate.
3824 * testsuite/dwp_test.h: New source file.
3825 * testsuite/dwp_test_1.cc: New source file.
3826 * testsuite/dwp_test_1.s: New source file.
3827 * testsuite/dwp_test_1.sh: New source file.
3828 * testsuite/dwp_test_1b.cc: New source file.
3829 * testsuite/dwp_test_1b.s: New source file.
3830 * testsuite/dwp_test_2.cc: New source file.
3831 * testsuite/dwp_test_2.s: New source file.
3832 * testsuite/dwp_test_2.sh: New source file.
3833 * testsuite/dwp_test_main.cc: New source file.
3834 * testsuite/dwp_test_main.s: New source file.
3835
77429909
CC
38362012-10-23 Cary Coutant <ccoutant@google.com>
3837
3838 * dwp.h: New header file.
3839 * dwp.cc: New source file.
3840 * gold.h: Move shared declarations to system.h.
3841 * system.h: New header file.
3842 * Makefile.am: Add dwp.
3843 * Makefile.in: Regenerate.
3844
ed5d6712
CC
38452012-10-23 Cary Coutant <ccoutant@google.com>
3846
3847 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3848 Dwarf_info_reader::read_from_pointer.
3849 (Dwarf_pubnames_table::read_header): Likewise.
3850 (Dwarf_pubnames_table::next_name): Likewise.
3851 (Dwarf_die::read_attributes): Likewise.
3852 (Dwarf_die::skip_attributes): Likewise.
3853 (Dwarf_info_reader::read_from_pointer): New function template.
3854 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3855 (Dwarf_pubnames_table): Likewise.
3856 (Dwarf_info_reader::read_from_pointer): New function template.
3857 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3858 Dwarf_pubnames_table ctor.
3859
8787852d
CC
38602012-10-23 Cary Coutant <ccoutant@google.com>
3861
3862 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3863 abbrev_shndx.
3864 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3865 abbrev_shndx_.
3866 (Dwarf_info_reader::set_abbrev_shndx): New method.
3867 (Dwarf_info_reader::abbrev_shndx_): New data member.
3868
9fc236f3
CC
38692012-10-23 Cary Coutant <ccoutant@google.com>
3870
3871 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3872 from object, not parameters.
3873 (Dwarf_info_reader::parse): Likewise.
3874 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3875 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3876 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3877 methods.
3878
effe8365
CC
38792012-10-23 Cary Coutant <ccoutant@google.com>
3880
3881 * fileread.cc (Input_file::Input_file): New constructor.
3882 * fileread.h (class Input_file): Add new constructor.
3883
1698990d
AM
38842012-10-18 Alan Modra <amodra@gmail.com>
3885
3886 PR gold/14727
3887 * object.cc (Relobj::is_section_name_included): Also match
3888 .sdata personality section.
3889
168a4726
AM
38902012-10-18 Alan Modra <amodra@gmail.com>
3891
3892 * target-reloc.h (class Default_comdat_behavior): New, package up..
3893 (get_comdat_behaviour): ..this.
3894 (relocate_section): Add Relocate_comdat_behavior template arg,
3895 adjust code to suit.
3896 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3897 (Target_arm::scan_reloc_section): Likewise.
3898 * i386.cc (Target_i386::relocate_section): Likewise.
3899 * sparc.cc (Target_sparc::relocate_section): Likewise.
3900 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3901 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3902 * powerpc.cc (class Relocate_comdat_behavior): New.
3903 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3904 gold::relocate_section with new template arg.
3905
acc276d8
AM
39062012-10-18 Alan Modra <amodra@gmail.com>
3907
3908 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3909 dynamic relocs for GOT_TPREL got entries, without symbol if
3910 resolving locally.
3911 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3912 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3913 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3914
e10f9870
AM
39152012-10-17 Alan Modra <amodra@gmail.com>
3916
3917 PR gold/14726
3918 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3919
ae034989
ST
39202012-10-16 Sriraman Tallam <tmsriram@google.com>
3921
3922 * layout.cc (Layout::include_section): Keep sections marked
3923 SHF_EXCLUDE when doing relocatable links.
3924
f3a0ed29
AM
39252012-10-16 Alan Modra <amodra@gmail.com>
3926
3927 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3928 (Target_powerpc::do_finalize_sections): Call it.
3929 (Output_data_save_res): New class and supporting functions.
3930 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3931 normal symbols defined in object files.
3932
c6de8ed4
AM
39332012-10-12 Alan Modra <amodra@gmail.com>
3934
3935 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3936 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3937 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3938 section if scan_opd_relocs not yet called.
3939 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3940
03e25981
AM
39412012-10-12 Alan Modra <amodra@gmail.com>
3942
3943 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3944 add_local_ifunc_entry): Revert last change.
3945 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3946
c9824451
AM
39472012-10-05 Alan Modra <amodra@gmail.com>
3948
3949 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3950 do_plt_address_for_global): New functions.
3951 (Output_data_got_powerpc::do_write): Don't segfault when linking
3952 statically.
3953 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3954 add_local_ifunc_entry): Return true on adding entry..
3955 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3956 glink->add_entry call. Remove unused symtab param. Adjust calls.
3957 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3958 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3959 set up symbols here.
3960 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3961 syms here. Do so even when no .iplt. Don't segfault when linking
3962 statically.
3963 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3964 new variants without reloc param.
3965 (Glink_sym_ent::Glink_sym_ent): Likewise.
3966 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3967 reloc when refs will resolve to plt call stub.
3968 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3969 R_PPC_PLTREL24 to resolve locally.
3970 (Target_powerpc::Scan::global): Correct ifunc handling.
3971 (Target_powerpc::Relocate::relocate): Correct local sym glink
3972 lookup. Don't destroy "value" when we have a plt call stub,
3973 and when checking plt call validity.
3974 (Target_powerpc::do_dynsym_value): Simplify.
3975
19fec8c1
AM
39762012-10-05 Alan Modra <amodra@gmail.com>
3977
3978 * i386.cc (Output_data_plt_i386::address_for_global,
3979 address_for_local): Add plt offset to returned value. Adjust uses.
3980 * sparc.cc (Output_data_plt_sparc::address_for_global,
3981 address_for_local): Likewise.
3982 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3983 address_for_local): Likewise.
3984 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3985 address_for_local): Likewise.
3986 * target.h (Target::plt_address_for_global, plt_address_for_local):
3987 Update comment.
3988 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3989 (Output_data_got::Got_entry::write): Nor here.
3990 * output.h: Comment fix.
3991
e867b647
WL
39922012-10-02 Jiong Wang <jiwang@tilera.com>
3993
3994 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3995 global_offset_table_ value for larget got.
3996 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3997
e5d5f5ed
AM
39982012-09-29 Alan Modra <amodra@gmail.com>
3999
4000 * powerpc.cc (Target_powerpc::iplt_): New output section.
4001 (Target_powerpc::iplt_section, make_iplt_section,
4002 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4003 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4004 Target_powerpc::plt_entry_count): Count iplt entries too.
4005 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4006 reloc section in constructor. New params.
4007 (Target_powerpc::make_plt_section): Create reloc section here instead.
4008 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4009 functions.
4010 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4011 (Output_data_glink::add_entry, find_entry): New functions to
4012 deal with local syms.
4013 (Glink_sym_ent): Add support for local syms.
4014 (Output_data_glink::do_write): Handle ifunc plt entries.
4015 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4016 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4017 (Target_powerpc::Relocate::relocate): Likewise.
4018 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4019
ec4dbad3
AM
40202012-09-25 Alan Modra <amodra@gmail.com>
4021
4022 * object.h (Sized_relobj_file::adjust_local_symbol,
4023 do_adjust_local_symbol): New functions.
4024 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4025 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4026 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4027 and irregular opd entry spacing.
4028 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4029 (Global_symbol_visitor_opd): New functor.
4030 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4031 on deleted opd entries.
4032
5c0b3823
WL
40332012-09-15 Jiong Wang <jiwang@tilera.com>
4034
4035 * tilegx.cc: New file.
4036 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4037 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4038 * configure.tgt: Add entries for tilegx*.
4039 * configure.ac: Likewise.
4040 * Makefile.in: Rebuild.
4041 * configure: Likewise.
4042 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4043 tilegx.
4044
bfdfa4cd
AM
40452012-09-13 Alan Modra <amodra@gmail.com>
4046
4047 * target-reloc.h (scan_relocs): Call scan.local for relocs
4048 against symbols in discarded sections. Pass is_discarded
4049 param.
4050 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4051 Add is_discarded param.
4052 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4053 is_discarded to flag opd entry as discarded. Don't emit dyn
4054 relocs on such entries.
4055 (Target_powerpc::Scan::global): Similarly detect and handle
4056 such opd entries.
4057 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4058 opd_ent_. Update all uses.
4059 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4060 (Target_powerpc::relocate_section): Zero out discarded opd
4061 entry relocs.
4062
d77a0555
ILT
40632012-09-12 Ian Lance Taylor <iant@google.com>
4064
4065 PR gold/14570
4066 * output.cc: Rename Output_data_got template parameter from size
4067 to got_size for all functions. Compile all variants of
4068 Output_data_got.
4069 (Output_data_got::Got_entry::write): Correct use of size for
4070 symbol value. Use local_is_tls rather than casting to
4071 Sized_relobj_file.
4072 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4073 (class Sized_relobj_file): Add do_local_is_tls.
4074 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4075
815a1205
AM
40762012-09-11 Alan Modra <amodra@gmail.com>
4077
4078 PR gold/14566
4079 * layout.cc (Layout::set_segment_offsets): When using
4080 common-page-size alignment, ensure we are on a new max-page-size
4081 page.
4082 * output.cc (Output_segment::set_section_addresses): Use
4083 abi_pagesize, not common_pagesize for relro boundary.
4084 (Output_segment::set_offset): Likewise.
4085
bd73a62d
AM
40862012-09-11 Alan Modra <amodra@gmail.com>
4087
4088 * output.h (Output_data_got::add_global_tls, add_local_tls,
4089 add_local_tls_pair): New functions.
4090 (Output_data_got::add_local_pair_with_rel): Remove second
4091 reloc param. Expand comment.
4092 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4093 use_plt_or_tls_offset_, similarly for constructor param.
4094 (Output_data_got::Got_entry::write): Add got_index param.
4095 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4096 add_local_tls_pair): New functions.
4097 (Output_data_got::Got_entry::write): Handle tls symbols
4098 with use_plt_or_tls_offset_ set specially.
4099 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4100 (Output_data_got::do_write): Replace iterator with index, pass
4101 index to entry write function.
4102 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4103 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4104 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4105 call.
4106 * i386.cc (Target_i386::Scan::local): Likewise.
4107 * sparc.cc (Target_sparc::Scan::local): Likewise.
4108 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4109 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4110 do_tls_offset_for_global): New functions.
4111 (Target_powerpc::Scan::local): Correct TLS relocations and got
4112 entry values.
4113 (Target_powerpc::Scan::global): Don't emit unnecessary
4114 dynamic relocations on TLS GOT entries.
4115
00716ab1
AM
41162012-09-10 Matthias Klose <doko@ubuntu.com>
4117
4118 * config.in: Disable sanity check for kfreebsd.
4119
c891b3f9
SA
41202012-09-10 Sterling Augustine <saugustine@google.com>
4121
4122 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4123 (Gdb_index::pubtypes_read): New parameter.
4124 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4125 to calls.
4126 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4127 pubtypes_object_.
4128
e81fea4d
AM
41292012-09-09 Alan Modra <amodra@gmail.com>
4130
4131 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4132 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4133 * gc.h (gc_process_relocs): Call target gc_add_reference.
4134 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4135 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4136 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4137 unnecessary cast.
4138 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4139 to cater for when we don't need code offset. Update use.
4140 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4141 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4142 set_opd_valid): New functions.
4143 (Target_powerpc::do_gc_add_reference): New function.
4144 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4145 stashed refs.
4146 (Target_powerpc::do_gc_mark_symbol): New function.
4147
d2d60eef
CC
41482012-09-06 Cary Coutant <ccoutant@google.com>
4149
4150 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4151 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4152 (Dwarf_die::skip_attributes): Likewise.
4153 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4154 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4155 (main): Call it.
4156 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4157
32ed4573
L
41582012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4159
4160 * testsuite/script_test_3.t: Add .got.plt output section
4161 statement.
4162 * testsuite/script_test_4.t: Likewise.
4163
f4baf0d4
AM
41642012-09-05 Alan Modra <amodra@gmail.com>
4165
4166 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4167 update all uses and lose "enum" when using type.
4168
864a1b56
AM
41692012-09-05 Alan Modra <amodra@gmail.com>
4170
4171 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4172 * configure: Regenerate.
4173 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4174 (plugin_final_layout.stdout): Likewise.
4175 (memory_test): Set page sizes to 0x1000.
4176 * testsuite/Makefile.in: Regenerate.
4177 * testsuite/discard_locals_test.sh: Add FIXME comment.
4178 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4179 * testsuite/pr14265.t: Add .got output section statement.
4180 * testsuite/script_test_2.t: Likewise.
4181 * testsuite/script_test_3.t: Likewise.
4182 * testsuite/script_test_4.t: Likewise.
4183 * testsuite/script_test_5.t: Likewise.
4184 * testsuite/script_test_6.t: Likewise.
4185 * testsuite/script_test_7.t: Likewise.
4186 * testsuite/script_test_9.t: Likewise.
4187
3ea0a085
AM
41882012-09-05 Alan Modra <amodra@gmail.com>
4189
4190 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4191 (Powerpc_relocate_functions::Status): New typedef.
4192 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4193 (Target_powerpc::Scan::local): Handle REL64.
4194 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4195 for REL32 and REL64.
4196 (Target_powerpc::symval_for_branch): New function, extracted from..
4197 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4198 checks. Report overflow errors.
4199
7404fe1b
AM
42002012-09-05 Alan Modra <amodra@gmail.com>
4201
4202 * object.h (Sized_relobj_file::emit_relocs): Delete.
4203 (Sized_relobj_file::emit_relocs_reltype): Delete.
4204 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4205 relocate_relocs for --emit-relocs.
4206 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4207 * output.h: Update comment.
4208 (Output_segment::first_section): New function.
4209 (Output_segment::first_section_load_address): Use first_section.
4210 * output.cc (Output_segment::first_section): New function extracted..
4211 (Output_segment::first_section_load_address): ..from here. Delete.
4212 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4213 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4214 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4215 adjust call to target.h function.
4216 * i386.cc (Target_i386): Likewise.
4217 * sparc.cc (Target_sparc): Likewise.
4218 * x86_64.cc (Target_x86_64): Likewise.
4219 * powerpc.cc (Target_powerpc): Likewise.
4220 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4221 first tls section has section symbol for optimised local dynamic
4222 output relocs.
4223 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4224 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4225 optimised tls code.
4226 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4227 Rename to relocate_relocs. Update error message.
4228
957564c9
AS
42292012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4230
4231 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4232 --just-symbols.
4233
dd93cd0a
AM
42342012-08-31 Alan Modra <amodra@gmail.com>
4235
4236 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4237 (Powerpc_relobj::toc_base_offset): New stub function.
4238 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4239 got_mod_index_offset to tlsld_got_offset. Update all refs.
4240 (Target_powerpc::Relocate::enum skip_tls): New.
4241 (Target_powerpc::call_tls_get_addr_): New var.
4242 (Target_powerpc::is_branch_reloc): Move to file scope.
4243 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4244 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4245 New functions.
4246 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4247 (powerpc_info): Correct common_pagesize for ppc64.
4248 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4249 (Powerpc_relocate_functions): Add overflow check enums and functions.
4250 Add non-shift version of rela, rela_ua. Delete all rel public
4251 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4252 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4253 addr16_ha3, addr14 functions.
4254 (Output_data_got_powerpc::add_constant_pair): New function.
4255 (Output_data_got_powerpc::got_base_offset): Likewise.
4256 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4257 (instruction constants): Sort, add some more.
4258 (Output_data_glink::do_write): Add and use Address typedef. Use
4259 object->toc_base_offset() stub for 64-bit.
4260 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4261 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4262 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4263 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4264 Always treat .opd relocs as against locally defined symbol.
4265 Correct condition for RELATIVE relocs.
4266 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4267 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4268 for 32-bit syms with a plt entry. Correct ppc64 toc base
4269 calculations. Handle TLS relocs, and more. Add overflow
4270 checking and adjust for Powerpc_relocate_functions changes.
4271 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4272 Reinstate --emit-relocs code with FIXME.
4273
a1373b60
AM
42742012-08-30 Alan Modra <amodra@gmail.com>
4275
4276 * layout.cc (Layout::set_segment_offsets): Set p_align to
4277 abi_pagesize, not common_pagesize.
4278 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4279 to determine whether file header can go in segment.
4280
703d02da
AM
42812012-08-30 Alan Modra <amodra@gmail.com>
4282
4283 * output.h (Output_reloc::Output_reloc <output section>): Add
4284 is_relative param. Adjust calls.
4285 (Output_reloc::add_output_section_relative): New functions.
4286 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4287 is_relative.
4288 (Output_reloc::symbol_value): Handle SECTION_CODE.
4289
16164a6b
ST
42902012-08-24 Sriraman Tallam <tmsriram@google.com>
4291
4292 * gold.cc (queue_middle_tasks): Call layout again when unique
4293 segments for sections is desired.
4294 * layout.cc (Layout::Layout): Initialize new members.
4295 (Layout::get_output_section_flags): New function.
4296 (Layout::choose_output_section): Call get_output_section_flags.
4297 (Layout::layout): Make output section for mapping to a unique segment.
4298 (Layout::insert_section_segment_map): New function.
4299 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4300 output sections marked so.
16164a6b
ST
4301 (Layout::segment_precedes): Check for unique segments when sorting.
4302 * layout.h (Layout::Unique_segment_info): New struct.
4303 (Layout::Section_segment_map): New typedef.
4304 (Layout::insert_section_segment_map): New function.
4305 (Layout::get_output_section_flags): New function.
4306 (Layout::is_unique_segment_for_sections_specified): New function.
4307 (Layout::set_unique_segment_for_sections_specified): New function.
4308 (Layout::unique_segment_for_sections_specified_): New member.
4309 (Layout::section_segment_map_): New member.
4310 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4311 Rename is_gc_pass_one to is_pass_one.
4312 Rename is_gc_pass_two to is_pass_two.
4313 Rename is_gc_or_icf to is_two_pass.
4314 Check for which pass based on whether symbols data is present.
4315 Make it two pass when unique segments for sections is desired.
4316 * output.cc (Output_section::Output_section): Initialize new
4317 members.
4318 * output.h (Output_section::is_unique_segment): New function.
4319 (Output_section::set_is_unique_segment): New function.
4320 (Output_section::is_unique_segment_): New member.
4321 (Output_section::extra_segment_flags): New function.
4322 (Output_section::set_extra_segment_flags): New function.
4323 (Output_section::extra_segment_flags_): New member.
4324 (Output_section::segment_alignment): New function.
4325 (Output_section::set_segment_alignment): New function.
4326 (Output_section::segment_alignment_): New member.
4327 (Output_segment::Output_segment): Initialize is_unique_segment_.
4328 (Output_segment::is_unique_segment): New function.
4329 (Output_segment::set_is_unique_segment): New function.
4330 (Output_segment::is_unique_segment_): New member.
4331 * plugin.cc (allow_unique_segment_for_sections): New function.
4332 (unique_segment_for_sections): New function.
4333 (Plugin::load): Add new functions to transfer vector.
4334 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4335 * Makefile.in: Regenerate.
4336 * testsuite/plugin_final_layout.sh: Check if unique segment
4337 functionality works.
4338 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4339 are available.
4340 (allow_unique_segment_for_sections): New global.
4341 (unique_segment_for_sections): New global.
4342 (claim_file_hook): Call allow_unique_segment_for_sections.
4343 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4344
1e2bee4f
CC
43452012-08-22 Cary Coutant <ccoutant@google.com>
4346
4347 * layout.cc (Layout::include_section): Don't assert on GROUP
4348 sections with --emit-relocs.
4349
1d5dfe78
CC
43502012-08-21 Cary Coutant <ccoutant@google.com>
4351
4352 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4353 if --export-dynamic-symbol names an undef symbol.
4354
c9269dff
AM
43552012-08-18 Alan Modra <amodra@gmail.com>
4356
4357 * powerpc.cc: Formatting and white space.
4358 (Powerpc_relobj): Rename got2_section_ to special_.
4359 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4360 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4361 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4362 (Target_powerpc): Add Address typedef and invalid_address. Use
4363 throughout.
4364 (Target_powerpc::is_branch_reloc): New function.
4365 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4366 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4367 for dst_mask, value and addend.
4368 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4369 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4370 (Output_data_glink::do_write): Correct toc base. Don't try to use
4371 uint16_t for 24-bit offset. Use get_output_section_offset and
4372 check return.
4373 (Target_powerpc::Scan::local): Handle more relocs.
4374 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4375 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4376 Plug in toc restoring insn after plt calls. Translate branches
4377 to function descriptor symbols to corresponding entry point.
4378 (Target_powerpc::relocate_for_relocatable): Check return from
4379 get_output_section_offset.
4380 * symtab.h: Comment typo.
4381
b1759dce
ILT
43822012-08-14 Ian Lance Taylor <iant@google.com>
4383
4384 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4385 unsupported_relocal_local to call unsupported_reloc_global.
4386
b9b2ae8b
NC
43872012-08-14 Nick Clifton <nickc@redhat.com>
4388
4389 PR ld/14265
4390 * script-sections.cc (Sections_element::output_section_name): Add
4391 keep return parameter.
4392 (Output_section_element::match_name): Add keep return parameter.
4393 Return the value of the keep_ member.
4394 * script-sections.h (class Output_section): Update
4395 output_section_name prototype.
4396 * layout.cc (Layout::keep_input_section): New public member
4397 function.
4398 (Layout::choose_output_section): Pass keep parameter to
4399 output_section_name.
4400 * layout.h (class Layout): Add keep_input_section.
4401 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4402 sections.
4403 * testsuite/Makefile.am: Add a test.
4404 * testsuite/Makefile.in: Regenerate.
4405 * testsuite/pr14265.c: Source file for the test.
4406 * testsuite/pr14265.t: Linker script for the test.
4407 * testsuite/pr14265.sh: Shell script for the test.
4408
921b5322
AM
44092012-08-14 Alan Modra <amodra@gmail.com>
4410
4411 * target.h (Target::output_section_name): New function.
4412 (Target::do_output_section_name): New function.
4413 * layout.cc (Layout::choose_output_section): Call the above.
4414 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4415
6ce78956
AM
44162012-08-14 Alan Modra <amodra@gmail.com>
4417
4418 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4419 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4420 for replace_constant call.
4421 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4422 (Output_data_glink::do_print_to_mapfile): New function.
4423 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4424 (Target_powerpc::Relocate::relocate): Likewise.
4425
d1a8cabd
AM
44262012-08-14 Alan Modra <amodra@gmail.com>
4427
4428 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4429 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4430 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4431 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4432 all references to shndx_. Handle special case for R_PPC_PLTREL24
4433 here.
4434 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4435 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4436 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4437 here.
4438 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4439 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4440
d83ce4e3
AM
44412012-08-12 Alan Modra <amodra@gmail.com>
4442
4443 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4444 (glink insn constants): Use uint32_t.
4445 (Output_data_glink::add_entry): Use insert, not [] operator.
4446
cf43a2fe
AM
44472012-08-11 Alan Modra <amodra@gmail.com>
4448
4449 * object.h (Sized_relobj_file::find_shdr): New function.
4450 (Sized_relobj_file::find_special_sections): New function.
4451 * object.cc (Sized_relobj_file::find_shdr): New function.
4452 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4453 (Sized_relobj_file::find_special_sections): New function, split out..
4454 (Sized_relobj_file::do_read_symbols): ..from here.
4455 * output.h (Output_data_got::replace_constant): New function.
4456 (Output_data_got::num_entries): New function.
4457 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4458 (Output_data_got::got_offset): Protected rather than private.
4459 (Output_data_got::replace_got_entry): New function.
4460 * output.cc (Output_data_got::replace_got_entry): New function.
4461 * powerpc.cc (class Powerpc_relobj): New.
4462 (class Powerpc_relocate_functions): Delete all psymval variants or
4463 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4464 Implement _ha functions using corresponding _hi function.
4465 (Powerpc_relobj::find_special_sections): New function.
4466 (Target_powerpc::do_make_elf_object): New function.
4467 (class Output_data_got_powerpc): New.
4468 (class Output_data_glink): New.
4469 (class Powerpc_scan_relocatable_reloc): New.
4470 Many more changes througout file.
4471
3c892704
NC
44722012-08-09 Nick Clifton <nickc@redhat.com>
4473
4474 * po/vi.po: Updated Vietnamese translation.
4475
82435b3b
ILT
44762012-08-07 Ian Lance Taylor <iant@google.com>
4477
4478 * layout.cc (Layout::add_target_dynamic_tags): If
4479 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4480 plt_rel.
4481
a6dc81d2
NC
44822012-07-30 Nick Clifton <nickc@redhat.com>
4483
4484 * po/gold.pot: Updated template.
4485 * po/es.po: Updated Spanish translation.
4486
f1415016
CC
44872012-07-18 Cary Coutant <ccoutant@google.com>
4488
4489 PR gold/14344
4490 * configure.ac: Add check for -gpubnames support.
4491 * configure: Regenerate.
4492 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4493 support; force -gno-pubnames.
4494 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4495 support.
4496 (gdb_index_test_4): New test.
4497 * testsuite/Makefile.in: Regenerate.
4498 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4499 * testsuite/gdb_index_test_2.sh: Likewise.
4500 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4501 * testsuite/gdb_index_test_4.sh: New script.
4502 * testsuite/gdb_index_test_comm.sh: New script with common code;
4503 don't look for space after colon.
4504
b7fd7c37
ST
45052012-07-16 Sriraman Tallam <tmsriram@google.com>
4506
4507 * gold.cc (queue_middle_tasks): Update function order only after
4508 deferred objects due to plugins are processed.
4509
1f3212db
ILT
45102012-07-11 Ian Lance Taylor <iant@google.com>
4511
4512 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4513 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4514 (Target_arm::scan_reloc_for_stub): Likewise.
4515 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4516 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4517 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4518 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4519 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4520
81c82a68
ILT
45212012-07-10 Dodji Seketeli <dodji@redhat.com>
4522 Ian Lance Taylor <iant@google.com>
4523
4524 PR gold/14309
4525 * configure.ac: Test whether std::tr1::hash<off_t> works.
4526 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4527 needed.
4528 * output.h (class Output_fill): Add virtual destructor.
4529 * configure, config.in: Rebuild.
4530
eabc84f4
RM
45312012-06-22 Roland McGrath <mcgrathr@google.com>
4532
4533 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4534
370e30b6
RÁE
45352012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4536
4537 * plugin.cc (Plugin::load): Handle position independent executables.
4538
fb1b895d
CC
45392012-06-06 Cary Coutant <ccoutant@google.com>
4540
4541 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4542 add .debug_macro.
4543 (lines_only_debug_sections): Likewise.
4544 (gdb_fast_lookup_sections): New static array.
4545 (is_gdb_debug_section): Rename formal parameter.
4546 (is_lines_only_debug_section): Likewise.
4547 (is_gdb_fast_lookup_section): New function.
4548 (Layout::include_section): Check for ".zdebug_" prefix; pass
4549 section name suffix to is_gdb_debug_section, et al.; check for
4550 fast-lookup sections when building .gdb_index.
4551 * options.h (--strip-debug-gdb): Update GDB version number.
4552
7c0640fa
CC
45532012-06-06 Cary Coutant <ccoutant@google.com>
4554
4555 * configure.ac: Add check for fallocate.
4556 * configure: Regenerate.
4557 * config.in: Regenerate.
4558
4559 * options.h (class General_options): Add --mmap-output-file and
4560 --posix-fallocate options.
4561 * output.cc: (posix_fallocate): Remove; replace with...
4562 (gold_fallocate): New function.
4563 (Output_file::map_no_anonymous): Call gold_fallocate.
4564 (Output_file::map): Check --mmap-output-file option.
4565
2a49eb69
DK
45662012-06-05 Jing Yu <jingyu@google.com>
4567
4568 * gold.h (textdomain): Add do {} to empty while(0).
4569 (bindtextdomain): Likewise.
4570
fad072ac
CC
45712012-06-04 Cary Coutant <ccoutant@google.com>
4572
4573 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4574 has_dynsym_index.
4575
8cc69fb6
ST
45762012-05-25 Sriraman Tallam <tmsriram@google.com>
4577
4578 * symtab.cc (Symbol_table::define_special_symbol):
4579 Initialize *poldsym to prevent uninitialized variable errors.
4580
1be75daa
CC
45812012-05-23 Cary Coutant <ccoutant@google.com>
4582
4583 * layout.cc (Layout::section_name_mapping): Add rules to handle
4584 exact match on .data.rel.ro.local or .data.rel.ro.
4585 (Layout::output_section_name): Check for exact matches.
4586
9b689de0
CC
45872012-05-23 Cary Coutant <ccoutant@google.com>
4588
4589 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4590 more carefully.
4591
b24fdbf5
CC
45922012-05-22 Cary Coutant <ccoutant@google.com>
4593
4594 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4595 object before exporting symbol.
4596
e550e1a2
L
45972012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4598
4599 * testsuite/tls_test.cc: Include "config.h" first.
4600 * testsuite/tls_test_c.c: Likewise.
4601
df7b86aa
NC
46022012-05-17 Daniel Richard G. <skunk@iskunk.org>
4603 Nick Clifton <nickc@redhat.com>
4604
4605 PR 14072
4606 * configure.in: Add check that sysdep.h has been included before
4607 any system header files.
4608 * configure: Regenerate.
4609 * config.in: Regenerate.
4610
1007b503
CC
46112012-05-14 Cary Coutant <ccoutant@google.com>
4612
4613 * layout.cc (Layout::make_output_section): Mark .tdata section
4614 as RELRO.
4615 * testsuite/relro_test.cc: Add a TLS variable.
4616
fd885f3a
L
46172012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4618
4619 PR gold/14091
4620 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4621 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4622 R_X86_64_64.
4623
80f5885c
CC
46242012-05-08 Cary Coutant <ccoutant@google.com>
4625
4626 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4627 (lines_only_debug_sections): Likewise.
4628
2e702c99
RM
46292012-05-02 Roland McGrath <mcgrathr@google.com>
4630
4631 * nacl.cc: New file.
4632 * nacl.h: New file.
4633 * Makefile.am (CCFILES, HFILES): Add them.
4634 * Makefile.in: Regenerate.
4635 * i386.cc (Output_data_plt_i386_nacl): New class.
4636 (Output_data_plt_i386_nacl_exec): New class.
4637 (Output_data_plt_i386_nacl_dyn): New class.
4638 (Target_i386_nacl): New class.
4639 (Target_selector_i386_nacl): New class.
4640 (target_selector_i386): Use it instead of Target_selector_i386.
4641 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4642 (Target_x86_64_nacl): New class.
4643 (Target_selector_x86_64_nacl): New class.
4644 (target_selector_x86_64, target_selector_x32): Use it instead of
4645 Target_selector_x86_64.
4646 * arm.cc (Output_data_plt_arm_nacl): New class.
4647 (Target_arm_nacl): New class.
4648 (Target_selector_arm_nacl): New class.
4649 (target_selector_arm, target_selector_armbe): Use it instead of
4650 Target_selector_arm.
4651
4652 * target-select.cc (select_target): Take new Input_file* and off_t
4653 arguments, pass them on to recognize method of selector.
4654 * object.cc (make_elf_sized_object): Update caller.
4655 * parameters.cc (parameters_force_valid_target): Likewise.
4656 * incremental.cc (make_sized_incremental_binary): Likewise.
4657 * target-select.h: Update decl.
4658 (Target_selector::recognize): Take new Input_file* argument,
4659 pass it on to do_recognize.
4660 (Target_selector::do_recognize): Take new Input_file* argument.
4661 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4662 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4663 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4664 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4665
4666 * target.h (Target::Target_info): New members isolate_execinstr
4667 and rosegment_gap.
4668 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4669 * arm.cc (Target_arm::arm_info): Update initializer.
4670 * i386.cc (Target_i386::i386_info): Likewise.
4671 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4672 * sparc.cc (Target_sparc::sparc_info): Likewise.
4673 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4674 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4675 * layout.cc (Layout::attach_allocated_section_to_segment):
4676 Take new const Target* argument. If target->isolate_execinstr(), act
4677 like --rosegment.
4678 (Layout::find_first_load_seg): Take new const Target* argument;
4679 if target->isolate_execinstr(), reject PF_X segments.
4680 (Layout::relaxation_loop_body): Update caller.
4681 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4682 reset file offset to zero when we hit LOAD_SEG, and then do a second
4683 loop over the segments before LOAD_SEG to reassign offsets after
4684 addresses have been determined. Handle target->rosegment_gap().
4685 (Layout::attach_section_to_segment): Take new const Target* argument;
4686 pass it to attach_allocated_section_to_segment.
4687 (Layout::make_output_section): Update caller.
4688 (Layout::attach_sections_to_segments): Take new const Target* argument;
4689 pass it to attach_section_to_segment.
4690 * gold.cc (queue_middle_tasks): Update caller.
4691 * layout.h (Layout): Update method decls with new arguments.
4692
4693 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4694 Target_info pointer to use.
4695 (Target_arm::do_make_data_plt): New virtual method.
4696 (Target_arm::make_data_plt): New method that calls it.
4697 (Target_arm::make_plt_entry): Use it.
4698 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4699 for the section alignment.
4700 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4701 method.
4702 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4703 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4704 method.
4705 (Output_data_plt_arm::get_plt_entry_size): Call it.
4706 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4707 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4708 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4709 method.
4710 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4711 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4712 method instead of sizeof(plt_entry).
4713 (Output_data_plt_arm::add_entry): Likewise.
4714 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4715 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4716 than static method.
4717 (Target_arm::plt_entry_size): Likewise.
4718 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4719 Move to ...
4720 (Output_data_plt_arm_standard): ... here, new class.
4721 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4722 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4723 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4724
4725 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4726 Take additional argument for the PLT entry size.
4727 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4728 Use get_plt_entry_size method rather than plt_entry_size variable.
4729 (Output_data_plt_x86_64::reserve_slot): Likewise.
4730 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4731 (Output_data_plt_x86_64::add_entry): Likewise.
4732 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4733 (Output_data_plt_x86_64::address_for_global): Likewise.
4734 (Output_data_plt_x86_64::address_for_local): Likewise.
4735 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4736 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4737 Make method non-static.
4738 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4739 method.
4740 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4741 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4742 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4743 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4744 virtual method.
4745 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4746 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4747 virtual method.
4748 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4749 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4750 virtual method.
4751 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4752 (Output_data_plt_x86_64::plt_entry_size)
4753 (Output_data_plt_x86_64::first_plt_entry)
4754 (Output_data_plt_x86_64::plt_entry)
4755 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4756 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4757 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4758 (Output_data_plt_x86_64_standard): ... here, new class.
4759 (Target_x86_64::Target_x86_64): Take optional argument for the
4760 Target_info pointer to use.
4761 (Target_x86_64::do_make_data_plt): New virtual method.
4762 (Target_x86_64::make_data_plt): New method to call it.
4763 (Target_x86_64::init_got_plt_for_update): Use that.
4764 Call this->plt_->add_eh_frame method here.
4765 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4766 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4767 rather than static method.
4768 (Target_x86_64::plt_entry_size): Likewise.
4769 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4770 rather than plt_entry_size variable. Move guts of PLT filling to...
4771 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4772 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4773 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4774
4775 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4776 additional argument for the section alignment.
4777 Don't do add_eh_frame_for_plt here.
4778 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4779 non-static. Use get_plt_entry_size method rather than plt_entry_size
4780 variable.
4781 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4782 method.
4783 (Output_data_plt_i386::get_plt_entry_size): Call it.
4784 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4785 (Output_data_plt_i386::add_eh_frame): New method to call it.
4786 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4787 method.
4788 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4789 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4790 method.
4791 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4792 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4793 method instead of plt_entry_size.
4794 (Output_data_plt_i386::plt_entry_size)
4795 (Output_data_plt_i386::plt_eh_frame_fde_size)
4796 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4797 (Output_data_plt_i386_standard): ... here, new class.
4798 (Output_data_plt_i386_exec): New class.
4799 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4800 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4801 (Output_data_plt_i386::exec_plt_entry): Move to ...
4802 (Output_data_plt_i386_exec::plt_entry): ... here.
4803 (Output_data_plt_i386_dyn): New class.
4804 (Output_data_plt_i386::first_plt_entry): Move to ...
4805 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4806 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4807 (Output_data_plt_i386_dyn::plt_entry): ... here.
4808 (Target_i386::Target_i386): Take optional argument for the Target_info
4809 pointer to use.
4810 (Target_i386::do_make_data_plt): New virtual method.
4811 (Target_i386::make_data_plt): New method to call it.
4812 (Target_i386::make_plt_section): Use that.
4813 Call this->plt_->add_eh_frame method here.
4814 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4815 rather than plt_entry_size variable.
4816 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4817 (Output_data_plt_i386::address_for_local): Likewise.
4818 (Output_data_plt_i386::do_write): Likewise.
4819 Move guts of PLT filling to...
4820 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4821 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4822 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4823 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4824
b9b9f2ee
CC
48252012-05-01 Cary Coutant <ccoutant@google.com>
4826
4827 * dwarf_reader.cc (Dwarf_die::read_attributes)
4828 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4829 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4830 * reduced_debug_output.cc
4831 (Output_reduced_debug_info_section::get_die_end): Remove
4832 DW_FORM_GNU_ref_index. Add default case.
4833
57923f48
MW
48342012-04-26 Mark Wielaard <mjw@redhat.com>
4835
4836 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4837 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4838 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4839 DW_AT_high_pc as offset from DW_AT_low_pc.
4840
4841 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4842 * testsuite/Makefile.in: Regenerate.
4843 * testsuite/gdb_index_test_3.c: New test source file.
4844 * testsuite/gdb_index_test_3.sh: New test source file.
4845
2c54b4f4
ILT
48462012-04-25 Ian Lance Taylor <iant@google.com>
4847
4848 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4849 pointer.
4850 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4851 as a class, not a struct.
4852 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4853 (Target_arm::apply_cortex_a8_workaround): Likewise.
4854 * gc.h: Declare Reloc_types as a struct, not a class.
4855 * object.h: Declare Symbols_data as a struct.
4856 * reloc.h: Declare Read_relocs_data as a struct.
4857 * target.h: Declare Relocate_info as a struct.
4858
a5a5f7a3
DM
48592012-04-24 David S. Miller <davem@davemloft.net>
4860
4861 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4862 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4863 and R_SPARC_WPLT30.
4864
f038d496
CC
48652012-04-24 Cary Coutant <ccoutant@google.com>
4866
4867 * incremental-dump.cc (find_input_containing_global): Replace
4868 magic number with symbolic constant.
4869 (dump_incremental_inputs): Update version number.
4870 * incremental.cc (Output_section_incremental_inputs): Update version
4871 number; import symbolic constants from Incremental_inputs_reader.
4872 (Incremental_inputs::create_data_sections): Align relocations
4873 section correctly for 64-bit targets.
4874 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4875 constants; add padding.
4876 (Output_section_incremental_inputs::write_header): Add assert for
4877 header_size.
4878 (Output_section_incremental_inputs::write_input_files): Add assert
4879 for input_entry_size.
4880 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4881 add assert for object_info_size, input_section_entry_size,
4882 global_sym_entry_size.
4883 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4884 for data structure sizes; use them.
4885 (Incremental_input_entry_reader): Import symbolic constants from
4886 Incremental_inputs_reader; use them.
4887
a4d85145
DM
48882012-04-23 David S. Miller <davem@davemloft.net>
4889
4890 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4891 and elf_flags_set_.
4892 (Target_sparc::Target_sparc): Initialize new fields.
4893 (Target_sparc::do_make_elf_object): New function.
4894 (Target_sparc::do_adjust_elf_header): New function.
4895
1d509098
CC
48962012-04-23 Cary Coutant <ccoutant@google.com>
4897
4898 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4899 CU range table of gdb index.
4900
7ebeff7f
DM
49012012-04-20 David S. Miller <davem@davemloft.net>
4902
4903 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4904 instead of false.
4905
13cf9988
DM
49062012-04-16 David S. Miller <davem@davemloft.net>
4907
2a1079e8
DM
4908 * sparc.cc (Target_sparc::got_address): New function.
4909 (Sparc_relocate_functions::gdop_hix22): New function.
4910 (Sparc_relocate_functions::gdop_lox10): New function.
4911 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4912 relocs.
4913 (Target_sparc::Scan::local): Likewise if the global symbol is not
4914 preemptible and is not IFUNC.
4915 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4916 transformations for local and non-preemptible non-IFUNC global
4917 symbols.
4918
0bc964fc
DM
4919 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4920 writing out 64-bit part of ranges.
4921
661d7a80
DM
4922 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4923 -fpic and -fpie respectively.
4924 * Makefile.in: Regenerate.
4925
8c2bf391
DM
4926 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4927 (Target_sparc::Target_sparc): Initialize new field.
4928 (Target_sparc::do_plt_section_for_global): New function.
4929 (Target_sparc::do_plt_section_for_local): New function.
4930 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4931 (Target_sparc::make_plt_section): New function, broken out of
4932 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4933 (Target_sparc::make_plt_entry): Call make_plt_section.
4934 (Target_sparc::make_local_ifunc_plt_entry): New function.
4935 (Target_sparc::rela_ifunc_section): New function.
4936 (Target_sparc::plt_section): Remove const.
4937 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4938 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4939 and ifunc_count_ fields.
4940 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4941 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4942 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4943 (Output_data_plt_sparc::rela_ifunc): New function.
4944 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4945 (Output_data_plt_sparc::has_ifunc_section): New function.
4946 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4947 (Output_data_plt_sparc::address_for_global): New function.
4948 (Output_data_plt_sparc::address_for_local): New function.
4949 (Output_data_plt_sparc::plt_index_to_offset): New function.
4950 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4951 and entry_count.
4952 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4953 entry_count.
4954 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4955 R_SPARC_JMP_IREL to switch.
4956 (Target_sparc::Scan::check_non_pic): Likewise.
4957 (Target_sparc::Scan::local): Handle IFUNC symbols.
4958 (Target_sparc::Scan::local): Likewise.
4959 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4960 and plt_address_for_local.
4961 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4962 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4963
13cf9988
DM
4964 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4965 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4966 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4967 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4968 global relocs too.
4969 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4970 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4971 calls.
4972 * sparc.cc (Target_sparc::Scan::global): Likewise.
4973 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4974
31821be0
CC
49752012-04-16 Cary Coutant <ccoutant@google.com>
4976
4977 * archive.cc (Library_base::should_include_member): Check for
4978 --export-dynamic-symbol.
4979 * options.h (class General_options): Add --export-dynamic-symbol.
4980 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4981 --export-dynamic-symbol.
4982 (Symbol_table::gc_mark_undef_symbols): Likewise.
4983 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4984
2615994e
DM
49852012-04-12 David S. Miller <davem@davemloft.net>
4986
4987 * sparc.cc (Reloc::wdisp10): New relocation method.
4988 (Reloc::h34): Likewise.
4989 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4990 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4991 R_SPARC_WDISP10.
4992 (Target_sparc::Scan::local): Likewise.
4993 (Target_sparc::Scan::global): Likewise.
4994 (Target_sparc::Relocate::relocate): Likewise.
4995
6782735d
CC
49962012-04-09 Cary Coutant <ccoutant@google.com>
4997
4998 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4999 low_pc == 0.
5000
8c7a0b00
ILT
50012012-04-06 Ian Lance Taylor <iant@google.com>
5002
5003 * timer.cc: #include <unistd.h>.
5004
58797674
RM
50052012-04-06 Roland McGrath <mcgrathr@google.com>
5006
5007 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5008 * config.in: Regenerate.
5009 * configure: Regenerate.
5010
44350750
NC
50112012-04-05 Nick Clifton <nickc@redhat.com>
5012
5013 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5014 (AM_LC_MESSAGES): Add.
5015 * aclocal.m4: Regenerate.
5016 * config.in: Regenerate.
5017 * configure: Regenerate.
5018
c1027032
CC
50192012-03-21 Cary Coutant <ccoutant@google.com>
5020
5021 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5022 * Makefile.in: Regenerate.
5023 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5024 (Sized_elf_reloc_mapper::symbol_section): New function.
5025 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5026 (make_elf_reloc_mapper): New function.
5027 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5028 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5029 (Dwarf_abbrev_table::do_get_abbrev): New function.
5030 (Dwarf_ranges_table::read_ranges_table): New function.
5031 (Dwarf_ranges_table::read_range_list): New function.
5032 (Dwarf_pubnames_table::read_section): New function.
5033 (Dwarf_pubnames_table::read_header): New function.
5034 (Dwarf_pubnames_table::next_name): New function.
5035 (Dwarf_die::Dwarf_die): New function.
5036 (Dwarf_die::read_attributes): New function.
5037 (Dwarf_die::skip_attributes): New function.
5038 (Dwarf_die::set_name): New function.
5039 (Dwarf_die::set_linkage_name): New function.
5040 (Dwarf_die::attribute): New function.
5041 (Dwarf_die::string_attribute): New function.
5042 (Dwarf_die::int_attribute): New function.
5043 (Dwarf_die::uint_attribute): New function.
5044 (Dwarf_die::ref_attribute): New function.
5045 (Dwarf_die::child_offset): New function.
5046 (Dwarf_die::sibling_offset): New function.
5047 (Dwarf_info_reader::check_buffer): New function.
5048 (Dwarf_info_reader::parse): New function.
5049 (Dwarf_info_reader::do_parse): New function.
5050 (Dwarf_info_reader::do_read_string_table): New function.
5051 (Dwarf_info_reader::lookup_reloc): New function.
5052 (Dwarf_info_reader::get_string): New function.
5053 (Dwarf_info_reader::visit_compilation_unit): New function.
5054 (Dwarf_info_reader::visit_type_unit): New function.
5055 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5056 Sized_elf_reloc_mapper.
5057 (Sized_dwarf_line_info::symbol_section): Remove function.
5058 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5059 (Sized_dwarf_line_info::read_line_mappings): Remove object
5060 parameter, adjust callers.
5061 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5062 * dwarf_reader.h: Include <sys/types.h>.
5063 (class Track_relocs): Remove forward declaration.
5064 (class Elf_reloc_mapper): New class.
5065 (class Sized_elf_reloc_mapper): New class.
5066 (class Dwarf_abbrev_table): New class.
5067 (class Dwarf_range_list): New class.
5068 (class Dwarf_ranges_table): New class.
5069 (class Dwarf_pubnames_table): New class.
5070 (class Dwarf_die): New class.
5071 (class Dwarf_info_reader): New class.
5072 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5073 (Sized_dwarf_line_info::symbol_section): Remove member function.
5074 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5075 base class.
5076 * gdb-index.cc: New source file.
5077 * gdb-index.h: New source file.
5078 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5079 and .debug_types sections, call Layout::add_to_gdb_index.
5080 (Sized_relobj_incr::do_section_name): Implement.
5081 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5082 return type; Implement.
5083 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5084 return type.
5085 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5086 parameter list and return type.
5087 (Sized_incr_dynobj::do_section_contents): Likewise.
5088 * layout.cc: Include gdb-index.h.
5089 (Layout::Layout): Initialize gdb_index_data_.
5090 (Layout::init_fixed_output_section): Check for .gdb_index section.
5091 (Layout::add_to_gdb_index): New function. Instantiate.
5092 * layout.h: Add forward declaration for class Gdb_index.
5093 (Layout::add_to_gdb_index): New member function.
5094 (Layout::gdb_index_data_): New data member.
5095 * main.cc: Include gdb-index.h.
5096 (main): Print statistics for gdb index.
5097 * object.cc (Object::section_contents): Move code into
5098 do_section_contents.
5099 (need_decompressed_section): Check for sections needed when building
5100 gdb index.
5101 (build_compressed_section_map): Likewise.
5102 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5103 gdb index.
5104 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5105 sections; call Layout::add_to_gdb_index.
5106 (Sized_relobj_file::do_decompressed_section_contents): Call
5107 do_section_contents directly.
5108 * object.h (Object::do_section_contents): Adjust parameter list and
5109 return type.
5110 (Object::do_decompressed_section_contents): Call do_section_contents
5111 directly.
5112 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5113 return type.
5114 * options.h (class General_options): Add --gdb-index option.
5115 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5116 list and return type.
5117 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5118 * reloc.h (Track_relocs::checkpoint): New function.
5119 (Track_relocs::reset): New function.
5120
5121 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5122 New test cases.
5123 * testsuite/Makefile.in: Regenerate.
5124 * testsuite/gdb_index_test.cc: New test source file.
5125 * testsuite/gdb_index_test_1.sh: New test source file.
5126 * testsuite/gdb_index_test_2.sh: New test source file.
5127
647f1574
DK
51282012-03-19 Doug Kwan <dougkwan@google.com>
5129
5130 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5131 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5132 __exidx_start and __exidx_end. Make symbol table parameter
5133 anonymous as it is not used.
5134 * gold.cc (queue_middle_tasks): Call target hook to define any
5135 target-specific symbols.
5136 * target.h (Target::define_standard_symbols): New method.
5137 (Target::do_define_standard_symbols): Same.
5138 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5139 * testsuite/Makefile.in: Regenerate.
5140 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5141 and __exidx_end.
5142 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5143 relocations are generated for __exidx_start and __exidx_end.
5144
7c6109da
DK
51452012-03-16 Doug Kwan <dougkwan@google.com>
5146
5147 * testsuite/Makefile.am: Disable test initpri3b.
5148 * testsuite/Makefile.in: Regenerate.
5149
7b8957f8
DK
51502012-03-15 Doug Kwan <dougkwan@google.com>
5151
5152 * arm.cc (Target_arm::got_section): Make .got section read-only
5153 if -z now is given.
5154
14dc9ef7
ILT
51552012-03-15 Ian Lance Taylor <iant@google.com>
5156
5157 PR gold/13850
5158 * layout.cc (Layout::make_output_section): Correctly mark
5159 SHT_INIT_ARRAY, et. al., as relro.
5160
fa40b62a
DK
51612012-03-14 Doug Kwan <dougkwan@google.com>
5162
5163 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5164 dynamic relocations for protected symbols in shared objects.
5165
fd325007
ILT
51662012-03-13 Ian Lance Taylor <iant@google.com>
5167
5168 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5169 keep the larger alignment.
5170
e8dd54e1
CC
51712012-03-12 Cary Coutant <ccoutant@google.com>
5172
5173 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5174 handling of DW_LNE_define_file.
5175
feb5f3b0
CC
51762012-03-12 Cary Coutant <ccoutant@google.com>
5177
5178 * reduced_debug_output.cc
5179 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5180 codes to switch.
5181
a1fb4256
CC
51822012-02-29 Cary Coutant <ccoutant@google.com>
5183
5184 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5185
5dd8762a
CC
51862012-02-29 Cary Coutant <ccoutant@google.com>
5187
5188 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5189 Call Object::decompressed_section_contents.
5190 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5191 New dtor.
5192 (Sized_dwarf_line_info::buffer_start_): New data member.
5193 * merge.cc (Output_merge_data::do_add_input_section): Call
5194 Object::decompressed_section_contents.
5195 (Output_merge_string::do_add_input_section): Likewise.
5196 * object.cc (need_decompressed_section): New function.
5197 (build_compressed_section_map): Decompress sections needed later.
5198 (Sized_relobj_file::do_decompressed_section_contents): New function.
5199 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5200 * object.h (Object::decompressed_section_contents): New function.
5201 (Object::discard_decompressed_sections): New function.
5202 (Object::do_decompressed_section_contents): New function.
5203 (Object::do_discard_decompressed_sections): New function.
5204 (Compressed_section_info): New type.
5205 (Compressed_section_map): Include decompressed section contents.
5206 (Sized_relobj_file::do_decompressed_section_contents): New function.
5207 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5208
7b5de7ee
CC
52092012-02-16 Cary Coutant <ccoutant@google.com>
5210
5211 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5212 * testsuite/Makefile.in: Regenerate.
5213
f9fa4a63
CC
52142012-02-14 Cary Coutant <ccoutant@google.com>
5215
5216 * options.cc (General_options::finalize): Disallow -pie and -static.
5217
2c175ebc
DK
52182012-02-03 Doug Kwan <dougkwan@google.com>
5219
5220 * arm.cc (Arm_relocate_functions::abs8,
5221 Arm_relocate_functions::abs16): Use
5222 Bits::has_signed_unsigned_overflow32.
5223 (Arm_relocate_functions::thm_abs8): Correct range of
5224 overflow check.
5225 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5226 in assertions.
5227
90cff06f
DK
52282012-02-02 Doug Kwan <dougkwan@google.com>
5229
5230 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5231 position independent outputs, not just shared objects.
5232
63887f3d
L
52332012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5234
5235 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5236 * configure: Regenerated.
5237
bef2b434
ILT
52382012-01-27 Ian Lance Taylor <iant@google.com>
5239
5240 * reloc.h (Bits): New class with static functions, copied from
5241 namespace utils in arm.cc.
5242 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5243 instead.
5244
c335b55d
L
52452012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5246
5247 * incremental.cc (write_info_blocks): Correct relocation offset.
5248
41194d9f
L
52492012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5250
5251 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5252 (Relocate::tls_gd_to_le): Likewise.
5253
1bae613c
L
52542012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5255
5256 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5257
24482ca0
L
52582012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5259
5260 * configure.ac: Check if -mcmodel=medium works.
5261 * configure: Regenerated.
5262
c2c7840a
CC
52632012-01-24 Cary Coutant <ccoutant@google.com>
5264
5265 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5266 definition and ...
5267 (read_unsigned_LEB_128_x): ... this new function.
5268 (read_signed_LEB_128): Replaced with inline definition and ...
5269 (read_signed_LEB_128_x): ... this new function.
5270 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5271 (read_unsigned_LEB_128): Add inline definition.
5272 (read_signed_LEB_128_x): New function.
5273 (read_signed_LEB_128): Add inline definition.
5274 * testsuite/Makefile.am (leb128_unittest): New unit test.
5275 * testsuite/Makefile.in: Regenerate.
5276 * testsuite/leb128_unittest.cc: New unit test.
5277
833de760 52782012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5279
5280 PR gold/13617
5281 * i386.cc (Target_i386::do_code_fill): When using a jmp
5282 instruction, pad with nop instructions.
5283 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5284
618d6666
L
52852012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5286
5287 * x86_64.cc (gc_process_relocs): Add typename on types used in
5288 template.
5289 (scan_relocs): Likewise.
5290 (relocate_section): Likewise.
5291 (apply_relocation): Likewise.
5292
3660ff06
L
52932012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5294
5295 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5296 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5297 under x32.
5298
fc51264f
L
52992012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5300
5301 * x86_64.cc: Initial support for x32.
5302
dd74ae06
CC
53032012-01-03 Cary Coutant <ccoutant@google.com>
5304
5305 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5306 Use abstract base class for GOT.
5307 * gold/output.h (class Output_data_got_base): New abstract base class.
5308 (class Output_data_got): Derive from new base class, adjust ctors.
5309 (Output_data_got::reserve_slot): Make virtual; rename to
5310 do_reserve_slot; Adjust callers.
5311 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5312 pointer to abstract base class.
5313 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5314
83896202
ILT
53152011-12-18 Ian Lance Taylor <iant@google.com>
5316
5317 * object.h (Relobj::local_symbol_value): New function.
5318 (Relobj::local_plt_offset): New function.
5319 (Relobj::local_has_got_offset): New function.
5320 (Relobj::local_got_offset): New function.
5321 (Relobj::set_local_got_offset): New function.
5322 (Relobj::do_local_symbol_value): New pure virtual function.
5323 (Relobj::do_local_plt_offset): Likewise.
5324 (Relobj::do_local_has_got_offset): Likewise.
5325 (Relobj::do_local_got_offset): Likewise.
5326 (Relobj::do_set_local_got_offset): Likewise.
5327 (Sized_relobj::do_local_has_got_offset): Rename from
5328 local_has_got_offset.
5329 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5330 (Sized_relobj::do_set_local_got_offset): Rename from
5331 set_local_got_offset.
5332 (Sized_relobj_file::do_local_plt_offset): Rename from
5333 local_plt_offset.
5334 (Sized_relobj_file::do_local_symbol_value): New function.
5335 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5336 local_plt_offset.
5337 * output.cc (Output_data_got::Got_entry::write): Change object to
5338 Relobj. Use local_symbol_value.
5339 (Output_data_got::add_global_with_rel): Change rel_dyn to
5340 Output_data_reloc_generic*. Use add_global_generic.
5341 (Output_data_got::add_global_with_rela): Remove. Change all
5342 callers to use add_global_with_rel.
5343 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5344 Output_data_reloc_generic*. Use add_global_generic.
5345 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5346 callers to use add_global_pair_with_rel.
5347 (Output_data_got::add_local): Change object to Relobj*.
5348 (Output_data_got::add_local_plt): Likewise.
5349 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5350 change rel_dyn to Output_data_reloc_generic*. Use
5351 add_local_generic.
5352 (Output_data_got::add_local_with_rela): Remove. Change all
5353 callers to use all_local_with_rel.
5354 (Output_data_got::add_local_pair_with_rel): Change object to
5355 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5356 add_output_section_generic.
5357 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5358 callers to use add_local_pair_with_rel.
5359 (Output_data_got::reserve_local): Change object to Relobj*.
5360 * output.h: (class Output_data_reloc_generic): Add pure virtual
5361 declarations for add_global_generic, add_local_generic,
5362 add_output_section_generic.
5363 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5364 functions for Output_data_reloc_generic. Update declarations for
5365 changes listed in output.cc.
5366 (class Output_data_got): Change template parameter to got_size.
5367 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5368 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5369 function.
5370 (Sized_relobj_incr::do_local_plt_offset): New function.
5371 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5372 add_global_generic.
5373
76677ad0
CC
53742011-12-17 Cary Coutant <ccoutant@google.com>
5375
5376 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5377 * resolve.cc (Symbol_table::resolve): Likewise.
5378 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5379 arrays.
5380 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5381
8b8dd8d5
ILT
53822011-12-16 Ian Lance Taylor <iant@google.com>
5383
5384 * output.h (Output_data_reloc_generic::add): Only call
5385 add_dynamic_reloc if this is a dynamic reloc section.
5386
d55525b9
L
53872011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5388
5389 PR gold/13505
5390 * target-reloc.h (apply_relocation): Replace <64, false> with
5391 <size, big_endian>.
5392
ff81c7c1
NC
53932011-11-25 Nick Clifton <nickc@redhat.com>
5394
5395 * po/it.po: New Italian translation.
5396
628f39be
SA
53972011-11-17 Sterling Augustine <saugustine@google.com>
5398
5399 * script.cc (script_include_directive): Implement.
5400 (read_script_file): New local variables name and search_path. Update
5401 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5402 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5403 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5404
98ef3ea4
SA
54052011-11-11 Sterling Augustine <saugustine@google.com>
5406
5407 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5408 (file_or_sections_cmd): Likewise.
5409
f4a8b6d7
DK
54102011-11-11 Doug Kwan <dougkwan@google.com>
5411
5412 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5413 if --just-symbols is given.
5414
29ab395d
DK
54152011-11-10 Doug Kwan <dougkwan@google.com>
5416
5417 PR gold/13362
5418 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5419 when processing data relocs.
5420 * reloc.h (Relocate_functions::rel_unaligned): New method.
5421 (Relocate_functions::pcrel_unaligned): Ditto.
5422 (Relocate_functions::rel32_unaligned): Ditto.
5423 (Relocate_functions::pcrel32_unaligned): Ditto.
5424
2c339f71
DK
54252011-11-09 Doug Kwan <dougkwan@google.com>
5426
5427 PR gold/13362
5428 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5429 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5430 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5431 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5432 (Relocate_functions::rel_unaligned): New.
5433 (Relocate_functions::rel32_unaligned): New.
5434 * target-reloc.h (relocate_for_relocatable): Add code to handle
5435 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5436 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5437 arm_unaligned_reloc_r): New targets.
5438 * testsuite/Makefile.in: Regenerate.
5439 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5440 linking.
5441
3f3cddf1
ILT
54422011-11-02 Ian Lance Taylor <iant@google.com>
5443
5444 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5445 NATIVE_LINKER.
5446 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5447 * options.cc (General_options::finalize): Use library search path
5448 from configure script if specified. If not native and no sysroot,
5449 only search TOOLLIBDIR.
5450 * options.h (Search_directory::Search_directory): Change name to
5451 const std::string&.
5452 (General_options::add_to_library_path_with_sysroot): Change arg to
5453 const std::string&.
5454 * configure, Makefile.in, config.in: Rebuild.
5455
a8e2273b
ILT
54562011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5457
5458 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5459 we are working around the ARM1176 Erratum.
5460 * options.h (General_options::fix_arm1176): Add option.
5461 * testsuite/Makefile.am: Add testcases, and keep current ones
5462 working.
5463 * testsuite/Makefile.in: Regenerate.
5464 * testsuite/arm_fix_1176.s: New file.
5465 * testsuite/arm_fix_1176.sh: Likewise.
5466
cd6eab1c
ILT
54672011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5468
5469 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5470 may_use_blx_.
5471 (Target_arm::may_use_blx): Remove method.
5472 (Target_arm::set_may_use_blx): Likewise.
5473 (Target_arm::may_use_v4t_interworking): New method.
5474 (Target_arm::may_use_v5t_interworking): Likewise.
5475 (Target_arm::may_use_blx_): Remove member variable.
5476 (Arm_relocate_functions::arm_branch_common): Check for v5T
5477 interworking.
5478 (Arm_relocate_functions::thumb_branch_common): Likewise.
5479 (Reloc_stub::stub_type_for_reloc): Likewise.
5480 (Target_arm::do_finalize_sections): Correct interworking checks.
5481 * testsuite/Makefile.am: Add new tests.
5482 * testsuite/Makefile.in: Regenerate.
5483 * testsuite/arm_farcall_arm_arm.s: New test.
5484 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5485 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5486 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5487 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5488 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5489 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5490 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5491
286adcf4
CC
54922011-10-31 Cary Coutant <ccoutant@google.com>
5493
5494 PR gold/13023
5495 * expression.cc (Expression::eval_with_dot): Add
5496 is_section_dot_assignment parameter.
5497 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5498 absolute and assigning to dot within a section.
5499 * script-sections.cc
5500 (Output_section_element_assignment::set_section_addresses): Pass
5501 dot_section to set_if_absolute.
5502 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5503 as is_section_dot_assignment flag to eval_with_dot.
5504 (Output_section_element_dot_assignment::set_section_addresses):
5505 Likewise.
5506 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5507 parameter. Also set value if relative to dot_section; set the
5508 symbol's output_section.
5509 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5510 parameter. Adjust all callers.
5511 (Expression::eval_maybe_dot): Likewise.
5512 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5513 Adjust all callers.
5514 * testsuite/script_test_2.t: Test assignment of an absolute value
5515 to dot within an output section element.
5516
9634ed06
CC
55172011-10-31 Cary Coutant <ccoutant@google.com>
5518
5519 * options.h (class General_options): Add --[no-]gnu-unique options.
5520 * symtab.cc (Symbol_table::sized_write_globals): Convert
5521 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5522
de4101c7
CC
55232011-10-31 Cary Coutant <ccoutant@google.com>
5524
5525 PR gold/13359
5526 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5527 unnecessary assertion.
5528 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5529
7257cc92
ST
55302011-10-31 Sriraman Tallam <tmsriram@google.com>
5531
5532 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5533 gc_mark_symbol.
5534 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5535 gc_mark_symbol.
5536 Change to just keep the section associated with symbol.
5537 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5538 they are externally visible and --export-dynamic is turned on.
5539 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5540
bfc34b3f
ILT
55412011-10-19 Ian Lance Taylor <iant@google.com>
5542
5543 PR gold/13163
5544 * script-sections.cc
5545 (Output_section_element_dot_assignment::needs_output_section): New
5546 function.
5547
ea0d8c47
ILT
55482011-10-19 Ian Lance Taylor <iant@google.com>
5549
5550 PR gold/13204
5551 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5552 --section-start option was seen.
5553 * options.h (General_options::any_section_start): New function.
5554
abd242a9
DM
55552011-10-18 David S. Miller <davem@davemloft.net>
5556
5557 PR binutils/13301
5558 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5559 member to track relocation locations that have moved during TLS
5560 reloc optimizations.
5561 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5562 (Target_sparc::Relocate::relocate): Adjust view down by 4
5563 bytes if it matches reloc_adjust_addr_.
5564 (Target_sparc::Relocate::relocate_tls): Always move the
5565 __tls_get_addr call delay slot instruction forward 4 bytes when
5566 performing relaxation.
5567
bab9090f
CC
55682011-10-18 Cary Coutant <ccoutant@google.com>
5569
5570 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5571 (Output_file::map_no_anonymous): Check for non-zero
5572 return code from posix_fallocate.
5573
f7c5b166
CC
55742011-10-17 Cary Coutant <ccoutant@google.com>
5575
5576 PR gold/13245
5577 * plugin.cc (is_visible_from_outside): Check for symbols
5578 referenced from dynamic objects.
5579 * resolve.cc (Symbol_table::resolve): Don't count references
5580 from dynamic objects as references from real ELF files.
5581 * testsuite/plugin_test_2.sh: Adjust expected result.
5582
b490c0bb
CC
55832011-10-17 Cary Coutant <ccoutant@google.com>
5584
5585 * gold.cc: Include timer.h.
5586 (queue_middle_tasks): Stamp time.
5587 (queue_final_tasks): Likewise.
5588 * main.cc (main): Store timer in parameters. Print timers
5589 for each pass.
5590 * parameters.cc (Parameters::Parameters): Initialize timer_.
5591 (Parameters::set_timer): New function.
5592 (set_parameters_timer): New function.
5593 * parameters.h (Parameters::set_timer): New function.
5594 (Parameters::timer): New function.
5595 (Parameters::timer_): New data member.
5596 (set_parameters_timer): New function.
5597 * timer.cc (Timer::stamp): New function.
5598 (Timer::get_pass_time): New function.
5599 * timer.h (Timer::stamp): New function.
5600 (Timer::get_pass_time): New function.
5601 (Timer::pass_times_): New data member.
5602
f475cf7b
CC
56032011-10-17 Cary Coutant <ccoutant@google.com>
5604
5605 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5606 task for members of lib groups.
5607
cdd7e244
CC
56082011-10-17 Cary Coutant <ccoutant@google.com>
5609
5610 PR gold/13288
4f95c8b4 5611 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5612 (File_read::make_view): Move bounds check (replace with assert)...
5613 (File_read::find_or_make_view): ... to here.
5614
dfb45471
CC
56152011-10-12 Cary Coutant <ccoutant@google.com>
5616
4f95c8b4 5617 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5618 ::read returns less than requested size.
5619
53bbcc1b
CC
56202011-10-10 Cary Coutant <ccoutant@google.com>
5621
4f95c8b4 5622 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5623 Initialize defined_count_.
5624 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5625 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5626 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5627 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5628 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5629 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5630 member.
5631 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5632 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5633 Return zeroes instead of internal error.
5634
397b129b
CC
56352011-10-10 Cary Coutant <ccoutant@google.com>
5636
5637 PR gold/13249
4f95c8b4 5638 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5639 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5640 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5641 (Output_reloc::type_): Adjust size of bit field.
5642 (Output_reloc::use_plt_offset_): New bit field.
5643 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5644 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5645 flag. Adjust all callers.
4f95c8b4 5646 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5647 creating RELATIVE relocations.
5648
d5698657
NC
56492011-10-10 Nick Clifton <nickc@redhat.com>
5650
5651 * po/es.po: Updated Spanish translation.
5652 * po/fi.po: Updated Finnish translation.
5653
6a59a5c2
DN
56542011-10-03 Diego Novillo <dnovillo@google.com>
5655
5656 * options.cc (parse_uint): Fix dereference of RETVAL.
5657
f0558624
ST
56582011-09-29 Sriraman Tallam <tmsriram@google.com>
5659
5660 * layout.h (section_order_map_): New member.
5661 (get_section_order_map): New member function.
5662 * output.cc (Output_section::add_input_section): Check for patterns
5663 only when --section-ordering-file is specified.
5664 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5665 output_sections have been formed.
5666 * layout.cc (Layout_Layout): Initialize section_order_map_.
5667 * plugin.cc (update_section_order): Store order in order_map. Do not
5668 update the order.
5669 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5670 * testsuite/Makefile.in: Regenerate.
5671 * testsuite/plugin_section_order.c: New file.
5672 * testsuite/plugin_final_layout.cc: New file.
5673 * testsuite/plugin_final_layout.sh: New file.
5674
a7dac153
CC
56752011-09-29 Cary Coutant <ccoutant@google.com>
5676
4f95c8b4 5677 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5678 Check for NULL.
4f95c8b4 5679 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5680 symbols during incremental update.
5681 (Symbol_table::add_from_dynobj): Likewise.
5682
eebd87a5
ILT
56832011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5684 Ian Lance Taylor <iant@google.com>
5685
5686 * symtab.cc (Symbol_table::define_special_symbol): Always
5687 canonicalize version string.
5688
403a3331
CC
56892011-09-26 Cary Coutant <ccoutant@google.com>
5690
4f95c8b4
CC
5691 * gold.cc (queue_initial_tasks): Move option checks ...
5692 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5693 some options; make others fatal.
5694
235061c2
CC
56952011-09-26 Cary Coutant <ccoutant@google.com>
5696
5697 gcc PR lto/47247
5698 * plugin.cc (get_symbols_v2): New function.
5699 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5700 (is_referenced_from_outside): New function.
5701 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5702 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5703 (get_symbols): Pass version parameter.
5704 (get_symbols_v2): New function.
5705 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5706 parameter.
5707 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5708 (onload): Add LDPT_GET_SYMBOLS_V2.
5709 (all_symbols_read_hook): Use get_symbols_v2; check for
5710 LDPR_PREVAILING_DEF_IRONLY_EXP.
5711 * testsuite/plugin_test_3.sh: Update expected results.
5712
dc87f620
ILT
57132011-09-23 Simon Baldwin <simonb@google.com>
5714
5715 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5716 configuration options.
5717 * configure: Regenerate.
5718 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5719 * Makefile.in: Regenerate.
5720 * testsuite/Makefile.in: Regenerate.
5721
a8279f82
ST
57222011-09-19 Sriraman Tallam <tmsriram@google.com>
5723
5724 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5725
0c9350c8
CC
57262011-09-19 Cary Coutant <ccoutant@google.com>
5727
5728 * incremental.cc (can_incremental_update): Fix typo in comment.
5729 * incremental.h (can_incremental_update): Likewise.
5730
aa06ae28
CC
57312011-09-18 Cary Coutant <ccoutant@google.com>
5732
5733 * incremental.cc (can_incremental_update): New function.
5734 * incremental.h (can_incremental_update): New function.
5735 * layout.cc (Layout::init_fixed_output_section): Call it.
5736 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5737 * object.cc (Sized_relobj_file::do_layout): Call
5738 can_incremental_update.
5739
ebb300b2
CC
57402011-09-13 Cary Coutant <ccoutant@google.com>
5741
5742 * configure.ac: Check for glibc support for gnu_indirect_function
5743 support with static linking, setting automake conditional
5744 IFUNC_STATIC.
5745 * Makefile.in: Regenerate.
5746 * configure: Regenerate.
5747
5748 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5749 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5750 for IFUNC_STATIC.
5751 * testsuite/Makefile.in: Regenerate.
5752
1206d0d5
CC
57532011-09-13 Cary Coutant <ccoutant@google.com>
5754
5755 * incremental.cc (Sized_relobj_incr::do_layout): Call
5756 report_comdat_group for kept comdat sections.
5757 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5758 * testsuite/Makefile.in: Regenerate.
5759 * testsuite/incr_comdat_test_1.cc: New source file.
5760 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5761 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5762 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5763
40b29874
ILT
57642011-09-13 Ian Lance Taylor <iant@google.com>
5765
5766 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5767 variable external_symbols_offset.
5768
1b045aac
ILT
57692011-09-12 Ian Lance Taylor <iant@google.com>
5770
5771 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5772 triggered if object has no symbols.
5773
24c6c55a
DM
57742011-09-09 David S. Miller <davem@davemloft.net>
5775
5776 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5777 (Output_fill_debug_line::do_write): Likewise.
5778
66570254
CC
57792011-08-29 Cary Coutant <ccoutant@google.com>
5780
5781 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5782 casts to match formatting specs.
5783 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5784
8ea8cd50
CC
57852011-08-26 Cary Coutant <ccoutant@google.com>
5786
5787 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5788 remaining hole size when allocating.
5789 (Layout::make_output_section): Set fill methods for debug sections.
5790 * layout.h (Free_list::Free_list_node): Move from private to
5791 public.
5792 (Free_list::set_min_hole_size): New function.
5793 (Free_list::begin, Free_list::end): New functions.
5794 (Free_list::min_hole_): New data member.
5795 * output.cc: Include dwarf.h.
5796 (Output_fill_debug_info::do_minimum_hole_size): New function.
5797 (Output_fill_debug_info::do_write): New function.
5798 (Output_fill_debug_line::do_minimum_hole_size): New function.
5799 (Output_fill_debug_line::do_write): New function.
5800 (Output_section::Output_section): Initialize new data member.
5801 (Output_section::set_final_data_size): Ensure patch space is larger
5802 than minimum hole size.
5803 (Output_section::do_write): Fill holes in debug sections.
5804 * output.h (Output_fill): New class.
5805 (Output_fill_debug_info): New class.
5806 (Output_fill_debug_line): New class.
5807 (Output_section::set_free_space_fill): New function.
5808 (Output_section::free_space_fill_): New data member.
5809 * testsuite/Makefile.am (incremental_test_3): Add
5810 --incremental-patch option.
5811 (incremental_test_4): Likewise.
5812 (incremental_test_5): Likewise.
5813 (incremental_test_6): Likewise.
5814 (incremental_copy_test): Likewise.
5815 (incremental_common_test_1): Likewise.
5816 * testsuite/Makefile.in: Regenerate.
5817
7cf80422
NC
58182011-08-26 Nick Clifton <nickc@redhat.com>
5819
5820 * po/es.po: Updated Spanish translation.
5821
c3f7b0e5
CC
58222011-08-01 Cary Coutant <ccoutant@google.com>
5823
5824 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5825 * gold/testsuite/Makefile.in: Regenerate.
5826 * gold/testsuite/justsyms_exec.c: New source file.
5827 * gold/testsuite/justsyms_lib.c: New source file.
5828
9590bf25
CC
58292011-08-01 Cary Coutant <ccoutant@google.com>
5830
5831 * layout.cc (Layout::set_segment_offsets): Don't realign text
5832 segment if -Ttext was specified.
5833 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5834 file type.
5835 * object.h (Sized_relobj_file::e_type): New function.
5836 (Sized_relobj_file::e_type_): New data member.
5837 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5838 base address for ET_EXEC files.
5839 * target.cc (Target::do_make_elf_object_implementation): Allow
5840 ET_EXEC files with --just-symbols option.
5841
dcd8d12e
CC
58422011-07-28 Cary Coutant <ccoutant@google.com>
5843
5844 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5845 Add thread_number parameter.
5846 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5847 * workqueue-threads.cc
5848 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5849 current thread if its thread number is greater than desired thread
5850 count.
5851 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5852 Add thread_number parameter.
5853 (Workqueue::should_cancel_thread): Likewise.
5854 (Workqueue::find_runnable_or_wait): Pass thread_number to
5855 should_cancel_thread.
5856 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5857 parameter.
5858
804eb480
ST
58592011-07-22 Sriraman Tallam <tmsriram@google.com>
5860
5861 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5862 only after checking if it cannot be forced local.
5863 * symtab.h (is_externally_visible): Check if the symbol is not forced
5864 local.
5865
f1ddb600
ILT
58662011-07-15 Ian Lance Taylor <iant@google.com>
5867
5868 * options.h (class General_options): Add --print-output-format.
5869 Move -EL next to -EB, for better --help output.
5870 * target-select.cc: Include <cstdio>, "options.h", and
5871 "parameters.h".
5872 (Target_selector::do_target_bfd_name): New function.
5873 (print_output_format): New function.
5874 * target-select.h (class Target_selector): Update declarations.
5875 (Target_selector::target_bfd_name): New function.
5876 (print_output_format): Declare.
5877 * main.cc: Include "target-select.h".
5878 (main): Handle --print-output-format.
5879 * gold.cc: Include "target-select.h".
5880 (queue_initial_tasks): Handle --print-output-format when there are
5881 no input files.
5882 * parameters.cc (parameters_force_valid_target): Give a better
5883 error message if -EB/-EL does not match target.
5884 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5885 function.
5886
7d172687
ILT
58872011-07-15 Ian Lance Taylor <iant@google.com>
5888
5889 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5890 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5891 (Output_data_plt_i386::do_write): Write address of .dynamic
5892 section to first entry in .got.plt section.
5893 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5894 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5895 Initialize layout_.
5896 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5897 section to first entry in .got.plt section.
5898 * layout.h (Layout::dynamic_section): New function.
5899
e9552f7e
ST
59002011-07-13 Sriraman Tallam <tmsriram@google.com>
5901
5902 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5903 to claim_file call.
5904 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5905 input_section_position_, and input_section_glob_.
5906 (read_layout_from_file): Call function section_ordering_specified.
5907 * layout.h (is_section_ordering_specified): New function.
5908 (section_ordering_specified): New function.
5909 (section_ordering_specified_): New boolean member.
5910 * main.cc(main): Call load_plugins after layout object is defined.
5911 * output.cc (Output_section::add_input_section): Use
5912 function section_ordering_specified to check if section ordering is
5913 needed.
5914 * output.cc (Output_section::add_relaxed_input_section): Use
5915 function section_ordering_specified to check if section ordering is
5916 needed.
5917 (Output_section::update_section_layout): New function.
5918 (Output_section::sort_attached_input_sections): Check if input section
5919 must be reordered.
5920 * output.h (Output_section::update_section_layout): New function.
5921 * plugin.cc (get_section_count): New function.
5922 (get_section_type): New function.
5923 (get_section_name): New function.
5924 (get_section_contents): New function.
5925 (update_section_order): New function.
58797674 5926 (allow_section_ordering): New function.
e9552f7e
ST
5927 (Plugin::load): Add the new interfaces to the transfer vector.
5928 (Plugin_manager::load_plugins): New parameter.
5929 (Plugin_manager::all_symbols_read): New parameter.
5930 (Plugin_manager::claim_file): New parameter. Save the elf object for
5931 unclaimed objects.
5932 (Plugin_manager::get_elf_object): New function.
5933 (Plugin_manager::get_view): Change to directly use the bool to check
5934 if get_view is called from claim_file_hook.
5935 * plugin.h (input_objects): New function
5936 (Plugin__manager::load_plugins): New parameter.
5937 (Plugin_manager::claim_file): New parameter.
5938 (Plugin_manager::get_elf_object): New function.
5939 (Plugin_manager::in_claim_file_handler): New function.
5940 (Plugin_manager::in_claim_file_handler_): New member.
5941 (layout): New function.
5942 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5943 handler with an extra parameter. Make the elf object before calling
5944 claim_file handler.
5945 * testsuite/plugin_test.c (get_section_count): New function pointer.
5946 (get_section_type): New function pointer.
5947 (get_section_name): New function pointer.
5948 (get_section_contents): New function pointer.
5949 (update_section_order): New function pointer.
5950 (allow_section_ordering): New function pointer.
5951 (onload): Check if the new interfaces exist.
5952
9446efde
ILT
59532011-07-13 Ian Lance Taylor <iant@google.com>
5954
5955 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5956 relro section.
5957 * x86_64.cc (Target_x86_64::got_section): Likewise.
5958 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5959 (relro_now_test_SOURCES): New variable.
5960 (relro_now_test_DEPENDENCIES): New variable.
5961 (relro_now_test_LDFLAGS): New variable.
5962 (relro_now_test_LDADD): New variable.
5963 (relro_now_test.so): New target.
5964 * testsuite/Makefile.in: Rebuild.
5965
07aa62f2
ILT
59662011-07-12 Ian Lance Taylor <iant@google.com>
5967
5968 PR gold/12980
5969 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5970 GLOB_DAT relocation rather than a RELATIVE relocation for a
5971 protected symbol when creating a shared library.
5972 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5973 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5974 * testsuite/protected_main_1.cc (main): Test that protected
5975 function has same address.
5976
e2153196
ILT
59772011-07-11 Ian Lance Taylor <iant@google.com>
5978
5979 PR gold/12979
5980 * options.h (class General_options): Add -Bgroup.
5981 * options.cc (General_options::finalize): If -Bgroup is set,
5982 default to --unresolved-symbols=report-all.
5983 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5984 * target-reloc.h (issue_undefined_symbol_error): Handle
5985 --unresolved-symbols=report-all.
5986
6daf5215
ILT
59872011-07-08 Ian Lance Taylor <iant@google.com>
5988
5989 PR gold/11985
5990 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5991 if linker script discards key sections.
5992 (Layout::create_dynamic_symtab): Likewise.
5993 (Layout::assign_local_dynsym_offsets): Likewise.
5994 (Layout::sized_create_version_sections): Likewise.
5995 (Layout::create_interp): Likewise.
5996 (Layout::finish_dynamic_section): Likewise.
5997 (Layout::set_dynamic_symbol_size): Likewise.
5998
beabb2c6
ILT
59992011-07-08 Ian Lance Taylor <iant@google.com>
6000
6001 PR gold/12386
6002 * options.h (class General_options): Add --unresolved-symbols.
6003 * target-reloc.h (issue_undefined_symbol_error): Check
6004 --unresolved-symbols. Add comments.
6005
9c16daf1
ILT
60062011-07-08 Ian Lance Taylor <iant@google.com>
6007
6008 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6009 expression more complex.
6010
191f1a2d
ILT
60112011-07-08 Ian Lance Taylor <iant@google.com>
6012
6013 PR gold/11317
6014 * target-reloc.h (issue_undefined_symbol_error): New inline
6015 function, broken out of relocate_section.
6016 (relocate_section): Call issue_undefined_symbol_error.
6017 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6018 there is no TLS segment if we are about to issue an undefined
6019 symbol error.
6020 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6021
62855347
ILT
60222011-07-08 Ian Lance Taylor <iant@google.com>
6023
6024 PR gold/12279
6025 * resolve.cc (Symbol_table::should_override): Add fromtype
6026 parameter. Change all callers. Give error when linking together
6027 TLS and non-TLS symbol.
6028 (Symbol_table::should_override_with_special): Add fromtype
6029 parameter. Change all callers.
6030 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6031 there is no TLS segment if we have reported some errors.
6032 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6033
67181c72
ILT
60342011-07-08 Ian Lance Taylor <iant@google.com>
6035
6036 PR gold/12372
6037 * target.h (Target::plt_address_for_global): New function.
6038 (Target::plt_address_for_local): New function.
6039 (Target::plt_section_for_global): Remove.
6040 (Target::plt_section_for_local): Remove.
6041 (Target::do_plt_address_for_global): New virtual function.
6042 (Target::do_plt_address_for_local): New virtual function.
6043 (Target::do_plt_section_for_global): Remove.
6044 (Target::do_plt_section_for_local): Remove.
6045 (Target::register_global_plt_entry): Add Symbol_table and Layout
6046 parameters.
6047 * output.cc (Output_data_got::Got_entry::write): Use
6048 plt_address_for_global and plt_address_for_local.
6049 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6050 address of output section.
6051 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6052 got_irelative_, and irelative_count_ fields. Update
6053 declarations.
6054 (Output_data_plt_i386::has_irelative_section): New function.
6055 (Output_data_plt_i386::entry_count): Add irelative_count_.
6056 (Output_data_plt_i386::set_final_data_size): Likewise.
6057 (class Target_i386): Add got_irelative_ and rel_irelative_
6058 fields. Update declarations.
6059 (Target_i386::Target_i386): Initialize new fields.
6060 (Target_i386::do_plt_address_for_global): New function replacing
6061 do_plt_section_for_global.
6062 (Target_i386::do_plt_address_for_local): New function replacing
6063 do_plt_section_for_local.
6064 (Target_i386::got_section): Create got_irelative_.
6065 (Target_i386::rel_irelative_section): New function.
6066 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6067 fields. Don't define __rel_iplt_{start,end}.
6068 (Output_data_plt_i386::add_entry): Add symtab and layout
6069 parameters. Change all callers. Use different PLT and GOT for
6070 IFUNC symbols.
6071 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6072 layout parameters. Change all callers. Use different PLT and
6073 GOT.
6074 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6075 (Output_data_plt_i386::rel_irelative): New function.
6076 (Output_data_plt_i386::address_for_global): New function.
6077 (Output_data_plt_i386::address_for_local): New function.
6078 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6079 IRELATIVE GOT when changing IFUNC GOT entries.
6080 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6081 reloc.
6082 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6083 if we didn't create an IRELATIVE GOT.
6084 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6085 plt_address_for_local.
6086 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6087 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6088 got_irelative_, and irelative_count_ fields. Update
6089 declarations.
6090 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6091 Initialize new fields. Remove symtab parameter. Change all
6092 callers.
6093 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6094 irelative_count_.
6095 (Output_data_plt_x86_64::has_irelative_section): New function.
6096 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6097 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6098 fields. Update declarations.
6099 (Target_x86_64::Target_x86_64): Initialize new fields.
6100 (Target_x86_64::do_plt_address_for_global): New function replacing
6101 do_plt_section_for_global.
6102 (Target_x86_64::do_plt_address_for_local): New function replacing
6103 do_plt_section_for_local.
6104 (Target_x86_64::got_section): Create got_irelative_.
6105 (Target_x86_64::rela_irelative_section): New function.
6106 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6107 all callers. Don't create __rel_iplt_{start,end}.
6108 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6109 parameters. Change all callers. Use different PLT and GOT for
6110 IFUNC symbols.
6111 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6112 layout parameters. Change all callers. Use different PLT and
6113 GOT.
6114 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6115 parameters. Change all callers. Use different PLT and GOT for
6116 IFUNC symbols.
6117 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6118 (Output_data_plt_x86_64::rela_irelative): New function.
6119 (Output_data_plt_x86_64::address_for_global): New function.
6120 (Output_data_plt_x86_64::address_for_local): New function.
6121 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6122 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6123 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6124 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6125 parameters.
6126 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6127 reloc.
6128 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6129 symbols if we didn't create an IRELATIVE GOT.
6130 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6131 plt_address_for_local.
6132 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6133 * testsuite/ifuncvar1.c: New test file.
6134 * testsuite/ifuncvar2.c: New test file.
6135 * testsuite/ifuncvar3.c: New test file.
6136 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6137 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6138 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6139 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6140 * testsuite/Makefile.in: Rebuild.
6141
33c15b45
CC
61422011-07-07 Cary Coutant <ccoutant@google.com>
6143
6144 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6145 (two_file_test_1_ndebug.o): Likewise.
6146 (two_file_test_1b_ndebug.o): Likewise.
6147 (two_file_test_2_ndebug.o): Likewise.
6148 (two_file_test_main_ndebug.o): Likewise.
6149 (incremental_test_2): Link with no-debug versions.
6150
f48b5fb7
CC
61512011-07-06 Cary Coutant <ccoutant@google.com>
6152
6153 * gold/incremental.cc
6154 (Output_section_incremental_inputs::write_info_blocks): Check for
6155 hidden and internal symbols.
6156
221597a5
CC
61572011-07-06 Cary Coutant <ccoutant@google.com>
6158
6159 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6160 Check disposition for startup file.
6161 (Incremental_inputs::report_command_line): Ignore
6162 --incremental-startup-unchanged option.
6163 * options.cc (General_options::parse_incremental_startup_unchanged):
6164 New function.
6165 (General_options::General_options): Initialize new data member.
6166 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6167 (General_options): Add --incremental-startup-unchanged option.
6168 (General_options::incremental_startup_disposition): New function.
6169 (General_options::incremental_startup_disposition_): New data member.
6170
e24719f6
CC
61712011-07-06 Cary Coutant <ccoutant@google.com>
6172
6173 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6174 input file index to Script_info ctor.
6175 (Sized_incremental_binary::do_file_has_changed): Find the
6176 command-line argument for files named in scripts.
6177 * incremental.h (Script_info::Script_info): New ctor
6178 with input file index.
6179 (Script_info::input_file_index): New function.
6180 (Script_info::input_file_index_): New data member.
6181 (Incremental_binary::get_library): Add const.
6182 (Incremental_binary::get_script_info): Add const.
6183 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6184 * testsuite/Makefile.am (incremental_test_5): New test case.
6185 (incremental_test_6): New test case.
6186 * testsuite/Makefile.in: Regenerate.
6187
8f7c81e8
CC
61882011-07-06 Cary Coutant <ccoutant@google.com>
6189
6190 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6191 debug output when command lines differ.
6192
9fbd3822
CC
61932011-07-06 Cary Coutant <ccoutant@google.com>
6194
6195 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6196 --incremental-patch option.
6197 * layout.cc (Free_list::allocate): Extend allocation beyond original
6198 end if enabled.
6199 (Layout::make_output_section): Mark sections that should get
6200 patch space.
6201 * options.cc (parse_percent): New function.
6202 * options.h (parse_percent): New function.
6203 (DEFINE_percent): New macro.
6204 (General_options): Add --incremental-patch option.
6205 * output.cc (Output_section::Output_section): Initialize new data
6206 members.
6207 (Output_section::add_input_section): Print section name when out
6208 of patch space.
6209 (Output_section::add_output_section_data): Likewise.
6210 (Output_section::set_final_data_size): Add patch space when
6211 doing --incremental-full.
6212 (Output_section::do_reset_address_and_file_offset): Remove patch
6213 space.
6214 (Output_segment::set_section_list_addresses): Print debug output
6215 only if --incremental-update.
6216 * output.h (Output_section::set_is_patch_space_allowed): New function.
6217 (Output_section::is_patch_space_allowed_): New data member.
6218 (Output_section::patch_space_): New data member.
6219 * parameters.cc (Parameters::incremental_full): New function.
6220 * parameters.h (Parameters::incremental_full): New function
6221 * testsuite/Makefile.am (incremental_test_2): Add test for
6222 --incremental-patch option.
6223 * testsuite/Makefile.in: Regenerate.
6224 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6225 (t18): Remove function body.
6226
f6cccc2c
DK
62272011-07-05 Doug Kwan <dougkwan@google.com>
6228
6229 PR gold/12771
6230 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6231 Arm_Address type for relocation result.
6232 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6233 overflow check.
6234 (Arm_relocate_functions::abs32): Use unaligned access.
6235 (Arm_relocate_functions::rel32): Ditto.
6236 (Arm_relocate_functions::prel31): Ditto.
6237 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6238 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6239 static data relocations.
6240 * testsuite/Makefile.in: Regnerate.
6241 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6242
28a13fec
ILT
62432011-07-05 Ian Lance Taylor <iant@google.com>
6244
6245 PR gold/12392
6246 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6247 symbols if necessary.
6248 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6249
24d47b34
ILT
62502011-07-05 Ian Lance Taylor <iant@google.com>
6251
6252 PR gold/12952
6253 * resolve.cc (Symbol::override_base_with_special): Simply override
6254 version with special symbol version, ignoring previous version.
6255
41f9cbbe
ILT
62562011-07-05 Ian Lance Taylor <iant@google.com>
6257
6258 * object.cc (Sized_relobj_file::include_section_group): Add
6259 information to comment about signature location.
6260
886288f1
ILT
62612011-07-02 Ian Lance Taylor <iant@google.com>
6262
6263 PR gold/12957
6264 * options.h (class General_options): Add -f and -F.
6265 * options.cc (General_options::finalize): Fatal error if -f/-F
6266 are used without -shared.
6267 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6268
ae3a6d4f
ILT
62692011-07-02 Ian Lance Taylor <iant@google.com>
6270
6271 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6272
21131061
ILT
62732011-07-01 Ian Lance Taylor <iant@google.com>
6274
6275 PR gold/12525
6276 PR gold/12952
6277 * resolve.cc (Symbol::override_base_with_special): Don't override
6278 the version if the overriding symbol has a different name.
6279 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6280 all callers. If we give an error about an undefined version,
6281 define the base version if necessary.
6282 * dynobj.h (class Versions): Update declaration.
6283 * testsuite/weak_alias_test_5.cc: New file.
6284 * testsuite/weak_alias_test.script: New file.
6285 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6286 and versioned_alias have the right value, and call t2.
6287 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6288 weak_alias_test_5.so.
6289 (weak_alias_test_LDADD): Likewise.
6290 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6291 * testsuite/Makefile.in: Rebuild.
6292
611062c0
ILT
62932011-07-01 Ian Lance Taylor <iant@google.com>
6294
6295 PR gold/12525
6296 * options.h (class General_options): Support -z notext.
6297 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6298 -Wl,-z,notext.
6299 (two_file_shared_nonpic.so): Likewise.
6300 (two_file_shared_mixed.so): Likewise.
6301 (two_file_shared_mixed_1.so): Likewise.
6302 (weak_undef_lib_nonpic.so): Likewise.
6303 (alt/weak_undef_lib_nonpic.so): Likewise.
6304 (tls_test_shared_nonpic.so): Likewise.
6305 * testsuite/Makefile.in: Rebuild.
6306
328c7c2f
ILT
63072011-07-01 Ian Lance Taylor <iant@google.com>
6308
6309 PR gold/12525
6310 * configure.ac: Test whether static linking works, setting
6311 the automake conditional HAVE_STATIC.
6312 * testsuite/Makefile.am: Disable tests using -static if
6313 HAVE_STATIC is not true.
6314 * configure, testsuite/Makefile.in: Rebuild.
6315
02d7cd44
ILT
63162011-07-01 Ian Lance Taylor <iant@google.com>
6317
6318 PR gold/12525
6319 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6320 Assert if we see DW_EH_PE_indirect.
6321 * target.h (Target::ehframe_datarel_base): New function.
6322 (Target::do_ehframe_datarel_base): New target function.
6323 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6324 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6325 function.
6326
07a60597
ILT
63272011-07-01 Ian Lance Taylor <iant@google.com>
6328
6329 PR gold/12571
6330 * options.h (class General_options): Add
6331 --ld-generated-unwind-info.
6332 * ehframe.cc (Fde::write): Add address parameter. Change all
6333 callers. If associated with PLT, fill in address and size.
6334 (Cie::set_output_offset): Only add merge mapping if there is an
6335 object.
6336 (Cie::write): Add address parameter. Change all callers.
6337 (Eh_frame::add_ehframe_for_plt): New function.
6338 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6339 input_offset_ fields into union u_, with new plt field.
6340 (Fde::Fde): Adjust for new union field.
6341 (Fde::Fde) [Output_data version]: New constructor.
6342 (Fde::add_mapping): Only add merge mapping if there is an object.
6343 (class Cie): Update declarations.
6344 (class Eh_frame): Declare add_ehframe_for_plt.
6345 * layout.cc (Layout::layout_eh_frame): Break out code into
6346 make_eh_frame_section, and call it.
6347 (Layout::make_eh_frame_section): New function.
6348 (Layout::add_eh_frame_for_plt): New function.
6349 * layout.h (class Layout): Update declarations.
6350 * merge.cc (Merge_map::add_mapping): Add assertion.
6351 * i386.cc: Include "dwarf.h".
6352 (class Output_data_plt_i386): Make first_plt_entry,
6353 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6354 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6355 and plt_eh_frame_fde.
6356 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6357 boundary. Call add_eh_frame_for_plt if appropriate.
6358 * x86_64.cc: Include "dwarf.h".
6359 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6360 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6361 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6362 and plt_eh_frame_fde.
6363 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6364 appropriate.
6365
14788a3f
ILT
63662011-06-29 Ian Lance Taylor <iant@google.com>
6367
6368 PR gold/12629
6369 * object.cc (Sized_relobj_file::layout_section): Change shdr
6370 parameter to be const.
6371 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6372 out of do_layout.
6373 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6374 appropriate. Call layout_eh_frame_section.
6375 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6376 sections.
6377 * object.h (class Sized_relobj_file): Update declarations.
6378
6c21fce1
ILT
63792011-06-29 Ian Lance Taylor <iant@google.com>
6380
37e41b03 6381 PR gold/12652
6c21fce1
ILT
6382 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6383 modifier.
6384 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6385
4d5e4e62
ILT
63862011-06-29 Ian Lance Taylor <iant@google.com>
6387
6388 PR gold/12675
6389 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6390 SHT_X86_64_UNWIND.
6391 * layout.cc (Layout::layout_eh_frame): Likewise.
6392
886f533a
ILT
63932011-06-29 Ian Lance Taylor <iant@google.com>
6394
6395 PR gold/12695
6396 * layout.cc (Layout::symtab_section_shndx): New function.
6397 * layout.h (class Layout): Declare symtab_section_shndx.
6398 * output.cc (Output_section::write_header): Call it.
6399
f3ae1b28
ILT
64002011-06-29 Ian Lance Taylor <iant@google.com>
6401
6402 PR gold/12818
6403 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6404 symbols which are not used in a relocation.
6405
aecf301f
ILT
64062011-06-28 Ian Lance Taylor <iant@google.com>
6407
6408 PR gold/12898
6409 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6410 script create indistinguishable segments.
6411 (Layout::set_segment_offsets): Use stable_sort when sorting
6412 segments. Pass this to Compare_segments constructor.
6413 * layout.h (class Layout): Make segment_precedes non-static.
6414 (class Compare_segments): Change from struct to class. Add
6415 layout_ field. Add constructor.
6416 * script-sections.cc
6417 (Script_sections::attach_sections_using_phdrs_clause): Rename
6418 local orphan to is_orphan. Don't report failure to put empty
6419 section in segment. On attachment failure, report name of
6420 section, and attach to first PT_LOAD segment.
6421
03ef7571
ILT
64222011-06-28 Ian Lance Taylor <iant@google.com>
6423
6424 PR gold/12934
6425 * target-select.cc (Target_selector::Target_selector): Add
6426 emulation parameter. Change all callers.
6427 (select_target_by_bfd_name): Rename from select_target_by_name.
6428 Change all callers.
6429 (select_target_by_emulation): New function.
6430 (supported_emulation_names): New function.
6431 * target-select.h (class Target_selector): Add emulation_ field.
6432 Update declarations.
6433 (Target_selector::recognize_by_bfd_name): Rename from
6434 recognize_by_name. Change all callers.
6435 (Target_selector::supported_bfd_names): Rename from
6436 supported_names. Change all callers.
6437 (Target_selector::recognize_by_emulation): New function.
6438 (Target_selector::supported_emulations): New function.
6439 (Target_selector::emulation): New function.
6440 (Target_selector::do_recognize_by_bfd_name): Rename from
6441 do_recognize_by_name. Change all callers.
6442 (Target_selector::do_supported_bfd_names): Rename from
6443 do_supported_names. Change all callers.
6444 (Target_selector::do_recognize_by_emulation): New function.
6445 (Target_selector::do_supported_emulations): New function.
6446 (select_target_by_bfd_name): Change name in declaration.
6447 (select_target_by_emulation): Declare.
6448 (supported_emulation_names): Declare.
6449 * parameters.cc (parameters_force_valid_target): Try to find
6450 target based on emulation from -m option.
6451 * options.h (class General_options): Change doc string for -m.
6452 * options.cc (help): Print emulations.
6453 (General_options::parse_V): Likewise.
6454 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6455 Add emulation parameter. Change all callers.
6456
200b2bb9
ILT
64572011-06-28 Ian Lance Taylor <iant@google.com>
6458
6459 * target.h (class Target): Add osabi_ field.
6460 (Target::osabi): New function.
6461 (Target::set_osabi): New function.
6462 (Target::Target): Initialize osabi_.
6463 (Target::do_adjust_elf_header): Make pure virtual.
6464 (Sized_target::do_adjust_elf_header): Declare.
6465 * target.cc (Sized_target::do_adjust_elf_header): New function.
6466 (class Sized_target): Instantiate all versions.
6467 * freebsd.h (class Target_freebsd): Remove.
6468 (Target_selector_freebsd::do_recognize): Call set_osabi on
6469 Target.
6470 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6471 (Target_selector_freebsd::set_osabi): Remove.
6472 * i386.cc (class Target_i386): Inherit from Sized_target rather
6473 than Target_freebsd.
6474 * x86_64.cc (class Target_x86_64): Likewise.
6475
b3ce541e
ILT
64762011-06-28 Ian Lance Taylor <iant@google.com>
6477
6478 * target.h (Target::can_check_for_function_pointers): Rewrite.
6479 Make non-virtual.
6480 (Target::can_icf_inline_merge_sections): Likewise.
6481 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6482 (Target::Target_info): Add can_icf_inline_merge_sections field.
6483 (Target::do_can_check_for_function_pointers): New virtual
6484 function.
6485 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6486 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6487 from can_check_for_function_pointers, move in file.
6488 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6489 section_may_have_icf_unsafe_poineters, move in file.
6490 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6491 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6492 Rename from can_check_for_function_pointers, move in file.
6493 (Target_i386::can_icf_inline_merge_sections): Remove.
6494 (Target_i386::i386_info): Initialize
6495 can_icf_inline_merge_sections.
6496 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6497 Initialize can_icf_inline_merge_sections.
6498 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6499 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6500 Rename from can_check_for_function_pointers, move in file.
6501 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6502 (Target_x86_64::x86_64_info): Initialize
6503 can_icf_inline_merge_sections.
6504 * testsuite/testfile.cc (Target_test::test_target_info):
6505 Likewise.
6506 * icf.cc (get_section_contents): Correct formatting.
6507
6d1c4efb
ILT
65082011-06-27 Ian Lance Taylor <iant@google.com>
6509
6510 * symtab.cc (Symbol::versioned_name): New function.
6511 (Symbol_table::add_to_final_symtab): Use versioned_name when
6512 appropriate.
6513 (Symbol_table::sized_write_symbol): Likewise.
6514 * symtab.h (class Symbol): Declare versioned_name.
6515 * stringpool.h (class Stringpool_template): Add variant of add
6516 which takes a std::basic_string.
6517 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6518 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6519 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6520 (ver_test_12.o): New target.
6521 * testsuite/Makefile.in: Rebuild.
6522
57eb9b50
DK
65232011-06-27 Doug Kwan <dougkwan@google.com>
6524
6525 * arm.cc (Arm_relocate_functions::thm_jump8,
6526 Arm_relocate_functions::thm_jump11): Use a wider signed
6527 type to compute offset.
6528 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6529 arm_thm_jump8.
6530 * testsuite/Makefile.in: Regenerate.
6531 * testsuite/arm_branch_in_range.sh: Check test results of
6532 arm_thm_jump11 and arm_thm_jump8.
6533 * testsuite/arm_thm_jump11.s: New test source file.
6534 * testsuite/arm_thm_jump11.t: New linker script.
6535 * testsuite/arm_thm_jump8.s: New test source file.
6536 * testsuite/arm_thm_jump8.t: New linker script.
6537
487b39df
ILT
65382011-06-24 Ian Lance Taylor <iant@google.com>
6539
6540 * layout.cc: Include "object.h".
6541 (ctors_sections_in_init_array): New static variable.
6542 (Layout::is_ctors_in_init_array): New function.
6543 (Layout::layout): Add entry to ctors_sections_in_init_array if
6544 appropriate.
6545 * layout.h (class Layout): Declare is_ctors_in_init_array.
6546 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6547 is_ctors_reverse_view is set.
6548 (Sized_relobj_file::write_sections): Add layout parameter. Change
6549 all callers. Set is_ctors_reverse_view field of View_size.
6550 (Sized_relobj_file::reverse_words): New function.
6551 * object.h (Sized_relobj_file::View_size): Add
6552 is_ctors_reverse_view field.
6553 (class Sized_relobj_file): Update declarations.
6554 * testsuite/initpri3.c: New test.
6555 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6556 initpri3b.
6557 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6558 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6559 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6560 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6561 * testsuite/Makefile.in: Rebuild.
6562
472076e4
CC
65632011-06-24 Cary Coutant <ccoutant@google.com>
6564
6565 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6566 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6567 (debug_msg_cdebug.err): New targets.
6568 * testsuite/Makefile.in: Regenerate.
6569 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6570 Fix checks for link with shared library.
6571
a60af0db
DK
65722011-06-24 Doug Kwan <dougkwan@google.com>
6573
6574 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6575 skip empty text sections.
6576 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6577
5393d741
ILT
65782011-06-22 Ian Lance Taylor <iant@google.com>
6579
6580 PR gold/12910
6581 * options.h (class General_options): Add --ctors-in-init-array.
6582 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6583 friends as SHT_PROGBITS for merging sections.
6584 (Layout::layout): Remove special handling of .init_array and
6585 friends. Don't sort if doing relocatable link. Sort for .ctors
6586 and .dtors if ctors_in_init_array.
6587 (Layout::make_output_section): Force correct section types for
6588 .init_array and friends. Don't sort if doing relocatable link,
6589 Don't sort .ctors and .dtors if ctors_in_init_array.
6590 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6591 (Layout::output_section_name): Add relobj parameter. Change all
6592 callers. Handle .ctors. and .dtors. in code rather than table.
6593 Handle .ctors and .dtors if ctors_in_init_array.
6594 (Layout::match_file_name): New function, moved from output.cc.
6595 * layout.h (class Layout): Update declarations.
6596 * output.cc: Include "layout.h".
6597 (Input_section_sort_entry::get_priority): New function.
6598 (Input_section_sort_entry::match_file_name): Just call
6599 Layout::match_file_name.
6600 (Output_section::Input_section_sort_init_fini_compare::operator()):
6601 Handle .ctors and .dtors. Sort by explicit priority rather than
6602 by name.
6603 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6604 * testsuite/initpri2.c: New test.
6605 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6606 (check_PROGRAMS): Add initpri2.
6607 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6608 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6609 * configure, testsuite/Makefile.in: Rebuild.
6610
e1f74f98
ILT
66112011-06-19 Ian Lance Taylor <iant@google.com>
6612
6613 PR gold/12880
6614 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6615 .interp section to a PT_INTERP segment even if we have seen a
6616 --dynamic-linker option. Don't do it if we have seen a PHDRS
6617 clause in a linker script.
6618 (Layout::finalize): Don't create a .interp section if we've
6619 already create a PT_INTERP segment.
6620 (Layout::create_interp): Always call choose_output_section (revert
6621 patch of 2011-06-17). Don't create PT_INTERP segment.
6622 * script-sections.cc
6623 (Script_sections::create_note_and_tls_segments): Add a .interp
6624 section to a PT_INTERP segment even if we have seen a
6625 --dynamic-linker option.
6626
766f91bb
ILT
66272011-06-18 Ian Lance Taylor <iant@google.com>
6628
6629 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6630 merely because a non-PT_LOAD segment has a dynamic reloc.
6631
0d212c3a
ILT
66322011-06-18 Ian Lance Taylor <iant@google.com>
6633
6634 * layout.cc (Layout::finish_dynamic_section): Don't create
6635 DT_FLAGS entry if not needed.
6636
911a5072
ILT
66372011-06-18 Ian Lance Taylor <iant@google.com>
6638
6639 PR gold/12745
6640 * layout.cc (Layout::layout_eh_frame): Correct handling of
6641 writable .eh_frame section.
6642
534b4e5f
ILT
66432011-06-17 Ian Lance Taylor <iant@google.com>
6644
6645 PR gold/12893
6646 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6647 symbol is redefined with the exact same object and value.
6648
10b4f102
ILT
66492011-06-17 Ian Lance Taylor <iant@google.com>
6650
6651 PR gold/12880
6652 * layout.h (class Layout): Add interp_segment_ field.
6653 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6654 (Layout::attach_allocated_section_to_segment): If making shared
6655 library, put .interp section in PT_INTERP segment.
6656 (Layout::finalize): Also call create_interp if -dynamic-linker
6657 option was used.
6658 (Layout::create_interp): Assert that there is no PT_INTERP
6659 segment. If not using a SECTIONS clause, use make_output_section.
6660 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6661 * script-sections.cc
6662 (Script_sections::create_note_and_tls_segments): If making shared
6663 library, put .interp section in PT_INTERP segment.
6664
a29b0dad
ILT
66652011-06-17 Ian Lance Taylor <iant@google.com>
6666
e588ea8d
ILT
6667 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6668 when making a shared library.
6669
66702011-06-17 Ian Lance Taylor <iant@google.com>
6671
6672 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6673 parameter. Change all callers. Don't issue warning about PC32
6674 against locally defined symbol.
a29b0dad 6675
9d3b0698
ILT
66762011-06-16 Ian Lance Taylor <iant@google.com>
6677
6678 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6679 occurs in same object.
6680
85b0f90c
AM
66812011-06-14 Alan Modra <amodra@gmail.com>
6682
6683 * po/POTFILES.in: Regenerate.
6684
a94907d9
ILT
66852011-06-09 Ian Lance Taylor <iant@google.com>
6686
6687 * script-sections.cc
6688 (Orphan_output_section::set_section_addresses): For a relocatable
6689 link set address to 0.
6690
4fb3a1c3
CC
66912011-06-09 Cary Coutant <ccoutant@google.com>
6692
6693 PR gold/12804
6694 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6695 used with --compress-debug-sections.
6696 * gold/object.cc (Sized_relobj_file::do_layout): Report
6697 uncompressed size of compressed input sections.
6698
61220854
CC
66992011-06-08 Cary Coutant <ccoutant@google.com>
6700
6701 PR gold/12804
6702 * testsuite/two_file_test_2_v1.cc: Change initialization of
6703 v2 to keep it in .data.
6704
e6455dfb
CC
67052011-06-07 Cary Coutant <ccoutant@google.com>
6706
6707 * common.cc (Symbol_table::do_allocate_commons_list): Call
6708 gold_fallback.
6709 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6710 (Errors::fallback): New function.
6711 (gold_fallback): New function.
6712 * errors.h (Errors::fallback): New function.
6713 * gold.cc (gold_exit): Change status parameter to enum; adjust
6714 all callers.
6715 (queue_initial_tasks): Call gold_fallback.
6716 * gold.h: Include cstdlib.
6717 (Exit_status): New enum type.
6718 (gold_exit): Change status parameter to enum.
6719 (gold_fallback): New function.
6720 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6721 (Layout::create_symtab_sections): Likewise.
6722 (Layout::create_shdrs): Likewise.
6723 * main.cc (main): Adjust call to gold_exit.
6724 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6725 (Output_data_got::add_got_entry_pair): Likewise.
6726 (Output_section::add_input_section): Likewise.
6727 (Output_section::add_output_section_data): Likewise.
6728 (Output_segment::set_section_list_addresses): Likewise.
6729 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6730
fb0e076f
CC
67312011-06-07 Cary Coutant <ccoutant@google.com>
6732
6733 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6734 for incremental links.
6735 * output.cc (Output_segment::set_section_list_addresses): Remove
6736 FIXME and test for TLS or BSS.
6737
a5ee4d5d
CC
67382011-06-07 Cary Coutant <ccoutant@google.com>
6739
6740 * testsuite/Makefile.am: Add incremental_copy_test,
6741 incremental_common_test_1.
6742 * testsuite/Makefile.in: Regenerate.
6743 * testsuite/common_test_1_v1.c: New source file.
6744 * testsuite/common_test_1_v2.c: New source file.
6745 * testsuite/copy_test_v1.cc: New source file.
6746
5146f448
CC
67472011-06-07 Cary Coutant <ccoutant@google.com>
6748
6749 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6750 update, allocate common from bss section's free list.
6751 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6752 linker-defined symbols.
6753 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6754 Skip GOT and PLT entries that are no longer referenced.
6755 (Output_section_incremental_inputs::write_info_blocks): Mark
6756 linker-defined symbols.
6757 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6758 * output.cc (Output_section::allocate): New function.
6759 * output.h (Output_section::allocate): New function.
6760 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6761 linker-defined symbols.
6762 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6763 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6764 (Symbol::init_base_output_data): Likewise.
6765 (Symbol::init_base_output_segment): Likewise.
6766 (Symbol::init_base_constant): Likewise.
6767 (Sized_symbol::init_output_data): Likewise.
6768 (Sized_symbol::init_output_segment): Likewise.
6769 (Sized_symbol::init_constant): Likewise.
6770 (Symbol_table::do_define_in_output_data): Likewise.
6771 (Symbol_table::do_define_in_output_segment): Likewise.
6772 (Symbol_table::do_define_as_constant): Likewise.
6773 * symtab.h (Symbol::is_predefined): New function.
6774 (Symbol::init_base_output_data): Add is_predefined parameter.
6775 (Symbol::init_base_output_segment): Likewise.
6776 (Symbol::init_base_constant): Likewise.
6777 (Symbol::is_predefined_): New data member.
6778 (Sized_symbol::init_output_data): Add is_predefined parameter.
6779 (Sized_symbol::init_output_segment): Likewise.
6780 (Sized_symbol::init_constant): Likewise.
6781 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6782
26d3c67d
CC
67832011-06-07 Cary Coutant <ccoutant@google.com>
6784
6785 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6786 instead of emit_copy_reloc.
6787 (Copy_relocs::emit_copy_reloc): Refactor.
6788 (Copy_relocs::make_copy_reloc): New function.
6789 (Copy_relocs::add_copy_reloc): Remove.
6790 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6791 section.
6792 (Copy_relocs::make_copy_reloc): New function.
6793 (Copy_relocs::add_copy_reloc): Remove.
6794 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6795 unchanged input files.
6796 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6797 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6798 Reserve BSS space for COPY relocations.
6799 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6800 (Output_section_incremental_inputs::write_info_blocks): Record
6801 whether a symbol is copied from a shared object.
6802 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6803 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6804 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6805 (Incremental_input_entry_reader::get_output_symbol_index): Add
6806 is_copy parameter.
6807 (Incremental_binary::emit_copy_relocs): New function.
6808 (Incremental_binary::do_emit_copy_relocs): New function.
6809 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6810 new data member.
6811 (Sized_incremental_binary::add_copy_reloc): New function.
6812 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6813 (Sized_incremental_binary::Copy_reloc): New struct.
6814 (Sized_incremental_binary::Copy_relocs): New typedef.
6815 (Sized_incremental_binary::copy_relocs_): New data member.
6816 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6817 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6818 * target.h (Sized_target::emit_copy_reloc): New function.
6819 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6820
7cdb37d9
CC
68212011-06-02 Cary Coutant <ccoutant@google.com>
6822
6823 PR gold/12163
6824 * gold/archive.cc (Archive::Archive): Initialize new data member.
6825 (Archive::include_all_members): Return if archive has already been
6826 included.
6827 * gold/archive.h (Archive::include_all_members_): New data member.
6828
cc643b88
NC
68292011-06-02 Nick Clifton <nickc@redhat.com>
6830
6831 * dynobj.h: Fix spelling mistake in comment.
6832 * output.cc: Likewise.
6833
f62a3ca7 68342011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6835 Asier Llano
f62a3ca7
DK
6836
6837 PR gold/12826
cc643b88 6838 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6839 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6840 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6841 redundant arm_exidx_test.so.
6842 * testsuite/Makefile.in: Regenerate.
6843 (check_SCRIPTS): Add pr12826.sh
6844 (check_DATA): Add pr12826.stdout
6845 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6846 * testsuite/pr12826.sh: New file.
6847 * testsuite/pr12826_1.s: Ditto.
6848 * testsuite/pr12826_1.s: Ditto.
6849
8dbe1edc
ILT
68502011-05-30 Ian Lance Taylor <iant@google.com>
6851
6852 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6853 sections.
6854
c49875be
ILT
68552011-05-29 Ian Lance Taylor <iant@google.com>
6856
6857 PR gold/12804
6858 * testsuite/Makefile.am: Use different file name for two_file_test
6859 temporary file for each incremental test.
6860 * testsuite/Makefile.in: Rebuild.
6861
69d53f7a
ILT
68622011-05-29 Ian Lance Taylor <iant@google.com>
6863
6864 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6865 binary input file is empty.
6866
41d0ab5f
ILT
68672011-05-27 Ian Lance Taylor <iant@google.com>
6868
6869 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6870 (ver_test_9.so): Likewise.
6871 * testsuite/Makefile.in: Rebuild.
6872
89d8a36b
CC
68732011-05-26 Cary Coutant <ccoutant@google.com>
6874
6875 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6876 * incremental.cc (Incremental_inputs::report_input_section): Fix
6877 comment, indentation.
6878 (Incremental_inputs::report_comdat_group): New function.
6879 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6880 of data for incremental input file entry.
6881 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6882 group count, COMDAT group signatures.
6883 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6884 an unchanged input file.
6885 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6886 Initialize new data member.
6887 (Incremental_object_entry::add_comdat_group): New function.
6888 (Incremental_object_entry::get_comdat_group_count): New function.
6889 (Incremental_object_entry::get_comdat_signature_key): New function.
6890 (Incremental_object_entry::groups_): New data member.
6891 (Incremental_inputs::report_comdat_group): New function.
6892 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6893 data for incremental input file entry.
6894 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6895 (Incremental_input_entry_reader::get_input_section): Adjust size of
6896 data for incremental input file entry.
6897 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6898 (Incremental_input_entry_reader::get_comdat_group_signature): New
6899 function.
6900 * object.cc (Sized_relobj::include_section_group): Report kept
6901 COMDAT groups for incremental links.
6902
1706a06f
ILT
69032011-05-24 David Meyer <pdox@google.com>
6904
6905 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6906 with name parameter. Add found_name parameter.
6907 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6908 * dirsearch.h (class Dirsearch): Update declaration.
6909
a10ae760
ILT
69102011-05-24 Ian Lance Taylor <iant@google.com>
6911
6912 * archive.cc (Library_base::should_include_member): Pull in object
6913 from archive if it defines the entry symbol.
6914 * parameters.cc (Parameters::entry): New function.
6915 * parameters.h (class Parameters): Declare entry.
6916 * output.h (class Output_file_header): Remove entry_ field.
6917 * output.cc (Output_file_header::Output_file_header): Remove entry
6918 parameter. Change all callers.
6919 (Output_file_header::entry): Use parameters->entry.
6920 * gold.cc (queue_middle_tasks): Likewise.
6921 * plugin.cc (Plugin_hook::run): Likewise.
6922
aa92d6ed
CC
69232011-05-24 Cary Coutant <ccoutant@google.com>
6924
6925 * gold.cc (queue_initial_tasks): Pass incremental base filename
6926 to Output_file::open_base_file; don't print error message.
6927 * incremental-dump.cc (main): Adjust call to
6928 Output_file::open_for_modification.
6929 * incremental-dump.cc (main): Likewise.
6930 * incremental.cc (Incremental_inputs::report_command_line):
6931 Ignore --incremental-base option when comparing command lines.
6932 Ignore parameter when given as separate argument.
6933 * options.h (class General_options): Add --incremental-base.
6934 * output.cc (Output_file::Output_file):
6935 (Output_file::open_base_file): Add base_name and writable parameters;
6936 read base file into new file; print error message here.
6937 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6938 callers.
6939 * output.h (Output_file::open_for_modification): Rename to...
6940 (Output_file::open_base_file): ...this; add base_name and
6941 writable parameters; adjust all callers.
6942 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6943 callers.
6944 * testsuite/Makefile.am (incremental_test_4): Test
6945 --incremental-base.
6946 * testsuite/Makefile.in: Regenerate.
6947
2eedd706
CC
69482011-05-24 Cary Coutant <ccoutant@google.com>
6949
6950 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6951 incremental_test_4.
6952 * testsuite/Makefile.in: Regenerate.
6953 * testsuite/two_file_test_1_v1.cc: New test source file.
6954 * testsuite/two_file_test_1b_v1.cc: New test source file.
6955 * testsuite/two_file_test_2_v1.cc: New test source file.
6956
0f1c85a6
CC
69572011-05-24 Cary Coutant <ccoutant@google.com>
6958
6959 * dynobj.h (Dynobj::do_dynobj): New function.
6960 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6961 flag and soname for shared objects.
6962 * incremental.cc (Incremental_inputs::report_object): Make
6963 either Incremental_object_entry or Incremental_dynobj_entry; add
6964 soname to string table.
6965 (Incremental_inputs::report_input_section): Add assertion.
6966 (Output_section_incremental_inputs::set_final_data_size): Adjust
6967 type of input file entry for shared libraries; adjust size of
6968 shared library info entry.
6969 (Output_section_incremental_inputs::write_input_files): Write
6970 as_needed flag for shared libraries.
6971 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6972 of input file entry for shared libraries; write soname.
6973 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6974 soname from incremental info.
6975 * incremental.h (enum Incremental_input_flags): Add
6976 INCREMENTAL_INPUT_AS_NEEDED.
6977 (Incremental_input_entry::Incremental_input_entry): Initialize new
6978 data member.
6979 (Incremental_input_entry::set_as_needed): New function.
6980 (Incremental_input_entry::as_needed): New function.
6981 (Incremental_input_entry::do_dynobj_entry): New function.
6982 (Incremental_input_entry::as_needed_): New data member.
6983 (Incremental_object_entry::Incremental_object_entry): Don't check
6984 for shared library.
6985 (Incremental_object_entry::do_type): Likewise.
6986 (class Incremental_dynobj_entry): New class.
6987 (Incremental_input_entry_reader::as_needed): New function.
6988 (Incremental_input_entry_reader::get_soname): New function.
6989 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6990 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6991 size of shared library info entry.
58797674 6992 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6993 incremental link when adding DT_NEEDED entries.
6994 * object.h (Object::Object): Initialize new data member.
6995 (Object::dynobj): New function.
6996 (Object::set_as_needed): New function.
6997 (Object::as_needed): New function.
6998 (Object::do_dynobj): New function.
6999 (Object::as_needed_): New data member.
7000
6fa2a40b
CC
70012011-05-24 Cary Coutant <ccoutant@google.com>
7002
7003 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7004 info; adjust display of GOT entries.
7005 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7006 vector of input objects; remove file_status_.
7007 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7008 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7009 got_plt reader; call target hooks to reserve GOT entries.
7010 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7011 of input file info header and GOT info entry.
7012 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7013 relocation info.
7014 (Got_plt_view_info::got_descriptor): Remove.
7015 (Got_plt_view_info::sym_index): New data member.
7016 (Got_plt_view_info::input_index): New data member.
7017 (Local_got_offset_visitor::visit): Write input file index.
7018 (Global_got_offset_visitor::visit): Write 0 for input file index.
7019 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7020 with sym_index and input_index.
7021 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7022 incremental info GOT entry; replace got_descriptor with input_index.
7023 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7024 map from input file index to object.
7025 (Sized_relobj_incr::do_layout): Replace direct data member reference
7026 with accessor function.
7027 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7028 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7029 Adjust size of input file info header.
7030 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7031 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7032 (Incremental_input_entry_reader::get_input_section): Adjust size of
7033 input file info header.
7034 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7035 of incremental info GOT entry.
7036 (Incremental_got_plt_reader::get_got_desc): Remove.
7037 (Incremental_got_plt_reader::get_got_symndx): New function.
7038 (Incremental_got_plt_reader::get_got_input_index): New function.
7039 (Sized_incremental_binary::Sized_incremental_binary): Remove
7040 file_status_; add input_objects_.
7041 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7042 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7043 (Sized_incremental_binary::file_is_unchanged): Remove.
7044 (Sized_incremental_binary::set_input_object): New function.
7045 (Sized_incremental_binary::input_object): New function.
7046 (Sized_incremental_binary::file_status_): Remove.
7047 (Sized_incremental_binary::input_objects_): New data member.
7048 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7049 references.
7050 (Sized_relobj_incr::invalid_address): Move to base class.
7051 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7052 class.
7053 (Sized_relobj_incr::do_output_section_offset): Likewise.
7054 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7055 (Sized_relobj_incr::section_offsets_): Likewise.
7056 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7057 function.
7058 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7059 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7060 with accessor function.
7061 (Sized_relobj_file::do_layout): Likewise.
7062 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7063 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7064 (Sized_relobj_file::compute_final_local_value): Replace refs to
7065 section_offsets_ with accessor function.
7066 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7067 * object.h (Relobj::Relobj): Initialize new data members.
7068 (Relobj::add_dyn_reloc): New function.
7069 (Relobj::first_dyn_reloc): New function.
7070 (Relobj::dyn_reloc_count): New function.
7071 (Relobj::first_dyn_reloc_): New data member.
7072 (Relobj::dyn_reloc_count_): New data member.
7073 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7074 references.
7075 (Sized_relobj::Address): New typedef.
7076 (Sized_relobj::invalid_address): Move here from child class.
7077 (Sized_relobj::Sized_relobj): Initialize new data members.
7078 (Sized_relobj::sized_relobj): New function.
7079 (Sized_relobj::is_output_section_offset_invalid): Move here from
7080 child class.
7081 (Sized_relobj::get_output_section_offset): Likewise.
7082 (Sized_relobj::local_has_got_offset): Likewise.
7083 (Sized_relobj::local_got_offset): Likewise.
7084 (Sized_relobj::set_local_got_offset): Likewise.
7085 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7086 (Sized_relobj::clear_got_offsets): New function.
7087 (Sized_relobj::section_offsets): Move here from child class.
7088 (Sized_relobj::do_output_section_offset): Likewise.
7089 (Sized_relobj::do_set_section_offset): Likewise.
7090 (Sized_relobj::Local_got_offsets): Likewise.
7091 (Sized_relobj::local_got_offsets_): Likewise.
7092 (Sized_relobj::section_offsets_): Likewise.
7093 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7094 references.
7095 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7096 class.
7097 (Sized_relobj_file::sized_relobj): New function
7098 (Sized_relobj_file::local_has_got_offset): Move to base class.
7099 (Sized_relobj_file::local_got_offset): Likewise.
7100 (Sized_relobj_file::set_local_got_offset): Likewise.
7101 (Sized_relobj_file::get_output_section_offset): Likewise.
7102 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7103 (Sized_relobj_file::do_output_section_offset): Likewise.
7104 (Sized_relobj_file::do_set_section_offset): Likewise.
7105 (Sized_relobj_file::Local_got_offsets): Likewise.
7106 (Sized_relobj_file::local_got_offsets_): Likewise.
7107 (Sized_relobj_file::section_offsets_): Likewise.
7108 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7109 (all constructors).
7110 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7111 (Output_reloc::get_symbol_index): Likewise.
7112 (Output_reloc::local_section_offset): Likewise.
7113 (Output_reloc::get_address): Likewise.
7114 (Output_reloc::symbol_value): Likewise.
7115 (Output_data_got::reserve_slot): Move to class definition.
7116 (Output_data_got::reserve_local): New function.
7117 (Output_data_got::reserve_slot_for_global): Remove.
7118 (Output_data_got::reserve_global): New function.
7119 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7120 (all constructors, two instantiations).
7121 (Output_reloc::get_relobj): New function (two instantiations).
7122 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7123 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7124 (Output_data_reloc::add_global): Adjust type of relobj.
7125 (Output_data_reloc::add_global_relative): Likewise.
7126 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7127 (Output_data_reloc::add_local): Likewise.
7128 (Output_data_reloc::add_local_relative): Likewise.
7129 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7130 (Output_data_reloc::add_local_section): Likewise.
7131 (Output_data_reloc::add_output_section): Likewise.
7132 (Output_data_reloc::add_absolute): Likewise.
7133 (Output_data_reloc::add_target_specific): Likewise.
7134 (Output_data_got::reserve_slot): Move definition here.
7135 (Output_data_got::reserve_local): New function.
7136 (Output_data_got::reserve_global): New function.
7137 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7138 section_offsets_ with accessor function.
7139 (Sized_relobj_file::write_sections): Likewise.
7140 (Sized_relobj_file::do_relocate_sections): Likewise.
7141 * target.h (Sized_target::reserve_local_got_entry): New function.
7142 (Sized_target::reserve_global_got_entry): New function.
7143 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7144 (Target_x86_64::reserve_global_got_entry): New function.
7145 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7146
4829d394
CC
71472011-05-23 Cary Coutant <ccoutant@google.com>
7148
7149 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7150 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7151 bit when checking got_type.
7152 * incremental.cc (Sized_incremental_binary::setup_readers):
7153 Store symbol table and string table locations; initialize bit vector
7154 of file status flags.
7155 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7156 unchanged files.
7157 (Sized_incremental_binary::do_process_got_plt): New function.
7158 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7159 (Output_section_incremental_inputs::set_final_data_size): Record
7160 file index for each input file.
7161 (Output_section_incremental_inputs::write_got_plt): Store file index
7162 instead of input entry offset for each GOT entry.
7163 * incremental.h
7164 (Incremental_input_entry::Incremental_input_entry): Initialize new
7165 data member.
7166 (Incremental_input_entry::set_offset): Store file index.
7167 (Incremental_input_entry::get_file_index): New function.
7168 (Incremental_input_entry::file_index_): New data member.
7169 (Incremental_binary::process_got_plt): New function.
7170 (Incremental_binary::do_process_got_plt): New function.
7171 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7172 data members.
7173 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7174 (Sized_incremental_binary::set_file_is_unchanged): New function.
7175 (Sized_incremental_binary::file_is_unchanged): New function.
7176 (Sized_incremental_binary::do_process_got_plt): New function.
7177 (Sized_incremental_binary::file_status_): New data member.
7178 (Sized_incremental_binary::main_symtab_loc_): New data member.
7179 (Sized_incremental_binary::main_strtab_loc_): New data member.
7180 * output.cc (Output_data_got::Got_entry::write): Add case
7181 RESERVED_CODE.
7182 (Output_data_got::add_global): Call add_got_entry.
7183 (Output_data_got::add_global_plt): Likewise.
7184 (Output_data_got::add_global_with_rel): Likewise.
7185 (Output_data_got::add_global_with_rela): Likewise.
7186 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7187 (Output_data_got::add_global_pair_with_rela): Likewise.
7188 (Output_data_got::add_local): Call add_got_entry.
7189 (Output_data_got::add_local_plt): Likewise.
7190 (Output_data_got::add_local_with_rel): Likewise.
7191 (Output_data_got::add_local_with_rela): Likewise.
7192 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7193 (Output_data_got::add_local_pair_with_rela): Likewise.
7194 (Output_data_got::reserve_slot): New function.
7195 (Output_data_got::reserve_slot_for_global): New function.
7196 (Output_data_got::add_got_entry): New function.
7197 (Output_data_got::add_got_entry_pair): New function.
7198 (Output_section::add_output_section_data): Edit FIXME.
7199 * output.h
7200 (Output_section_data_build::Output_section_data_build): New
7201 constructor with size parameter.
7202 (Output_data_space::Output_data_space): Likewise.
7203 (Output_data_got::Output_data_got): Initialize new data member; new
7204 constructor with size parameter.
7205 (Output_data_got::add_constant): Call add_got_entry.
7206 (Output_data_got::reserve_slot): New function.
7207 (Output_data_got::reserve_slot_for_global): New function.
7208 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7209 (Output_data_got::add_got_entry): New function.
7210 (Output_data_got::add_got_entry_pair): New function.
7211 (Output_data_got::free_list_): New data member.
7212 * target.h (Sized_target::init_got_plt_for_update): New function.
7213 (Sized_target::register_global_plt_entry): New function.
7214 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7215 Initialize new data member; call init; add constructor with PLT count.
7216 (Output_data_plt_x86_64::init): New function.
7217 (Output_data_plt_x86_64::add_relocation): New function.
7218 (Output_data_plt_x86_64::reserve_slot): New function.
7219 (Output_data_plt_x86_64::free_list_): New data member.
7220 (Target_x86_64::init_got_plt_for_update): New function.
7221 (Target_x86_64::register_global_plt_entry): New function.
7222 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7223 incremental updates.
7224 (Output_data_plt_x86_64::add_relocation): New function.
7225 * testsuite/object_unittest.cc (Object_test): Set default options.
7226
ec69d6da
ILT
72272011-05-16 Ian Lance Taylor <iant@google.com>
7228
7229 * options.h (class General_options): Make -i a synonym for -r.
7230
732e31de
ILT
72312011-05-16 Ian Lance Taylor <iant@google.com>
7232
7233 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7234
403676b5
CC
72352011-05-10 Cary Coutant <ccoutant@google.com>
7236
7237 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7238 strip_all (-s).
7239
5b7b7d6e
ILT
72402011-05-06 Ian Lance Taylor <iant@google.com>
7241
7242 * layout.cc (Layout::layout): If the output section flags change,
7243 update the ordering.
7244
f0f9babf
CC
72452011-04-25 Cary Coutant <ccoutant@google.com>
7246
7247 * incremental-dump.cc (dump_incremental_inputs): Print local
7248 symbol info for each input file.
7249 * incremental.cc
7250 (Output_section_incremental_inputs::set_final_data_size): Add local
7251 symbol info to input file entries in incremental info.
7252 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7253 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7254 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7255 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7256 implementation.
7257 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7258 (Sized_incr_relobj::do_relocate): Write the local symbols.
7259 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7260 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7261 Adjust size of input file header.
7262 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7263 (Incremental_inputs_reader::get_local_symbol_count): New function.
7264 (Incremental_inputs_reader::get_input_section): Adjust size of input
7265 file header.
7266 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7267 (Sized_incr_relobj::This): New typedef.
7268 (Sized_incr_relobj::sym_size): New const data member.
7269 (Sized_incr_relobj::Local_symbol): New struct.
7270 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7271 (Sized_incr_relobj::do_local_symbol_offset): New function.
7272 (Sized_incr_relobj::local_symbol_count_): New data member.
7273 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7274 (Sized_incr_relobj::local_symbol_index_): New data member.
7275 (Sized_incr_relobj::local_symbol_offset_): New data member.
7276 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7277 (Sized_incr_relobj::local_symbols_): New data member.
7278 * object.h (Relobj::output_local_symbol_count): New function.
7279 (Relobj::local_symbol_offset): New function.
7280 (Relobj::do_output_local_symbol_count): New function.
7281 (Relobj::do_local_symbol_offset): New function.
7282 (Sized_relobj::do_output_local_symbol_count): New function.
7283 (Sized_relobj::do_local_symbol_offset): New function.
7284
d0a9ace3
ILT
72852011-04-22 Vladimir Simonov <sv@sw.ru>
7286
7287 * descriptors.cc (set_close_on_exec): New function.
7288 (Descriptors::open): Use set_close_on_exec.
7289 * output.cc (S_ISLNK): Define if not defined.
7290
94a3fc8b
CC
72912011-04-22 Cary Coutant <ccoutant@google.com>
7292
7293 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7294 global symbol map.
7295 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7296 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7297 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7298 relocations.
7299 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7300 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7301 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7302 * incremental.h
7303 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7304 function.
7305 (Incremental_binary::apply_incremental_relocs): New function.
7306 (Incremental_binary::do_apply_incremental_relocs): New function.
7307 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7308 data member.
7309 (Sized_incremental_binary::add_global_symbol): New function.
7310 (Sized_incremental_binary::global_symbol): New function.
7311 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7312 (Sized_incremental_binary::symbol_map_): New data member.
7313 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7314 * target.h (Sized_target::apply_relocation): New function.
7315 * target-reloc.h (apply_relocation): New function.
7316 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7317
c87e4302
DK
73182011-04-22 Doug Kwan <dougkwan@google.com>
7319
7320 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7321 flag of a SHT_ARM_EXIDX section.
2e702c99 7322 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7323 * testsuite/Makefile.in: Regenerate.
7324 * testsuite/arm_exidx_test.s: New file.
7325 * testsuite/arm_exidx_test.sh: Same.
7326
e7782cf6
CC
73272011-04-20 Cary Coutant <ccoutant@google.com>
7328
7329 PR gold/12689
7330 * archive.h (Incremental_archive_entry::Archive_member):
7331 Initialize arg_serial_ (second constructor).
7332
308ecdc7
ILT
73332011-04-17 Ian Lance Taylor <iant@google.com>
7334
7335 * object.cc (Relocate_info::location): Simplify location string.
7336 * errors.cc (Errors::error_at_location): Don't print program
7337 name.
7338 (Errors::warning_at_location): Likewise.
7339 (Errors::undefined_symbol): Likewise.
7340 * testsuite/debug_msg.sh: Update accordingly.
7341
bec5b579
CC
73422011-04-14 Cary Coutant <ccoutant@google.com>
7343
7344 * gold/layout.cc (Layout::symtab_section_offset): New function.
7345 * gold/layout.h (Layout::symtab_section_offset): New function.
7346 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7347
88597d34
ILT
73482011-04-12 Ian Lance Taylor <iant@google.com>
7349
7350 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7351 with MREMAP_MAYMOVE.
7352 * output.h (class Output_file): Add map_is_allocated_ field.
7353 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7354 not available, provide stubs. If mremap is not available, #define
7355 it to gold_mremap.
7356 (MREMAP_MAYMOVE): Define if not defined.
7357 (Output_file::Output_file): Initialize map_is_allocated_.
7358 (Output_file::resize): Check map_is_allocated_.
7359 (Output_file::map_anonymous): If mmap fails, use malloc.
7360 (Output_file::unmap): Don't do anything for an anonymous map.
7361 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7362 is not available, provide stubs.
7363 (File_read::View::~View): Use free rather than delete[].
7364 (File_read::make_view): Use malloc rather than new[]. If mmap
7365 fails, use malloc.
7366 (File_read::find_or_make_view): Use malloc rather than new[].
7367 * gold.h: Remove HAVE_REMAP code.
7368 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7369 exists. Rename mremap to gold_mremap. If mmap is not available
7370 don't do anything.
7371 * configure, config.in: Rebuild.
7372
11e361bc
ILT
73732011-04-11 Ian Lance Taylor <iant@google.com>
7374
7375 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7376 initialize local variable v.
7377
cdc29364
CC
73782011-04-11 Cary Coutant <ccoutant@google.com>
7379
7380 * archive.cc (Archive::include_member): Adjust call to
7381 report_object.
7382 (Add_archive_symbols::run): Track argument serial numbers.
7383 (Lib_group::include_member): Likewise.
7384 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7385 * archive.h (Incremental_archive_entry::Archive_member):
7386 Initialize arg_serial_.
7387 (Archive_member::arg_serial_): New data member.
7388 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7389 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7390 incremental link.
7391 (Sized_dynobj::do_for_all_local_got_entries): New function.
7392 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7393 function.
7394 * fileread.cc (get_mtime): New function.
7395 * fileread.h (get_mtime): New function.
7396 * gold.cc (queue_initial_tasks): Check for incremental update.
7397 (process_incremental_input): New function.
7398 (queue_middle_tasks): Don't force valid target for incremental
7399 update.
7400 * incremental-dump.cc (find_input_containing_global): Adjust
7401 size of symbol info entry.
7402 (dump_incremental_inputs): Dump argument serial number and
7403 in_system_directory flag; bias shndx by 1; print symbol names
7404 when dumping per-file symbol lists; use new symbol info readers.
7405 * incremental.cc
7406 (Output_section_incremental_inputs:update_data_size): New function.
7407 (Sized_incremental_binary::setup_readers): Setup input readers
7408 for each input file; build maps for files added from libraries
7409 and scripts.
7410 (Sized_incremental_binary::check_input_args): New function.
7411 (Sized_incremental_binary::do_check_inputs): Build map of argument
7412 serial numbers to input arguments.
7413 (Sized_incremental_binary::do_file_has_changed): Rename
7414 do_file_is_unchanged to this; compare file modification times.
7415 (Sized_incremental_binary::do_init_layout): New function.
7416 (Sized_incremental_binary::do_reserve_layout): New function.
7417 (Sized_incremental_binary::do_get_input_reader): Remove.
7418 (Sized_incremental_binary::get_symtab_view): New function.
7419 (Incremental_checker::can_incrementally_link_output_file): Remove.
7420 (Incremental_inputs::report_command_line): Exclude --debug options.
7421 (Incremental_inputs::report_archive_begin): Add parameter; track
7422 argument serial numbers; don't put input file entry for archive
7423 before archive members.
7424 (Incremental_inputs::report_archive_end): Put input file entry
7425 for archive after archive members.
7426 (Incremental_inputs::report_object): Add parameter; track argument
7427 serial numbers and in_system_directory flag.
7428 (Incremental_inputs::report_script): Add parameter; track argument
7429 serial numbers.
7430 (Output_section_incremental_inputs::set_final_data_size): Adjust
7431 size of symbol info entry; check for forwarding symbols.
7432 (Output_section_incremental_inputs::write_input_files): Write
7433 in_system_directory flag and argument serial number.
7434 (Output_section_incremental_inputs::write_info_blocks): Map section
7435 indices between incremental info and original input file; store
7436 input section index for each symbol.
7437 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7438 change operator() to visit().
7439 (class Global_got_offset_visitor): Likewise.
7440 (class Global_symbol_visitor_got_plt):
7441 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7442 classes.
7443 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7444 (Sized_incr_relobj::do_read_symbols): New function.
7445 (Sized_incr_relobj::do_layout): New function.
7446 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7447 (Sized_incr_relobj::do_add_symbols): New function.
7448 (Sized_incr_relobj::do_should_include_member): New function.
7449 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7450 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7451 (Sized_incr_relobj::do_section_size): New function.
7452 (Sized_incr_relobj::do_section_name): New function.
7453 (Sized_incr_relobj::do_section_contents): New function.
7454 (Sized_incr_relobj::do_section_flags): New function.
7455 (Sized_incr_relobj::do_section_entsize): New function.
7456 (Sized_incr_relobj::do_section_address): New function.
7457 (Sized_incr_relobj::do_section_type): New function.
7458 (Sized_incr_relobj::do_section_link): New function.
7459 (Sized_incr_relobj::do_section_info): New function.
7460 (Sized_incr_relobj::do_section_addralign): New function.
7461 (Sized_incr_relobj::do_initialize_xindex): New function.
7462 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7463 (Sized_incr_relobj::do_read_relocs): New function.
7464 (Sized_incr_relobj::do_gc_process_relocs): New function.
7465 (Sized_incr_relobj::do_scan_relocs): New function.
7466 (Sized_incr_relobj::do_count_local_symbols): New function.
7467 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7468 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7469 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7470 (Sized_incr_relobj::do_relocate): New function.
7471 (Sized_incr_relobj::do_set_section_offset): New function.
7472 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7473 (Sized_incr_dynobj::do_read_symbols): New function.
7474 (Sized_incr_dynobj::do_layout): New function.
7475 (Sized_incr_dynobj::do_add_symbols): New function.
7476 (Sized_incr_dynobj::do_should_include_member): New function.
7477 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7478 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7479 (Sized_incr_dynobj::do_section_size): New function.
7480 (Sized_incr_dynobj::do_section_name): New function.
7481 (Sized_incr_dynobj::do_section_contents): New function.
7482 (Sized_incr_dynobj::do_section_flags): New function.
7483 (Sized_incr_dynobj::do_section_entsize): New function.
7484 (Sized_incr_dynobj::do_section_address): New function.
7485 (Sized_incr_dynobj::do_section_type): New function.
7486 (Sized_incr_dynobj::do_section_link): New function.
7487 (Sized_incr_dynobj::do_section_info): New function.
7488 (Sized_incr_dynobj::do_section_addralign): New function.
7489 (Sized_incr_dynobj::do_initialize_xindex): New function.
7490 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7491 (make_sized_incremental_object): New function.
7492 (Incremental_library::copy_unused_symbols): New function.
7493 (Incremental_library::do_for_all_unused_symbols): New function.
7494 * incremental.h (enum Incremental_input_flags): New type.
7495 (class Incremental_checker): Remove.
7496 (Incremental_input_entry::Incremental_input_entry): Add argument
7497 serial number.
7498 (Incremental_input_entry::arg_serial): New function.
7499 (Incremental_input_entry::set_is_in_system_directory): New function.
7500 (Incremental_input_entry::is_in_system_directory): New function.
7501 (Incremental_input_entry::arg_serial_): New data member.
7502 (Incremental_input_entry::is_in_system_directory_): New data member.
7503 (class Script_info): Move here from script.h.
7504 (Script_info::Script_info): Add filename parameter.
7505 (Script_info::filename): New function.
7506 (Script_info::filename_): New data member.
7507 (Incremental_script_entry::Incremental_script_entry): Add argument
7508 serial number.
7509 (Incremental_object_entry::Incremental_object_entry): Likewise.
7510 (Incremental_object_entry::add_input_section): Build list of input
7511 sections with map to original shndx.
7512 (Incremental_object_entry::get_input_section_index): New function.
7513 (Incremental_object_entry::shndx_): New data member.
7514 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7515 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7516 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7517 serial number.
7518 (Incremental_inputs::report_archive_begin): Likewise.
7519 (Incremental_inputs::report_object): Likewise.
7520 (Incremental_inputs::report_script): Likewise.
7521 (class Incremental_global_symbol_reader): New class.
7522 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7523 and store flags and input file type.
7524 (Incremental_input_entry_reader::arg_serial): New function.
7525 (Incremental_input_entry_reader::type): Extract type from flags.
7526 (Incremental_input_entry_reader::is_in_system_directory): New function.
7527 (Incremental_input_entry_reader::get_input_section_count): Call
7528 accessor function for type.
7529 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7530 function for type; adjust size of global symbol entry.
7531 (Incremental_input_entry_reader::get_global_symbol_count): Call
7532 accessor function for type.
7533 (Incremental_input_entry_reader::get_object_count): Likewise.
7534 (Incremental_input_entry_reader::get_object_offset): Likewise.
7535 (Incremental_input_entry_reader::get_member_count): Likewise.
7536 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7537 (Incremental_input_entry_reader::get_member_offset): Likewise.
7538 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7539 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7540 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7541 (Incremental_input_entry_reader::get_global_symbol_reader): New
7542 function.
7543 (Incremental_input_entry_reader::get_output_symbol_index): New
7544 function.
7545 (Incremental_input_entry_reader::type_): Remove.
7546 (Incremental_input_entry_reader::flags_): New data member.
7547 (Incremental_inputs_reader::input_file_offset): New function.
7548 (Incremental_inputs_reader::input_file_index): New function.
7549 (Incremental_inputs_reader::input_file): Call input_file_offset.
7550 (Incremental_inputs_reader::input_file_at_offset): New function.
7551 (Incremental_relocs_reader::get_r_type): Reformat.
7552 (Incremental_relocs_reader::get_r_shndx): Reformat.
7553 (Incremental_relocs_reader::get_r_offset): Reformat.
7554 (Incremental_relocs_reader::data): New function.
7555 (Incremental_binary::Incremental_binary): Initialize new data members.
7556 (Incremental_binary::check_inputs): Add cmdline parameter.
7557 (Incremental_binary::file_is_unchanged): Remove.
7558 (Input_reader::arg_serial): New function.
7559 (Input_reader::get_unused_symbol_count): New function.
7560 (Input_reader::get_unused_symbol): New function.
7561 (Input_reader::do_arg_serial): New function.
7562 (Input_reader::do_get_unused_symbol_count): New function.
7563 (Input_reader::do_get_unused_symbol): New function.
7564 (Incremental_binary::input_file_count): New function.
7565 (Incremental_binary::get_input_reader): Change signature to use
7566 index instead of filename.
7567 (Incremental_binary::file_has_changed): New function.
7568 (Incremental_binary::get_input_argument): New function.
7569 (Incremental_binary::get_library): New function.
7570 (Incremental_binary::get_script_info): New function.
7571 (Incremental_binary::init_layout): New function.
7572 (Incremental_binary::reserve_layout): New function.
7573 (Incremental_binary::output_file): New function.
7574 (Incremental_binary::do_check_inputs): New function.
7575 (Incremental_binary::do_file_is_unchanged): Remove.
7576 (Incremental_binary::do_file_has_changed): New function.
7577 (Incremental_binary::do_init_layout): New function.
7578 (Incremental_binary::do_reserve_layout): New function.
7579 (Incremental_binary::do_input_file_count): New function.
7580 (Incremental_binary::do_get_input_reader): Change signature.
7581 (Incremental_binary::input_args_map_): New data member.
7582 (Incremental_binary::library_map_): New data member.
7583 (Incremental_binary::script_map_): New data member.
7584 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7585 new data members.
7586 (Sized_incremental_binary::output_section): New function.
7587 (Sized_incremental_binary::inputs_reader): Add const.
7588 (Sized_incremental_binary::symtab_reader): Add const.
7589 (Sized_incremental_binary::relocs_reader): Add const.
7590 (Sized_incremental_binary::got_plt_reader): Add const.
7591 (Sized_incremental_binary::get_symtab_view): New function.
7592 (Sized_incremental_binary::Inputs_reader): New typedef.
7593 (Sized_incremental_binary::Input_entry_reader): New typedef.
7594 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7595 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7596 (Sized_incremental_binary::do_file_has_changed): New function.
7597 (Sized_incremental_binary::do_init_layout): New function.
7598 (Sized_incremental_binary::do_reserve_layout): New function.
7599 (Sized_input_reader::Inputs_reader): Remove.
7600 (Sized_input_reader::Input_entry_reader): Remove.
7601 (Sized_input_reader::do_arg_serial): New function.
7602 (Sized_input_reader::do_get_unused_symbol_count): New function.
7603 (Sized_input_reader::do_get_unused_symbol): New function.
7604 (Sized_incremental_binary::do_input_file_count): New function.
7605 (Sized_incremental_binary::do_get_input_reader): Change signature;
7606 use index instead of filename.
7607 (Sized_incremental_binary::section_map_): New data member.
7608 (Sized_incremental_binary::input_entry_readers_): New data member.
7609 (class Sized_incr_relobj): New class.
7610 (class Sized_incr_dynobj): New class.
7611 (make_sized_incremental_object): New function.
7612 (class Incremental_library): New class.
7613 * layout.cc (Free_list::num_lists): New static data member.
7614 (Free_list::num_nodes): New static data member.
7615 (Free_list::num_removes): New static data member.
7616 (Free_list::num_remove_visits): New static data member.
7617 (Free_list::num_allocates): New static data member.
7618 (Free_list::num_allocate_visits): New static data member.
7619 (Free_list::init): New function.
7620 (Free_list::remove): New function.
7621 (Free_list::allocate): New function.
7622 (Free_list::dump): New function.
7623 (Free_list::print_stats): New function.
7624 (Layout_task_runner::run): Resize output file for incremental updates.
7625 (Layout::Layout): Initialize new data members.
7626 (Layout::set_incremental_base): New function.
7627 (Layout::init_fixed_output_section): New function.
7628 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7629 incremental updates.
7630 (Layout::create_gold_note): Do not create gold note section for
7631 incremental updates.
7632 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7633 for incremental updates.
7634 (Layout::set_section_offsets): For incremental updates, allocate space
7635 from free list.
7636 (Layout::create_symtab_sections): Layout with offsets relative to
7637 start of section; for incremental updates, allocate space from free
7638 list.
7639 (Layout::create_shdrs): For incremental updates, allocate space from
7640 free list.
7641 (Layout::finish_dynamic_section): For incremental updates, do not
7642 check --as-needed (fixed in subsequent patch).
7643 * layout.h (class Free_list): New class.
7644 (Layout::set_incremental_base): New function.
7645 (Layout::incremental_base): New function.
7646 (Layout::init_fixed_output_section): New function.
7647 (Layout::allocate): New function.
7648 (Layout::incremental_base_): New data member.
7649 (Layout::free_list_): New data member.
7650 * main.cc (main): Print Free_list statistics.
7651 * object.cc (Relobj::finalize_incremental_relocs): Add
7652 clear_counts parameter; clear counts only when clear_counts is set.
7653 (Sized_relobj::Sized_relobj): Initialize new base class.
7654 (Sized_relobj::do_layout): Don't report special sections.
7655 (Sized_relobj::do_for_all_local_got_entries): New function.
7656 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7657 symtab_off to all symbol table offsets.
7658 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7659 * object.h (class Got_offset_list): Move to top of file.
7660 (Object::Object): Allow case where input_file == NULL.
7661 (Object::~Object): Likewise.
7662 (Object::input_file): Assert that input_file != NULL.
7663 (Object::lock): Allow case where input_file == NULL.
7664 (Object::unlock): Likewise.
7665 (Object::is_locked): Likewise.
7666 (Object::token): Likewise.
7667 (Object::release): Likewise.
7668 (Object::is_incremental): New function.
7669 (Object::get_mtime): New function.
7670 (Object::for_all_local_got_entries): New function.
7671 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7672 (Object::set_is_in_system_directory): New function.
7673 (Object::is_in_system_directory): New function.
7674 (Object::do_is_incremental): New function.
7675 (Object::do_get_mtime): New function.
7676 (Object::do_for_all_local_got_entries): New function.
7677 (Object::is_in_system_directory_): New data member.
7678 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7679 (class Sized_relobj_base): New class.
7680 (class Sized_relobj): Derive from Sized_relobj_base.
7681 (class Sized_relobj::Symbols): Redeclare from base class.
7682 (class Sized_relobj::local_got_offset_list): Remove.
7683 (class Sized_relobj::Output_sections): Redeclare from base class.
7684 (class Sized_relobj::do_for_all_local_got_entries): New function.
7685 (class Sized_relobj::write_local_symbols): Add offset parameter.
7686 (class Sized_relobj::local_symbol_offset_): Update comment.
7687 (class Sized_relobj::local_dynsym_offset_): Update comment.
7688 * options.cc (Input_arguments::add_file): Remove const.
7689 * options.h (Input_file_argument::Input_file_argument):
7690 Initialize arg_serial_ (all constructors).
7691 (Input_file_argument::set_arg_serial): New function.
7692 (Input_file_argument::arg_serial): New function.
7693 (Input_file_argument::arg_serial_): New data member.
7694 (Input_arguments::Input_arguments): Initialize file_count_.
7695 (Input_arguments::add_file): Remove const.
7696 (Input_arguments::number_of_input_files): New function.
7697 (Input_arguments::file_count_): New data member.
7698 (Command_line::number_of_input_files): Call
7699 Input_arguments::number_of_input_files.
7700 * output.cc (Output_segment_headers::Output_segment_headers):
7701 Set current size.
7702 (Output_section::Input_section::current_data_size): New function.
7703 (Output_section::Output_section): Initialize new data members.
7704 (Output_section::add_input_section): Don't do merge sections for
7705 an incremental link; allocate space from free list for an
7706 incremental update.
7707 (Output_section::add_output_section_data): Allocate space from
7708 free list for an incremental update.
7709 (Output_section::update_data_size): New function.
7710 (Output_section::set_fixed_layout): New function.
7711 (Output_section::reserve): New function.
7712 (Output_segment::set_section_addresses): Remove const.
7713 (Output_segment::set_section_list_addresses): Remove const; allocate
7714 space from free list for an incremental update.
7715 (Output_segment::set_offset): Adjust size of RELRO segment for an
7716 incremental update.
7717 * output.h (Output_data::current_data_size): Move here from
7718 child classes.
7719 (Output_data::pre_finalize_data_size): New function.
7720 (Output_data::update_data_size): New function.
7721 (Output_section_headers::update_data_size): new function.
7722 (Output_section_data_build::current_data_size): Move to Output_data.
7723 (Output_data_strtab::update_data_size): New function.
7724 (Output_section::current_data_size): Move to Output_data.
7725 (Output_section::set_fixed_layout): New function.
7726 (Output_section::has_fixed_layout): New function.
7727 (Output_section::reserve): New function.
7728 (Output_section::update_data_size): New function.
7729 (Output_section::has_fixed_layout_): New data member.
7730 (Output_section::free_list_): New data member.
7731 (Output_segment::set_section_addresses): Remove const.
7732 (Output_segment::set_section_list_addresses): Remove const.
7733 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7734 New function.
7735 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7736 New function.
7737 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7738 parameter when calling Add_symbols constructor; store argument
7739 serial number for members of a lib group.
7740 (Add_symbols::locks): Allow case where token == NULL.
7741 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7742 (Read_member::~Read_member): New function.
7743 (Read_member::is_runnable): New function.
7744 (Read_member::locks): New function.
7745 (Read_member::run): New function.
7746 (Check_script::~Check_script): New function.
7747 (Check_script::is_runnable): New function.
7748 (Check_script::locks): New function.
7749 (Check_script::run): New function.
7750 (Check_library::~Check_library): New function.
7751 (Check_library::is_runnable): New function.
7752 (Check_library::locks): New function.
7753 (Check_library::run): New function.
7754 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7755 (Add_symbols::library_): New data member.
7756 (class Read_member): New class.
7757 (class Check_script): New class.
7758 (class Check_library): New class.
7759 * reloc.cc (Read_relocs::is_runnable): Allow case where
7760 token == NULL.
7761 (Read_relocs::locks): Likewise.
7762 (Scan_relocs::locks): Likewise.
7763 (Relocate_task::locks): Likewise.
7764 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7765 to clear counters.
7766 (Sized_relobj::incremental_relocs_scan): Fix comment.
7767 (Sized_relobj::do_relocate): Pass output file offset to
7768 write_local_symbols.
7769 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7770 from class declaration.
7771 * script.cc (read_input_script): Allocate Script_info; pass
7772 argument serial number to report_script.
7773 * script.h (class Script_info): Move to incremental.h.
7774 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7775 * symtab.h (Symbol_table::add_from_incrobj): New function.
7776 (Symbol_table::set_file_offset): New function.
7777
b961d0d7
CC
77782011-04-05 Cary Coutant <ccoutant@google.com>
7779
7780 * incremental-dump.cc (dump_incremental_inputs): Change signature
7781 to take a Sized_incremental_binary; change caller. Use readers
7782 in Sized_incremental_binary.
7783 * incremental.cc
7784 (Sized_incremental_binary::find_incremental_inputs_sections):
7785 Rename do_find_incremental_inputs_sections to this.
7786 (Sized_incremental_binary::setup_readers): New function.
7787 (Sized_incremental_binary::do_check_inputs): Check
7788 has_incremental_info_ flag; move setup code to setup_readers;
7789 use input readers.
7790 (Sized_incremental_binary::do_file_is_unchanged): New function.
7791 (Sized_incremental_binary::do_get_input_reader): New function.
7792 * incremental.h (class Incremental_binary): Move to end of file.
7793 (Incremental_binary::file_is_unchanged): New function.
7794 (Incremental_binary::do_file_is_unchanged): New function.
7795 (Incremental_binary::Input_reader): New class.
7796 (Incremental_binary::get_input_reader): New function.
7797 (class Sized_incremental_binary): Move to end of file.
7798 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7799 input section reader classes.
7800 (Sized_incremental_binary::has_incremental_info): New function.
7801 (Sized_incremental_binary::inputs_reader): New function.
7802 (Sized_incremental_binary::symtab_reader): New function.
7803 (Sized_incremental_binary::relocs_reader): New function.
7804 (Sized_incremental_binary::got_plt_reader): New function.
7805 (Sized_incremental_binary::do_file_is_unchanged): New function.
7806 (Sized_incremental_binary::Sized_input_reader): New class.
7807 (Sized_incremental_binary::get_input_reader): New function.
7808 (Sized_incremental_binary::find_incremental_inputs_sections):
7809 Rename do_find_incremental_inputs_sections to this.
7810 (Sized_incremental_binary::setup_readers): New function.
7811 (Sized_incremental_binary::has_incremental_info_): New data member.
7812 (Sized_incremental_binary::inputs_reader_): New data member.
7813 (Sized_incremental_binary::symtab_reader_): New data member.
7814 (Sized_incremental_binary::relocs_reader_): New data member.
7815 (Sized_incremental_binary::got_plt_reader_): New data member.
7816 (Sized_incremental_binary::current_input_file_): New data member.
7817
a869183f
PP
78182011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7819
7820 PR gold/12640
7821 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7822 violation.
7823
78242011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7825
7826 * archive.cc (Archive::include_member): Adjust call to report_object.
7827 (Add_archive_symbols::run): Add script_info to call to
7828 report_archive_begin.
7829 (Lib_group::include_member): Adjust call to report_object.
7830 (Add_lib_group_symbols::run): Adjust call to report_object.
7831 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7832 blocks. Add object count for script input files.
7833 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7834 script_info parameter; change all callers.
7835 (Incremental_inputs::report_object): Add script_info parameter;
7836 change all callers.
7837 (Incremental_inputs::report_script): Store backpointer to
7838 incremental info entry.
7839 (Output_section_incremental_inputs::set_final_data_size): Record
7840 additional information for scripts.
7841 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7842 * incremental.h (Incremental_script_entry::add_object): New function.
7843 (Incremental_script_entry::get_object_count): New function.
7844 (Incremental_script_entry::get_object): New function.
7845 (Incremental_script_entry::objects_): New data member; adjust
7846 constructor.
7847 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7848 (Incremental_inputs::report_object): Add script_info parameter.
7849 (Incremental_inputs_reader::get_object_count): New function.
7850 (Incremental_inputs_reader::get_object_offset): New function.
7851 * options.cc (Input_arguments::add_file): Return reference to
7852 new input argument.
7853 * options.h (Input_argument::set_script_info): New function.
7854 (Input_argument::script_info): New function.
7855 (Input_argument::script_info_): New data member; adjust all
7856 constructors.
7857 (Input_file_group::add_file): Return reference to new input argument.
7858 (Input_file_lib::add_file): Likewise.
7859 (Input_arguments::add_file): Likewise.
7860 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7861 * script.cc (Parser_closure::Parser_closure): Add script_info
7862 parameter; adjust all callers.
7863 (Parser_closure::script_info): New function.
7864 (Parser_closure::script_info_): New data member.
7865 (read_input_script): Report scripts earlier to incremental info.
7866 (script_add_file): Set script_info in Input_argument.
7867 (script_add_library): Likewise.
7868 * script.h (Script_options::Script_info): Rewrite class.
7869
a869183f 78702011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7871
7872 * archive.cc (Library_base::should_include_member): Move
7873 method here from class Archive.
7874 (Archive::Archive): Initialize base class.
7875 (Archive::should_include_member): Move to base class.
7876 (Archive::do_for_all_unused_symbols): New function.
7877 (Add_archive_symbols::run): Remove redundant access to
7878 incremental_inputs.
7879 (Lib_group::Lib_group): Initialize base class.
7880 (Lib_group::do_filename): New function.
7881 (Lib_group::include_member): Pass pointer to Lib_group to
7882 report_object.
7883 (Lib_group::do_for_all_unused_symbols): New function.
7884 (Add_lib_group_symbols::run): Report archive information for
7885 incremental links.
7886 * archive.h (class Library_base): New base class.
7887 (class Archive): Derive from Library_base.
7888 (Archive::filename): Move to base class.
7889 (Archive::set_incremental_info): Likewise.
7890 (Archive::incremental_info): Likewise.
7891 (Archive::Should_include): Likewise.
7892 (Archive::should_include_member): Likewise.
7893 (Archive::Armap_entry): Remove.
7894 (Archive::Unused_symbol_iterator): Remove.
7895 (Archive::unused_symbols_begin): Remove.
7896 (Archive::unused_symbols_end): Remove.
7897 (Archive::do_filename): New function.
7898 (Archive::do_get_mtime): New function.
7899 (Archive::do_for_all_unused_symbols): New function.
7900 (Archive::task_): Move to base class.
7901 (Archive::incremental_info_): Likewise.
7902 (class Lib_group): Derive from Library_base.
7903 (Lib_group::do_filename): New function.
7904 (Lib_group::do_get_mtime): New function.
7905 (Lib_group::do_for_all_unused_symbols): New function.
7906 (Lib_group::task_): Move to base class.
7907 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7908 function.
7909 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7910 function.
7911 * incremental.cc (Incremental_inputs::report_archive_begin):
7912 Use Library_base; call library's get_mtime; add incremental inputs
7913 entry before members.
7914 (class Unused_symbol_visitor): New class.
7915 (Incremental_inputs::report_archive_end): Use Library_base; use
7916 visitor class to record unused symbols; don't add incremental inputs
7917 entry after members.
7918 (Incremental_inputs::report_object): Use Library_base.
7919 * incremental.h
7920 (Incremental_archive_entry::Incremental_archive_entry): Remove
7921 unused Archive parameter.
7922 (Incremental_inputs::report_archive_begin): Use Library_base.
7923 (Incremental_inputs::report_archive_end): Likewise.
7924 (Incremental_inputs::report_object): Likewise.
7925 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7926 function.
7927 * object.h (Object::for_all_global_symbols): New function.
7928 (Object::do_for_all_global_symbols): New function.
7929 (Sized_relobj::do_for_all_global_symbols): New function.
7930 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7931 function.
7932 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7933 function.
7934
61ab3e40
ILT
79352011-03-27 Ian Lance Taylor <iant@google.com>
7936
7937 * archive.cc (Archive::interpret_header): Return -1 if something
7938 goes wrong. Change callers accordingly.
7939
30e1f9e6
CC
79402011-03-25 Cary Coutant <ccoutant@google.com>
7941
7942 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7943 * testsuite/Makefile.in: Regenerate.
7944
9370ce59 79452011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7946
7947 * plugin.cc (get_view): New.
7948 (Plugin::load): Pass get_view to the plugin.
7949 (Plugin_manager::get_view): New.
7950
9312bb0a
ILT
79512011-03-21 Ian Lance Taylor <iant@google.com>
7952
7953 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7954 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7955
7e12ba9e
ST
79562011-03-21 Sriraman Tallam <tmsriram@google.com>
7957
7958 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7959 Change == to -eq.
7960 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7961 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7962 Change == to -eq.
7963 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7964 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7965
fd7a005d
ILT
79662011-03-14 Ian Lance Taylor <iant@google.com>
7967
7968 * script-sections.cc (Sort_output_sections::script_compare):
7969 Rename from is_before, change return type.
7970 (Sort_output_sections::operator()): Adjust accordingly.
7971
ed16fd1b
ILT
79722011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7973
7974 PR gold/12572
7975 * testsuite/odr_violation2.cc: Add comment to make all error line
7976 numbers double digits.
7977 * testsuite/debug_msg.sh: Adjust expected errors.
7978
71ff8986
ILT
79792011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7980
7981 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7982 but mark earlier ones as non-canonical
7983 (offset_to_iterator): Update search target and example
7984 (do_addr2line): Return extra lines in a vector*
7985 (format_file_lineno): Extract from do_addr2line
7986 (one_addr2line): Add vector* out-param
7987 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7988 when a lineno entry appeared last for its instruction
7989 (Dwarf_line_info): Add vector* out-param
7990 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7991 * symtab.cc (Odr_violation_compare): Include the lineno in the
7992 comparison again.
7993 (linenos_from_loc): New. Combine the canonical line for an
7994 address with its other lines.
7995 (True_if_intersect): New. Helper functor to make
7996 std::set_intersection a query.
7997 (detect_odr_violations): Compare sets of lines instead of just
7998 one line for each function. This became less deterministic, but
7999 has fewer false positives.
8000 * symtab.h: Declarations.
8001 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8002 mix an optimized and non-optimized object in the same binary
8003 (odr_violation2.so): Same.
8004 * testsuite/Makefile.in: Regenerate from Makefile.am.
8005 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8006 * testsuite/debug_msg.sh: Update line numbers and add
8007 assertions.
8008 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8009 non-optimized context.
8010 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8011 isn't inlined, and use OdrDerived in an optimized context.
8012 * testsuite/odr_header1.h: Defines OdrDerived, where
8013 optimization will change the
8014 first-instruction-in-the-destructor's file and line number.
8015 * testsuite/odr_header2.h: Defines OdrBase.
8016
a19fefdc
ILT
80172011-03-09 Ian Lance Taylor <iant@google.com>
8018
8019 * fileread.cc (File_read::clear_views): Don't delete the whole
8020 file view.
8021
ecb351e9
ILT
80222011-03-08 Ian Lance Taylor <iant@google.com>
8023
8024 PR gold/12525
8025 * fileread.cc: #include <climits>.
8026 (GOLD_IOV_MAX): Define.
8027 (File_read::read_multiple): Limit number of entries by iov_max.
8028 * fileread.h (class File_read): Always set max_readv_entries to
8029 128.
8030
b821d13c
ILT
80312011-03-07 Ian Lance Taylor <iant@google.com>
8032
8033 PR gold/12525
8034 * options.h (class General_options): Add -dy and -dn.
8035
89243142
CC
80362011-03-02 Cary Coutant <ccoutant@google.com>
8037
8038 * testsuite/script_test_9.t: Add TLS segment.
8039
d0773f31
ILT
80402011-03-02 Simon Baldwin <simonb@google.com>
8041
8042 * configure.ac: Add check for gnu_indirect_function support in
8043 the toolchain building binutils.
8044 * configure: Rebuild.
8045
9370ce59 80462011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8047
8048 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8049 plugin only symbols.
8050 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8051 in plugin files as not needed in the symbol table.
8052
4cf7a849
ST
80532011-02-11 Sriraman Tallam <tmsriram@google.com>
8054
8055 * output.cc (Output_section::add_input_section): Delay fill
8056 generation for section ordering.
8057
b578bd7d
ILT
80582011-02-09 Ian Lance Taylor <iant@google.com>
8059
8060 PR gold/12316
8061 * object.h (class Sized_relobj): Remove clear_local_symbols.
8062 * reloc.cc (Sized_relobj::do_relocate): Don't call
8063 clear_local_symbols.
8064
9370ce59 80652011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8066
8067 * plugin.cc (is_visible_from_outside): Return true for symbols
8068 in the -u option.
8069
55382fb7
ILT
80702011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8071
8072 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8073 filename.
8074
4e271fff
ST
80752011-02-02 Sriraman Tallam <tmsriram@google.com>
8076
8077 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8078 to std::string.
4e271fff 8079 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8080 section_name to be std::string.
4e271fff
ST
8081 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8082
d433c3ac
ILT
80832011-01-25 Ian Lance Taylor <iant@google.com>
8084
8085 * script.cc (script_add_extern): Rewrite to use
8086 add_symbol_reference.
8087
880473a6
DK
80882011-01-25 Doug Kwan <dougkwan@google.com>
8089
d433c3ac 8090 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8091
f30f86fa
ILT
80922011-01-24 Ian Lance Taylor <iant@google.com>
8093
8094 * options.h (class General_options): Accept
8095 --no-detect-odr-violations.
8096
8e51a0b9
ILT
80972011-01-24 Ian Lance Taylor <iant@google.com>
8098
8099 * version.cc (version_string): Bump to 1.11.
8100
0f3b89d8
ILT
81012011-01-24 Ian Lance Taylor <iant@google.com>
8102
8103 * plugin.cc (class Plugin_rescan): Define new class.
8104 (Plugin_manager::claim_file): Set any_claimed_.
8105 (Plugin_manager::save_archive): New function.
8106 (Plugin_manager::save_input_group): New function.
8107 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8108 necessary.
8109 (Plugin_manager::new_undefined_symbol): New function.
8110 (Plugin_manager::rescan): New function.
8111 (Plugin_manager::rescannable_defines): New function.
8112 (Plugin_manager::add_input_file): Set any_added_.
8113 * plugin.h (class Plugin_manager): define new fields rescannable_,
8114 undefined_symbols_, any_claimed_, and any_added_. Declare
8115 Plugin_rescan as friend. Declare new functions.
8116 (Plugin_manager::Rescannable): Define type.
8117 (Plugin_manager::Rescannable_list): Define type.
8118 (Plugin_manager::Undefined_symbol_list): Define type.
8119 (Plugin_manager::Plugin_manager): Initialize new fields.
8120 * archive.cc (Archive::defines_symbol): New function.
8121 (Add_archive_symbols::run): Pass archive to plugins if any.
8122 * archive.h (class Archive): Declare defines_symbol.
8123 * readsyms.cc (Input_group::~Input_group): New function.
8124 (Finish_group::run): Pass input_group to plugins if any.
8125 * readsyms.h (class Input_group): Declare destructor.
8126 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8127 any.
8128
3bb951e5
ILT
81292011-01-10 Ian Lance Taylor <iant@google.com>
8130
8131 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8132 section as relro.
8133 (Layout::set_segment_offsets): Reset increase_relro before calling
8134 set_section_addresses a second time.
8135
0aa45fac
CC
81362011-01-04 Cary Coutant <ccoutant@google.com>
8137
8138 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8139 sections before NOBITS sections.
8140
0db46eb4
L
81412011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8142
8143 * version.cc (print_version): Update copyright to 2011.
8144
829c9745
CC
81452010-12-23 Cary Coutant <ccoutant@google.com>
8146
8147 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8148 of OS to this->add. Add OD parameter to second form of the function.
8149
7500420b
ILT
81502010-12-20 Ian Lance Taylor <iant@google.com>
8151
8152 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8153 second of two consecutive entries with same offset.
8154
f8e9a930
RW
81552010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8156
8157 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8158 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8159 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8160 to avoid unneeded links against $(LDADD).
8161 * testsuite/Makefile.in: Regenerate.
8162
2fbb4320
ILT
81632010-12-15 Ian Lance Taylor <iant@google.com>
8164
8165 PR gold/12324
8166 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8167 for R_X86_64_32 and R_X86_64_PC32.
8168 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8169 ver_matching_def_pic.o.
8170 (ver_matching_def_pic.o): New target.
8171
fedb228d
RW
81722010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8173
8174 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8175 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8176 Move definition before File_read::View member definitions.
8177 (File_read::View::~View): Initialize and hold lock before
8178 updating current_mapped_bytes.
8179
9b547ce6
RW
81802010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8181
8182 * dwarf_reader.cc: Remove outdated comment.
8183 * gold-threads.cc: Fix typo in error message.
8184 * archive.cc: Fix typos in comments.
8185 * archive.h: Likewise.
8186 * arm-reloc-property.cc: Likewise.
8187 * arm-reloc-property.h: Likewise.
8188 * arm-reloc.def: Likewise.
8189 * arm.cc: Likewise.
8190 * attributes.h: Likewise.
8191 * cref.cc: Likewise.
8192 * ehframe.cc: Likewise.
8193 * fileread.h: Likewise.
8194 * gold.h: Likewise.
8195 * i386.cc: Likewise.
8196 * icf.cc: Likewise.
8197 * incremental.h: Likewise.
8198 * int_encoding.cc: Likewise.
8199 * layout.h: Likewise.
8200 * main.cc: Likewise.
8201 * merge.h: Likewise.
8202 * object.cc: Likewise.
8203 * object.h: Likewise.
8204 * options.cc: Likewise.
8205 * readsyms.cc: Likewise.
8206 * reduced_debug_output.cc: Likewise.
8207 * reloc.cc: Likewise.
8208 * script-sections.cc: Likewise.
8209 * sparc.cc: Likewise.
8210 * symtab.h: Likewise.
8211 * target-reloc.h: Likewise.
8212 * target.cc: Likewise.
8213 * target.h: Likewise.
8214 * timer.cc: Likewise.
8215 * timer.h: Likewise.
8216 * x86_64.cc: Likewise.
8217
83e17bd5
CC
82182010-12-09 Cary Coutant <ccoutant@google.com>
8219
8220 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8221 stack.
8222 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8223 parameter; change all callers.
8224 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8225 * options.h (warn_execstack): New option.
8226
017257f8
DK
82272010-12-07 Doug Kwan <dougkwan@google.com>
8228
8229 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8230 like function call relocations.
8231
c20cbc06
ILT
82322010-12-07 Ian Lance Taylor <iant@google.com>
8233
8234 * archive.cc (Archive::get_elf_object_for_member): Permit
8235 punconfigured to be NULL.
8236 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8237 (Archive::include_member): Pass NULL to get_elf_object_for_member
8238 if we searched for the archive and this is the first included
8239 object.
8240
4dbfafcc
ILT
82412010-12-01 Ian Lance Taylor <iant@google.com>
8242
8243 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8244 track_relocs_type_ field.
8245 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8246 Set track_relocs_type_.
8247 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8248 contents when using RELA relocs.
8249 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8250 reloc_map_.
8251 * reloc.cc (Track_relocs::next_addend): New function.
8252 * reloc.h (class Track_relocs): Declare next_addend.
8253
e5e19edd
ILT
82542010-12-01 Ian Lance Taylor <iant@google.com>
8255
8256 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8257 virtual destructor.
8258
9a5ce24c
ILT
82592010-12-01 Ian Lance Taylor <iant@google.com>
8260
8261 * README: Update compilers known to work and fail.
8262
c7791212
NC
82632010-11-23 Matthias Klose <doko@ubuntu.com>
8264
8265 * configure.in: For --enable-gold, handle value `default' instead of
8266 `both*'. Always install ld as ld.bfd, install as ld if gold is
8267 not the default.
8268 * configure: Regenerate.
8269
0ad220c9
DK
82702010-11-18 Doug Kwan <dougkwan@google.com>
8271
8272 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8273 and right_alignment to be zero. Store result alignment only if it is
8274 greater than existing alignment.
8275
ab8056e0
CC
82762010-11-16 Cary Coutant <ccoutant@google.com>
8277
8278 PR gold/12220
8279 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8280 Check for ".zdebug_line".
8281
fd064a5b
CC
82822010-11-16 Doug Kwan <dougkwan@google.com>
8283 Cary Coutant <ccoutant@google.com>
8284
8285 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8286 by reference; adjust all callers.
8287 * output.cc (Output_segment::set_section_addresses): Adjust references
8288 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8289 list is empty.
8290 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8291 end at page boundary.
8292
6fc6ea19
CC
82932010-11-16 Cary Coutant <ccoutant@google.com>
8294
8295 PR gold/12220
8296 * layout.cc (Layout::choose_output_section): Transform names of
8297 compressed sections even when using a script with a SECTIONS clause.
8298 (Layout::output_section_name): Remove code to transform
8299 compressed debug section names.
8300 * output.cc (Output_section::add_input_section): Use uncompressed
8301 section size when tracking input sections.
8302
95a2c8d6
RS
83032010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8304
8305 * symtab.h (Symbol::NON_PIC_REF): Remove.
8306 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8307 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8308 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8309 (Symbol::use_plt_offset): Take a flags argument and pass it
8310 directly to needs_dynamic_reloc. Restrict check for undefined
8311 weak symbols to function calls.
8312 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8313 (Target_arm::Scan::global): Use it.
8314 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8315 (Target_arm::Relocate::relocate): Likewise.
8316 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8317 parameter with an r_type parameter. Use get_reference_flags
8318 to get the flags.
8319 (Target_arm::Relocate::relocate): Update accordingly.
8320 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8321 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8322 (Target_i386::Scan::global): Likewise.
8323 (Target_i386::Relocate::relocate): Likewise.
8324 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8325 parameter with an r_type parameter. Use get_reference_flags
8326 to get the flags.
8327 (Target_i386::Relocate::relocate): Update accordingly.
8328 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8329 (Target_powerpc::Scan::global): Use it.
8330 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8331 (Target_powerpc::Relocate::relocate): Likewise.
8332 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8333 (Target_sparc::Scan::global): Use it.
8334 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8335 (Target_sparc::Relocate::relocate): Likewise.
8336 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8337 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8338 (Target_x86_64::Scan::global): Likewise.
8339 (Target_x86_64::Relocate::relocate): Likewise.
8340
f625ae50
DK
83412010-11-08 Doug Kwan <dougkwan@google.com>
8342 Cary Coutant <ccoutant@google.com>
8343
8344 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8345 (Arm_exidx_merge_section::section_contents_): New data member.
8346 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8347 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8348 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8349 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8350 in parameters instead of calling Object::section_contents without
8351 locking.
8352 (Arm_output_section::group_section): New parameter TASK. Pass it
8353 to callees that need locking objects.
8354 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8355 to lock EXIDX input sections. Fix a formatting issue. Call
8356 Arm_exidx_merged_section::build_contents to create merged section
8357 contents.
8358 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8359 to lock object of stub table owner.
8360 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8361 TEXT_SIZE to initialize data member TEXT_SIZE_.
8362 (Arm_exidx_input_section::addralign): Fix typo in comment.
8363 (Arm_exidx_input_section::text_size): New method.
8364 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8365 that require locking objects. Lock objects before scanning for stubs
8366 and updating local symbols.
8367 (Arm_input_section<big_endian>::init): Copy contents of original
8368 input section.
2e702c99 8369 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8370 original input section instead of calling Object::section_contents
8371 without locking.
8372 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8373 size without calling Object::section_size().
8374 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8375 for size. Allocate a buffer for merged EXIDX entries.
8376 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8377 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8378 building code to Arm_exidx_merged_section::build_contetns. Write
8379 out contetns in buffer instead of building it on the fly.
8380 (Arm_relobj::make_exidx_input_section): Also pass text section size
8381 to Arm_exidx_input_section constructor.
8382 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8383 (Arm_dynobj::do_read_symbols): Fix memory leak.
8384 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8385 * target.h: (class Task): Add forward declaration.
8386 (Target::relax): Add new parameter TASK and pass it to
8387 Target::do_relax().
8388 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8389
5f9bcf58
CC
83902010-11-05 Cary Coutant <ccoutant@google.com>
8391
8392 PR gold/10708
8393 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8394 object when reading from the file.
8395 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8396 second layout pass.
8397 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8398 when reading section contents.
8399 (get_section_contents): Likewise.
8400 (icf::find_identical_sections): Likewise.
8401 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8402 object when reading from the file.
8403 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8404 the object when doing deferred section layout.
8405
e597fa08
NC
84062010-11-03 Nick Clifton <nickc@redhat.com>
8407
8408 PR gold/12001
8409 * script.h (class Symbol_assignment: name): New member. Returns
8410 the name of the symbol.
8411 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8412 Returns true if the given symbol name is on the list of
8413 assignments wating to be processed.
8414 * archive.cc (should_incldue_member): If the symbol is undefined,
8415 check to see if it is on the list of symbols pending assignment.
8416
3f9a3278
ILT
84172010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8418
8419 * script-sections.cc (Script_sections::find_memory_region): Check
8420 for a NULL output section pointer.
8421
d06fb4d1
DK
84222010-10-29 Doug Kwan <dougkwan@google.com>
8423
8424 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8425 Output_section::add_relaxed_input_section.
8426 * output.cc (Output_section::add_relaxed_input_section): Add new
8427 arguments LAYOUT and NAME. Set section order index.
8428 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8429 Copy section order index.
8430 * output.h (Output_section::add_relaxed_input_section): Add new
8431 arguments LAYOUT and NAME.
8432
90e24de5
ILT
84332010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8434
8435 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8436 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8437 * testsuite/Makefile.in: Regenerate.
8438
c9484ea5
DK
84392010-10-20 Doug Kwan <dougkwan@google.com>
8440
8441 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8442 without SHF_LINK_ORDER flags.
8443 * layout.cc (Layout::choose_output_section): Do not filter
8444 SHF_LINK_ORDER flag in a relocatable link.
8445
5bc2f5be
CC
84462010-10-17 Cary Coutant <ccoutant@google.com>
8447
8448 * output.h (Output_segment::set_section_addresses): Change function
8449 signature. Update all callers.
8450 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8451 sections.
8452 (Output_segment::set_section_addresses): Align after last TLS
8453 section. Add padding before last relro section instead of after.
8454
0c91cf04
DK
84552010-10-17 Doug Kwan <dougkwan@google.com>
8456
8457 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8458 GOT output section to be writable.
8459
8c21d9d3
CC
84602010-10-14 Cary Coutant <ccoutant@google.com>
8461
8462 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8463 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8464 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8465 mode.
8466 * incremental.cc (report_command_line): Ignore all forms of
8467 --incremental.
8468 * layout.cc (Layout::Layout): Check parameters for incremental link
8469 mode.
8470 * options.cc (General_options::parse_incremental): New function.
8471 (General_options::parse_no_incremental): New function.
8472 (General_options::parse_incremental_full): New function.
8473 (General_options::parse_incremental_update): New function.
8474 (General_options::incremental_mode_): New data member.
8475 (General_options::finalize): Check incremental_mode_.
8476 * options.h (General_options): Update help text for --incremental.
8477 Add --no-incremental, --incremental-full, --incremental-update.
8478 (General_options::Incremental_mode): New enum type.
8479 (General_options::incremental_mode): New function.
8480 (General_options::incremental_mode_): New data member.
8481 * parameters.cc (Parameters::incremental_mode_): New data member.
8482 (Parameters::set_options): Set incremental_mode_.
8483 (Parameters::set_incremental_full): New function.
8484 (Parameters::incremental): New function.
8485 (Parameters::incremental_update): New function.
8486 (set_parameters_incremental_full): New function.
8487 * parameters.h (Parameters::set_incremental_full): New function.
8488 (Parameters::incremental): New function.
8489 (Parameters::incremental_update): New function.
8490 (Parameters::incremental_mode_): New data member.
8491 (set_parameters_incremental_full): New function.
8492 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8493 incremental link mode.
8494 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8495 (Sized_relobj::do_relocate_sections): Likewise.
8496 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8497 option.
8498 * testsuite/Makefile.in: Regenerate.
8499 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8500
bb32aa18 85012010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8502
8503 * script-sections.h (class Script_sections): Make
8504 Sections_elements typedef public.
8505 * script-sections.cc (class Sort_output_sections): Add elements_
8506 field. Add constructor which sets it; change all callers.
8507 (Sort_output_sections::is_before): New function.
8508 (Sort_output_sections::operator()): Call is_before.
8509 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8510 conditional.
8511 * testsuite/script_test_10.sh: New test. Test script section
8512 order.
8513 * testsuite/script_test_10.t: Likewise.
8514 * testsuite/script_test_10.s: Likewise.
8515 * testsuite/Makefile.am: Wrap the cross linker tests and the
8516 common tests into NATIVE_OR_CROSS_LINKER.
8517 (check_SCRIPTS): Add script_test_10.sh.
8518 (check_DATA): Add script_test_10.stdout.
8519 (script_test_10.o, script_test_10): New targets.
8520 (script_test_10.stdout): New target.
8521 * configure, testsuite/Makefile.in: Regenerate.
8522
3cef7179
ILT
85232010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8524
8525 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8526 error for the deprecated relocations.
8527 (Target_arm::Scan::global): Likewise.
8528 (Target_arm::Relocate::relocate): Likewise.
8529
7411e9a8
RS
85302010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8531
8532 * fileread.cc (Input_file::find_file): Initialize *found_name
8533 and *namep when using the fallback search for case 4.
8534
6a9da32a
CC
85352010-10-11 Cary Coutant <ccoutant@google.com>
8536
8537 * options.h (class General_options): Redefine -z lazy as an alias for
8538 the negation of -z now.
8539
ac897c20
ILT
85402010-10-11 Ian Lance Taylor <iant@google.com>
8541
8542 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8543 binding.
8544
ea5cae92
NC
85452010-10-06 Nick Clifton <nickc@redhat.com>
8546
8547 * script-sections.cc(class Memory_region): Remove
8548 current_lma_offset_ field. Rename current_vma_offset_ to
8549 current_offset_. Add last_section_ field.
8550 (Memory_region::get_current_vma_address): Rename to
8551 get_current_address.
8552 (Memory_region::get_current_lma_address): Delete.
8553 (Memory_region::increment_vma_offset): Rename to
8554 increment_offset.
8555 (Memory_region::increment_lma_offset): Delete.
8556 (Memory_region::attributes_compatible): New method. Returns
8557 true if the provided section is compatible with the region.
8558 (Memory_region::get_last_section): New method. Returns the last
8559 section to use the region.
8560 (Memory_region::set_last_section): New method. Stores the last
8561 section to use the region.
8562 (Script_sections::block_in_region): New method. Returns true if
8563 a block of memory is contained within a region.
8564 (Script_sections::find_memory_region): New method. Locates a
8565 memory region to be used to set a VMA or LMA address.
8566 (Output_section_definition::set_section_addresses): Add code to
8567 check for addresses set by memory regions.
8568 (Output_segment::set_section_addresses): Remove memory region
8569 walking code.
8570 (Script_sections::create_segment): Add a warning if a header
8571 segment is created outside of any region.
8572 * script-sections.h (class Script_sections): Add prototypes for
8573 find_memory_region and block_in_region methods.
8574 * testsuite/memory_test.s: Use .long instead of .word.
8575 * testsuite/memory_test.t: Add some more output sections.
8576 * testsuite/memory_test.sh: Update expected output.
8577
a9bfd952
DK
85782010-10-02 Doug Kwan <dougkwan@google.com>
8579
8580 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8581 defintion to symtab.h
8582 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8583 declaration to defintion.
8584
bacff3ab
NC
85852010-10-01 Nick Clifton <nickc@redhat.com>
8586
8587 * expression.cc (eval): Replace dummy argument with NULL.
8588 (eval_maybe_dot): Check for a NULL result section pointer.
8589 (Symbol_expression::value): Likewise.
8590 (Dot_expression::value): Likewise.
8591 (BINARY_EXPRESSION): Likewise.
8592 (Max_expression::value): Likewise.
8593 (Min_expression::value): Likewise.
8594 (Absolute_expression::value): Likewise.
8595 (Addr_expression::value_from_output_section): Likewise.
8596 (Loaddddr_expression::value_from_output_section): Likewise.
8597 (Segment_start_expression::value): Likewise.
8598 * script-sections.cc
8599 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8600 argument with NULL.
8601 (Sections_elememt_dot_assignment::set_section_addresses):
8602 Likewise.
8603 (Output_data_expression::do_write_to_buffer): Likewise.
8604 (Output_section_definition::finalize_symbols): Likewise.
8605 (Output_section_definition::set_section_addresses): Likewise.
8606
f81bc8b5
DK
86072010-09-30 Doug Kwan <dougkwan@google.com>
8608
8609 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8610
c95e9f27
ST
86112010-09-28 Sriraman Tallam <tmsriram@google.com>
8612
8613 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8614 function.
c95e9f27
ST
8615 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8616 virtual function.
8617 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8618 virtual function.
8619 * icf.cc (get_section_contents): Inline merge sections only when
8620 target allows it.
8621
3cac54d2
RW
86222010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8623
8624 * configure: Regenerate.
8625
2904037a
ILT
86262010-09-17 Ian Lance Taylor <iant@google.com>
8627
8628 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8629 * testsuite/Makefile.am (memory_test.o): New target.
8630 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8631 memory_test.t.
8632 * testsuite/Makefile.in: Rebuild.
2904037a 8633
bca7fb63
DK
86342010-09-17 Doug Kwan <dougkwan@google.com>
8635
8636 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8637 defintion if relocation uses GOT entries of the symbol.
8638 * testsuite/icf_safe_test.sh: Fix test.
8639 * testsuite/icf_safe_so_test.sh: Fix test.
8640
4ef28648
CC
86412010-09-16 Cary Coutant <ccoutant@google.com>
8642
8643 * script_sections.cc (class Memory_region): Remove "NULL" from
8644 vector initializations.
8645
793990de
CC
86462010-09-15 Cary Coutant <ccoutant@google.com>
8647
8648 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8649 Resolve forwarding symbols.
8650
81e015e2
DK
86512010-09-15 Doug Kwan <dougkwan@google.com>
8652
8653 * gold/testsuite/script_test_3.t: Add ARM special sections.
8654 * gold/testsuite/script_test_4.t: Same.
8655 * gold/testsuite/script_test_5.t: Same.
8656 * gold/testsuite/script_test_6.t: Same.
8657 * gold/testsuite/script_test_7.t: Same.
8658 * gold/testsuite/script_test_7.t: Same.
8659 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8660
36171d64
CC
86612010-09-14 Cary Coutant <ccoutant@google.com>
8662
8663 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8664 (Target_x86_64::Relocate::relocate_tls): Replace check for
8665 saw_tls_block_reloc_ with test for executable section.
8666
d89051bd
CC
86672010-09-12 Cary Coutant <ccoutant@google.com>
8668
8669 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8670 position-independent executables to shared libraries need dynamic
8671 relocations.
8672 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8673 position-independent executables.
8674 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8675 * testsuite/Makefile.in: Regenerate.
8676
fca41f0f
NC
86772010-09-10 Nick Clifton <nickc@redhat.com>
8678
8679 PR gold/11997
8680 * testsuite/memory_test.t: Discard any sections that are not
8681 needed.
8682
6695e4b3
L
86832010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8684
8685 PR gold/11996
8686 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8687 "This::" to work around a bug in gcc 4.2.
8688
8689 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8690
0f72bf6f
RÁE
86912010-09-09 Rafael Espindola <espindola@google.com>
8692
8693 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8694 sections with different PF_X flags in the same segment.
8695 (Layout::find_first_load_seg): Search all segments to find the first
8696 one.
8697 * options.h (rosegment): New.
8698
86992010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8700
05a79166 8701 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8702
aa98ff75
DK
87032010-09-08 Doug Kwan <dougkwan@google.com>
8704
8705 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8706 (Arm_relobj::do_relocate_sections): Add new parameter for output
8707 file to match the parent.
8708 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8709 of local symbols instead of input values. Update code to track
8710 changes in gold::relocate_section.
8711 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8712 (Sized_relobj::compute_final_local_value_internal): New methods.
8713 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8714 body into private version of Sized_relobj::compute_final_local_value.
8715 Call the inline method.
8716 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8717 merged symbol value if there is one.
8718 (Symbol_value::has_output_value): New method defintiion.
8719 (Sized_relobj::Compute_final_local_value_status): New enum type.
8720 (Sized_relobj::compute_final_local_value): New methods.
8721 (Sized_relobj::compute_final_local_value_internal): New methods.
8722 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8723 and arm_cortex_a8.sh.
8724 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8725 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8726 New tests.
8727 * Makefile.in: Regenerate.
8728 * testsuite/arm_bl_out_of_range.s: Update test.
8729 * testsuite/thumb_bl_out_of_range.s: Ditto.
8730 * testsuite/thumb_blx_out_of_range.s: Ditto.
8731 * testsuite/arm_branch_out_of_range.sh: New file.
8732 * testsuite/arm_cortex_a8.sh: Ditto.
8733 * testsuite/arm_cortex_a8_b.s: Ditto.
8734 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8735 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8736 * testsuite/arm_cortex_a8_bl.s: Ditto.
8737 * testsuite/arm_cortex_a8_blx.s: Ditto.
8738 * testsuite/arm_cortex_a8_local.s: Ditto.
8739 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8740 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8741
05a79166
L
87422010-09-08 Rafael Espindola <espindola@google.com>
8743
8744 * Makefile.am (memory_test.stdout): Run readelf with -W.
8745 * Makefile.in: Regenerate.
8746 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8747 64 bit output.
8748
33dbc701
RÁE
87492010-09-08 Rafael Espindola <espindola@google.com>
8750
8751 * script-sections.cc (Script_sections::add_memory_region): Convert
8752 field precision to int.
8753 * script.cc (script_set_section_region, script_set_section_region):
8754 Convert field precision to int.
8755
731ca54a
RÁE
87562010-09-08 Rafael Espindola <espindola@google.com>
8757
8758 * arm.cc (do_finalize_sections): Create the __exidx_start and
8759 __exdix_end symbols even when the section is missing.
8760
7f8cd844
NC
87612010-09-08 Nick Clifton <nickc@redhat.com>
8762
8763 * README: Remove claim that MEMORY is not supported.
8764 * expression.cc (script_exp_function_origin)
8765 (script_exp_function_length): Move from here to ...
8766 * script.cc: ... here.
8767 (script_set_section_region, script_add_memory)
8768 (script_parse_memory_attr, script_include_directive): New
8769 functions.
8770 * script-sections.cc
8771 (class Memory_region): New class.
8772 (class Output_section_definition): Add set_memory_region,
8773 set_section_vma, set_section_lma and get_section_name methods.
8774 (class Script_Sections): Add add_memory_region,
8775 find_memory_region, find_memory_region_origin,
8776 find_memory_region_length and set_memory_region methods.
8777 Have set_section_addresses method walk the list of set memory
8778 regions.
8779 Extend the print methos to display memory regions.
8780 * script-sections.h: Add prototypes for new methods.
8781 Add enum for MEMORY region attributes.
8782 * yyscript.y: Add support for parsing MEMORY regions.
8783 * script-c.h: Add prototypes for new functions.
8784 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8785 * testsuite/Makefile.in: Regenerate.
8786 * testsuite/memory_test.sh: New script.
8787 * testsuite/memory_test.s: New assembler source file.
8788 * testsuite/memory_test.t: New linker script.
8789
a4649286
DK
87902010-08-27 Doug Kwan <dougkwan@google.com>
8791
8792 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8793 reference override an existing dynamic weak reference.
8794 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8795 * testsuite/Makefile.in: Regenerate.
8796 * testsuite/dyn_weak_ref.sh: New file.
8797 * testsuite/dyn_weak_ref_1.c: Ditto.
8798 * testsuite/dyn_weak_ref_2.c: Ditto.
8799
b56648ad
ILT
88002010-08-27 Ian Lance Taylor <iant@google.com>
8801
8802 * incremental.h (class Incremental_input_entry): Add virtual
8803 destructor.
8804
809313cb
ILT
88052010-08-27 Ian Lance Taylor <iant@google.com>
8806
8807 * testsuite/start_lib_test_3.c: Mark t3 as used.
8808
11e32464
NC
88092010-08-27 Nick Clifton <nickc@redhat.com>
8810
8811 * options.cc (version_script): Fix small typo in previous
8812 whitespace tidyup.
8813
ca09d69a
NC
88142010-08-25 Nick Clifton <nickc@redhat.com>
8815
8816 * archive.cc: Formatting fixes: Remove whitespace between
8817 typename and following asterisk. Remove whitespace between
8818 function name and opening parenthesis.
8819 * archive.h: Likewise.
8820 * arm.cc: Likewise.
8821 * attributes.cc: Likewise.
8822 * attributes.h: Likewise.
8823 * common.cc: Likewise.
8824 * copy-relocs.cc: Likewise.
8825 * dirsearch.h: Likewise.
8826 * dynobj.cc: Likewise.
8827 * ehframe.cc: Likewise.
8828 * ehframe.h: Likewise.
8829 * expression.cc: Likewise.
8830 * fileread.cc: Likewise.
8831 * fileread.h: Likewise.
8832 * gc.h: Likewise.
8833 * gold-threads.cc: Likewise.
8834 * gold.cc: Likewise.
8835 * i386.cc: Likewise.
8836 * icf.h: Likewise.
8837 * incremental-dump.cc: Likewise.
8838 * incremental.cc: Likewise.
8839 * layout.cc: Likewise.
8840 * layout.h: Likewise.
8841 * main.cc: Likewise.
8842 * merge.cc: Likewise.
8843 * merge.h: Likewise.
8844 * object.cc: Likewise.
8845 * object.h: Likewise.
8846 * options.cc: Likewise.
8847 * options.h: Likewise.
8848 * output.cc: Likewise.
8849 * output.h: Likewise.
8850 * plugin.cc: Likewise.
8851 * plugin.h: Likewise.
8852 * powerpc.cc: Likewise.
8853 * reloc.cc: Likewise.
8854 * script-c.h: Likewise.
8855 * script-sections.cc: Likewise.
8856 * script.cc: Likewise.
8857 * stringpool.cc: Likewise.
8858 * symtab.cc: Likewise.
8859 * symtab.h: Likewise.
8860 * target.cc: Likewise.
8861 * timer.cc: Likewise.
8862 * timer.h: Likewise.
8863 * version.cc: Likewise.
8864 * x86_64.cc: Likewise.
8865
b8fa8750
NC
88662010-08-24 Nick Clifton <nickc@redhat.com>
8867
8868 PR 11899
8869 * layout.cc (segment_precedes): Sort segments by their physical
8870 addresses, if they have been set.
8871
9919d93b
CC
88722010-08-23 Cary Coutant <ccoutant@google.com>
8873
8874 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8875 symbols data.
8876 (Lib_group::include_member): Unlock object after deleting its
8877 symbols data.
8878 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8879 the bug fixed here.
8880
97b4be1c
CC
88812010-08-19 Neil Vachharajani <nvachhar@google.com>
8882 Cary Coutant <ccoutant@google.com>
8883
8884 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8885 constructor, and set_blocker.
8886 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8887 readsyms_blocker_.
8888 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8889 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8890 * testsuite/Makefile.am (start_lib_test): New test case.
8891 * testsuite/Makefile.in: Regenerate.
8892 * testsuite/start_lib_test_main.c: New file.
8893 * testsuite/start_lib_test_1.c: New file.
8894 * testsuite/start_lib_test_2.c: New file.
8895 * testsuite/start_lib_test_3.c: New file.
8896
dd0b1884
ILT
88972010-08-19 Ian Lance Taylor <iant@google.com>
8898
8899 * Makefile.in: Rebuild with automake 1.11.1.
8900 * aclocal.m4: Likewise.
8901 * testsuite/Makefile.in: Likewise.
8902
7223e9ca
ILT
89032010-08-19 Ian Lance Taylor <iant@google.com>
8904
8905 PR 10893
8906 * i386.cc (class Output_data_plt_i386): Update declarations.
8907 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8908 local_ifuncs_ fields.
8909 (Target_i386::do_plt_section_for_global): New function.
8910 (Target_i386::do_plt_section_for_local): New function.
8911 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8912 parameter; change all callers. Initialize global_ifuncs_ and
8913 local_ifuncs_. If doing a static link define __rel_iplt_start and
8914 __rel_iplt_end.
8915 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8916 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8917 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8918 symbols.
8919 (Target_i386::make_plt_section): New function, broken out of
8920 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8921 (Target_i386::make_plt_entry): Call make_plt_section.
8922 (Target_i386::make_local_ifunc_plt_entry): New function.
8923 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8924 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8925 R_386_IRELATIVE to switch.
8926 (Target_i386::Scan::global): Likewise.
8927 (Target_i386::Relocate::relocate): Likewise.
8928 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8929 switch.
8930 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8931 (Target_x86_64::do_plt_section_for_global): New function.
8932 (Target_x86_64::do_plt_section_for_local): New function.
8933 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8934 parameter; change all callers. If doing a static link define
8935 __rela_iplt_start and __rela_iplt_end.
8936 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8937 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8938 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8939 to point to .plt.
8940 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8941 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8942 switch.
8943 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8944 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8945 R_X86_64_IRELATIVE to switch.
8946 (Target_x86_64::Scan::global): Likewise.
8947 (Target_x86_64::Relocate::relocate): Likewise.
8948 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8949 switch.
8950 * target.h (class Target): Add plt_section_for_global and
8951 plt_section_for_local functions. Add do_plt_section_for_global
8952 and do_plt_section_for_local virtual functions.
8953 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8954 clarifying comments.
8955 (Symbol::use_plt_offset): Handle IFUNC symbol.
8956 * object.cc (Sized_relobj::Sized_relobj): Initialize
8957 local_plt_offsets_.
8958 (Sized_relobj::local_has_plt_offset): New function.
8959 (Sized_relobj::local_plt_offset): New function.
8960 (Sized_relobj::set_local_plt_offset): New function.
8961 (Sized_relobj::do_count): Handle IFUNC symbol.
8962 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8963 a bit away from input_shndx_ field. Add set_is_func_symbol and
8964 is_ifunc_symbol functions.
8965 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8966 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8967 local_plt_offsets_ field.
8968 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8969 * output.h (class Output_section_data): Add non-const
8970 output_section function.
8971 (class Output_data_got): Update declarations.
8972 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8973 Add use_plt_offset parameter to global and local constructors.
8974 Change all callers. Change local_sym_index_ field to 31 bits.
8975 Change GSYM_CODE and CONSTANT_CODE accordingly.
8976 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8977 doing a static link don't set sh_link field.
8978 (Output_data_got::Got_entry::write): Use PLT offset if
8979 appropriate.
8980 (Output_data_got::add_global_plt): New function.
8981 (Output_data_got::add_local_plt): New function.
8982 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8983 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8984 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8985 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8986 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8987 IFUNC conditional.
8988 * testsuite/ifunc-sel.h: New file.
8989 * testsuite/ifuncmain1.c: New file.
8990 * testsuite/ifuncmain1vis.c: New file.
8991 * testsuite/ifuncmod1.c: New file.
8992 * testsuite/ifuncdep2.c: New file.
8993 * testsuite/ifuncmain2.c: New file.
8994 * testsuite/ifuncmain3.c: New file.
8995 * testsuite/ifuncmod3.c: New file.
8996 * testsuite/ifuncmain4.c: New file.
8997 * testsuite/ifuncmain5.c: New file.
8998 * testsuite/ifuncmod5.c: New file.
8999 * testsuite/ifuncmain6pie.c: New file.
9000 * testsuite/ifuncmod6.c: New file.
9001 * testsuite/ifuncmain7.c: New file.
9002 * configure, testsuite/Makefile.in: Rebuild.
9003
56f75c03
ILT
90042010-08-18 Ian Lance Taylor <iant@google.com>
9005
9006 * incremental.cc
9007 (Output_section_incremental_inputs::write_input_files): Add cast
9008 to avoid signed/unsigned comparison warning.
9009 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9010
55455f89
CC
90112010-08-12 Cary Coutant <ccoutant@google.com>
9012
9013 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9014
e2054bcb
ILT
90152010-08-13 Ian Lance Taylor <iant@google.com>
9016
9017 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9018
74f67560
DK
90192010-08-12 Cary Coutant <ccoutant@google.com>
9020 Doug Kwan <dougkwan@google.com>
9021
9022 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9023 defintion overrides non-weak undef, remember that the original undef
9024 is not weak.
9025 * symtab.cc (Symbol_table::sized_write_global): For undef without
9026 an original weak binding, set binding to global in output.
9027 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9028 * testsuite/Makefile.in: Regenerate.
9029 * testsuite/strong_ref_weak_def.sh: New file.
9030 * testsuite/strong_ref_weak_def_1.c: Ditto.
9031 * testsuite/strong_ref_weak_def_2.c: Ditto.
9032
d1238d12
CC
90332010-08-12 Cary Coutant <ccoutant@google.com>
9034
9035 * testsuite/incremental_test.sh: Rewrite.
9036 * testsuite/incremental_test_1.c: Rewrite.
9037 * testsuite/incremental_test_2.c: Rewrite.
9038
0e70b911
CC
90392010-08-12 Cary Coutant <ccoutant@google.com>
9040
9041 * arm.cc (Target_arm::got_size): Add const.
9042 (Target_arm::got_entry_count): New function.
9043 (Target_arm::plt_entry_count): New function.
9044 (Target_arm::first_plt_entry_offset): New function.
9045 (Target_arm::plt_entry_size): New function.
9046 (Output_data_plt_arm::entry_count): New function.
9047 (Output_data_plt_arm::first_plt_entry_offset): New function.
9048 (Output_data_plt_arm::get_plt_entry_size): New function.
9049 * i386.cc (Target_i386::got_size): Add const.
9050 (Target_i386::got_entry_count): New function.
9051 (Target_i386::plt_entry_count): New function.
9052 (Target_i386::first_plt_entry_offset): New function.
9053 (Target_i386::plt_entry_size): New function.
9054 (Output_data_plt_i386::entry_count): New function.
9055 (Output_data_plt_i386::first_plt_entry_offset): New function.
9056 (Output_data_plt_i386::get_plt_entry_size): New function.
9057 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9058 find_incremental_inputs_sections. Dump incremental_got_plt section.
9059 * incremental.cc: Include target.h.
9060 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9061 parameter. Adjust all callers. Find incremental_got_plt section.
9062 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9063 section.
9064 (Output_section_incremental_inputs::set_final_data_size): Calculate
9065 size of incremental_got_plt section.
9066 (Output_section_incremental_inputs::do_write): Write the
9067 incremental_got_plt section.
9068 (Got_plt_view_info): New struct.
9069 (Local_got_offset_visitor): New class.
9070 (Global_got_offset_visitor): New class.
9071 (Global_symbol_visitor_got_plt): New class.
9072 (Output_section_incremental_inputs::write_got_plt): New function.
9073 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9074 Add parameter. Adjust all callers.
9075 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9076 (Incremental_inputs::got_plt_section): New function.
9077 (Incremental_inputs::got_plt_section_): New data member.
9078 (Incremental_got_plt_reader): New class.
9079 * layout.cc (Layout::create_incremental_info_sections): Add the
9080 incremental_got_plt section.
9081 * object.h (Got_offset_list::get_list): New function.
9082 (Got offset_list::for_all_got_offsets): New function.
9083 (Sized_relobj::local_got_offset_list): New function.
9084 * powerpc.cc (Target_powerpc::got_size): Add const.
9085 (Target_powerpc::got_entry_count): New function.
9086 (Target_powerpc::plt_entry_count): New function.
9087 (Target_powerpc::first_plt_entry_offset): New function.
9088 (Target_powerpc::plt_entry_size): New function.
9089 (Output_data_plt_powerpc::entry_count): New function.
9090 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9091 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9092 * sparc.cc (Target_sparc::got_size): Add const.
9093 (Target_sparc::got_entry_count): New function.
9094 (Target_sparc::plt_entry_count): New function.
9095 (Target_sparc::first_plt_entry_offset): New function.
9096 (Target_sparc::plt_entry_size): New function.
9097 (Output_data_plt_sparc::entry_count): New function.
9098 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9099 (Output_data_plt_sparc::get_plt_entry_size): New function.
9100 * symtab.h (Symbol::got_offset_list): New function.
9101 (Symbol_table::for_all_symbols): New function.
9102 * target.h (Sized_target::got_entry_count): New function.
9103 (Sized_target::plt_entry_count): New function.
9104 (Sized_target::plt_entry_size): New function.
9105 * x86_64.cc (Target_x86_64::got_size): Add const.
9106 (Target_x86_64::got_entry_count): New function.
9107 (Target_x86_64::plt_entry_count): New function.
9108 (Target_x86_64::first_plt_entry_offset): New function.
9109 (Target_x86_64::plt_entry_size): New function.
9110 (Output_data_plt_x86_64::entry_count): New function.
9111 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9112 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9113
09ec0418
CC
91142010-08-12 Cary Coutant <ccoutant@google.com>
9115
9116 * archive.cc: Include incremental.h.
9117 (Archive::Archive): Initialize incremental_info_.
9118 (Archive::include_member): Record archive members in incremental info.
9119 (Add_archive_symbols::run): Record begin and end of an archive in
9120 incremental info.
9121 (Lib_group::include_member): Record objects in incremental info.
9122 * archive.h (Incremental_archive_entry): Forward declaration.
9123 (Archive::set_incremental_info): New member function.
9124 (Archive::incremental_info): New member function.
9125 (Archive::Unused_symbol_iterator): New class.
9126 (Archive::unused_symbols_begin): New member function.
9127 (Archive::unused_symbols_end): New member function.
9128 (Archive::incremental_info_): New data member.
9129 * incremental-dump.cc (find_input_containing_global): New function.
9130 (dump_incremental_inputs): Dump new incremental info sections.
9131 * incremental.cc: Include symtab.h.
9132 (Output_section_incremental_inputs): New class.
9133 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9134 new incremental info sections.
9135 (Sized_incremental_binary::do_check_inputs): Likewise.
9136 (Incremental_inputs::report_archive): Remove.
9137 (Incremental_inputs::report_archive_begin): New function.
9138 (Incremental_inputs::report_archive_end): New function.
9139 (Incremental_inputs::report_object): New function.
9140 (Incremental_inputs::finalize_inputs): Remove.
9141 (Incremental_inputs::report_input_section): New function.
9142 (Incremental_inputs::report_script): Rewrite.
9143 (Incremental_inputs::finalize): Do nothing but finalize string table.
9144 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9145 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9146 (Incremental_inputs::create_data_sections): New function.
9147 (Incremental_inputs::relocs_entsize): New function.
9148 (Output_section_incremental_inputs::set_final_data_size): New function.
9149 (Output_section_incremental_inputs::do_write): New function.
9150 (Output_section_incremental_inputs::write_header): New function.
9151 (Output_section_incremental_inputs::write_input_files): New function.
9152 (Output_section_incremental_inputs::write_info_blocks): New function.
9153 (Output_section_incremental_inputs::write_symtab): New function.
9154 * incremental.h (Incremental_script_entry): Forward declaration.
9155 (Incremental_object_entry): Forward declaration.
9156 (Incremental_archive_entry): Forward declaration.
9157 (Incremental_inputs): Forward declaration.
9158 (Incremental_inputs_header_data): Remove.
9159 (Incremental_inputs_header): Remove.
9160 (Incremental_inputs_header_write): Remove.
9161 (Incremental_inputs_entry_data): Remove.
9162 (Incremental_inputs_entry): Remove.
9163 (Incremental_inputs_entry_write): Remove.
9164 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9165 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9166 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9167 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9168 Likewise.
9169 (Incremental_input_entry): New class.
9170 (Incremental_script_entry): New class.
9171 (Incremental_object_entry): New class.
9172 (Incremental_archive_entry): New class.
9173 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9174 (Incremental_inputs::report_inputs): Remove.
9175 (Incremental_inputs::report_archive): Remove.
9176 (Incremental_inputs::report_archive_begin): New function.
9177 (Incremental_inputs::report_archive_end): New function.
9178 (Incremental_inputs::report_object): Change prototype.
9179 (Incremental_inputs::report_input_section): New function.
9180 (Incremental_inputs::report_script): Change prototype.
9181 (Incremental_inputs::get_reloc_count): New function.
9182 (Incremental_inputs::set_reloc_count): New function.
9183 (Incremental_inputs::create_data_sections): New function.
9184 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9185 (Incremental_inputs::inputs_section): New function.
9186 (Incremental_inputs::symtab_section): New function.
9187 (Incremental_inputs::relocs_section): New function.
9188 (Incremental_inputs::get_stringpool): Add const.
9189 (Incremental_inputs::command_line): Add const.
9190 (Incremental_inputs::inputs): Remove.
9191 (Incremental_inputs::command_line_key): New function.
9192 (Incremental_inputs::input_file_count): New function.
9193 (Incremental_inputs::input_files): New function.
9194 (Incremental_inputs::relocs_entsize): New function.
9195 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9196 (Incremental_inputs::finalize_inputs): Remove.
9197 (Incremental_inputs::Input_info): Remove.
9198 (Incremental_inputs::lock_): Remove.
9199 (Incremental_inputs::inputs_): Change type.
9200 (Incremental_inputs::inputs_map_): Remove.
9201 (Incremental_inputs::current_object_entry_): New data member.
9202 (Incremental_inputs::inputs_section_): New data member.
9203 (Incremental_inputs::symtab_section_): New data member.
9204 (Incremental_inputs::relocs_section_): New data member.
9205 (Incremental_inputs::reloc_count_): New data member.
9206 (Incremental_inputs_reader): New class.
9207 (Incremental_symtab_reader): New class.
9208 (Incremental_relocs_reader): New class.
9209 * layout.cc (Layout::finalize): Move finalization of incremental info
9210 and creation of incremental info sections to follow finalization of
9211 symbol table. Set offsets for postprocessing sections.
9212 (Layout::create_incremental_info_sections): Call
9213 Incremental_inputs::create_data_sections. Add incremental symtab
9214 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9215 sections to layout after input sections.
9216 * layout.h (struct Timespec): Forward declaration.
9217 (Layout::incremental_inputs): Add const.
9218 (Layout::create_incremental_info_sections): Add parameter.
9219 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9220 * object.cc: Include incremental.h.
9221 (Relobj::finalize_incremental_relocs): New function.
9222 (Sized_relobj::do_layout): Record input sections in incremental info.
9223 * object.h (Object::output_section): New function.
9224 (Object::output_section_offset): Moved from Relobj.
9225 (Object::get_incremental_reloc_base): New function.
9226 (Object::get_incremental_reloc_count): New function.
9227 (Object::do_output_section): New function.
9228 (Object::do_output_section_offset): Moved from Relobj.
9229 (Object::do_get_incremental_reloc_base): New function.
9230 (Object::do_get_incremental_reloc_count): New function.
9231 (Object::Object): Initialize new data members.
9232 (Relobj::output_section): Renamed do_output_section and moved to
9233 protected.
9234 (Relobj::output_section_offset): Moved to Object.
9235 (Relobj::do_get_incremental_reloc_base): New function.
9236 (Relobj::do_get_incremental_reloc_count): New function.
9237 (Relobj::allocate_incremental_reloc_counts): New function.
9238 (Relobj::count_incremental_reloc): New function.
9239 (Relobj::finalize_incremental_relocs): New function.
9240 (Relobj::next_incremental_reloc_index): New function.
9241 (Relobj::reloc_counts_): New data member.
9242 (Relobj::reloc_bases_): New data member.
9243 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9244 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9245 (Sized_relobj::incremental_relocs_scan): New function.
9246 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9247 (Sized_relobj::incremental_relocs_write): New function.
9248 (Sized_relobj::incremental_relocs_write_reltype): New function.
9249 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9250 incremental link.
9251 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9252 archives and object files elsewhere.
9253 (Add_symbols::run): Report object files here.
9254 (Finish_group::run): Report end of archive at end of group.
9255 * reloc.cc: Include layout.h, incremental.h.
9256 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9257 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9258 (Sized_relobj::incremental_relocs_scan): New function.
9259 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9260 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9261 (Sized_relobj::incremental_relocs_write): New function.
9262 (Sized_relobj::incremental_relocs_write_reltype): New function.
9263 * script.cc (read_input_script): Rewrite test for incremental link.
9264 Change call to Incremental_inputs::report_script.
9265 * symtab.h (Symbol_table::first_global_index): New function.
9266 (Symbol_table::output_count): New function.
9267
ce0d1972
DK
92682010-08-12 Doug Kwan <dougkwan@google.com>
9269
9270 * arm.cc (Target_arm::merge_object_attributes): Check command line
9271 options --no-wchar-size-warning and --no-enum-size-warning.
9272 * options.h (General_options): Add ld-compatible options
9273 --no-enum-size-warning and --no-wchar-size-warning.
9274
6e5710ce
ILT
92752010-08-04 Ian Lance Taylor <iant@google.com>
9276
9277 * x86_64.cc (Target_x86_64::Scan::local): Use
9278 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9279 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9280 (Target_x86_64::Scan::global): Likewise.
9281 (Target_x86_64::Relocate::relocate): Likewise.
9282 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9283 Likewise.
9284
fef830db
CC
92852010-08-03 Cary Coutant <ccoutant@google.com>
9286
9287 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9288 to reserve space in merged_strings vector. Keep total input size
9289 for stats.
9290 (Output_merge_string::do_print_merge_stats): Print total input size.
9291 * merge.h (Output_merge_string): Add input_size_ field.
9292 * stringpool.cc (Stringpool_template::string_length): Move
9293 implementations out of Stringpool_template class and place in
9294 stringpool.h.
9295 * stringpool.h (string_length): Move out of Stringpool_template.
9296
1e3811b0
ILT
92972010-08-03 Ian Lance Taylor <iant@google.com>
9298
9299 PR 11712
9300 * layout.cc (relaxation_loop_body): If address of load segment is
9301 set, adjust address to include headers if possible.
9302
7af0c620
ILT
93032010-08-03 Ian Lance Taylor <iant@google.com>
9304
9305 * version.cc (version_string): Bump to 1.10.
9306
22f0da72
ILT
93072010-08-03 Ian Lance Taylor <iant@google.com>
9308
9309 PR 11805
9310 * layout.h (enum Output_section_order): Define.
9311 (class Layout): Update declarations.
9312 * layout.cc (Layout::get_output_section): Add order parameter.
9313 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9314 is_first_non_relro parameters. Change all callers.
9315 (Layout::choose_output_section): Likewise.
9316 (Layout::add_output_section_data): Likewise.
9317 (Layout::make_output_section): Likewise. Set order.
9318 (Layout::default_section_order): New function.
9319 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9320 * output.cc (Output_section::Output_section): Initialize order_.
9321 Don't initialize deleted fields.
9322 (Output_segment::Output_segment): Don't initialize deleted
9323 fields.
9324 (Output_segment::add_output_section_to_load): New function
9325 replacing add_output_section. Change all callers to call this or
9326 add_output_section_to_nonload.
9327 (Output_segment::add_output_section_to_nonload): New function.
9328 (Output_segment::remove_output_section): Rewrite.
9329 (Output_segment::add_initial_output_data): Likewise.
9330 (Output_segment::has_any_data_sections): Likewise.
9331 (Output_segment::is_first_section_relro): Likewise.
9332 (Output_segment::maximum_alignment): Likewise.
9333 (Output_segment::has_dynamic_reloc): New function replacing
9334 dynamic_reloc_count. Change all callers.
9335 (Output_segment::has_dynamic_reloc_list): New function replacing
9336 dynamic_reloc_count_list. Change all callers.
9337 (Output_segment::set_section_addresses): Rewrite.
9338 (Output_segment::set_offset): Rewrite.
9339 (Output_segment::find_first_and_last_list): Remove.
9340 (Output_segment::set_tls_offsets): Rewrite.
9341 (Output_segment::first_section_load_address): Likewise.
9342 (Output_segment::output_section_count): Likewise.
9343 (Output_segment::section_with_lowest_load_address): Likewise.
9344 (Output_segment::write_section_headers): Likewise.
9345 (Output_segment::print_sections_to_map): Likewise.
9346 * output.h (class Output_data): Remove dynamic_reloc_count_
9347 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9348 (Output_data::add_dynamic_reloc): Rewrite.
9349 (Output_data::has_dynamic_reloc): New function.
9350 (Output_data::dynamic_reloc_count): Remove.
9351 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9352 is_last_relro_, is_first_non_relro_, is_interp_,
9353 is_dynamic_linker_section_ fields. Add order and set_order
9354 functions. Remove is_relro_local, set_is_relro_local,
9355 is_last_relro, set_is_last_relro, is_first_non_relro,
9356 set_is_first_non_relro functions, is_interp, set_is_interp,
9357 is_dynamic_linker_section, and set_is_dynamic_linker_section
9358 functions.
9359 (class Output_segment): Change Output_data_list from std::list to
9360 std:;vector. Add output_lists_ field. Remove output_data_ and
9361 output_bss_ fields. Update declarations.
9362
3ff2ccb0
ILT
93632010-08-02 Ian Lance Taylor <iant@google.com>
9364
9365 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9366 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9367 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9368
88a4108b
ILT
93692010-08-02 Ian Lance Taylor <iant@google.com>
9370
9371 PR 11855
9372 * script.cc (Script_options::Script_options): Initialize
9373 symbol_definitions_ and symbol_references_.
9374 (Script_options::add_symbol_assignment): Update
9375 symbol_definitions_ and symbol_references_.
9376 (Script_options::add_symbol_reference): New function.
9377 (script_symbol): New function.
9378 * script.h (class Script_options): Add symbol_definitions_ and
9379 symbol_references_ fields.
9380 (Script_options::referenced_const_iterator): New type.
9381 (Script_options::referenced_begin): New function.
9382 (Script_options::referenced_end): New function.
9383 (Script_options::is_referenced): New function.
9384 (Script_options::any_unreferenced): New function.
9385 * script-c.h (script_symbol): Declare.
9386 * yyscript.y (exp): Call script_symbol.
9387 * symtab.cc: Include "script.h".
9388 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9389 Change all callers. Check symbols referenced by scripts.
9390 (Symbol_table::add_undefined_symbols_from_command_line): Add
9391 layout parameter. Change all callers.
9392 (Symbol_table::do_add_undefined_symbols_from_command_line):
9393 Likewise. Break out loop body. Check symbols referenced by
9394 scripts.
9395 (Symbol_table::add_undefined_symbol_from_command_line): New
9396 function broken out of
9397 do_add_undefined_symbols_from_command_line.
9398 * symtab.h (class Symbol_table): Update declarations.
9399 * archive.cc: Include "layout.h".
9400 (Archive::should_include_member): Add layout parameter. Change
9401 all callers. Check for symbol mentioned in expression.
9402 * archive.h (class Archive): Update declaration.
9403 * object.cc (Sized_relobj::do_should_include_member): Add layout
9404 parameter.
9405 * object.h (Object::should_include_member): Add layout parameter.
9406 Change all callers.
9407 (Object::do_should_include_member): Add layout parameter.
9408 (class Sized_relobj): Update declaration.
9409 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9410 parameter.
9411 * dynobj.h (class Sized_dynobj): Update declaration.
9412 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9413 layout parameter.
9414 * plugin.h (class Sized_pluginobj): Update declaration.
9415
5f1ab67a
ILT
94162010-08-02 Ian Lance Taylor <iant@google.com>
9417
9418 PR 11866
9419 * output.cc (Output_segment::set_offset): Search for the first and
9420 last sections rather than assuming that the list is in order.
9421 (Output_segment::find_first_and_last_list): New function.
9422 * output.h (class Output_segment): Update declarations.
9423 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9424 (relro_strip_test_SOURCES): New variable.
9425 (relro_strip_test_DEPENDENCIES): New variable.
9426 (relro_strip_test_LDFLAGS): New variable.
9427 (relro_strip_test_LDADD): New variable.
9428 (relro_strip_test.so): New target.
9429
a8df5856
ILT
94302010-08-02 Ian Lance Taylor <iant@google.com>
9431
9432 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9433 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9434 (Target_i386::got_tlsdesc_section): New function.
9435 (Target_i386::got_section): Create space for GOT entries for
9436 TLSDESC relocations.
9437 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9438 R_386_TLS_GOTDESC.
9439 (Target_i386::Scan::global): Likewise.
9440 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9441 using TLSDESC GOT.
9442 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9443 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9444 (Target_x86_64::got_tlsdesc_section): New function.
9445 (Target_x86_64::got_section): Create space for GOT entries for
9446 TLSDESC relocations.
9447 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9448 R_386_TLS_GOTDESC.
9449 (Target_x86_64::Scan::global): Likewise.
9450 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9451 using TLSDESC GOT.
9452
0c10a0a6
ILT
94532010-08-02 Ian Lance Taylor <iant@google.com>
9454
9455 * testsuite/final_layout.sh: Use dc to convert from hex to
9456 decimal.
9457
41cbeecc
ST
94582010-07-29 Sriraman Tallam <tmsriram@google.com>
9459
9460 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9461 paramter to the call to gold::gc_process_relocs.
9462 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9463 paramter to the call to gold::gc_process_relocs.
9464 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9465 parameter to the call to gold::gc_process_relocs.
9466 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9467 template parameter to the call to gold::gc_process_relocs.
9468 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9469 paramter to the call to gold::gc_process_relocs.
9470 * gc.h (get_embedded_addend_size): New function.
9471 (gc_process_relocs): Save the size of the reloc for use by ICF.
9472 * icf.cc (get_section_contents): Get the addend from the text section
9473 for SHT_REL relocation sections.
9474 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9475 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9476 * int_encoding.h (read_from_pointer): New overloaded function.
9477 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9478 * testsuite/icf_sht_rel_addend_test.sh: New file.
9479 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9480 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9481
6ea55b82
RW
94822010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9483
9484 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9485 * Makefile.in: Regenerate.
9486 * testsuite/Makefile.in: Regenerate.
9487
9691462b
ILT
94882010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9489
9490 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9491 * gold/testsuite/debug_msg.cc: Likewise.
9492 * gold/testsuite/odr_violation1.cc
9493 * gold/testsuite/odr_violation2.cc
9494
76897331
CC
94952010-07-21 Cary Coutant <ccoutant@google.com>
9496
9497 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9498 string, and length fields.
9499 (Output_merge_string::Merged_strings_list): New type.
9500 (Output_merge_string::Merged_strings_lists): New typedef.
9501 (Output_merge_string): Replace merged_strings_ with
9502 merged_strings_lists_.
9503 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9504 Merged_strings_list per input object and section. Don't store pointer
9505 to the string. Don't store length with each merged string entry.
9506 (Output_merge_string::finalize_merged_data): Loop over list of merged
9507 strings lists. Recompute length of each merged string.
9508
78384e8f
CC
95092010-07-15 Cary Coutant <ccoutant@google.com>
9510
9511 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9512 here.
9513
783659f9
ILT
95142010-07-14 Ian Lance Taylor <iant@google.com>
9515
9516 * descriptors.cc (Descriptors::open): Report correct name in error
9517 message.
9518
131687b4
DK
95192010-07-13 Doug Kwan <dougkwan@google.com>
9520
9521 * arm.cc (Arm_input_section::Arm_input_section): For a
9522 SHT_ARM_EXIDX section, always keeps the input sections.
9523 (Arm_input_section::set_exidx_section_link): New method.
9524 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9525 has_errors_ to false.
9526 (Arm_exidx_input_section::has_errors,
9527 Arm_exidx_input_section::set_has_errors): New methods.
9528 (Arm_exidx_input_section::has_errors_): New data member.
9529 (Arm_relobj::get_exidx_shndx_list): New method.
9530 (Arm_output_section::append_text_sections_to_list): Do not skip
9531 section without SHF_EXECINSTR.
9532 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9533 errors.
2e702c99 9534 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9535 section header. Make error messages more verbose. Check for
9536 a non-executable section linked to an EXIDX section.
9537 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9538 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9539 check that there is no deferred EXIDX section if we exit early.
9540 Instead of not making an EXIDX section in case of an error, make one
9541 and set the has_errors flag of it.
9542 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9543 in a relocatable link.
9544 (Target_arm::do_relax): Look for the EXIDX output section instead of
9545 assuming that it is called .ARM.exidx.
2e702c99 9546 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9547 section list. Do not check for SHF_EXECINSTR section flags but
9548 skip any input section with errors.
9549 * output.cc (Output_section::Output_section): Initialize
9550 always_keeps_input_sections_ to false.
9551 (Output_section::add_input_section): Check for
9552 always_keeps_input_sections_.
9553 * output.h (Output_section::always_keeps_input_sections,
9554 Output_section::set_always_keeps_input_sections): New methods.
9555 (Output_section::always_keeps_input_sections): New data member.
9556
69517287
RÁE
95572010-07-13 Rafael Espindola <espindola@google.com>
9558
9559 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9560 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9561
82742395
ILT
95622010-07-13 Philip Herron <herron.philip@googlemail.com>
9563 Ian Lance Taylor <iant@google.com>
9564
9565 * output.h (Output_section_lookup_maps::add_merge_section):
9566 Correct check of whether value was inserted.
9567 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9568 (Output_section_lookup_maps::add_relaxed_input_section):
9569 Likewise.
9570 * arm.cc (Target_arm::got_section): Remove used local os.
9571 * i386.cc (Target_i386::got_section): Likewise.
9572 * x86_64.cc (Target_x86_64::got_section): Likewise.
9573 * sparc.cc (Target_sparc::got_section): Likewise.
9574 (Target_sparc::relocate): Remove unused local have_got_offset.
9575 * powerpc.cc (Target_powerpc::relocate): Likewise.
9576
f2d707b5
ILT
95772010-07-13 Ian Lance Taylor <iant@google.com>
9578
241531d6
ILT
9579 * compressed_output.cc (zlib_decompress): Fix signature in
9580 !HAVE_ZLIB_H case.
9581
f2d707b5
ILT
9582 * archive.cc (Archive::include_member): Unlock an external member
9583 of a thin archive. Don't bother to delete an object we know is
9584 NULL.
9585
a2e47362
CC
95862010-07-12 Cary Coutant <ccoutant@google.com>
9587
9588 * compressed_output.cc (zlib_decompress): New function.
9589 (get_uncompressed_size): New function.
9590 (decompress_input_section): New function.
9591 * compressed_output.h (get_uncompressed_size): New function.
9592 (decompress_input_section): New function.
9593 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9594 Handle compressed debug sections.
9595 * layout.cc (is_compressed_debug_section): New function.
9596 (Layout::output_section_name): Map compressed section names to
9597 canonical names.
9598 * layout.h (is_compressed_debug_section): New function.
9599 (is_debug_info_section): Recognize compressed debug sections.
9600 * merge.cc: Include compressed_output.h.
9601 (Output_merge_data::do_add_input_section): Handle compressed
9602 debug sections.
9603 (Output_merge_string::do_add_input_section): Handle compressed
9604 debug sections.
9605 * object.cc: Include compressed_output.h.
9606 (Sized_relobj::Sized_relobj): Initialize new data members.
9607 (build_compressed_section_map): New function.
9608 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9609 * object.h (Object::section_is_compressed): New method.
9610 (Object::do_section_is_compressed): New method.
9611 (Sized_relobj::Compressed_section_map): New type.
9612 (Sized_relobj::do_section_is_compressed): New method.
9613 (Sized_relobj::compressed_sections_): New data member.
9614 * output.cc (Output_section::add_input_section): Handle compressed
9615 debug sections.
9616 * reloc.cc: Include compressed_output.h.
9617 (Sized_relobj::write_sections): Handle compressed debug sections.
9618
ce279a62
CC
96192010-07-08 Cary Coutant <ccoutant@google.com>
9620
9621 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9622 weak when resolving to a dynamic def.
9623 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9624 for weak undef/dynamic def cases. Adjust callers.
9625 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9626 undef_binding_weak_.
9627 (Symbol_table::sized_write_globals): Adjust symbol binding.
9628 (Symbol_table::sized_write_symbol): Add binding parameter.
9629 * symtab.h (Symbol::set_undef_binding): New method.
9630 (Symbol::is_undef_binding_weak): New method.
9631 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9632 (Symbol_table::should_override): Add new parameter.
9633 (Symbol_table::sized_write_symbol): Add new parameter.
9634
9635 * testsuite/weak_undef_file1.cc: Add new test case.
9636 * testsuite/weak_undef_file2.cc: Fix header comment.
9637 * testsuite/weak_undef_test.cc: Add new test case.
9638
b2286c10
DK
96392010-06-29 Doug Kwan <dougkwan@google.com>
9640
9641 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9642 Initialize USE_SYMBOL_.
9643 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9644 definition.
9645 (Arm_reloc_property::uses_symbol_): New data member declaration.
9646 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9647 uses symbol value and symbol is undefined but not weakly undefined.
9648
4802450a
RÁE
96492010-06-28 Rafael Espindola <espindola@google.com>
9650
9651 * plugin.cc (Plugin::load): Use dlerror.
9652
e5ca47ba
ILT
96532010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9654
9655 * symtab.cc (detect_odr_violations): When reporting an ODR
9656 violation, report an object where the symbol is defined.
9657
8a75a161
DK
96582010-06-25 Doug Kwan <dougkwan@google.com>
9659
9660 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9661 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9662 definition.
9663 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9664 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9665 target hook to detect function points.
9666 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9667 * icf.h (Icf::check_section_for_function_pointers): Change type of
9668 parameter SECTION_NAME to const reference to std::string. Use
9669 target hook to determine if section may have unsafe pointers.
9670 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9671 method definition.
9672
42218b9f
RÁE
96732010-06-21 Rafael Espindola <espindola@google.com>
9674
9675 * fileread.cc (Input_file::find_fie): New
9676 (Input_file::open): Use Input_file::find_fie.
9677 * fileread.h (Input_file::find_fie): New
9678 * plugin.cc (set_extra_library_path): New.
9679 (Plugin::load): Add set_extra_library_path to the transfer vector.
9680 (Plugin_manager::set_extra_library_path): New.
9681 (Plugin_manager::add_input_file): Use the extra search path if set.
9682 (set_extra_library_path(): New.
9683 * plugin.h (Plugin_manager): Add set_extra_library_path and
9684 extra_search_path_.
9685
a0506cca
CC
96862010-06-19 Cary Coutant <ccoutant@google.com>
9687
9688 * layout.cc (gdb_sections): Add .debug_types.
9689 (lines_only_debug_sections): Likewise.
9690
6508b958
RÁE
96912010-06-18 Rafael Espindola <espindola@google.com>
9692
9693 * plugin.cc (add_input_file,add_input_library)
9694 (Plugin_manager::add_input_file): Make filename arguments const.
9695 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9696 const.
9697
3e235302
DK
96982010-06-16 Doug Kwan <dougkwan@google.com>
9699
9700 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9701 .ARM.attributes section if we have not merged any input
9702 attributes sections.
9703
106e8a6c
DK
97042010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9705
9706 * arm.cc: Allow combining objects with no EABI version
9707 information.
9708
91ff43fe
RÁE
97092010-06-15 Rafael Espindola <espindola@google.com>
9710
9711 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9712
68ed838c
ILT
97132010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9714
9715 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9716 (struct iovec): Correct !HAVE_READV definition.
9717
f3a2388f
CC
97182010-06-10 Cary Coutant <ccoutant@google.com>
9719
9720 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9721 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9722 reloc sections.
9723 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9724
9725 PR 11683
9726 * symtab.h (Symbol::is_placeholder): New member function.
9727 * target-reloc.h (relocate_section): Check for placeholder symbols.
9728
9729 * testsuite/Makefile.am (plugin_test_8): New test.
9730 (plugin_test_9): New test.
9731 * testsuite/Makefile.in: Regenerate.
9732
e1df38aa
NC
97332010-06-09 Nick Clifton <nickc@redhat.com>
9734
9735 * yyscript.y (input_list_element): Allow strings prefixed with
9736 the '-' character. Treat these as libraries.
9737 * script.cc (script_add_library): New function. Adds a library
9738 specified by "-l<name>" found in an input script.
9739 * script-c.h: Add prototype for script_add_library.
9740
25bbe950
DK
97412010-06-07 Doug Kwan <dougkwan@google.com>
9742
9743 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9744 Restrict stub-group size to be within long conditional branch
9745 range when working around cortex-A8 erratum.
9746
0f32ea4c
ILT
97472010-06-07 Damien Diederen <dd@crosstwine.com>
9748
9749 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9750 #ifdef typo.
9751
8fe2a369
ST
97522010-06-03 Sriraman Tallam <tmsriram@google.com>
9753
9754 PR gold/11658
9755 * output.cc
9756 (Output_section::Input_section_sort_entry::compare_section_ordering):
9757 Change to return non-zero correctly.
9758 (Output_section::Input_section_sort_section_order_index_compare
9759 ::operator()): Change to fix ambiguity in comparisons.
9760
6e9ba2ca
ST
97612010-06-01 Sriraman Tallam <tmsriram@google.com>
9762
9763 * gold.h (is_wildcard_string): New function.
9764 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9765 (Layout::layout_eh_frame): Ditto.
9766 (Layout::find_section_order_index): New method.
9767 (Layout::read_layout_from_file): New method.
9768 * layout.h (Layout::find_section_order_index): New method.
9769 (Layout::read_layout_from_file): New method.
9770 (Layout::input_section_position_): New private member.
9771 (Layout::input_section_glob_): New private member.
9772 * main.cc (main): Call read_layout_from_file here.
9773 * options.h (--section-ordering-file): New option.
9774 * output.cc (Output_section::input_section_order_specified_): New
9775 member.
9776 (Output_section::Output_section): Initialize new member.
9777 (Output_section::add_input_section): Add new parameter.
9778 Keep input sections when --section-ordering-file is used.
9779 (Output_section::set_final_data_size): Sort input sections when
9780 section ordering file is specified.
9781 (Output_section::Input_section_sort_entry): Add new parameter.
9782 Check sorting type.
9783 (Output_section::Input_section_sort_entry::compare_section_ordering):
9784 New method.
9785 (Output_section::Input_section_sort_compare::operator()): Change to
9786 consider section_order_index.
9787 (Output_section::Input_section_sort_init_fini_compare::operator()):
9788 Change to consider section_order_index.
9789 (Output_section::Input_section_sort_section_order_index_compare
9790 ::operator()): New method.
9791 (Output_section::sort_attached_input_sections): Change to sort
9792 according to section order when specified.
e1df38aa
NC
9793 (Output_section::add_input_section<32, true>): Add new parameter.
9794 (Output_section::add_input_section<64, true>): Add new parameter.
9795 (Output_section::add_input_section<32, false>): Add new parameter.
9796 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9797 * output.h (Output_section::add_input_section): Add new parameter.
9798 (Output_section::input_section_order_specified): New
9799 method.
9800 (Output_section::set_input_section_order_specified): New method.
9801 (Input_section::Input_section): Initialize section_order_index_.
9802 (Input_section::section_order_index): New method.
9803 (Input_section::set_section_order_index): New method.
9804 (Input_section::section_order_index_): New member.
9805 (Input_section::Input_section_sort_section_order_index_compare): New
9806 struct.
9807 (Output_section::input_section_order_specified_): New member.
9808 * script-sections.cc (is_wildcard_string): Delete and move modified
9809 method to gold.h.
9810 (Output_section_element_input::Output_section_element_input): Modify
9811 call to is_wildcard_string.
9812 (Output_section_element_input::Input_section_pattern
9813 ::Input_section_pattern): Ditto.
9814 (Output_section_element_input::Output_section_element_input): Ditto.
9815 * testsuite/Makefile.am (final_layout): New test case.
9816 * testsuite/Makefile.in: Regenerate.
9817 * testsuite/final_layout.cc: New file.
9818 * testsuite/final_layout.sh: New file.
9819
3537c84b
RÁE
98202010-06-01 Rafael Espindola <espindola@google.com>
9821
9822 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9823
105b6afd
RÁE
98242010-06-01 Rafael Espindola <espindola@google.com>
9825
9826 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9827 visibility of symbols.
9828
29e11421
DK
98292010-05-27 Doug Kwan <dougkwan@google.com>
9830
9831 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9832 from start of output section instead of address for a local symbol
9833 in a merged or relaxed section when doing a relocatable link.
9834
5e0f337e
RÁE
98352010-05-26 Rafael Espindola <espindola@google.com>
9836
703d02da 9837 PR 11604
5e0f337e
RÁE
9838 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9839 adding sections the garbage collector removed.
9840 * gold/testsuite/Makefile.am: Add test.
9841 * gold/testsuite/Makefile.in: Regenerate.
9842 * gold/testsuite/plugin_test_7.sh: New.
9843 * gold/testsuite/plugin_test_7_1.c: New.
9844 * gold/testsuite/plugin_test_7_2.c: New.
9845
f4187277
RÁE
98462010-05-26 Rafael Espindola <espindola@google.com>
9847
9848 * script-sections.cc (Output_section_definition::set_section_addresses):
9849 Check for --section-start.
9850
5c388529
DK
98512010-05-26 Doug Kwan <dougkwan@google.com>
9852
9853 * arm.cc (Arm_scan_relocatable_relocs): New class.
9854 (Target_arm::relocate_special_relocatable): New method.
9855 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9856 (Arm_relocate_functions::thumb_branch_common): Same.
9857 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9858 instead of Default_scan_relocatable_relocs.
9859 * target-reloc.h (relocate_for_relocatable): Let target handle
9860 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9861 * target.h (Sized_target::relocate_special_relocatable): New method.
9862
bca1c3ae
ILT
98632010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9864
9865 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9866
0439c796
DK
98672010-05-23 Doug Kwan <dougkwan@google.com>
9868
9869 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9870 instead of a cast.
9871 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9872 with a direct branch, not a conditional branch, to a stub.
9873 * merge.cc (Output_merge_base::record_input_section): New method
9874 defintion.
9875 (Output_merge_data::do_add_input_section): Record input section if
9876 keeps-input-sections flag is set.
9877 (Output_merge_string::do_add_input_section): Ditto.
9878 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9879 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9880 INPUT_SECTIONS_.
9881 (Output_merge_base::keeps_input_sections,
9882 Output_merge_base::set_keeps_input_sections,
9883 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9884 method definitions.
9885 (Output_merge_base::Input_sections): New type declaration.
9886 (Output_merge_base::input_sections_begin,
9887 Output_merge_base::input_sections_end,
9888 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9889 (Output_merge_base::bool keeps_input_sections_,
9890 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9891 Output_merge_base::input_sections_): New data members.
9892 (Output_merge_data::do_set_keeps_input_sections): New method
9893 defintion.
9894 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9895 * output.cc (Output_section::Input_section::relobj): Move method
9896 defintion from class declaration to here and handle merge sections.
9897 (Output_section::Input_section::shndx): Ditto.
9898 (Output_section::Output_section): Remove initializations of removed
9899 data members and initialize new data member LOOKUP_MAPS_.
9900 (Output_section::add_input_section): Set keeps-input-sections flag
9901 for a newly created merge output section as appropriate. Adjust code
9902 to use Output_section_lookup_maps class.
9903 (Output_section::add_relaxed_input_section): Adjst code for lookup
9904 maps code refactoring.
2e702c99 9905 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9906 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9907 class. If adding input section to a newly created merge output
9908 section fails, remove the new merge section.
9909 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9910 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9911 (Output_section::find_merge_section): Ditto.
0439c796 9912 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9913 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9914 Output_section_lookup_maps class.
9915 (Output_section::get_input_sections): Export merge sections. Adjust
9916 code to use Output_section_lookup_maps class.
9917 (Output_section:::add_script_input_section): Adjust code to use
9918 Output_section_lookup_maps class. Update lookup maps for merge
9919 sections also.
9920 (Output_section::discard_states): Use Output_section_lookup_maps.
9921 (Output_section::restore_states): Same.
9922 * output.h (Merge_section_properties): Move class defintion out of
9923 Output_section.
9924 (Output_section_lookup_maps): New class.
9925 (Output_section::Input_section::is_merge_section): New method
9926 defintion.
9927 (Output_section::Input_section::relobj): Move defintion out of class
9928 defintion. Declare method only.
9929 (Output_section::Input_section::shndx): Ditto.
9930 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9931 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9932 (Output_section::Merge_section_by_properties_map,
9933 Output_section::Output_section_data_by_input_section_map,
9934 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9935 Remove types.
2e702c99 9936 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9937 KEEPS_INPUT_SECTIONS.
9938 (Output_section::build_lookup_maps): New method declaration.
9939 (Output_section::merge_section_map_,
9940 Output_section::merge_section_by_properties_map_,
9941 Output_section::relaxed_input_section_map_,
9942 Output_section::is_relaxed_input_section_map_valid_): Remove data
9943 members.
9944 (Output_section::lookup_maps_): New data member.
9945
76295588
L
99462010-05-21 Doug Kwan <dougkwan@google.com>
9947
9948 PR gold/11619
9949 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9950 avoid a compilation error.
9951
d103a984
RÁE
99522010-05-19 Rafael Espindola <espindola@google.com>
9953
9954 * script-sections.cc (Output_section_definition::allocate_to_segment):
9955 Update the phdrs_list even when the output section is NULL.
9956 * testsuite/Makefile.am: Add test.
9957 * testsuite/Makefile.in: Regenerate.
9958 * testsuite/script_test_9.cc: New.
9959 * testsuite/script_test_9.sh: New.
9960 * testsuite/script_test_9.t: New.
9961
6625d24e
DK
99622010-05-19 Doug Kwan <dougkwan@google.com>
9963
9964 * arm.cc (Arm_input_section::original_size): New method.
9965 (Arm_input_section::do_addralign): Add a cast.
9966 (Arm_input_section::do_output_offset): Remove static cast.
9967 (Arm_input_section::original_addralign,
9968 Arm_input_section::original_size_): Change type to uint32_t.
9969 (Arm_input_section::init): Add safe casts for section alignment
9970 and size.
9971 (Arm_input_section::set_final_data_size): Do not set address and
9972 offset of stub table.
9973 (Arm_output_section::fix_exidx_coverage): Change use of of
9974 Output_section::Simple_input_section to that of
9975 Output_section::Input_section.
9976 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9977 except for the first pass.
9978 * output.cc (Output_section::get_input_sections): Change type of
9979 input_sections to std::list<Input_section>.
9980 (Output_section::add_script_input_section): Rename from
9981 Output_section::add_simple_input_section. Change type of SIS
9982 parameter from Simple_input_section to Input_section.
9983 * output.h (Output_section::Simple_input_section): Remove class.
9984 (Output_section::Input_section): Change class visibility to public.
9985 (Output_section::Input_section::addralign): Use stored alignments
9986 for special input sections if set.
9987 (Output_section::Input_section::set_addralign): New method.
9988 (Output_section::get_input_sections): Change parameter type from
9989 list of Simple_input_section to list of Input_section.
9990 (Output_section::add_script_input_section): Rename from
9991 Output_section::add_simple_input_section. Change first parameter's
9992 type from Simple_input_section to Input_section and remove the
9993 second and third parameters.
9994 * script-sections.cc (Input_section::Input_section_list): Change
9995 type to list of Output_section::Input_section/
9996 (Input_section_info::Input_section_info): Change parameter type of
9997 INPUT_SECTION to Output_section::Input_section.
9998 (Input_section_info::input_section): Change return type.
9999 (Input_section_info::input_section_): Change type to
10000 Output_section::Input_section.
10001 (Output_section_element_input::set_section_addresses): Adjust code
10002 to use Output_section::Input_section instead of
10003 Output_section::Simple_input_section. Adjust code for renaming
10004 of Output_section::add_simple_input_section.
10005 (Orphan_output_section::set_section_addresses): Ditto.
10006
e1e82ea4
RW
100072010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10008
10009 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10010 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10011
91e75c8a
RÁE
100122010-05-18 Rafael Espindola <espindola@google.com>
10013
10014 * options.cc (General_options::finalize): Handle -nostdlib.
10015 * options.h (nostdlib): New option.
10016 * script.cc (script_add_search_dir): Handle -nostdlib.
10017
da59ad79
DK
100182010-05-12 Doug Kwan <dougkwan@google.com>
10019
10020 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10021 attributes section only if there no attributes section after merging.
10022 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10023 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10024 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10025 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10026 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10027 and arm_attr_merge_7.stdout.
10028 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10029 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10030 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10031 arm_attr_merge_7b.o): New rules.
10032 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10033 arm_attr_merge_7
10034 * testsuite/Makefile.in: Regenerate.
10035 * testsuite/arm_attr_merge.sh: New file.
10036 * testsuite/arm_attr_merge_[67][ab].s: Same.
10037
3e01a7fd
NC
100382010-05-05 Nick Clifton <nickc@redhat.com>
10039
10040 * po/es.po: Updated Spanish translation.
10041
7ad2014a
L
100422010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10043
10044 * Makefile.am (install-exec-local): Properly install gold as
10045 default cross linker.
10046 * Makefile.in: Regenerated.
10047
4fda8867
NC
100482010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10049 Nick Clifton <nickc@redhat.com>
10050
10051 * configure.ac (install_as_default): Define and set to false
10052 unless --enable-gold or --enable-gold=both/gold has been
10053 specified.
10054 * configure: Regenerate.
10055
10056 * Makefile.am (install-exec-local): Install the executable as
10057 'ld.gold'. If install_as_default is true then also install it as
10058 'ld'.
10059 * Makefile.in: Regenerated.
10060
bd288ea2
ILT
100612010-04-24 Ian Lance Taylor <iant@google.com>
10062
10063 * layout.cc (Layout::layout_reloc): In relocatable link don't
10064 combine reloc sections for grouped sections.
10065
ef38fd8a
ST
100662010-04-23 Sriraman Tallam <tmsriram@google.com>
10067
10068 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10069 sections that are not ordinary to icf.
10070 * icf.cc (get_section_contents): Handle relocation pointing to section
10071 with no object or shndx information.
10072 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10073 * testsuite/Makefile.in: Regenerate.
10074 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10075 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10076
f6973bdc
ILT
100772010-04-22 Ian Lance Taylor <iant@google.com>
10078
10079 * expression.cc (Expression::Expression_eval_info): Add
10080 result_alignment_pointer field.
10081 (Expression::eval_with_dot): Add result_alignment_pointer
10082 parameter. Change all callers.
10083 (Expression::eval_maybe_dot): Likewise.
10084 (class Binary_expression): Add alignment_pointer parameter to
10085 left_value and right_value. Change all callers.
10086 (BINARY_EXPRESSION): Set result alignment.
10087 (class Trinary_expression): Add alignment_pointer parameter to
10088 arg2_value and arg3_value. Change all callers.
10089 (Trinary_cond::value): Set result alignment.
10090 (Max_expression::value, Min_expression::value): Likewise.
10091 (Align_expression::value): Likewise.
10092 * script-sections.cc (class Sections_element): Add dot_alignment
10093 parameter to set_section_addresses virtual function. Update
10094 instantiations.
10095 (class Output_section_element): Likewise.
10096 (Script_sections::create_segments): Add dot_alignment parameter.
10097 Change all callers.
10098 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10099 (Script_sections::set_phdrs_clause_addresses): Likewise.
10100 * script-sections.h: Update declarations.
10101 * script.h: Update declarations.
10102 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10103 min_p_align.
10104 * testsuite/script_test_3.t: Set large alignment.
10105 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10106 segment has expected alignment.
10107
9c9c98a5
NC
101082010-04-22 Nick Clifton <nickc@redhat.com>
10109
10110 * po/gold.pot: Updated by the Translation project.
10111 * po/vi.po: Updated Vietnamese translation.
10112
2253bfba
L
101132010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10114
10115 * testsuite/Makefile.am (check_PROGRAMS): Add
10116 icf_virtual_function_folding_test.
10117 * testsuite/Makefile.in: Regenerated.
10118
85fdf906
AH
101192010-04-15 Andrew Haley <aph@redhat.com>
10120
10121 * options.h (merge_exidx_entries): New option.
10122 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10123 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10124 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10125 (Target_arm::merge_exidx_entries): New function.
10126 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10127 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10128 to Arm_exidx_fixup constructor.
10129 Add new arg, merge_exidx_entries.
10130 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10131 Arm_output_section::fix_exidx_coverage.
10132
ce97fa81
ST
101332010-04-18 Sriraman Tallam <tmsriram@google.com>
10134
10135 * icf.cc (get_section_contents): Check for preemptible functions.
10136 Ignore addend when appropriate.
10137 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10138 section folded.
10139 (add_from_relobj): Check for section folded.
10140 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10141 * symtab.h (should_add_dynsym_entry): Add new parameter.
10142 * target-reloc.h (scan_relocs): Check for section folded.
10143 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10144 Check reloc types for function pointers in shared objects.
10145 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10146 case.
10147 (icf_preemptible_functions_test): New test case.
10148 (icf_string_merge_test): New test case.
10149 * testsuite.Makefile.in: Regenerate.
10150 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10151 bar_glob. Refactor code.
10152 * testsuite/icf_preemptible_functions_test.cc: New file.
10153 * testsuite/icf_preemptible_functions_test.sh: New file.
10154 * testsuite/icf_string_merge_test.cc: New file.
10155 * testsuite/icf_string_merge_test.sh: New file.
10156 * testsuite/icf_virtual_function_folding_test.cc: New file.
10157 * testsuite/icf_virtual_function_folding_test.sh: New file.
10158
04ceb17c
DK
101592010-04-14 Doug Kwan <dougkwan@google.com>
10160
10161 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10162 for local symbol recounting if we remove a section due to ICF.
10163 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10164 there are no regular objects in input.
10165
153e7da4
DK
101662010-04-13 Doug Kwan <dougkwan@google.com>
10167
10168 * arm.cc (Arm_input_section::set_final_data_size): Compute
10169 accurate final data size instead of using current data size.
10170
4dbd9faf
DK
101712010-04-09 Doug Kwan <dougkwan@google.com>
10172
10173 * layout.cc (Layout::choose_output_section): Handle script section
10174 types.
10175 (Layout::make_output_section_for_script): Add section type parameter.
10176 Handle script section types.
10177 * layout.h (Layout::make_output_section_for_script): Add section
10178 type parameter.
10179 * output.cc (Output_section::Output_section): Initialize data member
10180 is_noload_.
10181 (Output_section::do_reset_address_and_file_offset): Do not set address
10182 to 0 if section is a NOLOAD section.
10183 * output.h (Output_section::is_noload): New method.
10184 (Output_section::set_is_noload): Ditto.
10185 (Output_section::is_noload_): New data member.
10186 * script-c.h (Script_section_type): New enum type.
10187 (struct Parser_output_section_header): Add new file section_type.
10188 * script-sections.cc (Sections_element::output_section_name): Add
10189 parameter for returning script section type.
10190 (Output_section_definition::output_section_name): Ditto.
10191 (Output_section_definition::section_type)P; New method.
10192 (Output_section_definiton::script_section_type_name): Ditto.
10193 (Output_section_definition::script_section_type_): New data member.
10194 (Output_section_definition::Output_section_definition): Initialize
10195 data member Output_section_definition::script_section_type_.
10196 (Output_section_definition::create_sections): Pass script section type
10197 to Layout::make_output_section_for_script.
10198 (Output_section_definition::output_section_name): Return script
10199 section type to caller.
10200 (Output_section_definition::set_section_address): Do not advance
10201 dot value and load address if section type is NOLOAD. Set address
10202 of NOLOAD sections regardless of section flags.
10203 (Output_section_definition::print): Print section type if it is
10204 not SCRIPT_SECTION_TYPE_NONE.
10205 (Output_section_definition::section_type): New method.
10206 (Output_section_definition::script_section_type_name): Ditto.
10207 (Script_sections::output_section_name): Add new parameter
10208 PSECTION_TYPE for returning script section type. Pass it to
10209 section elements. Handle discard sections.
10210 (Sort_output_sections::operator()): Handle NOLOAD sections.
10211 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10212 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10213 returning script section type.
10214 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10215 INFO and NOLOAD.
10216 * yyscript.y (union): Add new field SECTION_TYPE.
10217 (COPY, DSECT, INFO, NOLOAD): New tokens.
10218 (opt_address_and_section_type): Change type to output_section_header.
10219 (section_type): New non-terminal
10220 (section_header): Handle section type.
2253bfba 10221 (opt_address_and_section_type): Return section type value.
4dbd9faf 10222
721ea635
L
102232010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10224
10225 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10226 * testsuite/plugin_common_test_2.c (foo): Likewise.
10227
6bf924b0
DK
102282010-04-08 Doug Kwan <dougkwan@google.com>
10229
10230 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10231 Output_merge_data.
10232 * output.cc (Output_section::add_merge_input_section): Simplify
10233 code and return status of Output_merge_base::add_input_section.
e1df38aa 10234 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10235 returns true.
10236
24af6f92
DK
102372010-04-07 Doug Kwan <dougkwan@google.com>
10238
10239 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10240 if section is marked as containing instructions but has no mapping
10241 symbols.
10242 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10243 correct section index.
10244 (Arm_relobj::find_linked_text_section): Ditto.
10245
00698fc5
CC
102462010-04-07 Cary Coutant <ccoutant@google.com>
10247
10248 * archive.cc (include_member): Destroy Read_symbols_data object before
10249 releasing file.
10250 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10251 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10252 (Read_symbols_data::~Read_symbols_data) New destructor.
10253 (Section_relocs::Section_relocs) New constructor.
10254 (Section_relocs::~Section_relocs) New destructor.
10255 (Read_relocs_data::Read_relocs_data) New constructor.
10256 (Read_relocs_data::~Read_relocs_data) New destructor.
10257 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10258 pointers to NULL after deleting.
10259
7296d933
DK
102602010-04-07 Doug Kwan <dougkwan@google.com>
10261
10262 * arm.cc: Replace "endianity" with "endianness" in comments.
10263 (Arm_exidx_cantunwind): Ditto.
10264 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10265 (Arm_relobj::merge_flags_and_attributes): New method.
10266 (Arm_relobj::merge_flags_and_attributes_): New data member.
10267 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10268 (Arm_relobj::scan_sections_for_stubs): Ditto.
10269 (Arm_relobj::do_read_symbols): Check to see if we really want to
10270 merge processor-specific flags and attributes. Exit early if
10271 an object is empty except for section names and the undefined symbol.
10272 (Target_arm::do_finalize_sections): Move check for ELF format to
10273 Arm_relobj::do_read_symbols. Merge processor specific flags and
10274 attributes from a regular object only when we have determined that
10275 it is aapropriate. Do not create an .ARM.attributes section in
10276 output if there is no regular input object.
10277 (Target_arm::merge_processor_specific_flags): Check
10278 --warn-mismatch before printing any error.
10279 (Target_arm::merge_object_attributes): Ditto.
10280 * gold.cc (queue_middle_tasks): Handle the case in which there is
10281 no regular object in input.
10282 * options.cc (General_options::parse_EB): New method.
10283 (General_options::parse_EL): Same.
10284 (General_options::General_options): Initialize endianness_.
10285 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10286 New options.
10287 (General_options::Endianness): New enum.
10288 (General_options::endianness): New method.
10289 (General_options::endianness_): New data member.
10290 * parameters.cc (Parameters::set_options): Check target endianness.
10291 (Parameters::set_target_once): Ditto.
10292 (Parameters::check_target_endianness): New method.
10293 (parameters_force_valid_target): If either -EL or -EB is specified,
10294 use it to define endianness of default target.
10295 * parameters.h (Parameters::check_target_endianness): New method
10296 declaration.
10297 * target.h (class Target): Change "endianity" to "endianness"
10298 in comments.
10299
efc8d4f2
RW
103002010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10301
10302 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10303 * configure: Regenerate.
10304 * Makefile.in: Regenerate.
10305 * testsuite/Makefile.in: Regenerate.
10306
be234d88
CC
103072010-04-06 Cary Coutant <ccoutant@google.com>
10308
10309 gcc PR lto/42757
10310 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10311 prevailing definitions of common symbols.
10312 * testsuite/plugin_test_6.sh: New test case.
10313 * testsuite/plugin_common_test_1.c: New test case.
10314 * testsuite/plugin_common_test_2.c: New test case.
10315 * testsuite/Makefile.am (plugin_test_6): New test case.
10316 * testsuite/Makefile.in: Regenerate.
10317
bd32c6bd
NC
103182010-04-06 Nick Clifton <nickc@redhat.com>
10319
10320 * po/vi.po: New Vietnamese translation.
10321
323c532f
DK
103222010-03-30 Doug Kwan <dougkwan@google.com>
10323
10324 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10325
4fcd97eb
DK
103262010-03-25 Doug Kwan <dougkwan@google.com>
10327
10328 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10329 to avoid a conversion warning on a 32-bit host.
10330
4ebf39db
ILT
103312010-03-24 Ian Lance Taylor <iant@google.com>
10332
10333 * testsuite/script_test_3.t: Add a TLS segment.
10334 * testsuite/Makefile.am (check_PROGRAMS): Add
10335 tls_phdrs_script_test.
10336 (tls_phdrs_script_test_SOURCES): Define.
10337 (tls_phdrs_script_test_DEPENDENCIES): Define.
10338 (tls_phdrs_script_test_LDFLAGS): Define.
10339 (tls_phdrs_script_test_LDADD): Define.
10340 * testsuite/Makefile.in: Rebuild.
10341
4a599bdd
CC
103422010-03-23 Cary Coutant <ccoutant@google.com>
10343
10344 * fileread.cc (find_or_make_view): Fix comment.
10345
6c93b22c
ILT
103462010-03-23 Ian Lance Taylor <iant@google.com>
10347
10348 * script-sections.cc (class Orphan_section_placement): Define
10349 PLACE_TLS and PLACE_TLS_BSS.
10350 (Orphan_section_placement::Orphan_section_placement): Initialize
10351 new places.
10352 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10353 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10354 (tls_script_test_SOURCES): Define.
10355 (tls_script_test_DEPENDENCIES): Define.
10356 (tls_script_test_LDFLAGS): Define.
10357 (tls_script_test_LDADD): Define.
10358 * testsuite/Makefile.in: Rebuild.
10359
a2c7281b
DK
103602010-03-22 Doug Kwan <dougkwan@google.com>
10361
10362 * arm.cc (Arm_relocate_functions::abs8,
10363 Arm_relocate_functions::abs16): Use correct check for overflow
10364 specified in the ARM ELF specs.
10365 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10366 target of a BLX instruction specially.
10367 (Reloc_stub::stub_type_for_reloc): Ditto.
10368 (Relocate::relocate): Use symbolic names instead of numeric relocation
10369 codes to report error.
10370 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10371 workaround.
10372 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10373 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10374 thumb2_blx_out_of_range.stdout
10375 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10376 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10377 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10378 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10379 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10380 thumb2_blx_in_range, thumb2_blx_in_range.o,
10381 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10382 thumb2_blx_out_of_range.o): New rules.
2e702c99 10383 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10384 thumb2_blx_in_range and thumb2_blx_out_of_range.
10385 * testsuite/Makefile.in: Regenerate.
10386 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10387 * testsuite/thumb_blx_in_range.s: New file.
10388 * testsuite/thumb_blx_out_of_range.s: New file.
10389
b0193076
RÁE
103902010-03-22 Rafael Espindola <espindola@google.com>
10391
10392 * archive.cc (Should_include): Move to archive.h.
10393 (should_include_member): Make it a member of Archive.
10394 (Lib_group): New.
10395 (Add_lib_group_symbols): New.
10396 * archive.h: Include options.h.
10397 (Archive_member): Moved from Archive.
10398 (Should_include): Moved from archive.cc.
10399 (Lib_group): New.
10400 (Add_lib_group_symbols): New.
10401 * dynobj.cc (do_should_include_member): New.
10402 * dynobj.h (do_should_include_member): New.
10403 * gold.cc (queue_initial_tasks): Update call to queue.
10404 * main.cc (main): Print lib group stats.
10405 * object.cc (do_should_include_member): New.
10406 * object.h: Include archive.h.
10407 (Object::should_include_member): New.
10408 (Object::do_should_include_member): New.
10409 (Sized_relobj::do_should_include_member): New.
10410 * options.cc (General_options::parse_start_lib): New.
10411 (General_options::parse_end_lib): New.
10412 (Input_arguments::add_file): Handle lib groups.
10413 (Input_arguments::start_group): Check we are not in a lib.
10414 (Input_arguments::start_lib): New.
10415 (Input_arguments::end_lib): New.
10416 * options.h (General_options): Add start_lib and end_lib.
10417 (Input_argument::lib_): New.
10418 (Input_argument::lib): New.
10419 (Input_argument::is_lib): New.
10420 (Input_file_lib): New.
10421 (Input_arguments::in_lib_): New.
10422 (Input_arguments::in_lib): New.
10423 (Input_arguments::start_lib): New.
10424 (Input_arguments::end_lib_): New.
10425 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10426 in unused members as preempted.
10427 (Sized_pluginobj::do_should_include_member): New.
10428 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10429 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10430 return the blocker.
10431 (Read_symbols::do_whole_lib_group): New.
10432 (Read_symbols::do_lib_group): New.
10433 (Read_symbols::do_read_symbols): Handle lib groups.
10434 (Read_symbols::get_name): Handle lib groups.
10435 * readsyms.h (Read_symbols): Add an archive member pointer.
10436 (Read_symbols::do_whole_lib_group): New.
10437 (Read_symbols::do_lib_group): New.
10438 (Read_symbols::member_): New.
10439 * script.cc (read_input_script): Update call to queue_soon.
10440
d099120c
DK
104412010-03-19 Doug Kwan <dougkwan@google.com>
10442
10443 * arm.cc (Stub_table::Stub_table): Initialize new data members
10444 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10445 (Stub_table::add_reloc_stub): Assign stub offset and update
10446 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10447 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10448 New data members.
2e702c99 10449 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10450 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10451 instead of going over all reloc stubs.
2e702c99 10452 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10453 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10454 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10455 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10456 Stringpool_template::offset_.
10457 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10458 Stringpool_template::offset_ to zero.
10459
1aa37384
DK
104602010-03-15 Doug Kwan <dougkwan@google.com>
10461
10462 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10463 offset_.
10464 (Stringpool_template::new_key_offset): New method.
10465 (Stringpool_template::add_string): Assign offsets when adding new
10466 strings.
10467 (Stringpool_template::set_string_offsets): Do not set string offsets
10468 when not optimizing.
10469 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10470 member size_.
2e702c99
RM
10471 (Chunked_vector::clear): Clear size_.
10472 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10473 (Chunked_vector::size): Return size_.
10474 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10475 (Chunked_vector::size_): New data member.
1aa37384
DK
10476 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10477 (Stringpool_template::new_key_offset): New method declaration.
10478 (Stringpool_template::offset_): New data member.
10479
b672b057
RÁE
104802010-03-15 Rafael Espindola <espindola@google.com>
10481
10482 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10483 Add_symbols' constructor.
10484 * readsyms.h (Add_symbols): Remove the input_group member.
10485
b6848d3c
ILT
104862010-03-10 Ian Lance Taylor <iant@google.com>
10487
10488 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10489 target to ask whether a reference to a symbol requires a stack
10490 split.
10491 * target.h (Target::is_call_to_non_split): New function.
10492 (Target::do_is_call_to_non_split): Declare virtual function.
10493 * target.cc: Include "symtab.h".
10494 (Target::do_is_call_to_non_split): New function.
10495 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10496
a2a5469e
CC
104972010-03-10 Cary Coutant <ccoutant@google.com>
10498
10499 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10500 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10501 (File_read::open[2]): Add whole_file_view_ to list of views.
10502 (File_read::make_view): Remove test of whole_file_view_.
10503 (File_read::find_or_make_view): Create whole_file_view_ if
10504 necessary.
10505 (File_read::clear_views): Replace bool parameter with enum;
10506 adjust all callers. Don't delete views with permanent data;
10507 do delete cached views and views from archives if
10508 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10509 if clearing the corresponding view.
10510 * fileread.h (File_read::Clear_views_mode): New enum.
10511 (File_read::View::is_permanent_view): New method.
10512 (File_read::clear_views): Replace bool parameter
10513 with enum; adjust all callers.
10514 * options.h (General_options): Change keep_files_mapped option;
10515 add map_whole_files.
10516 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10517 releasing the file.
10518 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10519 the file.
10520
8861f32b
DM
105212010-03-10 David S. Miller <davem@davemloft.net>
10522
10523 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10524
d62d0f5f
ST
105252010-03-09 Sriraman Tallam <tmsriram@google.com>
10526
10527 * icf.cc (get_section_contents): Add '@' marker after processing the
10528 merge reloc.
10529
9177756d
DK
105302010-03-08 Doug Kwan <dougkwan@google.com>
10531
10532 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10533 due to a conversion warning.
10534 (Arm_relobj::update_output_local_symbol_count): Check for local
10535 symbol with unset output index.
10536
9e9e071b
ILT
105372010-03-05 Ian Lance Taylor <iant@google.com>
10538
10539 * options.h (class General_options): Add --spare-dynamic-tags.
10540 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10541 --spare-dynamic-tags.
10542
a81ee015
ILT
105432010-03-05 Ian Lance Taylor <iant@google.com>
10544
10545 * incremental.cc: Include "libiberty.h".
10546
44ec90b9
RO
105472010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10548
10549 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10550 function, is_info_ member.
10551 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10552 (Versions::Versions): Update caller.
10553 (Versions::define_base_version): Likewise.
10554 (Versions::add_def): Likewise.
10555
0897ed3b
ST
105562010-03-03 Sriraman Tallam <tmsriram@google.com>
10557
10558 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10559 (Scan::possible_function_pointer_reloc): New function.
10560 (Scan::local_reloc_may_be_function_pointer): Change to call
10561 possible_function_pointer_reloc.
10562 (Scan::global_reloc_may_be_function_pointer): Ditto.
10563 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10564 relocations in ".data.rel.ro._ZTV" section.
10565 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10566 * testsuite/icf_safe_so_test.cc: Ditto.
10567 * testsuite/icf_safe_test.cc: Ditto.
10568 * testsuite/icf_safe_test.sh: Ditto.
10569
d3bbad62
ILT
105702010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10571 Ian Lance Taylor <iant@google.com>
10572
10573 * target-reloc.h (relocate_section): Check the symbol table index
10574 for -1U before setting the local symbol index.
10575 (scan_relocatable_relocs): If copying the relocation, record that
10576 the local symbol is required.
10577 * object.h (Symbol_value::is_output_symtab_index_set): New
10578 function.
10579 (Symbol_value::may_be_discarded_from_output_symtab): New
10580 function.
10581 (Symbol_value::has_output_symtab_entry): New function.
10582 (Symbol_value::needs_output_symtab_entry): Remove.
10583 (Symbol_value::output_symtab_index): Make sure the symbol index is
10584 set.
10585 (Symbol_value::set_output_symtab_index): Make sure the symbol
10586 index is not set. Make sure the new index is valid.
10587 (Symbol_value::set_must_have_output_symtab_entry): New function.
10588 (Symbol_value::has_output_dynsym_entry): New function.
10589 (Symbol_value::set_output_dynsym_index): Make sure the new index
10590 is valid.
10591 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10592 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10593 local symbol if permitted.
10594 (Sized_relobj::do_finalize_local_symbols): Call
10595 is_output_symtab_index_set rather than needs_output_symtab_entry.
10596 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10597 rather than needs_output_symtab_entry. Call
10598 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10599 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10600 is_output_symtab_index_set rather than needs_output_symtab_entry.
10601 * testsuite/discard_locals_relocatable_test.c: New file.
10602 * testsuite/discard_locals_test.sh: Test -r.
10603 * testsuite/Makefile.am (check_DATA): Add
10604 discard_locals_relocatable_test1.syms,
10605 discard_local_relocatable_test2.syms.
10606 (MOSTLYCLEANFILES): Likewise. Also add
10607 discard_locals_relocatable_test1.lout and
10608 discard_locals_relocatable_test2.out.
10609 (discard_locals_relocatable_test1.syms): New target.
10610 (discard_locals_relocatable_test.o): New target.
10611 (discard_locals_relocatable_test1.out): New target.
10612 (discard_locals_relocatable_test2.syms): New target.
10613 (discard_locals_relocatable_test2.out): New target.
10614 (various): Add missing ../ld-new dependencies.
10615 * testsuite/Makefile.in: Rebuild.
10616
7e8ccf26
NC
106172010-03-03 Nick Clifton <nickc@redhat.com>
10618
10619 * po/fi.po: New Finnish translation.
10620
2a0ff005
DK
106212010-03-01 Doug Kwan <dougkwan@google.com>
10622
10623 * layout.cc (Layout::Layout): Force section types of .init_array*,
10624 .preinit_array* and .fini_array* sections.
10625 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10626 Fix check of return value of std::string::find.().
10627 (Output_section::Input_section_sort_compare::operator()): Remove
10628 comment about .init_array.
10629 (Output_section::Input_section_sort_init_fini_compare::operator()):
10630 New method.
10631 (Output_section::sort_attached_input_sections): Handle .init_array
10632 and .fini_array specially.
10633 * output.h (Output_section::Inut_section_sort_compare): Update
10634 comment.
10635 (Output_section::Input_section_sort_init_fini_compare): New struct.
10636
c3e4ae29
DK
106372010-02-26 Doug Kwan <dougkwan@google.com>
10638
10639 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10640 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10641 * testsuite/debug_msg.sh: Avoid matching source line number for
10642 use of global variable undef_int.
10643
2fd9ae7a
DK
106442010-02-26 Doug Kwan <dougkwan@google.com>
10645
10646 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10647 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10648 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10649 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10650 * options.cc (General_options::General_options): Initialize member
10651 fix_v4bx_.
10652 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10653 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10654 and rm_no_fix_v4bx.stdout
10655 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10656 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10657 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10658 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10659 and arm_no_fix_v4bx.
10660 * Makefile.in: Regenerate.
10661 * testsuite/arm_fix_v4bx.s: New file.
10662 * testsuite/arm_fix_v4bx.sh: Ditto.
10663
67ec7d0b
DK
106642010-02-24 Doug Kwan <dougkwan@google.com>
10665
10666 * arm.cc (Target_arm::got_section): Make the .got section the first
10667 non RELRO section in the data segment.
10668 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10669 suffixes of section names.
10670
10165461
DK
106712010-02-24 Doug Kwan <dougkwan@google.com>
10672
10673 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10674 flags and attributes merging if an input file is a binary file.
10675 * fileread.cc (Input_file::open): Record format of original file.
10676 * fileread.h (Input_file::Format): New enum type.
2e702c99 10677 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10678 (Input_file::format): New method definition.
10679 (Input_file::format_):: New data member.
10680
4a54abbb
DK
106812010-02-24 Doug Kwan <dougkwan@google.com>
10682
10683 * arm.cc (Arm_output_data_got): New class.
10684 (ARM_TCB_SIZE): New constant
10685 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10686 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10687 If user uses a script with a SECTIONS clause, issue only a warning
10688 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10689 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10690 garbage collection.
10691 (Target_arm::got_mode_index_entry): Handle static linking.
10692 (Target_arm::Scan::local): Ditto.
10693 (Target_arm::Scan::global): Ditto.
10694 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10695 all incorrectly implemented relocations.
e1df38aa 10696 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10697 Arm_output_section::fix_exidx_coverage.
10698 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10699 from ".ARM.exidx." and ".ARM.extab.".
10700
ca419a6f
ILT
107012010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10702
10703 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10704 section if it does not already exist.
10705 * attributes.cc (Attributes_section_data::Attributes_section_data):
10706 Don't crash if size is zero.
10707
135b9c78
ILT
107082010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10709 Ian Lance Taylor <iant@google.com>
10710
10711 * gold.cc (queue_middle_tasks): If no input files were opened,
10712 exit.
10713 * workqueue.h (Task_function::Task_function): Assert that there is
10714 a blocker.
10715
bb0bfe4f
DK
107162010-02-22 Doug Kwan <dougkwan@google.com>
10717
10718 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10719 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10720 types to avoid warnings due to different uint64_t implementations
10721 on different hosts.
10722
2a2b6d42
DK
107232010-02-21 Doug Kwan <dougkwan@google.com>
10724
10725 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10726 handling of the maximum backward branch offset.
2e702c99 10727 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10728 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10729 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10730 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10731 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10732 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10733 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10734 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10735 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10736 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10737 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10738 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10739 thumb2_bl_out_of_range.o): New rules.
10740 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10741 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10742 thumb2_bl_out_of_range
10743 * testsuite/Makefile.in: Regenerate.
10744 * testsuite/arm_bl_in_range.s: New file.
10745 * testsuite/arm_bl_out_of_range.s: Ditto.
10746 * testsuite/arm_branch_in_range.sh: Ditto.
10747 * testsuite/arm_branch_range.t: Ditto.
10748 * testsuite/thumb2_branch_range.t: Ditto.
10749 * testsuite/thumb_bl_in_range.s: Ditto.
10750 * testsuite/thumb_bl_out_of_range.s: Ditto.
10751 * testsuite/thumb_branch_range.t: Ditto.
10752
b487ad64
ST
107532010-02-20 Sriraman Tallam <tmsriram@google.com>
10754
10755 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10756 Add reloc offset information.
10757 * icf.cc (get_section_contents): Change iterators to point to the new
10758 vectors. Add reloc offset information to the contents.
10759 * icf.h (Icf::Sections_reachable_info): New typedef.
10760 (Icf::Sections_reachable_list): New typedef.
10761 (Icf::Offset_info): New typedef.
10762 (Icf::Reloc_info): New struct typedef.
10763 (Icf::Reloc_info_list): New typedef.
10764 (Icf::symbol_reloc_list): Delete method.
10765 (Icf::addend_reloc_list): Delete method.
10766 (Icf::section_reloc_list): Delete method.
10767 (Icf::reloc_info_list): New method.
10768 (Icf::reloc_info_list_): New member.
10769
f96accdf
DK
107702010-02-19 Doug Kwan <dougkwan@google.com>
10771
10772 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10773 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10774 * arm.cc (Arm_relocation_functions): New forward declaration.
10775 (Target_arm::Target_arm): Initialize new data members
10776 got_mod_index_offset_ and tls_base_symbol_defined_.
10777 (Target_arm::Relocate::relocate_tls): New method.
10778 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10779 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10780 New methods.
2e702c99 10781 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10782 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10783 (Target_arm::got_mod_index_offset_,
10784 Target_arm::tls_base_symbol_defined_): New data members.
10785 (Target_arm::Scan::local, Target::Scan::global,
10786 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10787 relocations.
10788
c8761b9a
DK
107892010-02-18 Doug Kwan <dougkwan@google.com>
10790
10791 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10792 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10793 text section as a parameter becuase some broken tools may not set
10794 the link in section header.
10795 (Target_arm::has_got_section): New method.
10796 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10797 without any mapping symbol as data only. Remove warning.
10798 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10799 link in its section header, try to discover the link by inspecting the
10800 REL31 relocation at the beginning of the section.
10801 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10802 in error message.
10803 (Target_arm::Scan::global): Treat any reference to the symbol
10804 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10805
21bb3914
ST
108062010-02-12 Sriraman Tallam <tmsriram@google.com>
10807
10808 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10809 (Scan::global_reloc_may_be_function_pointer): New function.
10810 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10811 (Scan::global_reloc_may_be_function_pointer): New function.
10812 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10813 (Scan::global_reloc_may_be_function_pointer): New function.
10814 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10815 (Scan::global_reloc_may_be_function_pointer): New function.
10816 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10817 (Scan::global_reloc_may_be_function_pointer): New function.
10818 (Scan::possible_function_pointer_reloc): New function.
10819 (Target_x86_64::can_check_for_function_pointers): New function.
10820 * gc.h (gc_process_relocs): Scan relocation types to determine if
10821 function pointers were taken for targets that support it.
10822 * icf.cc (Icf::find_identical_sections): Include functions for
10823 folding in safe ICF whose pointer is not taken.
10824 * icf.h (Secn_fptr_taken_set): New typedef.
10825 (fptr_section_id_): New member.
10826 (section_has_function_pointers): New function.
10827 (set_section_has_function_pointers): New function.
10828 (check_section_for_function_pointers): New function.
10829 * options.h: Fix comment for safe ICF option.
10830 * target.h (can_check_for_function_pointers): New function.
10831 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10832 Modify icf_safe_test for X86-64.
10833 * testsuite/Makefile.in: Regenerate.
10834 * testsuite/icf_safe_so_test.cc: New file.
10835 * testsuite/icf_safe_so_test.sh: New file.
10836 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10837 (main): Change to take pointer to function kept_func_3.
10838 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10839 folding is done correctly for X86-64.
10840
0da6fa6c
DM
108412010-02-12 David S. Miller <davem@davemloft.net>
10842
10843 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10844 is_symbolless parameter.
10845 (Output_reloc<SHT_REL>::is_symbolless): New.
10846 (Output_reloc<SHT_REL>::is_symbolless_): New.
10847 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10848 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10849 (Output_reloc<SHT_RELA>::is_symbolless): New.
10850 (Output_data_reloc::add_global): Handle is_symbolless.
10851 (Output_data_reloc::add_global_relative): Likewise.
10852 (Output_data_reloc::add_local): Likewise.
10853 (Output_data_reloc::add_local_relative): Likewise.
10854 (Output_data_reloc::add_symbolless_global_addend): New.
10855 (Output_data_reloc::add_symbolless_local_addend): New.
10856 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10857 is_symbolless.
10858 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10859 instead of ->is_relative_
10860 (Output_reloc::write): Likewise.
10861 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10862 (Output_reloc::write_rel): Simplify.
10863
10864 * sparc.cc (Target_sparc::Scan::local): Use
10865 ->add_symbolless_local_addend as needed.
10866 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10867 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10868 based upon relocation offset.
10869
e4782e83
DK
108702010-02-11 Doug Kwan <dougkwan@google.com>
10871
10872 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10873 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10874 beginning of function.
10875 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10876 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10877 parameter is_32bit in calls to should_apply_static_reloc.
10878 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10879 (check_DATA): Add arm_abs_global.stdout.
10880 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10881 arm_abs_global.stdout): New rules.
10882 (MOSTLLYCLEANFILES): Add arm_abs_global
10883 * Makefile.in: Regenerate.
10884 * testsuite/arm_abs_global.s: New file.
10885 * testsuite/arm_abs_global.sh: Ditto.
10886 * testsuite/arm_abs_lib.s: Ditto.
10887
93ceb764
ILT
108882010-02-11 Ian Lance Taylor <iant@google.com>
10889
10890 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10891 Read_relocs task.
10892 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10893 Allocate_commons_task first.
10894 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10895 task, rather than symtab_lock_.
10896 (Gc_process_relocs::~Gc_process_relocs): New function.
10897 (Gc_process_relocs::is_runnable): Check this_blocker_.
10898 (Gc_process_relocs::locks): Use next_blocker_ rather than
10899 blocker_.
10900 (Scan_relocs::~Scan_relocs): New function.
10901 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10902 symtab_lock_.
10903 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10904 next_blocker_.
10905 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10906 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10907 constructor accordingly.
10908 (class Gc_process_relocs): Likewise.
10909 (class Scan_relocs): Likewise.
10910 * common.h (class Allocate_commons_task): Remove symtab_lock_
10911 field, and corresponding constructor parameter.
10912 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10913 symtab_lock_.
10914 (Allocate_commons_task::locks): Likewise.
10915
114dfbe1
ILT
109162010-02-11 Ian Lance Taylor <iant@google.com>
10917
10918 * gold-threads.h (class Once): Define.
10919 (class Initialize_lock): Rewrite as child of Once.
10920 * gold-threads.cc (class Once_initialize): Define.
10921 (once_pointer_control): New static variable.
10922 (once_pointer, once_arg): New static variables.
10923 (c_run_once): New static function.
10924 (Once::Once, Once::run_once, Once::internal_run): New functions.
10925 (class Initialize_lock_once): Remove.
10926 (initialize_lock_control): Remove.
10927 (initialize_lock_pointer): Remove.
10928 (initialize_lock_once): Remove.
10929 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10930 (Initialize_lock::initialize): Rewrite.
10931 (Initialize_lock::do_run_once): New function.
10932 * archive.cc (Archive::interpret_header): Only clear name if it is
10933 not already empty.
10934 * fileread.cc: Include "gold-threads.h"
10935 (file_counts_lock): New static variable.
10936 (file_counts_initialize_lock): Likewise.
10937 (File_read::release): Only increment counts when using --stats.
10938 Use a lock around the increment.
10939 * parameters.cc (class Set_parameters_target_once): Define.
10940 (set_parameters_target_once): New static variable.
10941 (Parameters::Parameters): Move here from parameters.h.
10942 (Parameters::set_target): Rewrite.
10943 (Parameters::set_target_once): New function.
10944 (Parameters::clear_target): Move here and rewrite.
10945 * parameters.h (class Parameters): Update declarations. Add
10946 set_parameters_target_once_ field.
10947 (Parameters::Parameters): Move to parameters.cc.
10948 (Parameters::clear_target): Likewise.
10949 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10950 task.
10951 (Start_group::~Start_group): New function.
10952 (Start_group::is_runnable): New function.
10953 (Start_group::locks, Start_group::run): New functions.
10954 (Finish_group::run): Change saw_undefined to size_t.
10955 * readsyms.h (class Start_group): Define.
10956 (class Finish_group): Change saw_undefined_ field to size_t.
10957 (Finish_group::Finish_group): Remove saw_undefined and
10958 this_blocker parameters. Change all callers.
10959 (Finish_group::set_saw_undefined): New function.
10960 (Finish_group::set_blocker): New function.
10961 * symtab.h (class Symbol_table): Change saw_undefined to return
10962 size_t. Change saw_undefined_ field to size_t.
10963 * target-select.cc (Set_target_once::do_run_once): New function.
10964 (Target_selector::Target_selector): Initialize set_target_once_
10965 field. Don't initialize lock_ and initialize_lock_ fields.
10966 (Target_selector::instantiate_target): Rewrite.
10967 (Target_selector::set_target): New function.
10968 * target-select.h (class Set_target_once): Define.
10969 (class Target_selector): Update declarations. Make
10970 Set_target_once a friend. Remove lock_ and initialize_lock_
10971 fields. Add set_target_once_ field.
10972
fa17a3f4
ILT
109732010-02-10 Ian Lance Taylor <iant@google.com>
10974
10975 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10976 queueing any tasks.
10977 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10978 (queue_middle_tasks): Add all blockers before queueing any tasks.
10979 (queue_final_tasks): Likewise.
10980 * token.h (Task_token::add_blockers): New function.
10981 * object.h (Input_objects::number_of_relobjs): New function.
10982
c7177d31
ILT
109832010-02-10 Ian Lance Taylor <iant@google.com>
10984
5de0e392
ILT
10985 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10986 shared, not if not position independent.
10987 * x86_64.cc (Relocate::relocate_tls): Likewise.
10988 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10989 (tls_pie_pic_test): New target.
10990 * testsuite/Makefile.in: Rebuild.
10991
c7177d31
ILT
10992 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10993 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10994 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10995 * testsuite/Makefile.in: Rebuild.
10996
684b268a
DM
109972010-02-09 David S. Miller <davem@davemloft.net>
10998
10999 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11000 R_SPARC_RELATIVE using ->add_local_relative().
11001 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11002
612a8d3d
DM
11003 * output.h (Output_data_dynamic::add_section_size): New method
11004 that takes two Output_data objects.
11005 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11006 entry param. Handle it in initializers.
11007 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11008 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11009 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11010 arg.
11011 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11012 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11013 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11014 for dynrel_includes_plt.
11015 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11016 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11017 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11018 before .rela.plt
11019 (Target_sparc::do_finalize_sections): Update to pass true for
11020 dynrel_includes_plt.
11021 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11022 output before .rela.plt
11023 (Target_powerpc::do_finalize_sections): Update to pass true for
11024 dynrel_includes_plt when 32-bit.
11025
cb1be87e
DK
110262010-02-08 Doug Kwan <dougkwan@google.com>
11027
11028 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11029 method.
11030 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11031 Arm_relobj::scan_section_for_cortex_a8_stubs,
11032 Arm_relobj::do_relocation_section): Instead of calling
11033 Output_section::output_address, use faster
11034 Arm_relobj::simple_input_section_output_address.
11035
705b5121
DM
110362010-02-08 David S. Miller <davem@davemloft.net>
11037
11038 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11039 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11040 relocation helper function.
11041
024c4466
DM
11042 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11043 just like R_SPARC_GOT{10,13,22}.
11044 (Target_sparc::Scan::local): Likewise.
11045 (Target_sparc::Relocate:relocate): Likewise.
11046
9109c078
ILT
110472010-02-06 Ian Lance Taylor <iant@google.com>
11048
11049 * configure.ac: Rewrite targetobjs duplicate removal code to use
11050 only shell constructs.
11051 * configure: Rebuild.
11052
cf846138
DK
110532010-02-05 Doug Kwan <dougkwan@google.com>
11054
11055 PR 11247
11056 * arm.cc (Arm_relobj::section_is_scannable): New method.
11057 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11058 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11059
6cfaf60b
DK
110602010-02-04 Doug Kwan <dougkwan@google.com>
11061
11062 PR 11247
11063 * arm-reloc-property.cc (cstdio): Include.
11064 * configure.ac (targetobjs): Remove duplicates.
11065 * configure: Regenerate.
11066 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11067 big and little endian version for a given address size.
11068
5c57f1be
DK
110692010-02-03 Doug Kwan <dougkwan@google.com>
11070
11071 * arm-reloc-property.cc
11072 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11073 definition.
11074 * arm-reloc-property.h
11075 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11076 New method definition.
11077 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11078 declaration.
11079 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11080 overflow to N.
11081 (GOT_PREL): Change implemented to Y.
11082 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11083 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11084 (Arm_relocate_functions::movw_abs_nc): Remove method.
11085 (Arm_relocate_functions::movt_abs): Ditto.
11086 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11087 (Arm_relocate_functions::thm_movt_abs): Ditto.
11088 (Arm_relocate_functions::movw_rel_nc): Ditto.
11089 (Arm_relocate_functions::movw_rel): Ditto.
11090 (Arm_relocate_functions::movt_rel): Ditto.
11091 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11092 (Arm_relocate_functions:thm_movw_rel): Ditto.
11093 (Arm_relocate_functions:thm_movt_rel): Ditto.
11094 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11095 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11096 New method definitions.
11097 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11098 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11099 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11100 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11101 (Target_arm::Relocate::relocate): Check for non-static or
11102 unimplemented relocation code and exit early. Change calls to
11103 Target_arm::reloc_uses_thumb_bit and
11104 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11105 instead. Refactor code to handle similar relocations to increase
11106 code sharing. Remove check for unsupported relocation code in switch
11107 statement.
11108 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11109 relocation property table to find out size. Change error message to
11110 print out the name of a relocation code instead of the numeric value.
11111 (Target_arm::scan_reloc_for_stub): Use relocation property table
11112 instead of calling Target_arm::reloc_uses_thumb_bit().
11113
218c5831
DK
111142010-02-02 Doug Kwan <dougkwan@google.com>
11115
11116 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11117 types of relaxed input section.
11118
0d31c79d
DK
111192010-02-02 Doug Kwan <dougkwan@google.com>
11120
11121 * Makefile.am (HFILES): Add arm-reloc-property.h.
11122 (DEFFILES): New.
2e702c99
RM
11123 (TARGETSOURCES): Add arm-reloc-property.cc
11124 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11125 (libgold_a_SOURCES): $(DEFFILES)
11126 * Makefile.in: Regenerate.
11127 * arm-reloc-property.cc: New file.
11128 * arm-reloc-property.h: New file.
11129 * arm-reloc.def: New file.
11130 * arm.cc: Update comments.
11131 (arm-reloc-property.h): New included header.
11132 (arm_reloc_property_table): New global variable.
11133 (Target_arm::do_select_as_default_target): New method definition.
11134 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11135 arm-reloc-property to targ_extra_obj.
11136 * parameters.cc (set_parameters_target): Call
11137 Target::select_as_default_target().
11138 * target.h (Target::select_as_default_target): New method definition.
11139 (Target::do_select_as_default_target): Same.
11140
546c7457
DK
111412010-02-01 Doug Kwan <dougkwan@google.com>
11142
11143 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11144 first_output_text_section_.
11145 (Arm_exidx_fixup::first_output_text_section): New method definition.
11146 (Arm_exidx_fixup::first_output_text_section_): New data member.
11147 (Arm_exidx_fixup::process_exidx_section): Record the first text
11148 output section seen.
11149 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11150 and entsize in output section header.
11151
11b861d5
DK
111522010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11153
11154 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11155 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11156 (Arm_relocate_functions::thm_alu11): New Method.
11157 (Arm_relocate_functions::thm_pc8): New Method.
11158 (Arm_relocate_functions::thm_pc12): New Method.
11159 (Target_arm::Scan::local): Handle the relocations.
11160 (Target_arm::Scan::global): Likewise.
11161 (Target_arm::Relocate::relocate): Likewise.
11162 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11163
c9a2c125
DK
111642010-01-29 Doug Kwan <dougkwan@google.com>
11165
11166 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11167 of relocation types as ld.
11168
1521477a
DK
111692010-01-29 Doug Kwan <dougkwan@google.com>
11170
11171 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11172 to public.
11173 (Arm_relocate_functions::thumb_branch_common): Ditto.
11174 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11175 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11176 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11177 Arm_relocate_functions::jump24): Remove.
11178 (Target_arm::Relocate::relocate): Adjust code to call
11179 Arm_relocation_functions::arm_branch_common and
11180 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11181 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11182
e7eca48c
DK
111832010-01-29 Doug Kwan <dougkwan@google.com>
11184
11185 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11186 output_local_symbol_count_needs_update_.
11187 (Arm_relobj::output_local_symbol_count_needs_update,
11188 Arm_relobj::set_output_local_symbol_count_needs_update,
11189 Arm_relobj::update_output_local_symbol_count): New methods.
11190 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11191 member.
11192 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11193 of pointed function as in a R_ARM_PREL31 relocation.
11194 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11195 for output local symbol count updating.
11196 (Target_arm::do_relax): Update output local symbol counts in objects
11197 if necessary.
11198 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11199
02961d7e
ILT
112002010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11201
11202 * arm.cc: Added support for the ARM relocations:
11203 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11204 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11205 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11206 movw_prel_nc).
11207 (Arm_relocate_functions::movw_rel): New method.
11208 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11209 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11210 thm_movw_prel_nc).
11211 (Arm_relocate_functions::thm_movw_rel): New method.
11212 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11213 thm_movt_prel).
11214 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11215 relocations.
11216 (Target_arm::Scan::global): Likewise.
11217 (Target_arm::Relocate::relocate): Likewise.
11218 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11219 Likewise.
11220
b10d2873
ILT
112212010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11222
11223 * arm.cc: Added support for ARM group relocations.
11224 (Target_arm::reloc_needs_sym_origin): New method.
11225 (Arm_relocate_functions::calc_grp_kn): New method.
11226 (Arm_relocate_functions::calc_grp_residual): New method.
11227 (Arm_relocate_functions::calc_grp_gn): New method.
11228 (Arm_relocate_functions::arm_grp_alu): New Method.
11229 (Arm_relocate_functions::arm_grp_ldr): New Method.
11230 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11231 (Arm_relocate_functions::arm_grp_ldc): New Method.
11232 (Target_arm::Scan::local): Handle the ARM group relocations.
11233 (Target_arm::Scan::global): Likewise.
11234 (Target_arm::Relocate::relocate): Likewise.
11235 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11236 Likewise.
11237
2b328d4e
DK
112382010-01-26 Doug Kwan <dougkwan@google.com>
11239
11240 * arm.cc (set): Include.
11241 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11242 pointer type.
2e702c99 11243 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11244 (Arm_output_section::append_text_sections_to_list): New method.
11245 (Arm_output_section::fix_exidx_coverage): Ditto.
11246 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11247 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11248 Relobj::set_section_offset() instead of
11249 Sized_relobj::invalidate_section_offset().
2e702c99 11250 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11251 parameter for section headers. Ignore relocation sections for
11252 unallocated sections and EXIDX sections.
11253 (Target_arm::fix_exidx_coverage): New method.
11254 (Target_arm::output_section_address_less_than): New type.
11255 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11256 linked text section instead of the EXIDX section.
11257 (Arm_output_section::create_stub_group): Add an assertion to check
11258 that this is not an EXIDX output section.
11259 (Arm_output_section::append_text_sections_to_list): New method.
11260 (Arm_output_section::fix_exidx_coverage): Ditto.
11261 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11262 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11263 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11264 first pass.
11265 (Target_arm::fix_exidx_coverage): New method.
11266 * object.h (Relobj::set_output_section): New method.
11267 (Sized_relobj::invalidate_section_offset): Remove method.
11268 (Sized_relobj::do_invalidate_section_offset): Remove method.
11269 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11270
c7f3c371
DK
112712010-01-25 Doug Kwan <dougkwan@google.com>
11272
11273 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11274 Fix warning due to signed and unsigned comparison on a 32-bit host.
11275
8923b24c
DK
112762010-01-22 Doug Kwan <dougkwan@google.com>
11277
11278 * arm.cc (Target_arm::do_relax): Record an output section for section
11279 offset adjustment it contains any stub table that has changed.
11280 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11281 offsets in an output section if necessary.
11282 * output.cc (Output_section::Output_section): Initialize
11283 section_offsets_need_adjustments_.
11284 (Output_section::add_input_section_for_script): Renamed to
11285 Output_section::add_simple_input_section.
11286 (Output_section::save_states): Add a comment.
11287 (Output_section::discard_states): New method defintion.
11288 (Output_section::adjust_section_offsets): Same.
11289 * output.h (Output_section::add_input_section_for_script): Renamed to
11290 Output_section::add_simple_input_section.
11291 (Output_section::discard_states): New method declaration.
11292 (Output_section::adjust_section_offsets): Same.
11293 (Output_section::section_offsets_need_adjustment,
11294 Output_section::set_section_offsets_need_adjustment): New method
11295 definitions.
11296 (Output_section::section_offsets_need_adjustment_): New data member.
11297 * script-sections.cc
11298 (Output_section_element_input::set_section_address): Adjust code for
11299 renaming of Output_section::add_input_section_for_script.
11300 (Orphan_output_section::set_section_address): Same.
11301
9b2fd367
DK
113022010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11303
11304 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11305 Fix_v4bx enum values .
11306 * gold/options.h (General_options): New option definitions.
11307 (General_options::fix_v4bx): New method.
11308 (General_options::Fix_v4bx): New enum.
11309 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11310 (General_options::parse_fix_v4bx_interworking): New method.
11311
80d0d023
DK
113122010-01-22 Doug Kwan <dougkwan@google.com>
11313
11314 * arm.cc (Arm_exidx_fixup): New class.
11315
af2cdeae
DK
113162010-01-21 Doug Kwan <dougkwan@google.com>
11317
11318 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11319 classes.
11320 (Arm_exidx_section_offset_map): New type.
11321
993d07c1
DK
113222010-01-21 Doug Kwan <dougkwan@google.com>
11323
11324 * arm.cc (Arm_exidx_input_section): New class.
11325 (Arm_relobj::exidx_input_section_by_link,
11326 Arm_relobj::exidx_input_section_by_shndx,
11327 Arm_relobj::make_exidx_input_section): New methods.
11328 (read_arm_attributes_section): Remove.
11329 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11330 information about them.
11331 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11332 to here.
11333
5ac169d4
DK
113342010-01-20 Doug Kwan <dougkwan@google.com>
11335
11336 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11337 Input_section_specifier to Section_id.
11338 (Target_arm::new_arm_input_section: Adjust code for change of key
11339 type.
11340 (Target_arm::find_arm_input_section): Ditto.
11341 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11342 (Section_id): Remove.
11343 (Garbage_collection::Section_id_hash): Remove.
11344 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11345 (Section_id): Remove.
11346 (Icf::Section_id_hash): Remove.
11347 * object.h (Section_id, Const_section_id, Section_id_hash,
11348 Const_section_id_hash): New type definitions.
11349 * output.cc (Output_section::add_relaxed_input_section): Change to
11350 use Const_section_id instead of Input_section_specifier as key type.
11351 (Output_section::add_merge_input_section): Ditto.
11352 (Output_section::build_relaxation_map): Change to use Section_id
11353 instead of Input_section_specifier as key type.
2e702c99 11354 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11355 Ditto.
11356 (Output_section::convert_input_sections_to_relaxed_sections): Change
11357 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11358 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11359 (Output_section::find_relaxed_input_section): Ditto.
11360 * output.h (Input_section_specifier): Remove class.
11361 (Output_section::Output_section_data_by_input_section_map): Change
11362 key type to Const_section_id.
11363 (Output_section::Output_relaxed_input_section_by_input_section_map):
11364 Ditto.
11365 (Output_section::Relaxation_map): Change key type to Section_id.
11366
a2162063
ILT
113672010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11368
11369 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11370 (class Arm_v4bx_stub): New class.
11371 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11372 (Stub_factory::make_arm_v4bx_stub): New method.
11373 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11374 (Stub_table::empty): Handle v4bx stubs.
11375 (Stub_table::add_arm_v4bx_stub): New method.
11376 (Stub_table::find_arm_v4bx_stub): New method.
11377 (Arm_relocate_functions::v4bx): New method.
11378 (Target_arm::fix_v4bx): New method.
11379 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11380 (Stub_table::relocate_stubs): Likewise.
11381 (Stub_table::do_write): Likewise.
11382 (Stub_table::update_data_size_and_addralign): Likewise.
11383 (Stub_table::finalize_stubs): Likewise.
11384 (Target_arm::Scan::local): Likewise.
11385 (Target_arm::Scan::global): Likewise.
11386 (Target_arm::do_finalize_sections): Likewise.
11387 (Target_arm::Relocate::relocate): Likewise.
11388 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11389 Likewise.
11390 (Target_arm::scan_reloc_for_stub): Likewise.
11391 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11392
5696ab0b
ILT
113932010-01-19 Ian Lance Taylor <iant@google.com>
11394
11395 * output.cc (Output_section_headers::do_sized_write): Write large
11396 segment count to sh_info field.
11397 (Output_file_header::do_sized_write): For large segment count,
11398 write PN_XNUM to e_phnum field.
11399
800d0f56
ILT
114002010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11401
11402 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11403 (Arm_relocate_functions::thm_jump8): New function.
11404 (Arm_relocate_functions::thm_jump11): New function.
11405 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11406 R_ARM_THM_JUMP11.
11407 (Target_arm::Scan::global): Likewise.
11408 (Target_arm::Relocate::relocate): Likewise.
11409 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11410 Likewise.
11411
41263c05
DK
114122010-01-14 Doug Kwan <dougkwan@google.com>
11413
11414 * arm.cc (map, utility): Include headers.
11415 (Target_arm::apply_cortex_a8_workaround): New method.
11416 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11417 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11418 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11419 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11420 the --[no-]fix-cortex-a8 command line options.
11421 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11422 (Target_arm::relocate_stub): Use addend in instruction template.
11423 * options.h (DEFINE_bool): Set the user-set flag.
11424 (General_options): Add --[no-]-fix-cortex options.
11425 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11426 : Update fast look-up map after conversion.
41263c05 11427
459e9b03
ST
114282010-01-14 Sriraman Tallam <tmsriram@google.com>
11429
11430 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11431 in the first pass of do_layout.
11432
b521dfe4
DK
114332010-01-13 Doug Kwan <dougkwan@google.com>
11434
11435 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11436 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11437 apparent compiler problem of not folding static constant integral
11438 data members of elfcpp::Elf_sizes<32>.
11439
44272192
DK
114402010-01-13 Doug Kwan <dougkwan@google.com>
11441
11442 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11443 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11444 Arm_relobj::scan_section_for_cortex_a8_erratum,
11445 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11446 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11447 sections to scan for relocation stubs into a new method
11448 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11449 relocation and Cortex-A8 stub scanning.
11450 (Target_arm::do_relax): Force stubs to be after stubbed sections
11451 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11452 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11453 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11454
44b71ece
ILT
114552010-01-12 Ian Lance Taylor <iant@google.com>
11456
11457 * target-reloc.h (visibility_error): New inline function.
11458 (relocate_section): Call visibility_error.
11459 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11460 (MOSTLYCLEANFILES): Likewise.
11461 (protected_4_pic.o, protected_3.err): New targets.
11462 * testsuite/protected_4.cc: New file.
11463
a120bc7f
DK
114642010-01-12 Doug Kwan <dougkwan@google.com>
11465
11466 * arm.cc (Cortex_a8_reloc): New class.
11467 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11468 and cortex_a8_relocs_info_.
11469 (Target_arm::fix_cortex_a8): New method definition.
11470 (Target_arm::Cortex_a8_relocs_info): New type.
11471 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11472 New data member declarations.
11473 (Target_arm::scan_reloc_for_stub): Record information about
11474 relocations for THUMB branches that might be exempted from the
11475 Cortex-A8 workaround.
11476 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11477 at the beginning of a relaxation pass.
11478
20138696
DK
114792010-01-12 Doug Kwan <dougkwan@google.com>
11480
11481 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11482 (Arm_relobj::Mapping_symbol_position,
11483 Arm_reloj::Mapping_symbol_position_less,
11484 Arm_relobj::Mapping_symbols_info): New types.
11485 (Target_arm::is_mapping_symbol_name): New method definition.
11486 (Arm_relobj::do_count_local_symbols): Save information about mapping
11487 symbols.
11488
089d69dc
DK
114892010-01-11 Doug Kwan <dougkwan@google.com>
11490
11491 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11492 Arm_relocate_functions::thumb32_branch_upper,
11493 Arm_relocate_functions::thumb32_branch_lower,
11494 Arm_relocate_functions::thumb32_cond_branch_offset,
11495 Arm_relocate_functions::thumb32_cond_branch_upper,
11496 Arm_relocate_functions::thumb32_cond_branch_lower,
11497 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11498 branch offset encoding.
11499 (Arm_relocate_functions::thumb_branch_common): Use new branch
11500 offset encoding methods to avoid code duplication.
11501 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11502 (Stub_addend_reader::operator()): Use new branch encoding method
11503 to avoid code duplication.
11504
99e5bff2
DK
115052010-01-11 Doug Kwan <dougkwan@google.com>
11506
11507 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11508 (Target_arm::do_finalize_sections): Define special EXIDX section
11509 symbols only if referenced.
11510 * gc.h (Garbage_collection::add_reference): New method.
11511 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11512 code duplication.
11513
98e090bd
ILT
115142010-01-11 Ian Lance Taylor <iant@google.com>
11515
d0a91bd8
ILT
11516 * script.cc (Version_script_info::build_expression_list_lookup):
11517 Change complaing about duplicate wildcard match from error to
11518 warning.
11519
98e090bd
ILT
11520 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11521 of 2009-12-30.
11522 (Version_script_info::Version_script_info): Initialize globs_,
11523 default_version_, default_is_global_, and exact_. Don't
11524 initialize globals_ or locals_.
11525 (Version_script_info::build_lookup_tables): Build local symbols
11526 first.
11527 (Version_script_info::unquote): New function.
11528 (Version_script_info::add_exact_match): New function.
11529 (Version_script_info::build_expression_list_lookup): Remove lookup
11530 parameter. Add is_global parameter. Change all callers. Handle
11531 wildcard pattern specially. Unquote pattern. Call
11532 add_exact_match.
11533 (Version_script_info::get_name_to_match): New function.
11534 (Version_script_info::get_symbol_version): New function.
11535 (Version_script_info::get_symbol_version_helper): Remove.
11536 (Version_script_info::check_unmatched_names): Call unquote.
11537 * script.h (class Version_script_info): Change get_symbol_version
11538 to be non-inline and add is_global parameter; change all callers.
11539 Rewrite symbol_is_local. Update declarations. Define struct
11540 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11541 Remove globals_ and locals_ members. Add exact_, globs_,
11542 default_version_, is_global_.
11543 (Version_script_info::Glob): Remove pattern, add expression and
11544 is_global. Update constructor. Change all callers.
11545 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11546 default version.
11547 (Versions::symbol_section_contents): If a symbol is undefined, or
11548 defined in a dynamic object, set the version index to
11549 VER_NDX_LOCAL.
11550 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11551 symbol_is_local.
11552 (Symbol_table::add_from_pluginobj): Likewise.
11553 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11554
d56962d3
DK
115552010-01-11 Doug Kwan <dougkwan@google.com>
11556
11557 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11558 (incremental_dump_LDADD): Add linking option for libintl.
11559 * Makefile.in: Regenerate.
11560
94e6ee91
L
115612010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11562
11563 PR gold/11144
11564 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11565 instead of -Ds.
11566 * testsuite/Makefile.in: Regenerated.
11567
e96c574b
DK
115682010-01-10 Doug Kwan <dougkwan@google.com>
11569
11570 * options.h (DEFINE_var): Use parentheses around argument varname__
11571 in macro body to avoid any unintended subsequent substitutions.
11572
7198066b
ILT
115732010-01-10 Ian Lance Taylor <iant@google.com>
11574
ba4d53bf
ILT
11575 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11576 candidates before doing symbol resolution.
11577
7198066b
ILT
11578 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11579 ODR candidates if only one is weak.
11580
a2beed37
ILT
115812010-01-08 Ian Lance Taylor <iant@google.com>
11582
11583 * script.cc (Version_script_info::build_expression_list_lookup):
11584 Don't warn about ambiguous version, just record the ambiguity.
11585 (Version_script_info::get_symbol_version_helper): Give error if
11586 version is ambiguous.
11587
2fb7225c
DK
115882010-01-08 Doug Kwan <dougkwan@google.com>
11589
11590 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11591 prev_data_size_ and prev_addralign_. Remove initializer for
11592 deleted data member has_been_changed_.
11593 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11594 to determine if the table is empty.
11595 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11596 Remove.
11597 (Stub_table::add_reloc_stub): Define method in class definition
11598 instead of just declaring it there.
11599 (Stub_table::add_cortex_a8_stub): New method definition.
11600 (Stub_table::update_data_size_and_addralign): Ditto.
11601 (Stub_table::finalize_stubs): Ditto.
11602 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11603 (Stub_table::do_addralign_): Return address alignment in the
11604 (Stub_table::do_reset_address_and_file_offset): Define method in
11605 class definition instead of declaring it there. Set current data
11606 size to be the data size of the previous pass.
11607 (Stub_table::set_final_data_size): Use current data size as the
11608 final data size.
11609 (Stub_table::relocate_stub): Change parameter type of stub from
11610 Reloc_stub pointer to Stub pointer.
11611 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11612 (Stub_table::Cortex_a8_stub_list): New typedef.
11613 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11614 Stub_table::prev_addralign_): New data member.
11615 (Arm_relobj::Arm_relobj): Initialize data member
11616 section_has_cortex_a8_workaround_.
11617 (Arm_relobj::section_has_cortex_a8_workaround,
11618 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11619 definitions.
11620 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11621 declarations.
11622 (Target_arm::relocate_stub): Change parameter type of stub from
11623 Reloc_stub pointer to Stub pointer.
11624 (Insn_template::size, Insn_template::alignment): Handle
11625 THUMB16_SPECIAL_TYPE.
11626 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11627 Stub_table::update_data_size_and_addralign,
11628 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11629 definitions.
11630 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11631 (Stub_table::do_write): Ditto.
11632 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11633
880cd20d
ILT
116342010-01-08 Ian Lance Taylor <iant@google.com>
11635
11636 PR 11108
11637 * symtab.h (class Symbol): Remove fields is_target_special_ and
11638 has_plt_offset_. Add field is_defined_in_discarded_section_.
11639 (Symbol::is_defined_in_discarded_section): New function.
11640 (Symbol::set_is_defined_in_discarded_section): New function.
11641 (Symbol::has_plt_offset): Rewrite.
11642 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11643 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11644 Don't initialize is_target_special_ or has_plt_offset_.
11645 Initialize is_defined_in_discarded_section_.
11646 (Symbol_table::add_from_relobj): If appropriate, set
11647 is_defined_in_discarded_section.
11648 * resolve.cc (Symbol::override_base_with_special): Don't test
11649 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11650 * target-reloc.h (relocate_section): Do special handling for
11651 symbols defined in discarded sections for global symbols as well
11652 as local symbols.
11653
2703e3eb
ILT
116542010-01-08 Ian Lance Taylor <iant@google.com>
11655
11656 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11657 the SHT_SYMTAB case.
11658
339d40a3
ILT
116592010-01-08 Ian Lance Taylor <iant@google.com>
11660
11661 * object.cc (Sized_relobj::do_layout): Don't get confused if
11662 layout_eh_frame returns NULL.
11663
abecea76
ILT
116642010-01-08 Ian Lance Taylor <iant@google.com>
11665
11666 PR 11084
11667 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11668 dynamic symbol table, use the normal symbol table.
11669 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11670 symbol table.
11671
6b7dd3f3
ILT
116722010-01-08 Ian Lance Taylor <iant@google.com>
11673
11674 PR 11072
11675 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11676 sections.
11677
36c50e63
L
116782010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11679
11680 * version.cc (print_version): Change to "Copyright 2010".
11681
e291e7b9
ILT
116822010-01-08 Ian Lance Taylor <iant@google.com>
11683
11684 PR 10287
11685 PR 11063
11686 * i386.cc (class Target_i386): Change return type of plt_section
11687 to be non-const.
11688 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11689 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11690 tls_desc_rel_ field.
11691 (Output_data_plt_i386::rel_tls_desc): New function.
11692 (Target_i386::rel_tls_desc_section): New function.
11693 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11694 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11695 R_386_TLS_DESC reloc in rel_tls_desc_section.
11696 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11697 Define struct Tlsdesc_info.
11698 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11699 (Target_x86_64::do_reloc_symbol_index): New function.
11700 (Target_x86_64::add_tlsdesc_info): New function.
11701 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11702 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11703 tlsdesc_rel_ field.
11704 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11705 all callers.
11706 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11707 (Target_x86_64::rela_tlsdesc_section): New function.
11708 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11709 handling.
11710 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11711 (Target_x86_64::do_reloc_addend): New function.
11712 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11713 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11714 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11715 (Output_reloc::type): New function.
11716 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11717 (Output_reloc::is_target_specific): New function.
11718 (Output_reloc::target_arg): New function.
11719 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11720 absolute relocs and target specific relocs.
11721 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11722 add_target_specific.
11723 (class Output_data_reloc) [SHT_RELA]: Likewise.
11724 * output.cc (Output_reloc::Output_reloc): Add four new versions
11725 for absolute relocs and target specific relocs.
11726 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11727 (Output_reloc::get_symbol_index): Likewise.
11728 (Output_reloc::local_section_offset): Check that local_sym_index_
11729 is not TARGET_CODE or 0.
11730 (Output_reloc::symbol_value): Likewise.
11731 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11732 reloc.
11733 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11734 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11735 functions.
11736 * layout.cc (add_target_dynamic_tags): Use output section for
11737 DT_PLTRELSZ and DT_JMPREL.
11738
3a44184e
ILT
117392010-01-07 Ian Lance Taylor <iant@google.com>
11740
11741 PR 11061
11742 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11743 function.
11744 (class Output_data_reloc_generic): Define.
11745 (class Output_data_reloc_base): Change base class to
11746 Output_data_reloc_generic. Change add() method to call
11747 bump_relative_reloc_count for a relative reloc. Remove
11748 sort_relocs_ field.
11749 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11750 to sort_relocs().
11751 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11752 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11753 appropriate.
11754 * layout.h (class Layout): Update declaration.
11755
ea715a34
ILT
117562010-01-07 Ian Lance Taylor <iant@google.com>
11757
11758 * output.h (class Output_data): Add const version of
11759 output_section and do_output_section.
11760 (class Output_section_data): Add const version of
11761 do_output_section.
11762 (class Output_section): Likewise.
11763 * layout.cc (Layout::add_target_dynamic_tags): New function.
11764 * layout.h (class Layout): Update declarations.
11765 * arm.cc (Target_arm::do_finalize_sections): Use
11766 add_target_dynamic_tags.
11767 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11768 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11769 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11770 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11771
659948a4
ILT
117722010-01-07 Ian Lance Taylor <iant@google.com>
11773
11774 PR 11042
11775 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11776 object as needed.
11777
9d3b86f6
ILT
117782010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11779 Ian Lance Taylor <iant@google.com>
11780
11781 PR 11019
11782 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11783 Xindex::read_symtab_xindex.
11784
bb0d3eb0
DK
117852010-01-07 Doug Kwan <dougkwan@google.com>
11786
11787 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11788 (Insn_template::thumb16_bcond_insn): New method declaration.
11789 (Insn_template): Fix spelling.
11790 (Stub::thumb16_special): New method declaration.
11791 (Stub::do_write): Define virtual method which was previously pure
11792 virtual.
11793 (Stub::do_thumb16_special): New method declaration.
11794 (Stub::do_fixed_endian_write): New template member.
11795 (Reloc_stub::do_write): Remove.
11796 (Reloc_stub::do_fixed_endian_write): Remove.
11797 (Cortex_a8_stub): New class definition.
11798 (Stub_factory::make_cortex_a8_stub): New method definition.
11799 (Stub_factory::Stub_factory): Add missing static storage class
11800 qualifier for elf32_arm_stub_a8_veneer_blx.
11801
ffeef7df
ILT
118022010-01-07 Ian Lance Taylor <iant@google.com>
11803
dc3f80fe
ILT
11804 PR 10980
11805 * options.h (class General_options): Add --warn-unresolved-symbols
11806 and --error-unresolved-symbols.
11807 * errors.cc (Errors::undefined_symbol): Implement
11808 --warn-unresolved-symbols.
11809
ffeef7df
ILT
11810 * options.h (class General_options): Add -z text and -z textoff.
11811 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11812
f1ec9ded
ST
118132010-01-06 Sriraman Tallam <tmsriram@google.com>
11814
11815 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11816 (Garbage_collection::cident_sections): New function.
11817 (Garbage_collection::add_cident_section): New function.
11818 (Garbage_collection::cident_sections_): New member.
11819 (gc_process_relocs): Add references to sections whose names are C
11820 identifiers.
11821 * gold.h (cident_section_start_prefix): New constant.
11822 (cident_section_stop_prefix): New constant.
11823 (is_cident): New function.
11824 * layout.cc (Layout::define_section_symbols): Replace string constants
11825 with the newly defined constants.
11826 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11827 C identifiers.
11828 * testsuite/Makefile.am: Add gc_orphan_section_test.
11829 * testsuite/Makefile.in: Regenerate.
11830 * testsuite/gc_orphan_section_test.cc: New file.
11831 * testsuite/gc_orphan_section_test.sh: New file.
11832
6eda8c29
ILT
118332010-01-06 Ian Lance Taylor <iant@google.com>
11834
b9674e17
ILT
11835 PR 10980
11836 * options.h (class General_options): Add --warn-shared-textrel.
11837 * layout.cc (Layout::finish_dynamic_section): Implement
11838 --warn-shared-textrel.
11839
6eda8c29
ILT
11840 PR 10980
11841 * options.h (class General_options): Add --warn-multiple-gp.
11842
32dcd44e
ILT
118432010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11844
11845 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11846 $(THREADSLIB) and $(LIBDL).
11847 * Makefile.in: Rebuild.
11848
a192ba05
ILT
118492010-01-06 Ian Lance Taylor <iant@google.com>
11850
11851 PR 10980
11852 * options.cc (General_options::parse_section_start): New function.
11853 (General_options::section_start): New function.
11854 (General_options::General_options): Initialize all members.
11855 * options.h: Include <map>
11856 (class General_options): Add --section-start. Add section_starts_
11857 member.
11858 * layout.cc (Layout::attach_allocated_section_to_segment): If
11859 --section-start was used, set the address of the segment. Remove
11860 local sort_sections.
11861 (Layout::relaxation_loop_body): If the address of the load segment
11862 has been set by --section-start, don't use it.
11863 * output.h (Output_segment::update_flags_for_output_section): New
11864 function.
11865 * output.cc (Output_segment::add_output_section): Call
11866 update_flags_for_output_section.
11867
dde3f402
ILT
118682010-01-05 Ian Lance Taylor <iant@google.com>
11869
62dfdd4d
ILT
11870 PR 10980
11871 * options.h (class General_options): Add --undefined-version.
11872 * script.cc (struct Version_expression): Add was_matched_by_symbol
11873 field.
11874 (Version_script_info::matched_symbol): New function.
11875 (Version_script_info::get_symbol_version_helper): Call
11876 matched_symbol.
11877 (Version_script_info::check_unmatched_names): New function.
11878 * script.h (class Version_script_info): Update declarations.
11879 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11880
9c4ae156
ILT
11881 * options.h (class General_options): Use DEFINE_bool_alias for
11882 allow_multiple_definition.
11883 * resolve.cc (Symbol_table::should_override): Don't test
11884 allow_multiple_definition.
11885
dde3f402
ILT
11886 PR 10980
11887 * options.h (class General_options): Add --cref.
11888 * main.cc (main): Print cref table if --cref. Don't close mapfile
11889 until after printing cref table.
11890 * cref.cc: Include "symtab.h".
11891 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11892 (Cref_table_compare::operator()): New function.
11893 (Cref_inputs::gather_cref): New function.
11894 (filecol): New static const.
11895 (Cref_inputs::print_cref): New function.
11896 (Cref::print_cref): New function.
11897 * cref.h: Include <cstdio>.
11898 (class Cref): Update declarations.
11899 * mapfile.h (Mapfile::file): New function.
11900 * object.h (class Object): Define Symbols. Declare virtual
11901 do_get_global_symbols.
11902 (Object::get_global_symbols): New function.
11903 * object.cc (Input_objects::add_object): Pass object to cref_ if
11904 --cref.
11905 (Input_objects::archive_start): Likewise.
11906 (Input_objects::archive_stop): Likewise.
11907 (Input_objects::print_cref): New function.
11908 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11909 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11910 --cref.
11911 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11912 function.
11913 * plugin.h (class Sized_pluginobj): Update declarations.
11914
8781f709
ILT
119152010-01-05 Ian Lance Taylor <iant@google.com>
11916
11917 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11918 to is_default_version. Rename insdef to insdefault.
11919 (Symbol_table::add_from_relobj): Rename def to is_default_version
11920 and local to is_forced_local.
11921 (Symbol_table::add_from_pluginobj): Likewise.
11922 (Symbol_table::add_from_dynobj): Likewise.
11923 (Symbol_table::define_special_symbol): Rename insdef to
11924 insdefault.
11925
fe35d28d
ILT
119262010-01-04 Ian Lance Taylor <iant@google.com>
11927
30bc8c46
ILT
11928 PR 10980
11929 * options.h (class General_options): Add
11930 --allow-multiple-definition and -z muldefs.
11931 * resolve.cc (Symbol_table::should_override): Don't warn about a
11932 multiple symbol definition if --allow-multiple-definition or -z
11933 muldefs.
11934
7eaea549
ILT
11935 PR 10980
11936 * options.h (class General_options): Add --add-needed and
11937 --copy-dt-needed-entries. Tweak --as-needed help entry.
11938 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11939 error if --copy-dt-needed-entries aka --add-needed is used and
11940 would cause a change in behaviour.
11941
fe35d28d
ILT
11942 PR 10980
11943 * options.h (class General_options): Add -G as a short version of
11944 --shared. Add no-op options -assert, -g, and -i.
11945
55a2bb35
ST
119462010-01-04 Sriraman Tallam <tmsriram@google.com>
11947
11948 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11949 check for .text or .gnu.linkonce.t sections.
11950 * icf.cc (Icf::find_identical_sections): Ditto.
11951 Change the detection for mangled function name within the section
11952 name.
11953 * icf.h (is_section_foldable_candidate): New function.
11954
719328e1
ILT
119552009-12-30 Ian Lance Taylor <iant@google.com>
11956
11957 PR 10980
11958 * options.h (class General_options): Permit two dashes with
11959 --retain-symbols-file.
11960
d7bb5745
ILT
119612009-12-30 Ian Lance Taylor <iant@google.com>
11962
403a15dd
ILT
11963 PR 10979
11964 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11965 don't put the file header and segment headers in the text
11966 segment.
11967
eda294df
ILT
11968 PR 10979
11969 * common.cc (Sort_commons::operator()): Stabilize sort when both
11970 entries are NULL.
11971 (Symbol_table::do_allocate_commons_list): When allocating common
11972 symbols, skip a symbol which is no longer common.
11973 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11974 an object before checking its type.
11975 * testsuite/common_test_2.c: New file.
11976 * testsuite/common_test_3.c: New file.
11977 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11978 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11979 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11980 (common_test_2_pic.o, common_test_2.so): New targets.
11981 (common_test_3_pic.o, common_test_3.so): New targets.
11982 * testsuite/Makefile.in: Rebuild.
11983
d7bb5745
ILT
11984 PR 10979
11985 * script.cc (read_input_script): If we see a new SECTIONS clause,
11986 and we have added an input section, give an error.
11987 * layout.h (class Layout): Add have_added_input_section function.
11988 Add have_added_input_section_ field.
11989 * layout.cc (Layout::Layout): Initialize
11990 have_added_input_section_.
11991 (Layout::layout): Set have_added_input_section_.
11992 (Layout::layout_eh_frame): Likewise.
11993
fc59c572
ILT
119942009-12-30 Ian Lance Taylor <iant@google.com>
11995
11996 PR 10931
11997 * options.h (class General_options): Add --sort-common option.
11998 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11999 * common.cc (Sort_common): Add sort_order parameter to
12000 constructor. Add sort_order_ field.
12001 (Sort_commons::operator): Check sort_order_.
12002 (Symbol_table::allocate_commons): Determine the sort order.
12003 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12004 Change all callers.
12005 (Symbol_table::do_allocate_commons_list): Likewise.
12006
1c74fab0
ILT
120072009-12-30 Ian Lance Taylor <iant@google.com>
12008
12009 PR 10916
12010 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12011 symbols from this object, don't change the visibility of an
12012 undefined symbol.
12013 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12014
6affe781
ILT
120152009-12-30 Ian Lance Taylor <iant@google.com>
12016
12017 PR 10861
12018 * script.h (class Version_script_info): Define Language enum.
12019 Update declarations. Define Glob, Exact, and Lookup types. Add
12020 new fields globals_, locals_, and is_finalized_.
12021 * script.cc: Various formatting fixes.
12022 (class Parser_closure): Change language_stack_ from a vector of
12023 std::string to one of Version_script_info::Language. Adjust all
12024 uses accordingly.
12025 (class Lazy_demangler): Remove.
12026 (struct Version_expression): Change language from std::string to
12027 Version_script_info::Language.
12028 (Version_script_info::Version_script_info): New function.
12029 (Version_script_info::~Version_script_info): Don't call clear.
12030 (Version_script_info::finalize): New function.
12031 (Version_script_info::build_lookup_tables): New function.
12032 (Version_script_info::build_expression_list_lookup): New
12033 function.
12034 (Version_script_info::get_symbol_version_helper): Rewrite to use
12035 lookup tables.
12036 (Version_script_info::print_expression_list): Adjust to use
12037 Version_script_info::Language.
12038 (script_push_lex_into_version_mode): Check that the version script
12039 has not been finalized.
12040 (version_script_push_lang): Change language string to
12041 Version_script_info::Language.
12042 * options.cc (Command_line::version_script): New function.
12043 * options.h (class General_options): Add finalize_dynamic_list
12044 function. Change version_script from declaration to definition.
12045 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12046 * testsuite/version_script.map: Remove duplicate def of foo.
12047 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12048 version_script.map.
12049 * testsuite/Makefile.in: Rebuild.
12050
818bf354
ILT
120512009-12-30 Ian Lance Taylor <iant@google.com>
12052
12053 PR 10843
12054 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12055 if the input symbol index is 0, make the output symbol index 0.
12056
ebcc8304
ILT
120572009-12-30 Ian Lance Taylor <iant@google.com>
12058
12059 PR 10670
12060 * options.h (class General_options): Add -x/--discard-all.
12061 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12062 --discard-all. If the local symbol needs a dynamic entry, check
12063 that before handling --discard-locals.
12064
176fe33f
ILT
120652009-12-30 Ian Lance Taylor <iant@google.com>
12066
bb321bb1
ILT
12067 PR 10450
12068 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12069 flags to PF_R.
12070 (Output_segment::add_output_section): Don't change the flags if
12071 the type is PT_TLS.
12072
176fe33f
ILT
12073 PR 10450
12074 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12075 GNU hash table if they need a dynamic value. Otherwise, don't add
12076 them if they are defined in a dynamic object or are forced local.
12077
e8cd95c7
ILT
120782009-12-29 Ian Lance Taylor <iant@google.com>
12079
1b81fb71
ILT
12080 PR 10450
12081 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12082 .gnu.hash table for a 32-bit target.
12083
8d6d383d
ILT
12084 PR 10450
12085 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12086 regular and a dynamic object only needs a dynamic symbol table
12087 entry if it is externally visible.
12088
e785ec03
ILT
12089 PR 10450
12090 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12091 constructor. Add global_offset_table_ field.
12092 (Target_i386::got_section): Set global_offset_table_.
12093 (Target_i386::do_finalize_sections): Set global_offset_table_
12094 size.
12095 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12096 in constructor. Add global_offset_table_ field.
12097 (Target_x86_64::got_section): Set global_offset_table_.
12098 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12099 size.
12100
1a2dff53
ILT
12101 * layout.cc (Layout::Layout): Initialize increase_relro_.
12102 (Layout::get_output_section): Add is_relro, is_last_relro, and
12103 is_first_non_relro parameters. Change all callers.
12104 (Layout::choose_output_section): Likewise.
12105 (Layout::add_output_section_data): Likewise.
12106 (Layout::make_output_section): Likewise.
12107 (Layout::set_segment_offsets): Clear increase_relro when using a
12108 linker script.
12109 * layout.h (class Layout): Add increase_relro method. Add
12110 increase_relro_ field. Update declarations.
12111 * output.cc (Output_section::Output_section): Initialize
12112 is_last_relro_ and is_first_non_relro_.
12113 (Output_segment::add_output_section): Group relro sections is
12114 do_sort is true. Handle is_last_relro and is_first_non_relro.
12115 (Output_segment::maximum_alignment): Remove relro handling.
12116 (Output_segment::set_section_addresses): Add increase_relro
12117 parameter. Change all callers. Add initial alignment to align
12118 relro sections on separate page. Remove old relro handling.
12119 (Output_segment::set_section_list_addresses): Remove in_relro
12120 parameter. Change all callers.
12121 (Output_segment::set_offset): Add increase parameter. Change all
12122 callers. Remove old relro handling.
12123 * output.h (class Output_section): Add new methods: is_last_relro,
12124 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12125 Add is_last_relro_ and is_first_non_relro_ fields.
12126 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12127 Create separate .got.plt section. Call increase_relro.
12128 * x86_64.cc (Target_x86_64::got_section): Likewise.
12129 * testsuite/relro_script_test.t: Add .got.plt.
12130
f0ba79e2
ILT
12131 PR 10450
12132 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12133 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12134 (Layout::finalize): Call set_dynamic_symbol_size.
12135 (Layout::set_dynamic_symbol_size): New function.
12136 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12137 set_dynamic_symbol_size.
12138
e8cd95c7
ILT
12139 PR 10450
12140 * output.h (class Output_section): Add is_entsize_zero_ field.
12141 * output.cc (Output_section::Output_section): Initialize
12142 is_entsize_zero_.
12143 (Output_section::set_entsize): If two different entsizes are
12144 requested, force it to zero.
12145 (Output_section::add_input_section): Set flags for .debug_str
12146 before updating section flags. Set entsize.
12147 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12148 and SHF_STRING if all input sections have those flags.
12149
3e1b9a8a
RÁE
121502009-12-29 Rafael Espindola <espindola@google.com>
12151
12152 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12153 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12154 reporting.
3e1b9a8a 12155
3dcad376
ST
121562009-12-29 Sriraman Tallam <tmsriram@google.com>
12157
12158 * options.cc (General_options::parse_version): Allow -v to exit
12159 without an error if there is nothing to link.
12160
084e2665
ILT
121612009-12-29 Ian Lance Taylor <iant@google.com>
12162
12163 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12164 using a version of gcc before 4.1.
12165 * configure: Rebuild.
12166
250acde3
CD
121672009-12-28 Chris Demetriou <cgd@google.com>
12168
12169 * attributes.cc (Output_attributes_section_data::do_write): Use
12170 std::vector::front rather than std::vector::data.
12171
99fff23b
ILT
121722009-12-28 Ian Lance Taylor <iant@google.com>
12173
12174 * symtab.h (class Symbol_table): Add enum Defined.
12175 * resolve.cc (Symbol_table::should_override): Add defined
12176 parameter. Change all callers. Test whether object is NULL
12177 before calling a method on it.
12178 (Symbol_table::report_resolve_problem): Add defined parameter.
12179 Change all callers.
12180 (Symbol_table::should_override_with_special): Likewise.
12181 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12182 parameter. Change all callers.
12183 (Symbol_table::do_define_in_output_data): Likewise.
12184 (Symbol_table::define_in_output_segment): Likewise.
12185 (Symbol_table::do_define_in_output_segment): Likewise.
12186 (Symbol_table::define_as_constant): Likewise.
12187 (Symbol_table::do_define_as_constant): Likewise.
12188 * script.h (class Symbol_assignment): Add is_defsym parameter to
12189 constructor; change all callers.
12190 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12191 parameter. Change all callers. Add is_defsym_ field.
12192 (class Parser_closure): Add parsing_defsym parameter to
12193 constructor; change all callers. Add parsing_defsym accessor
12194 function. Add parsing_defsym_ field.
12195
556bd683
ILT
121962009-12-28 Ian Lance Taylor <iant@google.com>
12197
12198 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12199 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12200
1782c879
ILT
122012009-12-23 Ian Lance Taylor <iant@google.com>
12202
12203 * i386.cc (Target_i386::do_calls_non_split): Recognize
12204 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12205 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12206 -fsplit-stack prologue when using %r11.
1782c879 12207
329ca2b1
ST
122082009-12-21 Sriraman Tallam <tmsriram@google.com>
12209
12210 * options.cc (General_options::parse_version): Make -v continue and do
12211 the link like GNU ld does.
12212
d675ff46
RÁE
122132009-12-17 Rafael Avila de Espindola <espindola@google.com>
12214
12215 * Makefile.am (CCFILES): Add timer.cc.
12216 (HFILES): Add timer.h.
12217 * configure.ac: Check for sysconf and times.
12218 * main.cc: include timer.h.
12219 (main): Use Timer instead of get_run_time.
12220 * timer.cc: New.
12221 * timer.h: New.
12222 * workqueue.cc: include timer.h.
12223 (Workqueue::find_and_run_task):
12224 Report user, sys and wall time.
12225 * Makefile.in: Regenerate.
12226 * config.in: Regenerate.
12227 * configure: Regenerate.
12228
d6344fb5
DK
122292009-12-16 Doug Kwan <dougkwan@google.com>
12230
12231 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12232 sections.
12233 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12234 relaxed input sections.
12235 * output.cc (Output_section::find_relaxed_input_section): Change
12236 return type to Output_relaxed_input_section pointer. Adjust code
12237 for new type of relaxed_input_section_map_.
12238 * output.h (Output_section::find_relaxed_input_section): Change
12239 return type to Output_relaxed_input_section pointer.
12240 (Output_section::Output_relaxed_input_section_by_input_section_map):
12241 New type.
12242 (Output_section::relaxed_input_section_map_): Change type to
12243 Output_section::Output_relaxed_input_section_by_input_section_map.
12244 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12245 input section.
12246
0e0d5469
ILT
122472009-12-15 Ian Lance Taylor <iant@google.com>
12248
12249 * layout.cc (Layout::create_shstrtab): Only write out after input
12250 sections if we are compressing debug sections.
12251
0649a889
ILT
122522009-12-15 Ian Lance Taylor <iant@google.com>
12253
12254 * archive.cc (Archive::add_symbols): Only look up a symbol without
12255 a version if there is, in fact, a version.
12256
2ea97941
ILT
122572009-12-14 Ian Lance Taylor <iant@google.com>
12258
12259 Revert -Wshadow changes, all changes from:
12260 2009-12-11 Doug Kwan <dougkwan@google.com>
12261 2009-12-11 Nick Clifton <nickc@redhat.com>
12262 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12263
b0eec2cc
DK
122642009-12-11 Doug Kwan <dougkwan@google.com>
12265
12266 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12267 due to -Wshadow.
12268 * attributes.cc (Object_attribute::size): Ditto.
12269 (Attributes_section_data::size): Ditto.
12270 (Attributes_section_data::Attributes_section_data): Ditto.
12271 (Output_attributes_section_data::do_write): Ditto.
12272 * attributes.h (Object_attribute::set_type): Ditto.
12273 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12274
91d6fa6a
NC
122752009-12-11 Nick Clifton <nickc@redhat.com>
12276
12277 * archive.cc: Fix shadowed variable warnings.
12278 * arm.cc: Likewise.
12279 * compressed_output.cc: Likewise.
12280 * compressed_output.h: Likewise.
12281 * configure: Likewise.
12282 * dwarf_reader.cc: Likewise.
12283 * dynobj.cc: Likewise.
12284 * dynobj.h: Likewise.
12285 * ehframe.cc: Likewise.
12286 * ehframe.h: Likewise.
12287 * errors.cc: Likewise.
12288 * expression.cc: Likewise.
12289 * fileread.cc: Likewise.
12290 * fileread.h: Likewise.
12291 * freebsd.h: Likewise.
12292 * i386.cc: Likewise.
12293 * icf.cc: Likewise.
12294 * incremental.h: Likewise.
12295 * layout.cc: Likewise.
12296 * layout.h: Likewise.
12297 * mapfile.cc: Likewise.
12298 * merge.cc: Likewise.
12299 * merge.h: Likewise.
12300 * object.cc: Likewise.
12301 * object.h: Likewise.
12302 * options.h: Likewise.
12303 * output.cc: Likewise.
12304 * output.h: Likewise.
12305 * parameters.cc: Likewise.
12306 * plugin.cc: Likewise.
12307 * powerpc.cc: Likewise.
12308 * reduced_debug_output.cc: Likewise.
12309 * reduced_debug_output.h: Likewise.
12310 * reloc.cc: Likewise.
12311 * reloc.h: Likewise.
12312 * resolve.cc: Likewise.
12313 * script-sections.cc: Likewise.
12314 * script.cc: Likewise.
12315 * script.h: Likewise.
12316 * sparc.cc: Likewise.
12317 * symtab.cc: Likewise.
12318 * symtab.h: Likewise.
12319 * target-select.cc: Likewise.
12320 * target-select.h: Likewise.
12321 * token.h: Likewise.
12322 * workqueue.cc: Likewise.
12323 * workqueue.h: Likewise.
12324 * x86_64.cc: Likewise.
12325
a0351a69
DK
123262009-12-10 Doug Kwan <dougkwan@google.com>
12327
12328 * arm.cc (attributes.h): New include.
12329 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12330 (Arm_relobj::~Arm_relobj): Delete object pointed by
12331 attributes_section_data_.
12332 (Arm_relobj::attributes_section_data): New method definition.
12333 (Arm_relobj::attributes_section_data_): New data member declaration.
12334 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12335 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12336 attributes_section_data_.
12337 (Arm_dynobj::attributes_section_data): New method definition.
12338 (Arm_dynobj::attributes_section_data_): New data member declaration.
12339 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12340 initialization value of may_use_blx_ to false.
2e702c99 12341 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12342 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12343 object attributes to compute results instead of hard-coding.
12344 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12345 Target_arm::get_secondary_compatible_arch,
12346 Target_arm::set_secondary_compatible_arch
12347 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12348 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12349 New method declarations.
12350 (Target_arm::get_aeabi_object_attribute): New method definition.
12351 (Target_arm::attributes_section_data_): New data member declaration.
12352 (read_arm_attributes_section): New template definition.
12353 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12354 (Arm_dynobj::do_read_symbols): Ditto.
12355 (Target_arm::do_finalize_sections): Merge attributes sections from
12356 input. Check for BLX use after attributes section merging.
12357 Fix __exidx_start and __exidx_end visibility. Create an
12358 .ARM.attributes section if necessary.
12359 (Target_arm::get_secondary_compatible_arch,
12360 Target_arm::set_secondary_compatible_arch,
12361 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12362 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12363 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12364 New method definitions.
12365
b59befec
ILT
123662009-12-09 Ian Lance Taylor <iant@google.com>
12367
12368 * plugin.cc (Plugin::load): Don't cast from void* to a function
12369 pointer.
12370
1276bc89
ILT
123712009-12-09 Ian Lance Taylor <iant@google.com>
12372
12373 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12374 information fields.
12375
2f2de248
L
123762009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12377
12378 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12379 Replace two_file_shared_1.so with two_file_shared_2.so.
12380 * testsuite/Makefile.in: Regenerated.
12381
4f787271
DK
123822009-12-08 Doug Kwan <dougkwan@google.com>
12383
12384 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12385 (HFILES): Add attributes.h and int_encoding.h.
12386 * Makefile.in: Regenerate.
12387 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12388 function definitions to int_encoding.cc
12389 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12390 prototypes to int_encoding.h
12391 * reduced_debug_output.cc (int_encoding.h): New include.
12392 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12393 function definitions to int_encoding.cc
12394 (insert_into_vector, read_from_pointer): Move template definitions to
12395 int_encoding.h
12396 * attributes.cc: New file.
12397 * attributes.h: New file.
12398 * int_encoding.cc: New file.
12399 * int_encoding.h: New file.
12400
20b52f1a
RÁE
124012009-12-07 Rafael Avila de Espindola <espindola@google.com>
12402
12403 PR gold/11055
12404 * incremental-dump.cc (dump_incremental_inputs): New.
12405 (main): Use dump_incremental_inputs.
12406
53d7974c
L
124072009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12408
12409 PR gold/10893
12410 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12411 checking elfcpp::STT_FUNC.
12412 (Target_i386::Relocate::relocate): Likewise.
12413 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12414
12415 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12416 symbols from shared libraries into normal FUNC symbols.
12417
12418 * symtab.h (Symbol): Add is_func and use it.
12419
05a352e6
DK
124202009-12-05 Doug Kwan <dougkwan@google.com>
12421
12422 * arm.cc (Target_arm::arm_info): Initialize new fields
12423 attributes_section and attributes_vendor.
12424 * i386.cc (Target_i386::i386_info): Same.
12425 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12426 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12427 fields attributes_section and attributes_vendor.
53d7974c 12428 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12429 * target.h (Target::attributes_section, Target::attributes_vendor,
12430 Target::is_attributes_section, Target::attribute_arg_type,
12431 Target::attributes_order): New method definitions.
12432 (Target::Target_info::attributes_section,
12433 Target::Target_info::attributes_vendor): New fields.
12434 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12435 virtual method definitions.
12436 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12437 attributes_section and attributes_vendor.
12438 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12439
f4e5969c
DK
124402009-12-05 Doug Kwan <dougkwan@google.com>
12441
12442 * arm.cc: Update comments about interworking and stub generation.
12443 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12444 considered as non-PIC.
12445 (Arm_relocate_functions::base_abs): Fix formatting.
12446 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12447 of function to use GOT entry address instead of offset.
12448 (Target_arm::Scan::global): Issue an error if a symbol would need a
12449 PLT does not get one because it is untyped. Remove code to create
12450 dynamic symbols for relative branches.
12451 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12452 takes unsigned integer instead of boolean.
12453
1abce4a6
L
124542009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12455
12456 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12457 (two_file_test_LDADD): Likewise.
12458 (common_test_1_LDADD): Likewise.
12459 (exception_test_LDADD) Likewise.
12460 (weak_test_LDADD): Likewise.
12461 (many_sections_test_LDADD): Likewise.
12462 (initpri1_LDADD): Likewise.
12463 (script_test_1_LDADD): Likewise.
12464 (script_test_2_LDADD): Likewise.
12465 (justsyms_LDADD): Likewise.
12466 (binary_test_LDADD): Likewise.
12467 (large_LDADD): Likewise.
12468 * testsuite/Makefile.in: Regenerated.
12469
adcf2816 124702009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12471
adcf2816
L
12472 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12473 (Symbol_table::override_with_special): Likewise.
12474 (Symbol_table::add_from_object): Likewise.
12475
28e67f5d
RÁE
124762009-12-04 Rafael Avila de Espindola <espindola@google.com>
12477
12478 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12479 Don't set the data_offset twice.
12480
ae10a101
RÁE
124812009-12-04 Rafael Avila de Espindola <espindola@google.com>
12482
12483 * testsuite/Makefile.in: Regenerate.
12484
f59f41f3
DK
124852009-12-03 Doug Kwan <dougkwan@google.com>
12486
12487 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12488 (Target_arm::do_finalize_sections): Add parameter for symbol table
12489 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12490 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12491 parameter for symbol table pointer.
12492 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12493 an additional parameter for a pointer to symbol table.
12494 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12495 parameter for a symbol table pointer.
12496 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12497 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12498 Ditto.
12499 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12500 parameter for a symbol table pointer.
12501
ca55d848
RÁE
125022009-12-03 Rafael Avila de Espindola <espindola@google.com>
12503
12504 * incremental.cc (Incremental_inputs_header)
12505 (Incremental_inputs_header_write, Incremental_inputs_entry)
12506 (Incremental_inputs_entry_write): Move ...
12507 * incremental.h (Incremental_inputs_header)
12508 (Incremental_inputs_header_write, Incremental_inputs_entry)
12509 (Incremental_inputs_entry_write): here.
12510
3aec4f9c
RÁE
125112009-12-02 Rafael Avila de Espindola <espindola@google.com>
12512
12513 * incremental.cc (make_sized_incremental_binary): Set the target.
12514 Error if it is incompatible.
12515 * output.h (Output_file): Add filename method.
12516
9c0ae74d
RÁE
125172009-12-02 Rafael Avila de Espindola <espindola@google.com>
12518
12519 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12520 from the get_* methods.
12521
a45500ae
RÁE
125222009-12-02 Rafael Avila de Espindola <espindola@google.com>
12523
12524 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12525 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12526 Write 0 for the data_offset of scripts.
12527
325e6408
RÁE
125282009-12-02 Rafael Avila de Espindola <espindola@google.com>
12529
12530 * testsuite/Makefile.am: Add the incremental_test.sh test.
12531 * testsuite/incremental_test.sh: New.
12532 * testsuite/incremental_test_1.c: New.
12533 * testsuite/incremental_test_2.c: New.
12534
954c3e2e
RÁE
125352009-12-01 Rafael Avila de Espindola <espindola@google.com>
12536
703d02da 12537 * incremental-dump.cc (main): Fix typos.
954c3e2e 12538
f8086623
RÁE
125392009-11-27 Rafael Avila de Espindola <espindola@google.com>
12540
12541 PR gold/11025
12542 * incremental-dump.cc (main): Use llu to print 64 bit values.
12543
3b0dd6ac
L
125442009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12545 H.J. Lu <hongjiu.lu@intel.com>
12546
12547 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12548 $(LIBDL).
12549 (incremental_dump_LDADD): Likewise.
12550 * Makefile.in: Regenerated.
12551
a6d1ef57 125522009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12553
a6d1ef57
DK
12554 Revert:
12555
12556 2009-11-25 Doug Kwan <dougkwan@google.com>
12557
12558 * arm.cc (Target_arm::Target_arm): Move method definition
12559 outside of class definition. Add code to handle
12560 --target1-rel, --target1-abs and --target2= options.
12561 (Target_arm::get_reloc_reloc_type): Change method to be
12562 non-static and const.
12563 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12564 New data member declaration.
12565 (Target_arm::Scan::local, Target_arm::Scan::global,
12566 Target_arm::Relocate::relocate,
12567 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12568 Adjust call to Target_arm::get_real_reloc_type.
12569 (Target_arm::get_real_reloc_type): Use command line options
12570 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12571 * options.h (--target1-rel, --target1-abs, --target2): New
12572 ARM-only options.
12573
50aeb7d4
DK
125742009-11-25 Doug Kwan <dougkwan@google.com>
12575
12576 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12577 class definition. Add code to handle --target1-rel, --target1-abs
12578 and --target2= options.
12579 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12580 and const.
12581 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12582 member declaration.
12583 (Target_arm::Scan::local, Target_arm::Scan::global,
12584 Target_arm::Relocate::relocate,
12585 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12586 call to Target_arm::get_real_reloc_type.
12587 (Target_arm::get_real_reloc_type): Use command line options to
12588 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12589 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12590 options.
12591
51938283
DK
125922009-11-25 Doug Kwan <dougkwan@google.com>
12593
12594 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12595 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12596 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12597 formatting.
12598 (Arm_relocate_functions::thm_call): Replace body with a call to
12599 Arm_relocate_functions::thumb_branch_common.
12600 (Arm_relocate_functions::thm_jump24,
12601 Arm_relocate_functions::thm_xpc22): New method definitions.
12602 (Arm_relocate_functions::thumb_branch_common): New method definition.
12603 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12604 operator.
12605 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12606 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12607
e2b8f3c4
RÁE
126082009-11-24 Rafael Avila de Espindola <espindola@google.com>
12609
12610 * Makefile.am: Build incremental-dump
12611 * Makefile.in: Regenerate.
12612 * incremental-dump.cc: New.
12613 * incremental.cc (Incremental_inputs_header_data,
12614 Incremental_inputs_entry_data): Move to incremental.h
12615 * incremental.h: (Incremental_inputs_header_data,
12616 Incremental_inputs_entry_data): Move from incremental.cc
12617
bcba9aec
RÁE
126182009-11-24 Rafael Avila de Espindola <espindola@google.com>
12619
12620 * incremental.cc (Incremental_inputs_header,
12621 Incremental_inputs_header_write, Incremental_inputs_entry,
12622 Incremental_inputs_entry_write): Add a typedef with the data type.
12623
7c3afe08
RÁE
126242009-11-24 Rafael Avila de Espindola <espindola@google.com>
12625
12626 * incremental.cc (Incremental_inputs_header,
12627 Incremental_inputs_header_write, Incremental_inputs_entry,
12628 Incremental_inputs_entry_write): Update comment about which
12629 type has the filed descriptions.
12630
d204b6e9
DK
126312009-11-15 Doug Kwan <dougkwan@google.com>
12632
12633 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12634 (Arm_relocate_functions::arm_branch_common): Change method defintion
12635 in class definition to a method declaration and update list of formal
12636 parameters.
12637 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12638 Arm_relocation_functions::jump24): Adjust call to
12639 Arm_relocate_functions::arm_branch_common. Update list of formal
12640 parameters.
12641 (Arm_relocate_functions::xpc25): New method definition.
12642 (Arm_relocate_functions::arm_branch_common): Move method defintion
12643 out from class definition. Use stubs for mode-switching and extending
12644 branch ranges.
12645 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12646 specially. Change code to enable use of stubs in ARM branches.
12647
43d12afe
DK
126482009-11-10 Doug Kwan <dougkwan@google.com>
12649
12650 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12651 in method declaration.
12652 (Target_arm::relocate_stub): New method declaration.
12653 (Target_arm::default_target): Change to return a pointer instead of
12654 a const reference.
12655 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12656 Target_arm::default_target.
12657 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12658 method definition.
12659 (Target_arm::relocate_section): Adjust view.
12660 (Target_arm::relocate_stub): New method definition.
12661
ac33a407
DK
126622009-11-10 Doug Kwan <dougkwan@google.com>
12663
12664 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12665 a format warning.
12666 * incremental.cc (open_incremental_binary): Initialized local
12667 variables to avoid warnings.
12668 * object.cc (make_elf_object): Ditto.
12669 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12670 a format warning.
e1df38aa 12671
88ee28e9
L
12672009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12673
12674 PR gold/10930
12675 * testsuite/plugin_test.c: Include "config.h".
12676
2daedcd6
DK
126772009-11-09 Doug Kwan <dougkwan@google.com>
12678
12679 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12680 (arm_symbol_value): Remove.
12681 (Arm_relocate_functions::arm_branch_common,
12682 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12683 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12684 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12685 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12686 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12687 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12688 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12689 Arm_relocate_functions::thm_mobw_abs_nc,
12690 Arm_relocate_functions::thm_mov_abs,
12691 Arm_relocate_functions::movw_prel_nc,
12692 Arm_relocate_functions::thm_movt_abs,
12693 Arm_relocate_functions::movt_prel,
12694 Arm_relocate_functions::thm_movw_prel_nc,
12695 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12696 (Target_arm::Relocate::relocate): Only decompose address into two
12697 parts if relocation type uses the thumb-bit and pass the actual
12698 bit instead of a flag indicating that the thumb-bit is used. Adjust
12699 calls to methods in Arm_relocate_functions for this change.
12700
1276bc89 127012009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12702
12703 PR 10925
12704 * reloc.cc: Instantiate
12705 Sized_relobj::initialize_input_to_output_maps and
12706 Sized_relobj:free_input_to_output_maps.
12707
e53ad1b5
ILT
127082009-11-06 Ian Lance Taylor <iant@google.com>
12709
12710 PR 10876
12711 * defstd.cc (in_segment): Set only_if_ref true for "end".
12712
eb44217c
DK
127132009-11-06 Doug Kwan <dougkwan@google.com>
12714
12715 * arm.cc (class Reloc_stub): Correct a comment.
12716 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12717 (Target_arm::scan_section_for_stubs): New method declaration.
12718 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12719 Change methods from private to protected.
12720 (Target_arm::do_may_relax): New method definition.
12721 (Target_arm::do_relax, Target_arm::group_sections,
12722 Target_arm::scan_reloc_for_stub,
12723 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12724 (Target_arm::arm_input_section_map_): New data member declaration.
12725 (Target_arm::scan_reloc_for_stub,
12726 Target_arm::scan_reloc_section_for_stubs,
12727 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12728 Target_arm::do_relax): New method definitions.
12729
5d329b7d
ILT
127302009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12731
12732 * configure.ac: Check for (struct stat)::st_mtim
12733 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12734 * config.in: Regenerate.
12735 * configure: Regenerate.
12736
96a0d71b
ILT
127372009-11-05 Ian Lance Taylor <iant@google.com>
12738
12739 PR 10910
12740 * output.cc (Output_segment::add_output_section): Add missing
12741 return statement.
12742
594c8e5e
ILT
127432009-11-04 Ian Lance Taylor <iant@google.com>
12744
12745 PR 10880
12746 * object.h (class Object): Add is_needed and set_is_needed
12747 methods. Add is_needed_ field. Make bool fields into bitfields.
12748 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12749 defined in a dynamic object and referenced by a regular object,
12750 set is_needed for the dynamic object.
12751 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12752 if the file is marked with as_needed and it is not needed.
12753
22b127cc
ILT
127542009-11-04 Ian Lance Taylor <iant@google.com>
12755
12756 PR 10887
12757 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12758 tags if data is discarded by linker script.
12759 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12760 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12761 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12762 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12763
f5c870d2
ILT
127642009-11-04 Ian Lance Taylor <iant@google.com>
12765
12766 * layout.cc (Layout::get_output_section): Add is_interp and
12767 is_dynamic_linker_section parameters. Change all callers.
12768 (Layout::choose_output_section): Likewise.
12769 (Layout::make_output_section): Likewise.
12770 (Layout::add_output_section_data): Add is_dynamic_linker_section
12771 parameter. Change all callers.
12772 * layout.h (class Layout): Update declarations.
12773 * output.h (class Output_section): Add is_interp, set_is_interp,
12774 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12775 Add is_interp_, is_dynamic_linker_section_ fields. Change
12776 generate_code_fills_at_write_ to a bitfield.
12777 * output.cc (Output_section::Output_sections): Initialize new
12778 fields.
12779 (Output_segment::add_output_section): Add do_sort parameter.
12780 Change all callers.
12781
1ae4d23b
ILT
127822009-11-03 Ian Lance Taylor <iant@google.com>
12783
12784 PR 10860
12785 * options.h (class General_options): Add --warn-common.
12786 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12787 merging two common symbols.
12788 (Symbol_table::should_override): Handle --warn-common when merging
12789 a common symbol with a defined symbol. Use report_resolve_problem
12790 for multiple definitions.
12791 (Symbol_table::report_resolve_problem): New function.
12792 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12793
55da9579
DK
127942009-11-03 Doug Kwan <dougkwan@google.com>
12795
12796 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12797 stub_factory_.
12798 (Target_arm::stub_factory): New method definition.
12799 (Target_arm::new_arm_input_section,
12800 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12801 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12802 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12803 New type definitions.
12804 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12805 member declarations.
12806 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12807 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12808 New method definitions.
12809
37a9ac43
ILT
128102009-11-03 Ian Lance Taylor <iant@google.com>
12811
12812 * options.h (class General_options): Add --warn_constructors.
12813
b3d6a3d4
ILT
128142009-11-03 Ian Lance Taylor <iant@google.com>
12815
12816 PR 10893
12817 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12818 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12819
934b01dd
ILT
128202009-11-03 Ian Lance Taylor <iant@google.com>
12821
12822 PR 10895
12823 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12824 --msgid-bugs-address.
12825 (install-pdf): New target.
12826 (install-data_yes): Look up one directory to find mkinstalldirs.
12827
03c1939b
L
128282009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12829
12830 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12831 tree.
12832
ebd95253
DK
128332009-10-30 Doug Kwan <dougkwan@google.com>
12834
12835 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12836
e9bbb538
DK
128372009-10-30 Doug Kwan <dougkwan@google.com>
12838
12839 * arm.cc (Stub_addend_reader): New struct template definition
12840 and partial specializations.
12841 (Stub_addend_reader::operator()): New method definition for a
12842 partially specialized template.
12843
d5b40221
DK
128442009-10-30 Doug Kwan <dougkwan@google.com>
12845
12846 * arm.cc (Arm_relobj::processor_specific_flags): New method
12847 definition.
12848 (Arm_relobj::do_read_symbols): New method declaration.
12849 (Arm_relobj::processor_specific_flags_): New data member declaration.
12850 (Arm_dynobj): New class definition.
12851 (Target_arm::do_finalize_sections): Add input_objects parameter.
12852 (Target_arm::do_adjust_elf_header): New method declaration.
12853 (Target_arm::are_eabi_versions_compatible,
12854 (Target_arm::merge_processor_specific_flags): New method declaration.
12855 (Target_arm::do_make_elf_object): New overloaded method definitions
12856 and declaration.
12857 (Arm_relobj::do_read_symbols): New method definition.
12858 (Arm_dynobj::do_read_symbols): Ditto.
12859 (Target_arm::do_finalize_sections): Add input_objects parameters.
12860 Merge processor-specific flags from all input objects.
12861 (Target_arm::are_eabi_versions_compatible,
12862 Target_arm::merge_processor_specific_flags,
12863 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12864 New method definitions.
12865 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12866 Input_objects pointer type parameter.
12867 * layout.cc (Layout::finalize): Pass input objects to target's.
12868 finalize_sections function.
12869 * output.cc (Output_file_header::do_sized_write): Set ELF file
12870 header's processor-specific flags.
12871 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12872 Input_objects pointer type parameter.
12873 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12874 * target.h (Input_objects): New forward class declaration.
12875 (Target::processor_specific_flags,
12876 Target::are_processor_specific_flags_sect): New method definitions.
12877 (Target::finalize_sections): Add input_objects parameter.
12878 (Target::Target): Initialize processor_specific_flags_ and
12879 are_processor_specific_flags_set_.
12880 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12881 parameter.
12882 (Target::set_processor_specific_flags): New method definition.
12883 (Target::processor_specific_flags_,
12884 Target::are_processor_specific_flags_set_): New data member
12885 declarations.
12886 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12887 Input_objects pointer type parameter.
12888
ebabffbd
DK
128892009-10-30 Doug Kwan <dougkwan@google.com>
12890
12891 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12892
ad0f2072
ILT
128932009-10-28 Ian Lance Taylor <iant@google.com>
12894
12895 * object.h (class Relobj): Drop options parameter from
12896 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12897 do_scan_relocs, do_relocate. Change all callers.
12898 (class Sized_relobj): Drop options parameters from
12899 do_gc_process_relocs, do_scan_relocs, do_relocate,
12900 do_relocate_sections, relocate_sections, emit_relocs_scan,
12901 emit_relocs_scan_reltype. Change all callers.
12902 (struct Relocate_info): Remove options field and all references to
12903 it.
12904 * reloc.h (class Read_relocs): Remove options constructor
12905 parameter and options_ field. Change all callers.
12906 (class Gc_process_relocs, class Scan_relocs): Likewise.
12907 (class Relocate_task): Likewise.
12908 * target-reloc.h (scan_relocs): Remove options parameter. Change
12909 all callers.
12910 (scan_relocatable_relocs): Likewise.
12911 * target.h (class Sized_target): Remove options parameter from
12912 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12913 all callers.
12914 * gc.h (gc_process_relocs): Remove options parameter. Change all
12915 callers.
12916 * arm.cc: Update functions to remove options parameters.
12917 * i386.cc: Likewise.
12918 * powerpc.cc: Likewise.
12919 * sparc.cc: Likewise.
12920 * x86_64.cc: Likewise.
12921 * testsuite/testfile.cc: Likewise.
12922
8ffa3667
DK
129232009-10-28 Doug Kwan <dougkwan@google.com>
12924
12925 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12926 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12927 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12928 New method definitions.
12929
40f36857
CC
129302009-10-28 Cary Coutant <ccoutant@google.com>
12931
12932 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12933 (Plugin::cleanup_done_): New member.
12934 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12935 (Plugin_manager::cleanup_done_): Remove.
12936 (Plugin_manager::add_input_file): Edit error message.
12937 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12938 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12939
2c849493
ILT
129402009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12941
12942 * fileread.cc: (File_read::View::~View): Use the new
12943 data_ownership_ filed.
12944 (File_read::~File_read): Dispose the new whole_file_view_.
12945 (File_read::open): Mmap the whole file if needed.
12946 (File_read::open): Use whole_file_view_ instead of contents_.
12947 (File_read::find_view): Use whole_file_view_ if applicable.
12948 (File_read::do_read): Use whole_file_view_ instead of contents_.
12949 (File_read::make_view): Use whole_file_view_ instead of contents_,
12950 update File_read::View::View call.
12951 (File_read::find_or_make_view): Update File_read::View::View
12952 call.
12953 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12954 remove contents_
12955 (File_read::View::Data_ownership): New enum.
12956 (File_read::View::View): Replace bool mapped_ with Data_ownership
12957 argument.
12958 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12959 (File_read::View::data_ownership_): New field.
12960 (File_read::contents_): Remove (replaced by whole_file_view_).
12961 (File_read::whole_file_view_): New field.
12962 * options.h (class General_options): Add --keep-files-mapped.
12963
24998053
CC
129642009-10-27 Cary Coutant <ccoutant@google.com>
12965
12966 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12967 * testsuite/Makefile.am (plugin_test_5): New test case.
12968 * testsuite/Makefile.in: Regenerate.
12969
72adc4fa
DK
129702009-10-25 Doug Kwan <dougkwan@google.com>
12971
12972 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12973 from private to protected to allow access by child class.
12974 (Sized_relobj::do_relocate_sections): New method declaration.
12975 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12976 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12977 Sized_relobj::relocate_sections. Instantiate template explicitly
12978 for different target sizes and endianity.
12979
07f508a2
DK
129802009-10-24 Doug Kwan <dougkwan@google.com>
12981
12982 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12983 (Arm_input_section::as_arm_input_section): New method.
12984 (Arm_output_section): New class definition.
12985 (Arm_output_section::create_stub_group,
12986 Arm_output_section::group_sections): New method definitions.
12987
10ad9fe5
DK
129882009-10-22 Doug Kwan <dougkwan@google.com>
12989
12990 * arm.cc (Arm_input_section): New class definition.
12991 (Arm_input_section::init, Arm_input_section:do_write,
12992 Arm_input_section::set_final_data_size,
12993 Arm_input_section::do_reset_address_and_file_offset): New method
12994 definitions.
12995
56ee5e00
DK
129962009-10-21 Doug Kwan <dougkwan@google.com>
12997
12998 * arm.cc (Stub_table, Arm_input_section): New forward class
12999 declarations.
13000 (Stub_table): New class defintion.
13001 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13002 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13003 New method definition.
13004
b569affa
DK
130052009-10-21 Doug Kwan <dougkwan@google.com>
13006
13007 * arm.cc: Update copyright comments.
13008 (Target_arm): New forward class template declaration.
13009 (Arm_address): New type.
13010 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13011 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13012 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13013 constants.
13014 (Insn_template): Same.
13015 (DEF_STUBS): New macro.
13016 (Stub_type): New enum type.
13017 (Stub_template): New class definition.
13018 (Stub): Same.
13019 (Reloc_stub): Same.
13020 (Stub_factory): Same.
13021 (Target_arm::Target_arm): Initialize may_use_blx_ and
13022 should_force_pic_veneer_.
13023 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13024 Target_arm::should_force_pic_veneer,
13025 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13026 Target_arm::using_thumb_only, Target_arm:;default_target): New
13027 method defintions.
13028 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13029 New data member declarations.
13030 (Insn_template::size, Insn_template::alignment): New method defintions.
13031 (Stub_template::Stub_template): New method definition.
13032 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13033 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13034 (Stub_factory::Stub_factory): New method definition.
13035 * gold.h (string_hash): New template.
13036 * output.h (Input_section_specifier::hash_value): Use
13037 gold::string_hash.
13038 (Input_section_specifier::string_hash): Remove.
13039 * stringpool.cc (Stringpool_template::string_hash): Use
13040 gold::string_hash.
13041
6c172549
DK
130422009-10-20 Doug Kwan <dougkwan@google.com>
13043
13044 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13045 symbols of relaxed input sections.
13046 * output.h (Output_section::find_relaxed_input_section): Make
13047 method public.
13048
c5617f2f
DK
130492009-10-16 Doug Kwan <dougkwan@google.com>
13050
13051 * dynobj.cc (Versions::Versions): Initialize version_script_.
13052 Only insert base version symbol definition for a shared object
13053 if version script defines any version versions.
13054 (Versions::define_base_version): New method definition.
13055 (Versions::add_def): Check that base version is not needed.
13056 (Versions::add_need): Define base version lazily.
13057 * dynobj.h (Versions::define_base_version): New method declaration.
13058 (Versions::needs_base_version_): New data member declaration.
13059 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13060 (check_DATA): Add no_version_test.stdout.
13061 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13062 New make rules.
13063 * testsuite/Makefile.in: Regenerate.
13064 * testsuite/no_version_test.c: New file.
13065 * testsuite/no_version_test.sh: Ditto.
13066
3c12dcdb
DK
130672009-10-16 Doug Kwan <dougkwan@google.com>
13068
13069 * expression.cc (class Segment_start_expression): New class definition.
13070 (Segment_start_expression::value): New method definition.
13071 (script_exp_function_segment_start): Return a new
13072 Segment_start_expression.
13073 * gold/script-c.h (script_saw_segment_start_expression): New function
13074 prototype.
13075 * script-sections.cc (Script_sections::Script_sections): Initialize
13076 SAW_SEGMENT_START_EXPRESSION_ to false.
13077 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13078 and -Tbbs options to specify section addresses if given in
13079 command line and no SEGMENT_START expression is seen in a script.
13080 * script-sections.h (Script_sections::saw_segment_start_expression,
13081 Script_sections::set_saw_segment_start_expression): New method
13082 definition.
13083 (Script_sections::saw_segment_start_expression_): New data member
13084 declaration.
13085 * script.cc (script_saw_segment_start_expression): New function.
13086 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13087 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13088 script_test_7.sh and script_test_8.sh.
13089 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13090 script_test_8.stdout.
13091 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13092 (script_test_6, script_test_6.stdout, script_test_7,
13093 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13094 * Makefile.in: Regenerate.
13095 * testsuite/script_test_6.sh: New file.
13096 * testsuite/script_test_6.t: Same.
13097 * testsuite/script_test_7.sh: Same.
13098 * testsuite/script_test_7.t: Same.
13099 * testsuite/script_test_8.sh: Same.
13100
64b1ae37
DK
131012009-10-16 Doug Kwan <dougkwan@google.com>
13102
13103 * output.cc (Output_segment::set_section_list_address): Cast
13104 expressions to unsigned long long type to avoid format warnings.
13105
661be1e2
ILT
131062009-10-15 Ian Lance Taylor <iant@google.com>
13107
12edd763 13108 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13109 dot assignment to script_sections_.
12edd763
ILT
13110 * script-sections.cc (Script_sections::add_dot_assignment):
13111 Initialize if necessary.
13112
68b6574b
ILT
13113 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13114 program headers with no load segment if there is a linker script.
13115
661be1e2
ILT
13116 * layout.cc (Layout::set_segment_offsets): Align the file offset
13117 to the segment aligment for -N or -n with no load segment.
13118 * output.cc (Output_segment::add_output_section): Don't crash if
13119 the first section is a TLS section.
13120 (Output_segment::set_section_list_addresses): Print an error
13121 message if the address moves backward in a linker script.
13122 * script-sections.cc
13123 (Output_section_element_input::set_section_addresses): Don't
13124 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13125 (Orphan_output_section::set_section_addresses): Likewise.
13126
f15f61a7
DK
131272009-10-15 Doug Kwan <dougkwan@google.com>
13128
13129 * layout.cc (Layout::finish_dynamic_section): Generate tags
13130 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13131 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13132 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13133
82bb573a
ILT
131342009-10-14 Ian Lance Taylor <iant@google.com>
13135
13136 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13137 fields.
13138 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13139 data_shdr fields of relinfo.
13140 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13141 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13142 R_386_TLS_LDO_32, adjust based on section flags.
13143 (Target_i386::Relocate::fix_up_ldo): Remove.
13144
374ad285
ILT
131452009-10-13 Ian Lance Taylor <iant@google.com>
13146
13147 Add support for -pie.
13148 * options.h (class General_options): Add -pie and
13149 --pic-executable.
13150 (General_options::output_is_position_independent): Test -pie.
13151 (General_options::output_is_executable): Return true if not shared
13152 and not relocatable.
13153 (General_options::output_is_pie): Remove.
13154 * options.cc (General_options::finalize): Reject incompatible uses
13155 of -pie.
13156 * gold.cc (queue_middle_tasks): A -pie link is not static.
13157 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13158 * symtab.cc (Symbol::final_value_is_known): Return false if
13159 output_is_position_independent.
13160 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13161 output_is_position_independent.
13162 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13163 output_is_position_independent.
13164 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13165 output_is_position_independent.
13166 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13167 two_file_pie_test.
13168 (basic_pie_test.o, basic_pie_test): New targets.
13169 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13170 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13171 (two_file_pie_test): New target.
13172 * testsuite/Makefile.in: Rebuild.
13173 * README: Remove note saying that -pie is not supported.
13174
c6585162
ILT
131752009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13176
13177 * options.h (class General_options): Add -init and -fini.
13178 * layout.cc (Layout::finish_dynamic_section): Emit
13179 given init and fini functions.
13180
032ce4e9
ST
131812009-10-13 Sriraman Tallam <tmsriram@google.com>
13182
13183 * gc.h (gc_process_relocs): Check if icf is enabled using new
13184 function.
13185 * gold.cc (queue_initial_tasks): Likewise.
13186 (queue_middle_tasks): Likewise.
13187 * object.cc (do_layout): Likewise.
13188 * symtab.cc (is_section_folded): Likewise.
13189 * main.cc (main): Likewise.
13190 * reloc.cc (Read_relocs::run): Likewise.
13191 (Sized_relobj::do_scan_relocs): Likewise.
13192 * icf.cc (is_function_ctor_or_dtor): New function.
13193 (Icf::find_identical_sections): Check if function is ctor or dtor when
13194 safe icf is chosen.
13195 * options.h (General_options::icf): Change option to be an enum.
13196 (Icf_status): New enum.
13197 (icf_enabled): New method.
13198 (icf_safe_folding): New method.
13199 (set_icf_status): New method.
13200 (icf_status_): New variable.
13201 * (options.cc) (General_options::finalize): Set icf_status_.
13202 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13203 icf_test and icf_keep_unique_test to use the --icf enum flag.
13204 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13205 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13206
f345227a
ST
132072009-10-12 Sriraman Tallam <tmsriram@google.com>
13208
13209 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13210 includes to gc.h and icf.h.
13211 * arm.cc: Include gc.h.
13212 * gold.cc: Likewise.
13213 * i386.cc: Likewise.
13214 * powerpc.cc: Likewise.
13215 * sparc.cc: Likewise.
13216 * x86_64.cc: Likewise.
13217 * gc.h: Include icf.h.
13218
1c7814ed
ILT
132192009-10-11 Ian Lance Taylor <iant@google.com>
13220
13221 * plugin.cc: Include "gold.h" before other header files.
13222
ae3b5189
CD
132232009-10-10 Chris Demetriou <cgd@google.com>
13224
13225 * options.h (Input_file_argument::Input_file_type): New enum.
13226 (Input_file_argument::is_lib_): Replace with...
13227 (Input_file_argument::type_): New member.
13228 (Input_file_argument::Input_file_argument): Take Input_file_type
13229 'type' rather than boolean 'is_lib' as second argument.
13230 (Input_file_argument::is_lib): Use type_.
13231 (Input_file_argument::is_searched_file): New function.
13232 (Input_file_argument::may_need_search): Handle is_searched_file.
13233 * options.cc (General_options::parse_library): Support -l:filename.
13234 (General_options::parse_just_symbols): Update for Input_file_argument
13235 changes.
13236 (Command_line::process): Likewise.
13237 * archive.cc (Archive::get_file_and_offset): Likewise.
13238 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13239 * script.cc (read_script_file, script_add_file): Likewise.
13240 * fileread.cc (Input_file::Input_file): Likewise.
13241 (Input_file::will_search_for): Handle is_searched_file.
13242 (Input_file::open): Likewise.
13243 * readsyms.cc (Read_symbols::get_name): Likewise.
13244 * testsuite/Makefile.am (searched_file_test): New test.
13245 * testsuite/Makefile.in: Regenerate.
13246 * testsuite/searched_file_test.cc: New file.
13247 * testsuite/searched_file_test_lib.cc: New file.
13248
f3048a1d
ILT
132492009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13250 Ian Lance Taylor <iant@google.com>
13251
13252 * descriptor.cc: Include <cstdio> and "binary-io.h".
13253 (Descriptors::open): Open the files in binary mode always.
13254 * script.cc (Lex::get_token): Treat \r as whitespace.
13255
d4780e57
ILT
132562009-10-09 Ian Lance Taylor <iant@google.com>
13257
13258 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13259
d9a893b8
ILT
132602009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13261 Ian Lance Taylor <iant@google.com>
13262
13263 * configure.ac: Check for readv function also.
13264 * fileread.cc (readv): Define if not HAVE_READV.
13265 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13266 does not exist.
13267 * config.in: Regenerate.
13268 * configure: Regenerate.
13269
c0a62865
DK
132702009-10-09 Doug Kwan <dougkwan@google.com>
13271
13272 * layout.cc (Layout::make_output_section): Call target hook to make
13273 ordinary output section.
13274 (Layout::finalize): Adjust parameter list of call the
13275 Target::may_relax().
13276 * layout.h (class Layout::section_list): New method.
13277 * merge.h (Output_merge_base::entsize): Change visibility to public.
13278 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13279 New methods.
13280 (Output_merge_string::do_is_string): New method.
13281 * object.cc (Sized_relobj::do_setup): renamed from
13282 Sized_relobj::set_up.
13283 * object.h (Sized_relobj::adjust_shndx,
13284 Sized_relobj::initializ_input_to_output_maps,
13285 Sized_relobj::free_input_to_output_maps): Change visibilities to
13286 protected.
13287 (Sized_relobj::setup): Virtualize.
13288 (Sized_relobj::do_setup): New method declaration.
13289 (Sized_relobj::invalidate_section_offset,
13290 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13291 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13292 * options.cc (parse_int): New function.
13293 * options.h (parse_int): New declaration.
13294 (DEFINE_int): New macro.
13295 (stub_group_size): New option.
13296 * output.cc (Output_section::Output_section): Initialize memebers
13297 merge_section_map_, merge_section_by_properties_map_,
13298 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13299 (Output_section::add_input_section): Handled deferred code-fill
13300 generation and remove an old comment.
13301 (Output_section::add_relaxed_input_section): New method definition.
13302 (Output_section::add_merge_input_section): Use merge section by
13303 properties map to speed to search. Update merge section maps
13304 as appropriate.
13305 (Output_section::build_relaxation_map): New method definition.
13306 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13307 Same.
13308 (Output_section::relax_input_section): Renamed to
13309 Output_section::convert_input_sections_to_relaxed_sections and change
13310 interface to take a vector of pointers to relaxed sections.
13311 (Output_section::find_merge_section,
13312 Output_section::find_relaxed_input_section): New method definitions.
13313 (Output_section::is_input_address_mapped,
13314 Output_section::output_offset, Output_section::output_address):
13315 Use output section data maps to speed up searching.
13316 (Output_section::find_starting_output_address): Add comments.
13317 (Output_section::do_write,
13318 Output_section::write_to_postprocessing_buffer): Do code-fill
13319 generation as appropriate.
13320 (Output_section::get_input_sections): Invalidate relaxed input section
13321 map.
13322 (Output_section::restore_states): Adjust type of checkpoint .
13323 Invalidate relaxed input section map.
13324 * output.h (Output_merge_base): New class declaration.
13325 (Input_section_specifier): New class defintion.
13326 (class Output_relaxed_input_section) Change base class to
13327 Output_section_data_build.
13328 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13329 base class initializer.
13330 (Output_section::add_relaxed_input_section): New method declaration.
13331 (Output_section::Input_section): Change visibility to protected.
2e702c99 13332 (Output_section::Input_section::relobj,
c0a62865
DK
13333 Output_section::Input_section::shndx): Handle relaxed input sections.
13334 Output_section::input_sections) Change visibility to protected. Also
13335 define overload to return a non-const pointer.
13336 (Output_section::Merge_section_properties): New class defintion.
13337 (Output_section::Merge_section_by_properties_map,
13338 Output_section::Output_section_data_by_input_section_map,
13339 Output_section::Relaxation_map): New types.
13340 (Output_section::relax_input_section): Rename method to
13341 Output_section::convert_input_sections_to_relaxed_sections and change
13342 interface to take a vector of relaxed section pointers.
13343 (Output_section::find_merge_section,
13344 Output_section::find_relaxed_input_section,
13345 Output_section::build_relaxation_map,
13346 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13347 New method declarations.
13348 (Output_section::merge_section_map_
13349 Output_section::merge_section_by_properties_map_,
13350 Output_section::relaxed_input_section_map_,
13351 Output_section::is_relaxed_input_section_map_valid_,
13352 Output_section::generate_code_fills_at_write_): New data members.
13353 * script-sections.cc
13354 (Output_section_element_input::set_section_addresses): Call
13355 current_data_size and addralign methods of relaxed input sections.
13356 (Orphan_output_section::set_section_addresses): Call current_data_size
13357 and addralign methods of relaxed input sections.
13358 * symtab.cc (Symbol_table::compute_final_value): Extract template
13359 from the body of Symbol_table::sized_finalize_symbol.
13360 (Symbol_table::sized_finalized_symbol): Call
13361 Symbol_table::compute_final_value.
13362 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13363 (Symbol_table::compute_final_value): New templated method declaration.
13364 * target.cc (Target::do_make_output_section): New method defintion.
13365 * target.h (Target::make_output_section): New method declaration.
13366 (Target::relax): Add more parameters for input objects, symbol table
13367 and layout. Adjust call to do_relax.
13368 (Target::do_make_output_section): New method declaration.
13369 (Target::do_relax): Add parameters for input objects, symbol table
13370 and layout.
13371
d446d6c4
ILT
133722009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13373
13374 * pread.c: Include stdio.h.
13375
bc06c745
ILT
133762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13377
13378 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13379 defined.
13380
75aea3d0
ILT
133812009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13382
13383 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13384 Change read_shndx type to unsigned int.
13385 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13386 int.
13387 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13388 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13389 Change read_shndx type to unsigned int.
13390 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13391 int.
13392 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13393 * layout.cc (Layout::create_symtab_sections): Cast the result of
13394 local_symcount * symsize to off_t in the gold_assert.
13395
be8fcb75
ILT
133962009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13397
13398 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13399 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13400 R_ARM_BASE_ABS.
13401 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13402 (Arm_relocate_functions::thm_abs5): New function.
13403 (Arm_relocate_functions::abs12): New function.
13404 (Arm_relocate_functions::abs16): New function.
13405 (Arm_relocate_functions::base_abs): New function.
13406 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13407 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13408 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13409 R_ARM_BASE_ABS.
13410 (Scan::global): Likewise.
13411 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13412 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13413 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13414 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13415 R_ARM_BASE_ABS.
13416
c2a122b6
ILT
134172009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13418
13419 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13420 (Arm_relocate_functions::movt_prel): New function.
13421 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13422 (Arm_relocate_functions::thm_movt_prel): New function.
13423 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13424 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13425 (Scan::global, Relocate::relocate): Likewise.
13426 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13427
c4aa1e2d
ILT
134282009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13429
13430 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13431 Incremental_checker.
13432 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13433 unsigned int.
13434 (class Incremental_inputs_header): New class.
13435 (Incremental_inputs_header_writer): Edit comment.
13436 (Incremental_inputs_entry): New class.
13437 (Incremental_inputs_entry_writer): Edit comment.
13438 (Sized_incremental_binary::do_find_incremental_inputs_section):
13439 Add *strtab_shndx parameter, fill it.
13440 (Sized_incremental_binary::do_check_inputs): New method.
13441 (Incremental_checker::can_incrementally_link_output_file): Use
13442 Sized_incremental_binary::check_inputs.
13443 (Incremental_inputs::report_command_line): Save command line in
13444 command_line_.
13445 * incremental.h:
13446 (Incremental_binary::find_incremental_inputs_section): New
13447 method.
13448 (Incremental_binary::do_find_incremental_inputs_section): Add
13449 strtab_shndx parameter.
13450 (Incremental_binary::do_check_inputs): New pure virtual method.
13451 (Sized_incremental_binary::do_check_inputs): Declare.
13452 (Incremental_checker::Incremental_checker): Add incremental_inputs
13453 parameter, use it to initialize incremental_inputs_.
13454 (Incremental_checker::incremental_inputs_): New field.
13455 (Incremental_checker::command_line): New method.
13456 (Incremental_checker::inputs): New method.
13457 (Incremental_checker::command_line_): New field.
13458
c549a694
ILT
134592009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13460
13461 * incremental.cc: Include <cstdarg> and "target-select.h".
13462 (vexplain_no_incremental): New function.
13463 (explain_no_incremental): New function.
13464 (Incremental_binary::error): New method.
13465 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13466 method.
13467 (make_sized_incremental_binary): New function.
13468 (open_incremental_binary): New function.
13469 (can_incrementally_link_file): Add checks if output is ELF and has
13470 inputs section.
13471 * incremental.h: Include "elfcpp_file.h" and "output.h".
13472 (Incremental_binary): New class.
13473 (Sized_incremental_binary): New class.
13474 (open_incremental_binary): Declare.
13475 * object.cc (is_elf_object): Use
13476 elfcpp::Elf_recognizer::is_elf_file.
13477 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13478 * output.h (Output_file::filesize): New method.
13479
fd3c5f0b
ILT
134802009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13481
13482 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13483 New function.
13484 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13485 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13486 function.
13487 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13488 function.
13489 (Arm_relocate_functions::movw_abs_nc): New function.
13490 (Arm_relocate_functions::movt_abs): New function.
13491 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13492 (Arm_relocate_functions::thm_movt_abs): New function.
13493 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13494 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13495 (Scan::global): Likewise.
13496 (Relocate::relocate): Likewise.
13497 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13498
7f5309a5
ILT
134992009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13500
13501 * arm.cc (Arm_relocate_functions::got_prel) New function.
13502 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13503 (Relocate::relocate): Likewise.
13504 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13505
364c7fa5
ILT
135062009-10-06 Ian Lance Taylor <iant@google.com>
13507
13508 * options.h (class General_options): Define
13509 split_stack_adjust_size parameter.
13510 * object.h (class Object): Add uses_split_stack_ and
13511 has_no_split_stack_ fields. Add uses_split_stack and
13512 has_no_split_stack accessor functions. Declare
13513 handle_split_stack_section.
13514 (class Reloc_symbol_changes): Define.
13515 (class Sized_relobj): Define Function_offsets. Declare
13516 split_stack_adjust, split_stack_adjust_reltype, and
13517 find_functions.
13518 * object.cc (Object::handle_split_stack_section): New function.
13519 (Sized_relobj::do_layout): Call handle_split_stack_section.
13520 * dynobj.cc (Sized_dynobj::do_layout): Call
13521 handle_split_stack_section.
13522 * reloc.cc (Sized_relobj::relocate_sections): Call
13523 split_stack_adjust for executable sections in split_stack
13524 objects. Pass reloc_map to relocate_section.
13525 (Sized_relobj::split_stack_adjust): New function.
13526 (Sized_relobj::split_stack_adjust_reltype): New function.
13527 (Sized_relobj::find_functions): New function.
13528 * target-reloc.h: Include "object.h".
13529 (relocate_section): Add reloc_symbol_changes parameter. Change
13530 all callers.
13531 * target.h (class Target): Add calls_non_split method. Declare
13532 do_calls_non_split virtual method. Declare match_view and
13533 set_view_to_nop.
13534 * target.cc: Include "elfcpp.h".
13535 (Target::do_calls_non_split): New function.
13536 (Target::match_view): New function.
13537 (Target::set_view_to_nop): New function.
13538 * gold.cc (queue_middle_tasks): Give an error if mixing
13539 split-stack and non-split-stack objects with -r.
13540 * i386.cc (Target_i386::relocate_section): Add
13541 reloc_symbol_changes parameter.
13542 (Target_i386::do_calls_non_split): New function.
13543 * x86_64.cc (Target_x86_64::relocate_section): Add
13544 reloc_symbol_changes parameter.
13545 (Target_x86_64::do_calls_non_split): New function.
13546 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13547 parameter.
13548 * powerpc.cc (Target_powerpc::relocate_section): Add
13549 reloc_symbol_changes parameter.
13550 * sparc.cc (Target_sparc::relocate_section): Add
13551 reloc_symbol_changes parameter.
13552 * configure.ac: Call AM_CONDITIONAL for the default target.
13553 * configure: Rebuild.
13554 * testsuite/Makefile.am (TEST_AS): New variable.
13555 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13556 (check_DATA): Add split_i386 and split_x86_64 files.
13557 (SPLIT_DEFSYMS): Define.
13558 (split_i386_[1234n].o): New targets.
13559 (split_i386_[124]): New targets.
13560 (split_i386_[1234r].stdout): New targets.
13561 (split_x86_64_[1234n].o): New targets.
13562 (split_x86_64_[124]): New targets.
13563 (split_x86_64_[1234r].stdout): New targets.
13564 (MOSTLYCLEANFILES): Add new executables.
13565 * testsuite/split_i386.sh: New file.
13566 * testsuite/split_x86_64.sh: New file.
13567 * testsuite/split_i386_1.s: New file.
13568 * testsuite/split_i386_2.s: New file.
13569 * testsuite/split_i386_3.s: New file.
13570 * testsuite/split_i386_4.s: New file.
13571 * testsuite/split_i386_n.s: New file.
13572 * testsuite/split_x86_64_1.s: New file.
13573 * testsuite/split_x86_64_2.s: New file.
13574 * testsuite/split_x86_64_3.s: New file.
13575 * testsuite/split_x86_64_4.s: New file.
13576 * testsuite/split_x86_64_n.s: New file.
13577 * testsuite/testfile.cc (Target_test): Update relocation_section
13578 function.
13579 * testsuite/Makefile.in: Rebuild.
13580
e8a9fcda
ILT
135812009-10-06 Ian Lance Taylor <iant@google.com>
13582
13583 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13584 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13585 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13586 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13587 the address on ldo_addrs_.
13588 (Target_i386::Relocate::fix_up_ldo): New function.
13589
e99daf92
ILT
135902009-10-06 Rafael Espindola <espindola@google.com>
13591
13592 * plugin.cc (add_input_library): New.
13593 (Plugin::load): Add add_input_library to tv.
13594 (Plugin_manager::add_input_file): Add the is_lib argument.
13595 (add_input_file): Update call to Plugin_manager::add_input_file.
13596 (add_input_library): New.
13597 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13598
966d4097
DK
135992009-09-30 Doug Kwan <dougkwan@google.com>
13600
13601 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13602 symbol and call Symbol::may_need_copy_reloc to determine if
13603 a copy reloc is needed.
13604 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13605 nocopyreloc is given in command line.
13606 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13607 given in command line.
13608 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13609 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13610 of the removed Target_i386::may_need_copy_reloc.
13611 * options.h (copyreloc): New option with default value false.
13612 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13613 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13614 instead of the removed Target_powerpc::may_need_copy_reloc.
13615 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13616 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13617 instead of the removed Target_sparc::may_need_copy_reloc.
13618 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13619 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13620 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13621 instead of the removed Target_x86_64::may_need_copy_reloc.
13622
029ba973
ILT
136232009-09-30 Ian Lance Taylor <iant@google.com>
13624
13625 * object.h (class Object): Remove target_ field, and target,
13626 sized_target, and set_target methods.
13627 (Object::sized_target): Remove.
13628 (class Sized_relobj): Update declarations. Remove sized_target.
13629 * object.cc (Sized_relobj::setup): Remove target parameter.
13630 Change all callers.
13631 (Input_objects::add_object): Don't do anything with the target.
13632 (make_elf_sized_object): Add punconfigured parameter. Change all
13633 callers. Set or test parameter target.
13634 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13635 Change all callers.
13636 * parameters.cc (Parameters::set_target): Change parameter type to
13637 be non-const.
13638 (Parameters::default_target): Remove.
13639 (set_parameters_target): Change parameter type to be non-const.
13640 (parameters_force_valid_target): New function.
13641 (parameters_clear_target): New function.
13642 * parameters.h (class Parameters): Update declarations. Remove
13643 default_target method. Add sized_target and clear_target
13644 methods. Change target_ to be non-const.
13645 (set_parameters_target): Update declaration.
13646 (parameters_force_valid_target): Declare.
13647 (parameters_clear_target): Declare.
13648 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13649 as NULL if we aren't searching.
13650 (Add_symbols::run): Don't check for compatible target.
13651 * fileread.cc (Input_file::open_binary): Call
13652 parameters_force_valid_target.
13653 * gold.cc (queue_middle_tasks): Likewise.
13654 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13655 set_target on object.
13656 * dynobj.h (class Sized_dynobj): Update declarations.
13657 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13658 make_elf_object returns NULL.
13659 (Archive::include_member): Don't check whether object target is
13660 compatible.
13661 * output.cc (Output_section::add_input_section): Get target from
13662 parameters.
13663 (Output_section::relax_input_section): Likewise.
13664 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13665 parameters.
13666 (Sized_relobj::do_scan_relocs): Likewise.
13667 (Sized_relobj::relocate_sections): Likewise.
13668 * resolve.cc (Symbol_table::resolve): Likewise.
13669 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13670 parameter. Change all callers.
13671 (Symbol_table::add_from_object): Get target from parameters.
13672 (Symbol_table::add_from_relobj): Don't check object target.
13673 (Symbol_table::add_from_dynobj): Likewise.
13674 (Symbol_table::define_special_symbol): Get target from
13675 parameters.
13676 * symtab.h (class Symbol_table): Update declaration.
13677 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13678 parameter. Change all callers. Clear parameter target.
13679 (Binary_test): Test target here.
13680 * testsuite/object_unittest.cc (gold_testsuite): Remove
13681 target_test_pointer parameter. Change all callers.
13682 (Object_test): Test target here.
13683
a6a22b83
ILT
136842009-09-26 Ian Lance Taylor <iant@google.com>
13685
13686 * testsuite/initpri1.c: Don't try to use constructor priorities if
13687 compiling with gcc before 4.3.
13688
6a8f49fe
ILT
136892009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13690
13691 * testsuite/retain_symbols_file_test.sh (check_present): Change
13692 output file name to retain_symbols_file_test.stdout.
13693 (check_absent): Likewise.
13694
8c604651
CS
136952009-09-18 Craig Silverstein <csilvers@google.com>
13696
13697 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13698 * options.cc: Include <cerrno> and <fstream>.
13699 (General_options::finalize): Parse -retain-symbols-file tag.
13700 * options.h: New flag.
13701 (General_options): New method should_retain_symbol, new
13702 variable symbols_to_retain.
13703 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13704 should_retain_symbol map.
13705 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13706 * testsuite/Makefile.in: Regenerate.
13707 * testsuite/retain_symbols_file_test.sh: New file.
13708
ca58b19f
NC
137092009-09-18 Nick Clifton <nickc@redhat.com>
13710
13711 * po/es.po: Updated Spanish translation.
13712
20e6d0d6
DK
137132009-09-17 Doug Kwan <dougkwan@google.com>
13714
13715 * debug.h (DEBUG_RELAXATION): New constant.
13716 (DEBUG_ALL): Add DEBUG_RELAXATION.
13717 (debug_string_to_enum): Add relaxation debug option.
13718 * layout.cc
13719 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13720 Layout::Relaxation_debug_check::read_sections,
13721 Layout::Relaxation_debug_check::read_sections): New method definitions.
13722 (Layout::Layout): Initialize data members
13723 record_output_section_data_from_scrips_,
13724 script_output_section_data_list_ and relaxation_debug_check_.
13725 (Layout::save_segments, Layout::restore_segments,
13726 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13727 Layout::relaxation_loop_body): New method definitions.
13728 (Layout::finalize): Support relaxation. Move section layout code to
13729 Layout::relaxation_loop_body.
13730 (Layout::set_asection_address_from_script): Move code for orphan
13731 section placement out.
13732 (Layout::place_orphan_sections_in_script): New method definition.
13733 * layout.h (Output_segment_headers, Output_file_header):
13734 New forward class declarations.
13735 (Layout::~Layout): Define.
13736 (Layout::new_output_section_data_from_script): New method definition.
13737 (Layout::place_orphan_sections_in_script): New method declaration.
13738 (Layout::Segment_states): New type declaration.
13739 (Layout::save_segments, Layout::restore_segments,
13740 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13741 Layout::relaxation_loop_body): New method declarations.
13742 (Layout::Output_section_data_list): New type declaration.
13743 (Layout::Relaxation_debug_check): New class definition.
13744 (Layout::record_output_section_data_from_script_,
13745 Layout::script_output_section_data_list_, Layout::segment_states_,
13746 Layout::relaxation_debug_check_): New data members.
13747 * output.cc: (Output_section_headers::do_size): New method definition.
13748 (Output_section_headers::Output_section_headers): Move size
13749 computation to Output_section_headers::do_size.
13750 (Output_segment_headers::do_size): New method definition.
e1df38aa 13751 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13752 Output_file_header::do_size and call it.
13753 (Output_file_header::do_size): New method definition.
13754 (Output_data_group::Output_data_group): Adjust call to
13755 Output_section_data.
13756 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13757 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13758 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13759 RELAXED_INPUT_SECTION_CODE.
13760 (Output_section::Output_section): Initialize data member checkpoint_.
13761 (Output_section::~Output_section): Delete checkpoint object pointed
13762 by checkpoint_.
13763 (Output_section::add_input_section): Always add an Input_section if
13764 relaxing.
13765 (Output_section::add_merge_input_section): Add assert.
13766 (Output_section::relax_input_section): New method definition.
13767 (Output_section::set_final_data_size): Set load address to zero for
13768 an unallocated section.
13769 (Output_section::do_address_and_file_offset_have_reset_values):
13770 New method definition.
13771 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13772 Handle relaxed input section.
13773 (Output_section::sort_attached_input_sections): Checkpoint input
13774 section list lazily.
13775 (Output_section::get_input_sections): Change type of input_sections to
13776 list of Simple_input_section pointers. Checkpoint input section list
13777 lazily. Also handle relaxed input sections.
13778 (Output_section::add_input_section_for_script): Take a reference to
13779 a Simple_input_section object instead of Relobj pointer and section
13780 index as parameter. Handle relaxed input sections.
13781 (Output_section::save_states, Output_section::restore_states): New
13782 method definitions.
13783 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13784 (Output_data::is_data_size_fixed): New method definition.
13785 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13786 if it is fixed.
13787 (Output_data::address_and_file_offset_have_reset_values): New method
13788 definition.
13789 (Output_data::do_address_and_file_offset_have_reset_values): New method
13790 definition.
13791 (Output_data::set_data_size): Check that data size is not fixed.
13792 (Output_data::fix_data_size): New method definition.
13793 (Output_data::is_data_size_fixed_): New data member.
13794 (Output_section_headers::set_final_data_size): New method definition.
13795 (Output_section_headers::do_size): New method declaration.
13796 (Output_segment_headers::set_final_data_size): New method definition.
13797 (Output_segment_headers::do_size): New method declaration.
13798 (Output_file_header::set_final_data_size)::New method definition.
13799 (Output_file_header::do_size)::New method declaration.
13800 (Output_section_data::Output_section_data): Add new parameter
13801 is_data_size_fixed and use it to fix data size.
13802 (Output_data_const::Output_data_const): Adjust call to base class
13803 constructor and fix data size.
13804 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13805 base class constructor and fix data size.
13806 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13807 base class constructor and fix data size.
13808 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13809 class constructor and fix data size.
13810 (Output_data_group::set_final_data_size): New method definition.
13811 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13812 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13813 class constructor and fix data size.
13814 (Output_relaxed_input_section): New class definition.
13815 (Output_section::Simple_input_section): New class definition.
13816 (Output_section::get_input_sections): Adjust parameter list.
13817 (Output_section::add_input_section_for_script): Same.
13818 (Output_section::save_states, Output_section::restore_states,
13819 Output_section::do_address_and_file_offset_have_reset_values,
13820 (Output_section::Input_section::Input_section): Handle
13821 RELAXED_INPUT_SECTION_CODE. Add new overload for
13822 Output_relaxed_input_section.
13823 (Output_section::Input_section::is_input_section,
13824 Output_section::Input_section::set_output_section): Handle relaxed
13825 input section.
13826 (Output_section::Input_section::is_relaxed_input_section,
13827 Output_section::Input_section::output_section_data,
13828 Output_section::Input_section::relaxed_input_section): New method
13829 definitions.
13830 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13831 value.
13832 (Output_section::Input_section::u1_): Update comments.
13833 (Output_section::Input_section::u2_): Add new union member poris.
13834 (Output_section::Checkpoint_output_section): New classs definition.
13835 (Output_section::relax_input_section): New method declaration.
13836 (Output_section::checkpoint_): New data member.
13837 (Output_segment): Update comments.
13838 (Output_segment::Output_segment): Un-privatize copy constructor.
13839 (Output_segment::operator=): Un-privatize.
13840 * script-sections.cc (Output_section_element::Input_section_list):
13841 Change element type to Output_section::Simple_input_section.
13842 (Output_section_element_dot_assignment::set_section_addresses):
13843 Register output section data for relaxation clean up.
13844 (Output_data_exression::Output_data_expression): Adjust call to base
13845 constructor to fix data size.
13846 (Output_section_element_data::set_section_addresses): Register
13847 Output_data_expression object for relaxation clean up.
13848 (struct Input_section_info): Replace Relobj pointer and section index
13849 pair with Output_section::Simple_input_section and Convert struct to a
13850 class.
13851 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13852 Input_section_info data member to use accessors.
20e6d0d6
DK
13853 (Output_section_element_input::set_section_addresses): Use layout
13854 parameter. Adjust code to use Output_section::Simple_input_section
13855 and Input_secction_info classes. Register filler for relaxation
13856 clean up.
13857 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13858 and section index pair with Output_section::Simple_input_section
13859 class. Adjust code accordingly.
13860 (Phdrs_element::release_segment): New method definition.
13861 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13862 segment list.
13863 (Script_sections::release_segments): New method definition.
13864 * gold/script-sections.h (Script_sections::release_segments): New
13865 method declaration.
13866 * gold/target.h (Target::may_relax, Target::relax,
13867 Target::do_may_relax, Target::do_relax): New method definitions.
13868
5e445df6
ILT
138692009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13870
13871 * arm.cc (has_signed_unsigned_overflow): New function.
13872 (Arm_relocate_functions::abs8): New function.
13873 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13874 (Target_arm::Scan::global): Likewise.
13875 (Target_arm::relocate::relocate): Likewise.
13876 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13877 Likewise.
13878
8c604651 138792009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13880
13881 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13882 * testsuite/Makefile.in: Regenerate.
13883
1e9cc1c2
NC
138842009-09-11 Nick Clifton <nickc@redhat.com>
13885
13886 * po/gold.pot: Updated by the Translation project.
13887
6a89f575
CC
138882009-09-08 Cary Coutant <ccoutant@google.com>
13889
13890 * output.cc (Output_file::open): Add execute permission to empty file.
13891 * testsuite/Makefile.am (permission_test): New test.
13892 * testsuite/Makefile.in: Regenerate.
13893
fdcac5af
ILT
138942009-09-02 Ian Lance Taylor <iant@google.com>
13895
13896 * output.cc (Output_file::resize): Call map_no_anonymous rather
13897 than map.
13898
44453f85
ILT
138992009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13900
13901 * gold.cc: Include "incremental.h".
13902 (queue_initial_tasks): Call Incremental_checker methods.
13903 * incremental.cc: Include "output.h".
13904 (Incremental_checker::can_incrementally_link_output_file): New
13905 method.
13906 * incremental.h (Incremental_checker): New class.
13907
13908 * output.cc (Output_file::open_for_modification): New method.
13909 (Output_file::map_anonymous): Changed return type to bool. Record
13910 map in base_ field.
13911 (Output_file::map_no_anonymous): New method, broken out of map.
13912 (Output_file::map): Use map_no_anonymous and map_anonymous.
13913 * output.h (class Output_file): Update declarations.
13914
293c1386
CC
139152009-08-24 Cary Coutant <ccoutant@google.com>
13916
13917 * options.h (Command_line::Pre_options): New class.
13918 (Command_line::pre_options): New member.
13919 * options.cc (gold::options::ready_to_register): New variable.
13920 (One_option::register_option): Do nothing if not registering options.
13921 Assert if same short option registered twice.
13922 (General_options::General_options): Turn off option registration when
13923 done constructing.
13924 (Command_line::Pre_options::Pre_options): New constructor.
13925
f773f3d2
CC
139262009-08-24 Cary Coutant <ccoutant@google.com>
13927
06a73cfe
CC
13928 * options.h (General_options::no_keep_memory): Remove incorrect
13929 short option.
f773f3d2 13930
a15af8e2
RW
139312009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13932
13933 * Makefile.am (am__skiplex, am__skipyacc): New.
13934 * Makefile.in: Regenerate.
13935
c462b41b
RW
139362009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13937
14ec8efd
RW
13938 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13939 (INCLUDES): ... this.
13940 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13941 (AM_CPPFLAGS): Renamed from ...
13942 (INCLUDE): ... this.
13943 * Makefile.in, testsuite/Makefile.in: Regenerate.
13944
81ecdfbb
RW
13945 * Makefile.in: Regenerate.
13946 * aclocal.m4: Likewise.
13947 * config.in: Likewise.
13948 * configure: Likewise.
13949 * testsuite/Makefile.in: Likewise.
13950
c462b41b
RW
13951 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13952 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13953 * Makefile.in: Regenerate.
13954 * testsuite/Makefile.in: Regenerate.
13955
2da73f13
CC
139562009-08-19 Cary Coutant <ccoutant@google.com>
13957
13958 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13959 symbols in shared libraries overridden by hidden or internal symbols
13960 in the main program.
13961
2db70501
CD
139622009-08-19 Chris Demetriou <cgd@google.com>
13963
13964 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13965 checking source file names in error messages.
13966
f733487b
DK
139672009-08-18 Doug Kwan <dougkwan@google.com>
13968
13969 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13970 an elcpp::Ehdr as parameter. Adjust call to set_target.
13971 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13972 an elfcpp::Ehdr as parameter.
13973 * object.cc (Object::set_target): Remove the version that looks up
13974 a target and sets it.
13975 (Sized_relobj::setup): Take a Target object instead of
13976 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13977 (make_elf_sized_object): Find target and ask target to
13978 make an ELF object.
13979 * object.h: (Object::set_target): Remove the version that looks up
13980 a target and sets it.
13981 (Sized_relobj::setup): Take a Target object instead of
13982 an elfcpp:Ehdr as parameter.
13983 * target.cc: Include dynobj.h.
13984 (Target::do_make_elf_object_implementation): New.
2e702c99 13985 (Target::do_make_elf_object): New.
f733487b
DK
13986 * target.h (Target::make_elf_object): New template declaration.
13987 (Target::do_make_elf_object): New method declarations.
13988 (Target::do_make_elf_object_implementation): New template declaration.
13989
cc70f101
ILT
139902009-08-14 Ian Lance Taylor <iant@google.com>
13991
13992 * gold.h (FUNCTION_NAME): Define.
13993 (gold_unreachable): Use FUNCTION_NAME.
13994
ef5e0cb1
ST
139952009-08-12 Sriraman Tallam <tmsriram@google.com>
13996
13997 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13998 symbol in the --keep-unique list is not found.
13999
48c187ce
ST
140002009-08-12 Sriraman Tallam <tmsriram@google.com>
14001
14002 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14003 been maked as --keep-unique.
14004 (Icf::unfold_section): New function.
14005 * icf.h (Icf::unfold_section): New function.
14006 * options.h (General_options::keep_unique): New option.
14007 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14008 * testsuite/Makefile.in: Regenerate.
14009 * testsuite/icf_keep_unique_test.sh: New file.
14010 * testsuite/icf_keep_unique_test.cc: New file.
14011
645afe0c
CC
140122009-08-12 Cary Coutant <ccoutant@google.com>
14013
14014 PR 10471
14015 * resolve.cc (Symbol_table::resolve): Check for references from
14016 dynamic objects to hidden and internal symbols.
14017 * testsuite/Makefile.am (hidden_test.sh): New test.
14018 * testsuite/Makefile.in: Regenerate.
14019 * testsuite/hidden_test.sh: New script.
14020 * testsuite/hidden_test_1.c: New test source.
14021 * testsuite/hidden_test_main.c: New test source.
14022
11af873f
DK
140232009-08-11 Doug Kwan <dougkwan@google.com>
14024
14025 * arm.cc: Update comments.
14026 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14027 segment to locate the .ARM.exidx section if present.
14028
b9f7d72d
DK
140292009-08-09 Doug Kwan <dougkwan@google.com>
14030
14031 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14032 patch.
14033
ddd3c53c
ST
140342009-08-07 Sriraman Tallam <tmsriram@google.com>
14035 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14036 compiler warnings.
14037
27721062
ST
140382009-08-06 Sriraman Tallam <tmsriram@google.com>
14039
14040 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14041 valid tls_segment only for non-debug-section relocations.
14042 * testsuite/Makefile.am: Add gc_tls_test.
14043 * testsuite/Makefile.in: Regenerate.
14044 * testsuite/gc_tls_test.cc: New file.
14045 * testsuite/gc_tls_test.sh: New file.
14046
ef15dade 140472009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14048
ef15dade
ST
14049 * icf.cc: New file.
14050 * icf.h: New file.
14051 * Makefile.am (CCFILES): Add icf.cc.
14052 (HFILES): Add icf.h
14053 * Makefile.in: Regenerate.
14054 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14055 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14056 section, symbol and addend information for the relocs.
14057 * gold.cc (queue_middle_tasks): Call identical code folding.
14058 * gold.h: Add defines for multimap.
14059 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14060 to the call of finalize_local_symbols.
14061 * main.cc (main): Create object of class Icf.
14062 * object.cc (Sized_relobj::do_layout): Allow this function to be
14063 called twice during icf.
14064 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14065 to sections marked as identical by icf.
14066 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14067 when available.
14068 (Sized_relobj::do_section_entsize): New function.
14069 * object.h (Object::section_entsize): New function.
14070 (Object::do_section_entsize): New pure virtual function.
14071 (Relobj::finalize_local_symbols): Add new parameter.
14072 (Relobj::do_section_entsize): New function.
14073 * options.h (General_options::icf): New option.
14074 (General_options::icf_iterations): New option.
14075 (General_options::print_icf_sections): New option.
14076 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14077 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14078 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14079 icf.
14080 * symtab.cc (Symbol_table::is_section_folded): New function.
14081 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14082 to sections marked as identical by icf.
14083 * symtab.h (Symbol_table::set_icf): New function.
14084 (Symbol_table::icf): New function.
14085 (Symbol_table::is_section_folded): New function.
14086 (Symbol_table::icf_): New data member.
14087 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14088 * testsuite/Makefile.am: Add commands to build icf_test.
14089 * testsuite/Makefile.in: Regenerate.
14090 * testsuite/icf_test.sh: New file.
14091 * testsuite/icf_test.cc: New file.
14092
c3b65ac4
CD
140932009-07-24 Chris Demetriou <cgd@google.com>
14094
14095 * layout.cc (is_compressible_debug_section): Fix incorrect
14096 comment about compressed section names.
14097
1caf2c51
ILT
140982009-07-20 Ian Lance Taylor <ian@airs.com>
14099
14100 PR 10419
14101 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14102
1ef4d87f
ILT
141032009-07-16 Ian Lance Taylor <iant@google.com>
14104
14105 PR 10400
14106 * layout.h: #include <map>.
14107 (class Kept_section): Change from struct to class. Add accessors
14108 and setters. Add section size to Comdat_group mapping. Change
14109 Comdat_group to std::map. Add is_comdat_ field. Add
14110 linkonce_size field in union.
14111 (class Layout): Update declaration of find_or_add_kept_section.
14112 Don't declare find_kept_object.
14113 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14114 parameter. Add object, shndx, is_comdat, and is_group_name
14115 parameters. Change all callers. Adjust for new Kept_section.
14116 (Layout::find_kept_object): Remove.
14117 * object.cc (Sized_relobj::include_section_group): Update use of
14118 Kept_section. Rename secnum to shndx. Only record
14119 Kept_comdat_section if sections are the same size.
14120 (Sized_relobj::include_linkonce_section): Update use of
14121 Kept_section. Only record Kept_comdat_section if sections are the
14122 same size. Set size of linkonce section.
14123 (Sized_relobj::map_to_kept_section): Update call to
14124 get_kept_comdat_section.
14125 * object.h (class Sized_relobj): Rename fields in
14126 Kept_comdat_section to drop trailing underscores; change object
14127 field to Relobj*. Change Kept_comdat_section_table to store
14128 struct rather than pointer.
14129 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14130 Add kept_object and kept_shndx parameters. Change all callers.
14131 (Sized_relobj::get_kept_comdat_section): Change return type to
14132 bool. Add kept_object and kept_shndx parameters. Change all
14133 callers.
14134 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14135 Layout::find_or_add_kept_section.
14136
37c3b7b0
ILT
141372009-07-09 Ian Lance Taylor <iant@google.com>
14138
14139 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14140 Reserve space in the hash table.
14141
98fa85cb
ILT
141422009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14143
14144 * fileread.cc (File_read::get_mtime): New method.
14145 * fileread.h (Timespec): New structure.
14146 (File_read::get_mtime): New method.
14147 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14148 Renamed from timestamp_nsec.
14149 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14150 Elf_Xword.
e1df38aa 14151 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14152 timestamp_nsec.
e1df38aa 14153 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14154 (Incremental_inputs::report_obejct): Save mtime; style fix.
14155 (Incremental_inputs::report_script): Save mtime; style fix.
14156 (Incremental_inputs::finalize_inputs): Style fix.
14157 (Incremental_inputs::finalize): Style fix.
14158 (Incremental_inputs::create_input_section_data): Store inputs
14159 mtime.
14160 * incremental.h (Incremental_inputs::report_script): Add mtime
14161 argument.
14162 (Incremental_inputs::Input_info::Input_info): Intialize only one
14163 union member.
14164 (Incremental_inputs::Input_info::archive): Move to nameless
14165 union.
14166 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14167 (Incremental_inputs::Input_info::script): Move to nameless union.
14168 (Incremental_inputs::mtime): New field.
14169 * script.cc (read_input_script): Pass file mtime to
14170 Incremental_input.
14171 * script.h (Script_info::inputs): Style fix.
14172
c9d70757
ILT
141732009-07-01 Ian Lance Taylor <ian@airs.com>
14174
14175 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14176 instead of 32.
14177
9c547ec3
ILT
141782009-06-24 Ian Lance Taylor <iant@google.com>
14179
14180 PR 10156
14181 * layout.cc (Layout::choose_output_section): If we find an
14182 existing section, update the flags.
14183 (Layout::create_notes): New function, broken out of
14184 Layout::finalize.
14185 (Layout::finalize): Don't create note sections.
14186 (Layout::create_note): Don't crash if linker script discards
14187 section.
14188 (Layout::create_gold_note): Likewise.
14189 (Layout::create_build_id): Likewise. Don't set
14190 after_input_sections on the section.
14191 (Layout::create_executable_stack_info): Remove target parameter.
14192 Change caller.
14193 * layout.h (class Layout): Declare create_notes. Update
14194 declaration of create_executable_stack_info.
14195 * gold.cc (queue_middle_tasks): Call create_notes.
14196 * output.cc (Output_section::update_flags_for_input_section): Move
14197 here from output.h. If SHF_ALLOC flag is newly set, mark address
14198 invalid.
14199 * output.h (Output_data::mark_address_invalid): New function.
14200 (class Output_section): Only declare, not define,
14201 update_flags_for_input_section. Remove set_flags.
14202
55458500
ILT
142032009-06-24 Ian Lance Taylor <iant@google.com>
14204
14205 * script-sections.cc (Output_section_definition::
14206 set_section_addresses): Rename shadowing local load_address to
14207 laddr.
14208
1307d6cd
ILT
142092009-06-24 Ian Lance Taylor <iant@google.com>
14210
14211 PR 10244
14212 * reloc.cc (relocate_sections): Skip empty relocation sections.
14213
ec3f783e
ILT
142142009-06-23 Ian Lance Taylor <iant@google.com>
14215
14216 PR 10156
14217 * layout.cc (Layout::create_note): Use choose_output_section
14218 rather than make_output_section.
14219
459c9f1c
ILT
142202009-06-23 Ian Lance Taylor <iant@google.com>
14221
14222 PR 10237
14223 * options.cc (General_options::parse_V): Set printed_version_.
14224 (General_options::General_options): Initialize printed_version_.
14225 * options.h (class General_options): Add printed_version_ field.
14226 * gold.cc (queue_initial_tasks): If there are no input files,
14227 don't give a fatal error if we printed the version information.
14228 (queue_middle_tasks): If using -r with a shared object, give a
14229 fatal error rather than an ordinary error.
14230
1518dc8f
ILT
142312009-06-23 Ian Lance Taylor <iant@google.com>
14232
14233 PR 10219
14234 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14235 (Layout::make_output_section): Set have_stabstr_section_ if we see
14236 a .stab*str section.
14237 (Layout::finalize): Call link_stabs_sections.
14238 (Layout::link_stabs_sections): New file.
14239 * layout.h (class Layout): Add have_stabstr_section_ field.
14240 Declare link_stabs_sections.
14241
3d857b98
DK
142422009-06-23 Doug Kwan <dougkwan@google.com>
14243
14244 * Makefile.am (libgold_a_LIBADD): New.
14245 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14246 * Makefile.in: Regenerate.
3d857b98
DK
14247 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14248 * configure: Regenerate.
14249 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14250 * fileread.cc: Include sys/state.h
14251 * gold.h: Declare memmem and strndup if found missing.
14252 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14253
0639a6f6
ILT
142542009-06-23 Ian Lance Taylor <iant@google.com>
14255
14256 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14257 * configure: Rebuild.
14258
8d63875c
ILT
142592009-06-23 Ian Lance Taylor <iant@google.com>
14260
14261 PR 10147
14262 * object.cc (Object::section_contents): Don't try to get a view if
14263 the section has length zero.
14264 (Object::handle_gnu_warning_section): If the section is empty, use
14265 the name of the section as the warning.
14266
f7c8a183
ILT
142672009-06-23 Ian Lance Taylor <iant@google.com>
14268
14269 PR 10133
14270 * stringpool.h (class Stringpool_template): Add optimize_ field.
14271 (Stringpool_template::set_optimize): New function.
14272 * stringpool.cc (Stringpool_template::Stringpool_template):
14273 Initialize optimize_ field.
14274 (Stringpool_template::set_string_offsets): Test local optimize
14275 fild rather than parameter.
14276 * layout.cc (Layout::Layout): Call set_optimize on the section
14277 name stringpool.
14278
e6a307ba
ILT
142792009-06-22 Ian Lance Taylor <iant@google.com>
14280
14281 PR 10030
14282 * yyscript.y: Parse TARGET.
14283 * script.cc (script_set_target): New function.
14284 * script-c.h (script_set_target): Declare.
14285 * options.cc (General_options::string_to_object_format): Rename
14286 from string_to_object_format in anonymous namespace. Change
14287 callers.
14288 * options.h (class General_options): Declare
14289 string_to_object_format.
14290
3ee173de
ILT
142912009-06-22 Ian Lance Taylor <iant@google.com>
14292
14293 * script-sections.cc (Script_sections::create_segments): Don't put
14294 program headers in a PT_LOAD segment if -n or -N.
14295
142962009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14297
14298 PR 10141
14299 * options.h (class General_options): Add -z lazy and -z now. Sort
14300 -z options into alphabetical order.
14301 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14302
cd6739a1 143032009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14304
14305 * layout.cc (Layout::make_output_section): Call
14306 Target::new_output_section.
14307 (Layout::attach_allocated_section_to_segment): Put large section
14308 sections in a separate load segment with the large segment flag
14309 set.
14310 (Layout::segment_precedes): Sort large data segments after other
14311 load segments.
14312 (align_file_offset): New static function.
14313 (Layout::set_segment_offsets): Use align_file_offset.
14314 * output.h (class Output_section): Add is_small_section_ and
14315 is_large_section_ fields.
14316 (Output_section::is_small_section): New function.
14317 (Output_section::set_is_small_section): New function.
14318 (Output_section::is_large_section): New function.
14319 (Output_section::set_is_large_section): New function.
14320 (Output_section::is_large_data_section): New function.
14321 (class Output_segment): Add is_large_data_segment_ field.
14322 (Output_segment::is_large_data_segment): New function.
14323 (Output_segment::set_is_large_data_segment): New function.
14324 * output.cc (Output_section::Output_section): Initialize new
14325 fields.
14326 (Output_segment::Output_segment): Likewise.
14327 (Output_segment::add_output_section): Add assertion that large
14328 data sections always go in large data segments. Force small data
14329 sections to the end of the list of data sections. Force small BSS
14330 sections to the start of the list of BSS sections. For large BSS
14331 sections to the end of the list of BSS sections.
14332 * symtab.h (class Symbol): Declare is_common_shndx.
14333 (Symbol::is_defined): Check Symbol::is_common_shndx.
14334 (Symbol::is_common): Likewise.
14335 (class Symbol_table): Define enum Commons_section_type. Update
14336 declarations. Add small_commons_ and large_commons_ fields.
14337 * symtab.cc (Symbol::is_common_shndx): New function.
14338 (Symbol_table::Symbol_table): Initialize new fields.
14339 (Symbol_table::add_from_object): Put small and large common
14340 symbols in the right list.
14341 (Symbol_table::sized_finalized_symbol): Check
14342 Symbol::is_common_shndx.
14343 (Symbol_table::sized_write_globals): Likewise.
14344 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14345 common symbol lists. Don't call do_allocate_commons_list if the
14346 list is empty.
14347 (Symbol_table::do_allocate_commons_list): Remove is_tls
14348 parameter. Add comons_section_type parameter. Change all
14349 callers. Handle small and large common symbols.
14350 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14351 Symbol::is_common_shndx.
14352 * resolve.cc (symbol_to_bits): Likewise.
14353 * target.h (Target::small_common_shndx): New function.
14354 (Target::small_common_section_flags): New function.
14355 (Target::large_common_shndx): New function.
14356 (Target::large_common_section_flags): New function.
14357 (Target::new_output_section): New function.
14358 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14359 small_common_section_flags, and large_common_section_flags
14360 fields.
14361 (Target::do_new_output_section): New virtual function.
14362 * arm.cc (Target_arm::arm_info): Initialize new fields.
14363 * i386.cc (Target_i386::i386_info): Likewise.
14364 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14365 Likewise.
14366 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14367 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14368 (Target_x86_64::do_new_output_section): New function.
14369 * configure.ac: Define conditional MCMODEL_MEDIUM.
14370 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14371 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14372 (large_LDFLAGS): Define.
14373 * testsuite/large.c: New file.
14374 * testsuite/testfile.cc (Target_test::test_target_info):
14375 Initialize new fields.
14376 * configure, testsuite/Makefile.in: Rebuild.
14377
bb04269c
DK
143782009-06-05 Doug Kwan <dougkwan@google.com>
14379
14380 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14381 * Makefile.in: Regenerate.
bb04269c
DK
14382 * i386.cc (class Target_i386): Define new virtual method to
14383 override do_is_local_label_name in parent.
14384 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14385 local symbols if --discard-locals or -X is given.
14386 * options.h (class General_options): Declare new options
14387 '--discard-locals' and '-X' for discarding locals.
14388 * target.h (class Target): Define new methods is_local_label_name.
14389 Declare new virtual method do_is_local_label_name.
14390 * target.cc: New file.
14391 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14392 (check_SCRIPTS): Add discard_locals_test.sh.
14393 (check_DATA): Add discard_local_tests.syms.
14394 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14395 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14396 * testsuite/Makefile.in: Regenerate.
14397 * testsuite/discard_locals_test.c: New file.
14398 * testsuite/discard_locals_test.sh: Same.
14399
805bb01c
DK
144002009-06-05 Doug Kwan <dougkwan@google.com>
14401
14402 * object.cc (Sized_relobj::Sized_relobj): Initialize
14403 discarded_eh_frame_shndx_ to -1U.
14404 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14405 section.
14406 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14407 a discarded .eh_frame section.
14408 (Sized_relobj::do_finalize_local_symbols): Ditto.
14409 * object.h (class Sized_relobj): Declare new member
14410 discarded_eh_frame_shndx_.
14411 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14412 (local_labels_test.o, local_labels_test): New rules.
14413 * testsuite/Makefile.in: Regenerate.
14414
1dcd334d
DK
144152009-06-04 Doug Kwan <dougkwan@google.com>
14416
14417 * layout.cc (Layout::section_name_mapping): Add mapping for
14418 special ARM sections.
14419
96d49306
DK
144202009-06-03 Doug Kwan <dougkwan@google.com>
14421
14422 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14423 (utils::has_overflow): Same.
14424
dff16297
ILT
144252009-06-03 Ian Lance Taylor <iant@google.com>
14426
14427 * layout.cc (Layout::section_name_mapping): New array, replacing
14428 Layout::linkonce_mapping.
14429 (Layout::section_name_mapping_count): New variable, replacing
14430 Layout::linkonce_mapping_count.
14431 (Layout::linkonce_output_name): Remove.
14432 (Layout::output_section_name): Rewrite.
14433 * layout.h (class Layout): Rename Linkonce_mapping to
14434 Section_name_mapping, linkonce_mapping to section_name_mapping,
14435 linkonce_mapping_count to section_name_mapping_count. Don't
14436 declare linkonce_output_name.
14437
c121c671
DK
144382009-06-03 Doug Kwan <dougkwan@google.com>
14439
14440 * gold/arm.cc (namespace utils): New.
14441 (Target_arm::reloc_is_non_pic): Define new method.
14442 (class Arm_relocate_functions): New.
14443 (Target_arm::Relocate::relocate): Handle relocation types used by
14444 Android.
14445
07800fab
ILT
144462009-06-03 Ian Lance Taylor <iant@google.com>
14447
14448 * arm.cc (Target_arm::scan::global): Use || instead of |.
14449
c121c671
DK
144502009-06-02 Doug Kwan <dougkwan@google.com>
14451
14452 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14453 issued_non_pic_error_.
14454 (class Target_arm::Scan): Declare new method check_non_pic.
14455 Define new method symbol_needs_plt_entry.
14456 Declare new data member issued_non_pic_error_.
14457 (class Target_arm::Relocate): Declare new method
14458 should_apply_static_reloc.
14459 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14460 (Target_arm::Scan::check_non_pic): Define new method.
14461 (Target_arm::Scan::local): Handle a small subset of reloc types used
14462 by Android.
14463 (Target_arm::Scan::local): Same.
14464 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14465
b19b0c6d
ILT
144662009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14467
14468 * incremental.cc (Incremental_inputs::report_command_line): Filter
14469 out --incremental-* options.
14470
94cdfcff
DK
144712009-05-29 Doug Kwan <dougkwan@google.com>
14472
14473 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14474 template class.
14475 (class Target_arm): Update comment.
14476 (Target_arm::Target_arm): Initialize new data members GOT_,
14477 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14478 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14479 and Target_arm::rel_dyn_section.
14480 Declare new_enum Target_arm::Got_type.
14481 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14482 and DYNBSS_.
14483 Update commments for member do_dynsym_value.
14484 (Target_arm::got_size, Target_arm::plt_section,
14485 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14486 new methods inside class defintion.
14487 (Target_arm::got_section): Define new method.
14488 (Target_arm::rel_dyn_section): Same.
14489 (Output_data_plt_arm): New template class.
14490 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14491 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14492 (Output_data_plt_arm::add_entry): Same.
14493 (Output_data_plt_arm::first_plt_entry): Define new
14494 static data member for PLT instruction template.
14495 (Output_data_plt_arm::plt_entry): Same.
14496 (Output_data_plt_arm::do_write): Define new method.
14497 (Target_arm::make_plt_entry): Same.
14498 (Target_arm::do_finalize_sections): Same.
14499 (Target_arm::do_dynsym_value): Same.
14500
4a657b0d
DK
145012009-05-28 Doug Kwan <dougkwan@google.com>
14502
14503 * Makefile.am (TARGETSOURCES): Add arm.cc.
14504 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14505 * Makefile.in: Regenerate.
14506 * arm.cc: New file.
14507 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14508
e7ae8c36
DK
145092009-05-26 Doug Kwan <dougkwan@google.com>
14510
14511 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14512 (General_options::check_excluded_libs): Strip off directories in
14513 archive name before matching like GNU ld does.
14514 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14515 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14516 (exclude_libs_test_LDFLAGS): Add linker option
14517 -Wl,--exclude-libs,libexclude_libs_test_3
14518 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14519 an explicit archive without using -l.
14520 (alt/libexclude_libs_test_3.a): New make rule.
14521 * testsuite/Makefile.in: Regenerate.
14522 * testsuite/exclude_libs_test.c : Declare lib3_default().
14523 (main): Call it.
14524 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14525 * exclude_libs_test_3.c: New file.
14526
f12e7348
NC
145272009-05-26 Nick Clifton <nickc@redhat.com>
14528
14529 * po/id.po: New Indonesian translation.
14530 * po/gold.pot: Updated template file.
14531
4daadc0d
ST
145322009-05-22 Sriraman Tallam <tmsriram@google.com>
14533
e1df38aa 14534 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14535 gc_comdat_test files. Add -Wl,--gc-sections to build
14536 gc_comdat_test.
14537 * testsuite/Makefile.in: Regenerate.
14538 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14539
531813ad
ST
145402009-05-21 Sriraman Tallam <tmsriram@google.com>
14541
14542 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14543 kept comdat section was garbage collected.
14544 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14545 * testsuite/Makefile.in: Regenerate.
14546 * testsuite/gc_comdat_test.sh: New file.
14547 * testsuite/gc_comdat_test_1.cc: New file.
14548 * testsuite/gc_comdat_test_2.cc: New file.
14549
65514900
CC
145502009-05-19 Doug Kwan <dougkwan@google.com>
14551
14552 * archive.cc (Archive::Archive): Move constructor from archive.h
14553 to here. Initialize no_export_.
14554 (Archive::get_elf_object_for_member): Set no_export flag of object.
14555 * archive.h (Archive::Archive): Move constructor body to
14556 archive.cc.
14557 (Archive::no_export): New method.
14558 (Archive::no_export_): New field.
14559 * object.h (Object::Object): Initialize no_export_ to false.
14560 (Object::no_export, Object::set_no_export): New methods.
14561 (Object::no_export_): New field.
14562 * options.cc (General_options::parse_exclude_libs): New method.
14563 (General_options::check_excluded_libs) Same.
14564 * options.h (exclude_libs): New option.
14565 (General_options::check_excluded_libs): New method declaration.
14566 (General_options::excluded_libs_): New field.
14567 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14568 default or protected visibility if an object has no-export flag set.
14569 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14570 (check_SCRIPTS): Add exclude_libs_test.sh.
14571 (check_DATA): Add exclude_libs_test.syms.
14572 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14573 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14574 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14575 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14576 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14577 libexclude_libs_test_2.a): New rules.
14578 * testsuite/Makefile.in: Regenerate.
14579 * testsuite/exclude_libs_test.c: New file.
14580 * testsuite/exclude_libs_test.sh: Ditto.
14581 * testsuite/exclude_libs_test_1.c: Ditto.
14582 * testsuite/exclude_libs_test_2.c: Ditto.
14583
1b77ea50
ILT
145842009-05-15 Ian Lance Taylor <iant@google.com>
14585
14586 * configure.ac: Check for declarations for cases where libiberty.h
14587 checks HAVE_DECL_xxx.
14588 * configure, config.in: Rebuild.
14589
072fe7ce
ILT
145902009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14591
14592 * gold.h (Incremental_argument_list): Remove (invalid) forward
14593 declaration.
14594 * incremental.cc (Incremental_inputs::report_achive): New method.
14595 (Incremental_inputs::report_object): New method.
14596 (Incremental_inputs::report_script): New method.
14597 (Incremental_inputs::finalize_inputs): New method.
14598 (Incremental_inputs::finalize): Call finalize_inputs().
14599 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14600 Create inputs entries.
14601 * incremental.h (Incremental_input_type): New enum.
14602 (Incremental_inputs::Incremental_input): Initialize new fields.
14603 (Incremental_inputs::report_inputs): New method.
14604 (Incremental_inputs::report_achive): New method.
14605 (Incremental_inputs::report_object): New method.
14606 (Incremental_inputs::report_script): New method.
14607 (Incremental_inputs::finalize_inputs): New method.
14608 (Incremental_inputs::Input_info): New struct.
14609 (Incremental_inputs::Input_info_map): New typedef.
14610 (Incremental_inputs::lock_): New field.
14611 (Incremental_inputs::Inputs_): New field.
14612 (Incremental_inputs::Inputs_map): New field.
14613 * main.cc (main): Call Incremental_input::report_inputs.
14614 * options.h (Input_argument_list): Typedef moved from
14615 Input_arguments.
14616 (Input_file_group::Files): Remove, use ::Input_argument_list.
14617 (Input_file_group::Input_argument_list): Remove, use
14618 ::Input_argument_list.
14619 * plugin.cc (Plugin_manager::add_input_file): Add error in
14620 incremental build.
14621 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14622 functions.
14623 * script.cc (read_input_script): Call
14624 Incremental_input::report_script.
14625 * script.h (Script_info): New class.
14626
b0481b0b
ILT
146272009-04-27 Ian Lance Taylor <iant@google.com>
14628
14629 * x86_64.cc (do_adjust_output_section): Set entsize to
14630 plt_entry_size.
14631
b22a5a41 146322009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14633
14634 * output.cc (Output_file::close): After short writes, continue
14635 writing from the correct offset in the buffer being written.
14636
40fde488
CD
146372009-04-23 Chris Demetriou <cgd@google.com>
14638
14639 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14640 * configure: Regenerate.
14641 * config.in: Regenerate.
14642 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14643 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14644
3ce2c28e
ILT
146452009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14646
14647 * incremental.cc (Incremental_inputs_header_data): Renamed from
14648 Incremental_input_header_data.
14649 (Incremental_inputs_header_data::data_size): New field.
14650 (Incremental_inputs_header_data::put_input_file_count): Renamed
14651 from input_file_count.
14652 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14653 from command_line_offset.
14654 (Incremental_inputs_header_data::put_reserved): Renamed from
14655 put_reserved.
14656 (Incremental_inputs_entry_data): Renamed from
14657 Incremental_input_entry_data.
14658 (Incremental_inputs_entry_data::data_size): New field.
14659 (Incremental_inputs::report_command_line): New method.
14660 (Incremental_inputs::finalize): New method.
14661 (Incremental_inputs::create_incremental_inputs_data): New method.
14662 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14663 * incremental.h: New file.
14664 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14665 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14666 incremental builds.
703d02da 14667 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14668 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14669 (Layout::create_incremental_info_sections): New method.
14670 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14671 * main.cc (main): Notify Incremental_input of the command line.
14672
e55bde5e
ILT
146732009-04-01 Ian Lance Taylor <iant@google.com>
14674 Mikolaj Zalewski <mikolajz@google.com>
14675
14676 * gold.h (reserve_unordered_map): Define, three versions, one for
14677 each version of Unordered_map.
14678 * layout.cc (Layout::Layout): Remove options parameter. Add
14679 number_of_input_files parameter. Don't initialize options_.
14680 Initialize number_of_input_files_ and resized_signatures_. Move
14681 sections_are_attached_.
14682 (Layout::layout_group): Reserve space for group_signatures_.
14683 (Layout::find_or_add_kept_section): Change name parameter to be a
14684 reference. Resize signatures_ map when it gets large enough.
14685 (Layout::layout_eh_frame): Use parameters->options() instead of
14686 this->options_.
14687 (Layout::make_output_section): Likewise.
14688 (Layout::attach_allocated_section_to_segment): Likewise.
14689 (Layout::finalize, Layout::create_executable_stack): Likewise.
14690 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14691 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14692 * layout.h (class Layout): Update declarations. Remove options_
14693 field. Add number_of_input_files_ and resized_signatures_
14694 fields. Move sections_are_attached_ field.
14695 * main.cc (main): Pass number of input files to Layout
14696 constructor. Don't pass options.
14697
154b857c
ILT
146982009-03-30 Ian Lance Taylor <iant@google.com>
14699
14700 * ffsll.c (ffsll): Correct implementation.
14701
2f35ab9b
ILT
147022009-03-27 Ian Lance Taylor <iant@google.com>
14703
fd03461a
ILT
14704 * ffsll.c: New file.
14705 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14706 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14707 * ftruncate.c (ftruncate): Declare before definition.
14708 * mremap.c (mremap): Likewise.
14709 * pread.c (pread): Likewise.
14710 * configure, Makefile.in, config.in: Rebuild.
14711
2f35ab9b
ILT
14712 * mremap.c: New file.
14713 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14714 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14715 (mremap): Declare if HAVE_MREMAP is not defined.
14716 * configure, Makefile.in, config.in: Rebuild.
14717
33aea2fd
CC
147182009-03-27 Cary Coutant <ccoutant@google.com>
14719
14720 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14721 position independent.
14722 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14723 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14724
6d479619
CC
147252009-03-24 Cary Coutant <ccoutant@google.com>
14726
14727 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14728 an executable.
14729 (needs_dynamic_reloc): Likewise.
14730
afc06bb8
ILT
147312009-03-24 Ian Lance Taylor <iant@google.com>
14732
14733 * yyscript.y (file_cmd): Recognize EXTERN.
14734 (extern_name_list, extern_name_list_body): New nonterminals.
14735 * script.cc (script_add_extern): Define.
14736 * script-c.h (script_add_extern): Declare.
14737
f6060a4d
ILT
147382009-03-24 Rafael Avila de Espindola <espindola@google.com>
14739
14740 * object.cc (is_elf_object): Define.
14741 * object.h (is_elf_object): Declare.
14742 * archive.cc (Archive::get_elf_object_for_member): Call
14743 is_elf_object.
33aea2fd 14744 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14745
26736d8e
ILT
147462009-03-24 Elliott Hughes <enh@google.com>
14747
14748 * output.cc (Output_file::map_anonymous): Define.
14749 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14750 try an anonymous one. Report the size if the mmap fails.
14751 * output.h (class Output_file): Declare map_anonymous.
14752
22fd9730
ILT
147532009-03-24 Ian Lance Taylor <iant@google.com>
14754
14755 * target-select.cc (instantiate_target): Don't acquire the lock if
14756 the instantiated_target_ field has already been set.
14757
cb010894
ILT
147582009-03-23 Ian Lance Taylor <iant@google.com>
14759
7f055c20
ILT
14760 * gold-threads.h (class Initialize_lock): Define.
14761 * gold-threads.cc (class Initialize_lock_once): Define.
14762 (initialize_lock_control): New static variable.
14763 (initialize_lock_pointer): New static variable.
14764 (initialize_lock_once): New static function.
14765 (Initialize_lock::Initialize_lock): Define.
14766 (Initialize_lock::initialize): Define.
14767 * target-select.h: Include "gold-threads.h".
14768 (class Target_selector): Add lock_ and initialize_lock_ fields.
14769 Don't define instantiate_target, just declare it.
14770 * target-select.cc (Target_selector::Target_selector): Initialize
14771 new fields.
14772 (Target_selector::instantiate_target): Define.
14773 * descriptors.h: Include "gold-threads.h".
14774 (class Descriptors): Add initialize_lock_ field.
14775 * descriptors.cc (Descriptors::Descriptors): Initialize new
14776 field.
14777 (Descriptors::open): Use initialize_lock_ field
14778 * errors.h (class Errors): Add initialize_lock_ field.
14779 * errors.cc (Errors::Errors): Initialize new field.
14780 (Errors::initialize_lock): Use initialize_lock_ field.
14781 * powerpc.cc (class Target_selector_powerpc): Remove
14782 instantiated_target_ field. In do_recognize call
14783 instantiate_target rather than do_instantiate_target. In
14784 do_instantiate_target just allocate a new target.
14785 * sparc.cc (class Target_selector_sparc): Likewise.
14786
36959681
ILT
14787 * freebsd.h: New file.
14788 * i386.cc: Include "freebsd.h".
14789 (Target_i386): Derive from Target_freebsd rather than
14790 Sized_target.
14791 (Target_selector_i386): Derive from Target_selector_freebsd rather
14792 than Target_selector.
14793 * x86_64.cc: Include "freebsd.h".
14794 (Target_x86_64): Derive from Target_freebsd rather than
14795 Sized_target.
14796 (Target_selector_x86_64): Derive from Target_selector_freebsd
14797 rather than Target_selector.
14798 * target.h (class Target): Add adjust_elf_header and
14799 do_adjust_elf_header.
14800 * output.cc (Output_file_header:: do_sized_write): Call target
14801 adjust_elf_header routine.
14802 * configure.tgt: Set targ_osabi.
14803 * configure.ac: Define GOLD_DEFAULT_OSABI.
14804 * parameters.cc (Parameters::default_target): Pass
14805 GOLD_DEFAULT_OSABI to select_target.
14806 * target-select.h (class Target_selector): Make instantiate_target
14807 protected rather than private.
14808 * Makefile.am (HFILES): Add freebsd.h.
14809 * configure, Makefile.in, config.in: Rebuild.
14810
cb010894
ILT
14811 * merge.cc (do_add_input_section): Correct pend value. Change
14812 message about last entry not being null terminated from error to
14813 warning.
14814
0e879927
ILT
148152009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14816
14817 * incremental.cc: New file.
14818 * Makefile.am (CCFILES): Add incremental.cc.
14819 * Makefile.in: Rebuild.
14820
41105937
PP
148212009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14822
14823 * layout.cc (Layout::output_section_name): Preserve names
14824 of '.note.' sections.
e1df38aa 14825
60439920
ILT
148262009-03-19 Ian Lance Taylor <iant@google.com>
14827
14828 * descriptors.cc (Descriptors::open): Check that the options are
14829 valid before using them.
14830
0d371ad3
ILT
148312009-03-18 Ian Lance Taylor <iant@google.com>
14832
14833 * script-sections.h: Include <list>.
14834 (class Script_sections): Change Sections_elements from std::vector
14835 to std::list. Typedef public Elements_iterator. Add
14836 orphan_section_placement_, data_segment_align_start_, and
14837 saw_data_segment_align_ fields. Remove data_segment_align_index_
14838 field.
14839 * script-sections.cc (class Orphan_section_placement): New class.
14840 (class Sections_element): Add virtual functions is_relro and
14841 orphan_section_init. Remove virtual function place_orphan_here.
14842 (class Output_section_definition): Add is_relro and
14843 orphan_section_init. Remove place_orphan_here.
14844 (class Orphan_output_section): Likewise.
14845 (Script_sections::Script_sections): Update for field changes.
14846 (Script_sections::data_segment_align): Set saw_data_segment_align_
14847 and data_segment_align_start_, not data_segment_align_index.
14848 (Script_sections::data_segment_relro_end): Check
14849 saw_data_segment_align_. Use data_segment_align_start_ rather
14850 than data_segment_align_index_.
14851 (Script_sections::place_orphan): Rewrite to use
14852 Orphan_section_placement.
14853
9201d894
ILT
148542009-03-17 Ian Lance Taylor <iant@google.com>
14855
9c5b8369
ILT
14856 * archive.cc (Archive::add_symbols): Check for a version attached
14857 to the symbol name in the archive map.
14858 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14859 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14860 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14861 (ver_test_11.a): New target.
14862 * testsuite/Makefile.in: Rebuild.
14863
9201d894
ILT
14864 * configure.ac: Check for chsize and posix_fallocate. Replace
14865 ftruncate.
14866 * ftruncate.c: New file, from gnulib.
14867 * output.cc (posix_fallocate): Define dummy version if not
14868 HAVE_POSIX_FALLOCATE.
14869 (Output_file::map): Call posix_fallocate rather than lseek and
14870 write.
14871 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14872 * configure, Makefile.in, config.in: Rebuild.
14873
ef4ab7a8 148742009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14875
ef4ab7a8
PP
14876 * layout.h (Layout::create_note): Add section_name parameter.
14877 * layout.cc (Layout::create_note): Likewise.
14878 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14879
8c500701
ILT
148802009-03-17 Ian Lance Taylor <iant@google.com>
14881
e85b18e1
ILT
14882 * descriptors.cc: Include "options.h".
14883 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14884 (Descriptors::open): Always use O_CLOEXEC when opening a new
14885 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14886 then set FD_CLOEXEC.
14887
9efe6174
ILT
14888 * sparc.cc (class Target_sparc): Add has_got_section.
14889 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14890 make sure we have a GOT section.
14891
14892 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14893 (Target_sparc::Scan::local): Likewise.
14894 (Target_sparc::Scan::global): Likewise.
14895 (Target_sparc::Relocate::relocate): Likewise.
14896 (Target_sparc::Relocate::relocate_tls): Likewise.
14897
8c500701
ILT
14898 * symtab.cc (Symbol_table::define_default_version): New function,
14899 broken out of add_from_object.
14900 (Symbol_table::add_from_object): Call define_default_version.
14901 (Symbol_table::define_special_symbol): Add resolve_oldsym
14902 parameter. Change all callers. If the version for a symbol comes
14903 from a version script, resolve it with the symbol with the same
14904 name with no version. Also add the symbol without a version if
14905 appropriate.
14906 (do_define_in_output_data): If resolving with oldsym, don't delete
14907 sym.
14908 (do_define_in_output_segment): Likewise.
14909 (do_define_as_constant): Likewise.
14910 * symtab.h (class Symbol_table): Update declarations.
14911
f1ed28fb
ILT
149122009-03-13 Ian Lance Taylor <iant@google.com>
14913
15f8229b
ILT
14914 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14915 (Read_symbols::requeue): New function.
14916 (Read_symbols::do_read_symbols): If make_elf_object fails because
14917 the target type is not configured, and the file was searched for,
14918 issue a warning and retry with the next directory.
14919 (Add_symbols::run): If the file has an incompatible format, and
14920 it was searched for, requeue the Read_symbols task. On error,
14921 release the object.
14922 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14923 dirindex parameter to constructor. Change all callers. Declare
14924 incompatible_warning and requeue.
14925 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14926 input_argument_ and input_group_ fields. Add them to
14927 constructor. Change all callers.
14928 (class Read_script): Add dirindex_ field. Add it to constructor.
14929 Change all callers.
14930 * archive.cc (Archive::setup): Remove input_objects parameter.
14931 Change all callers.
14932 (Archive::get_file_and_offset): Likewise.
14933 (Archive::read_all_symbols): Likewise.
14934 (Archive::read_symbols): Likewise.
14935 (Archive::get_elf_object_for_member): Remove input_objects
14936 parameter. Add punconfigured parameter. Change all callers.
14937 (Archive::add_symbols): Change return type to bool. Check return
14938 value of include_member.
14939 (Archive::include_all_members): Likewise.
14940 (Archive::include_member): Change return type to bool. Return
14941 false if first included object has incompatible target. Set
14942 included_member_ field.
14943 (Add_archive_symbols::run): If add_symbols returns false, requeue
14944 Read_symbols task.
14945 * archive.h (class Archive): Add included_member_ field.
14946 Initialize it in constructor. Add input_file and searched_for
14947 methods. Update declarations.
14948 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14949 input_argument_ fields. Add them to constructor. Change all
14950 callers.
14951 * script.cc: Include "target-select.h".
14952 (class Parser_closure): Add skip_on_incompatible_target_ and
14953 found_incompatible_target_ fields. Add
14954 skip_on_incompatible_target parameter to constructor. Change all
14955 callers. Add methods skip_on_incompatible_target,
14956 clear_skip_on_incompatible_target, found_incompatible_target, and
14957 set_found_incompatible_target.
14958 (read_input_script): Add dirindex parameter. Change all callers.
14959 If parser finds an incompatible target, requeue Read_symbols
14960 task.
14961 (script_set_symbol): Clear skip_on_incompatible_target in
14962 closure.
14963 (script_add_assertion, script_parse_option): Likewise.
14964 (script_start_sections, script_add_phdr): Likewise.
14965 (script_check_output_format): New function.
14966 * script.h (read_input_script): Update declaration.
14967 * script-c.h (script_check_output_format): Declare.
14968 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14969 (ignore_cmd): Remove OUTPUT_FORMAT.
14970 * fileread.cc (Input_file::Input_file): Add explicit this.
14971 (Input_file::will_search_for): New function.
14972 (Input_file::open): Add pindex parameter. Change all callers.
14973 * fileread.h (class Input_file): Add input_file_argument method.
14974 Declare will_search_for. Update declarations.
14975 * object.cc (make_elf_object): Add punconfigured parameter.
14976 Change all callers.
14977 * object.h (class Object): Make input_file public. Add
14978 searched_for method.
14979 (make_elf_object): Update declaration.
14980 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14981 restart search.
14982 * dirsearch.h (class Dirsearch): Update declaration.
14983 * options.h (class General_options): Add --warn-search-mismatch.
14984 * parameters.cc (Parameters::is_compatible_target): New function.
14985 * parameters.h (class Parameters): Declare is_compatible_target.
14986 * workqueue.cc (Workqueue::add_blocker): New function.
14987 * workqueue.h (class Workqueue): Declare add_blocker.
14988
f1ed28fb
ILT
14989 * fileread.cc (Input_file::open): Remove options parameter.
14990 Change all callers.
14991 (Input_file::open_binary): Likewise.
14992 * script.cc (read_input_script): Likewise.
14993 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14994 options parameter from constructor. Change all callers.
14995 (class Read_script): Likewise.
14996 * fileread.h (class Input_file): Update declarations.
14997 * script.h (read_input_script): Update declaration.
14998
34dd024a
NC
149992009-03-10 Nick Clifton <nickc@redhat.com>
15000
15001 * po/es.po: New Spanish translation.
15002
6d71b17c
CC
150032009-03-06 Cary Coutant <ccoutant@google.com>
15004
15005 * options.cc (parse_short_option): Keep dash_z from registering itself.
15006
031cdbed
ILT
150072009-03-03 Ian Lance Taylor <iant@google.com>
15008
15009 PR 9918
15010 * target-reloc.h (relocate_section): Pass output_section to
15011 relocate.
15012 * i386.cc (Target_i386::should_apply_static_reloc): Add
15013 output_section parameter. Change all callers.
15014 (Target_i386::Relocate::relocate): Add output_section parameter.
15015 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15016 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15017 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15018 * testsuite/two_file_shared.sh: New script.
15019 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15020 (check_DATA): Add two_file_shared.dbg.
15021 (two_file_shared.dbg): New target.
15022 * testsuite/Makefile.in: Rebuild.
15023
15d5fa16
ILT
150242009-03-01 Ian Lance Taylor <iant@google.com>
15025
15026 * configure.ac: Check for byteswap.h.
15027 * configure: Rebuild.
15028 * config.in: Rebuild.
15029
8a4c0b0d
ILT
150302009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15031
15032 * layout.cc (Layout::find_or_add_kept_section): New function.
15033 (Layout::add_comdat): Removed.
15034 * layout.h (struct Kept_section): Move out of class Layout.
15035 Remove trailing underscores from field names. Add group_sections
15036 field. Rename group_ field to is_group. Change all uses.
15037 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15038 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15039 comdat_groups_ field.
15040 (Sized_relobj::include_section_group): Use
15041 find_or_add_kept_section and Kept_section::group_sections.
15042 (Sized_relobj::include_linkonce_section): Likewise.
15043 * object.cc (class Sized_relobj): Don't define Comdat_group or
15044 Comdat_group_table. Remove find_comdat_group and
15045 add_comdat_group. Remove comdat_groups_ field.
15046 * plugin.cc (include_comdat_group): Use
15047 Layout::find_or_add_kept_section.
15048
b4ecf66b
ILT
150492009-02-28 Ian Lance Taylor <iant@google.com>
15050
14359ca0
ILT
15051 * README: --gc-sections and map files are now supported. Document
15052 some build requirements.
15053
b4ecf66b
ILT
15054 PR 6992
15055 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15056 relocatable link set the value of the section symbol to zero.
15057 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15058 relocatable link don't include the section address in the local
15059 symbol value.
15060
0602e05a
ILT
150612009-02-27 Ian Lance Taylor <iant@google.com>
15062
fd9d194f
ILT
15063 PR 6811
15064 * options.h (class Search_directory): Add is_system_directory.
15065 (class General_options): Declare is_in_system_directory.
15066 * options.cc (get_relative_sysroot): Make static.
15067 (get_default_sysroot): Make static.
15068 (General_optoins::is_in_system_directory): New function.
15069 * fileread.cc (Input_file::is_in_system_directory): New function.
15070 * fileread.h (class Input_file): Declare is_in_system_directory.
15071 * object.h (class Object): Add is_in_system_directory.
15072 (class Input_objects): Remove system_library_directory_ field.
15073 * object.cc (Input_objects::add_object): Don't set
15074 system_library_directory_.
15075 (input_objects::found_in_system_library_directory): Remove.
15076 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15077 parameter. Change all callers.
15078 (Symbol_table::sized_write_globals): Likewise.
15079 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15080 Call Object::is_in_system_directory.
15081 * symtab.h (class Symbol_table): Update declarations.
15082
61edd21f
ILT
15083 PR 5990
15084 * descriptors.h (Open_descriptor): Add is_on_stack field.
15085 * descriptors.cc (Descriptors::open): If the descriptor is on the
15086 top of the stack, remove it. Initialize is_on_stack field.
15087 (Descriptors::release): Only add pod to stack if it is not on the
15088 stack already.
15089 (Descriptors::close_some_descriptor): Clear stack_next and
15090 is_on_stack fields.
15091
e29e076a
ILT
15092 PR 7091
15093 * output.cc (Output_section::find_starting_output_address): Rename
15094 from starting_output_address; add PADDR parameter; change return
15095 type.
15096 * output.h (class Output_section): Declare
15097 find_starting_output_address instead of starting_output_address.
15098 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15099 section symbol for which we can't find a merge section.
15100
0602e05a
ILT
15101 PR 9836
15102 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15103 hidden or internal, force the symbol to be local.
15104 * resolve.cc (Symbol::override_visibility): Define.
15105 (Symbol::override_base): Use override_visibility.
15106 (Symbol_table::resolve): Likewise.
15107 (Symbol::override_base_with_special): Likewise.
15108 (Symbol_table::override_with_special): If the visibility is hidden
15109 or internal, force the symbol to be local.
15110 * symtab.h (class Symbol): Add set_visibility and
15111 override_visibility.
15112 * testsuite/ver_test_1.sh: New file.
15113 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15114 (check_DATA): Add ver_test_1.syms.
15115 (ver_test_1.syms): New target.
15116 * testsuite/Makefile.in: Rebuild.
15117
401a9a73
CC
151182009-02-25 Cary Coutant <ccoutant@google.com>
15119
15120 * layout.cc (Layout::choose_output_section): Don't rename sections
15121 when using a linker script that has a SECTIONS clause.
15122 * Makefile.in: Regenerate.
15123
15124 * testsuite/Makefile.am (script_test_5.sh): New test case.
15125 * testsuite/Makefile.in: Regenerate.
15126 * testsuite/script_test_5.cc: New file.
15127 * testsuite/script_test_5.sh: New file.
15128 * testsuite/script_test_5.t: New file.
15129
f488e4b0
CC
151302009-02-13 Rafael Avila de Espindola <espindola@google.com>
15131
15132 * archive.cc (Archive::include_member): Update calls to add_symbols.
15133 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15134 the Layout argument.
15135 * dynobj.h (do_add_symbols): Add the Layout argument.
15136 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15137 Layout argument.
15138 * object.h (Object::add_symbols): Add the Layout argument.
15139 (Object::do_add_symbols): Add the Layout argument.
15140 (Sized_relobj::do_add_symbols): Add the Layout argument.
15141 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15142 Unify the two versions.
15143 (Add_plugin_symbols): Remove.
15144 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15145 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15146 (Add_plugin_symbols): Remove.
15147 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15148 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15149 (Add_symbols::run): Make it work with Pulginobj.
15150
89dd1680
ILT
151512009-02-06 Ian Lance Taylor <iant@google.com>
15152
15153 * object.cc (Sized_relobj::do_layout): Make info message start
15154 with lower case letter.
15155
266d0a74
ILT
151562009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15157
602b464e
ILT
15158 * binary.cc: Fix file comment.
15159
266d0a74
ILT
15160 * options.h (enum Incremental_disposition): Define.
15161 (class General_options): Add new options: --incremental,
15162 --incremental_changed, --incremental_unchanged,
15163 --incremental_unknown. Add incremental_disposition_ and
15164 implicit_incremental_ fields.
15165 (General_options::incremental_disposition): New function.
15166 (class Position_dependent_options): Add incremental_disposition
15167 option.
15168 (Position_dependent_options::copy_from_options): Set incremental
15169 dispositions.
15170 * options.cc (General_options::parse_incremental_changed): New
15171 function.
2e702c99
RM
15172 (General_options::parse_incremental_unchanged): New function.
15173 (General_options::parse_incremental_unknown): New function.
15174 (General_options::General_options): Initialize new fields
266d0a74 15175 incremental_disposition_ and implicit_incremental_.
2e702c99 15176 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15177 without --incremental.
15178
f073bbf7
CD
151792009-02-06 Chris Demetriou <cgd@google.com>
15180
15181 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15182 pointer and to report location as the file name associated with
15183 the symbol.
15184 (gold_undefined_symbol_at_location): New function to replace the
15185 old gold_undefined_symbol functionality.
15186 * target-reloc.h (relocate_section): Update to use
15187 gold_undefined_symbol_at_location.
15188 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15189 Call gold_undefined_symbol function rather than gold_error.
15190 * errors.h (Errors::undefined_symbol): Take location as a
15191 string, rather than calculating it from a relocation.
15192 * errors.cc (Errors::fatal): Print "fatal error:" before the
15193 formatted message.
15194 (Errors::error, Errors::error_at_location): Print "error: "
15195 before the formatted message.
15196 (Errors::undefined_symbol): Take location as a string, rather
15197 than calculating it from a relocation.
15198 (gold_undefined_symbol_at_location): New function akin to
15199 old gold_undefined_symbol, calculates location from relocation.
15200 (gold_undefined_symbol): Change to take only a Symbol pointer
15201 and to report location as the file name associated with the symbol.
15202 * testsuite/debug_msg.sh: Update for changed error messages.
15203 * testsuite/undef_symbol.sh: Likewise.
15204
8e94a90c
ILT
152052009-02-04 Duncan Sands <baldrick@free.fr>
15206
15207 PR 9812
15208 * reduced_debug_output.h
15209 (Output_reduced_debug_abbrev_section::failed): Use format for
15210 gold_warning.
15211 (Output_reduced_debug_info_section::faild): Likewise.
15212
88a0e15b
ILT
152132009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15214
15215 * script.cc (Lazy_demangler): New class.
2e702c99 15216 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15217 symbol only once.
15218
5efc7cd2
CC
152192009-01-29 Cary Coutant <ccoutant@google.com>
15220
15221 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15222 to __tls_get_addr.
15223 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15224
e0ebcf42
ILT
152252009-01-28 Ian Lance Taylor <iant@google.com>
15226
5efc7cd2 15227 * version.cc (version_string): Bump to 1.9.
75fe7426 15228
e0ebcf42
ILT
15229 * gold.h: Include <cstring> and <stdint.h>.
15230 * version.cc: Include <cstdio>.
15231 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15232 warning.
15233 * reduced_debug_output.cc (insert_into_vector): Rename from
15234 Insert_into_vector; change all callers. Use Swap_unaligned to
15235 avoid aliasing issue; remove union since it is unnecessary.
15236
8e2813be 152372009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15238
15239 * Makefile.am (CCFILES): Add gc.cc.
15240 (HFILES): Add gc.h.
15241 * Makefile.in: Regenerate.
15242 * gold.cc (Gc_runner): New class.
15243 (queue_initial_tasks): Call garbage collection related tasks
15244 when corresponding options are invoked.
15245 (queue_middle_gc_tasks): New function.
15246 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15247 processed early before laying out sections during garbage collection.
15248 * gold.h (queue_middle_gc_tasks): New function.
15249 (is_prefix_of): Move from "layout.cc".
15250 * i386.cc (Target_i386::gc_process_relocs): New function.
15251 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15252 * main.cc (main): Create object of class "Garbage_collection".
15253 * object.cc (Relobj::copy_symbols_data): New function.
15254 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15255 (Sized_relobj::do_layout): Allow this function to be called twice
15256 during garbage collection and defer layout of section during the
6d03d481
ST
15257 first call.
15258 * object.h (Relobj::get_symbols_data): New function.
15259 (Relobj::is_section_name_included): New function.
15260 (Relobj::copy_symbols_data): New function.
15261 (Relobj::set_symbols_data): New function.
15262 (Relobj::get_relocs_data): New function.
15263 (Relobj::set_relocs_data): New function.
15264 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15265 (Relobj::gc_process_relocs): New function.
15266 (Relobj::do_gc_process_relocs): New pure virtual function.
15267 (Relobj::sd_): New data member.
15268 (Sized_relobj::is_output_section_offset_invalid): New function.
15269 (Sized_relobj::do_gc_process_relocs): New function.
15270 * options.h (General_options::gc_sections): Modify to not be a no-op.
15271 (General_options::print_gc_sections): New option.
15272 * plugin.cc (Plugin_finish::run): Remove function call to
15273 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15274 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15275 * reloc.cc (Read_relocs::run): Add task to process relocs and
15276 determine unreferenced sections when doing garbage collection.
15277 (Gc_process_relocs): New class.
15278 (Sized_relobj::do_gc_process_relocs): New function.
15279 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15280 sections that are garbage collected.
15281 * reloc.h (Gc_process_relocs): New class.
15282 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15283 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15284 symbols whose corresponding sections are garbage collected.
15285 (Symbol_table::Symbol_table): Add new parameter for the garbage
15286 collection object.
15287 (Symbol_table::gc_mark_undef_symbols): New function.
15288 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15289 (Symbol_table::gc_mark_dyn_syms): New function.
15290 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15291 as garbage.
15292 (Symbol_table::add_from_object): Likewise.
15293 (Symbol_table::add_from_relobj): When building shared objects, do not
15294 treat externally visible symbols as garbage.
15295 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15296 table information for static and relocatable links.
15297 * symtab.h (Symbol_table::set_gc): New function.
15298 (Symbol_table::gc): New function.
15299 (Symbol_table::gc_mark_undef_symbols): New function.
15300 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15301 (Symbol_table::gc_mark_dyn_syms): New function.
15302 (Symbol_table::gc_): New data member.
e1df38aa 15303 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15304 function.
15305 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15306 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15307
3b293544
CF
153082009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15309
15310 * options.h (General_options::gc_sections): Define as a no-op for now.
15311 (General_options::no_keep_memory): Ditto.
15312 (General_options::Bshareable): Define.
15313 * options.cc (General_options::finalize): Honor -Bshareable.
15314
83d22aa8
AS
153152009-01-20 Andreas Schwab <schwab@suse.de>
15316
15317 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15318 read the value in the contents, since we don't use it. Use the
15319 template endianness when writing.
15320 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15321
cd536b21
AS
153222009-01-19 Andreas Schwab <schwab@suse.de>
15323
15324 * configure.tgt (powerpc64-*): Fix targ_obj.
15325
99e9a495
ILT
153262009-01-15 Ian Lance Taylor <iant@google.com>
15327
15328 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15329 local symbols when stripping all symbols.
15330
bbbfea06
CC
153312009-01-14 Cary Coutant <ccoutant@google.com>
15332
99e9a495 15333 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15334
0f7c0701
CC
153352009-01-14 Cary Coutant <ccoutant@google.com>
15336
15337 * archive.cc (Archive::get_elf_object_for_member): Remove call
15338 to File_read::claim_for_plugin.
15339 * descriptors.cc (Descriptors::open): Remove reference to
15340 is_claimed.
15341 (Descriptors::claim_for_plugin): Remove.
15342 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15343 (Descriptors::is_claimed): Remove.
15344 (claim_descriptor_for_plugin): Remove.
15345 * fileread.cc (File_read::claim_for_plugin): Remove.
15346 * fileread.h (File_read::claim_for_plugin): Remove.
15347 (File_read::descriptor): Reopen descriptor if necessary.
15348 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15349 (Plugin_manager::all_symbols_read): Add task parameter. Change
15350 all callers.
15351 (Plugin_manager::get_input_file): New function.
15352 (Plugin_manager::release_input_file): New function.
15353 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15354 corresponding data member.
15355 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15356 and pass to base constructor. Change all callers.
15357 (get_input_file, release_input_file): New functions.
15358 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15359 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15360 (Plugin_manager::all_symbols_read): Add task parameter.
15361 (Plugin_manager::get_input_file): New function.
15362 (Plugin_manager::release_input_file): New function.
15363 (Plugin_manager::task_): New data member.
15364 (Pluginobj::Pluginobj): Add filesize parameter.
15365 (Pluginobj::filename): New function.
15366 (Pluginobj::descriptor): New function.
15367 (Pluginobj::filesize): New function.
15368 (Pluginobj::filesize_): New data member.
15369 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15370 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15371 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15372
15373 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15374 with archive libraries.
15375 * testsuite/Makefile.in: Regenerate.
15376 * testsuite/plugin_test.c (struct sym_info): New type.
15377 (get_input_file, release_input_file): New static variables.
15378 (onload): Capture new transfer vector entries.
15379 (claim_file_hook): Stop reading at end of file according to filesize.
15380 Factor out parsing of readelf output into separate function.
15381 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15382 APIs and get the source file name from the symbol table. Convert
15383 source file name to corresponding object file name. Print info
15384 message when adding new input files.
15385 (parse_readelf_line): New function.
15386 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15387 * testsuite/plugin_test_2.sh: Likewise.
15388 * testsuite/plugin_test_3.sh: Likewise.
15389 * testsuite/plugin_test_4.sh: New test case.
15390
62a6d109
ILT
153912009-01-07 Ian Lance Taylor <iant@google.com>
15392
15393 * version.cc (version_string): Bump to 1.8.
15394
483620e8
CC
153952008-12-23 Cary Coutant <ccoutant@google.com>
15396
15397 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15398 * plugin.cc (Plugin_manager::finish): Rename as
15399 layout_deferred_objects. Move cleanup to separate function.
15400 (Plugin_manager::cleanup): New function.
15401 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15402 separately.
15403 * plugin.h (Plugin_manager::finish): Rename as
15404 layout_deferred_objects.
15405 (Plugin_manager::cleanup): New function.
15406 (Plugin_manager::cleanup_done): New field.
15407
d66a9eb3
CC
154082008-12-23 Cary Coutant <ccoutant@google.com>
15409
15410 * plugin.cc (is_visible_from_outside): New function.
15411 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15412 so we don't return "IR only" status for exported symbols or -r links.
15413
15414 * testsuite/Makefile.am (plugin_test_3): New test case.
15415 * testsuite/Makefile.in: Regenerate.
15416 * testsuite/plugin_test_3.sh: New file.
15417
5995b570
CC
154182008-12-22 Cary Coutant <ccoutant@google.com>
15419
15420 * object.cc (Sized_relobj::layout_section): New function.
15421 (Sized_relobj::do_layout): Defer layout of input sections until after
15422 plugin has provided replacement files.
15423 (Sized_relobj::do_layout_deferred_sections): New function.
15424 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15425 (Relobj::layout_deferred_sections): New function.
15426 (Relobj::do_layout_deferred_sections): New function.
15427 (Sized_relobj::do_layout_deferred_sections): New function.
15428 (Sized_relobj::layout_section): New function.
15429 (Sized_relobj::Deferred_layout): New structure.
15430 (Sized_relobj::deferred_layout_): New field.
15431 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15432 Change all callers. Layout deferred sections.
15433 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15434 references.
15435 (Plugin_hook::run): Move code from do_plugin_hook inline.
15436 (Plugin_hook::do_plugin_hook): Remove.
15437 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15438 (Plugin_manager::finish): Renamed, was cleanup.
15439 (Plugin_manager::should_defer_layout): New function.
15440 (Plugin_manager::add_deferred_layout_object): New function.
15441 (Plugin_manager::Deferred_layout_list): New type.
15442 (Plugin_manager::deferred_layout_objects_): New field.
15443 (Plugin_hook::do_plugin_hook): Remove.
15444
ee769c88
ILT
154452008-12-17 Ian Lance Taylor <iant@google.com>
15446
15447 * options.h (class General_options): Add --no case for
15448 --export-dynamic.
15449
abc8dcba
CC
154502008-12-16 Cary Coutant <ccoutant@google.com>
15451
15452 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15453 vector.
15454 (Plugin_manager::claim_file): Create plugin object even if
15455 plugin did not call the add_symbols callback.
15456 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15457 asking for more symbols than were added.
15458 * testsuite/Makefile.am (plugin_test_1): Add test case with
15459 no global symbols.
15460 (empty.syms): New target.
15461 * testsuite/Makefile.in: Regenerate.
15462 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15463 message. Don't call add_symbols if no globals.
15464 (all_symbols_read_hook): Don't provide replacement for empty
15465 claimed file.
15466
b0074644
ILT
154672008-12-12 Ian Lance Taylor <iant@google.com>
15468
68943102
ILT
15469 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15470 r_type == 0 for a local symbol with r_sym == 0.
15471 (scan_relocatable_relocs): Pass r_sym to
15472 local_non_section_strategy.
15473 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15474 r_sym parameter.
15475
b0074644
ILT
15476 * configure.ac: Update test for TLS descriptors: they are
15477 supported as of glibc 2.9.
15478 * configure: Rebuild.
15479
c2508178
ILT
154802008-12-11 Ian Lance Taylor <iant@google.com>
15481
15482 PR 7091
15483 * target-reloc.h (Default_scan_relocatable_relocs): For each
15484 function, map r_type == 0 to RELOC_DISCARD.
15485
2756a258
CC
154862008-12-10 Cary Coutant <ccoutant@google.com>
15487
15488 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15489 object to override a kept COMDAT group from a plugin object.
15490
bb6f53d3
ILT
154912008-12-09 Ian Lance Taylor <iant@google.com>
15492
fbc558e1
ILT
15493 PR 7088
15494 * yyscript.y (file_cmd): Handle INPUT.
15495
bb6f53d3
ILT
15496 * testsuite/initpri1.c: Change all declarations to be full
15497 prototypes by adding void, to avoid compiler warnings.
15498
4674ecfc
CC
154992008-12-05 Rafael Avila de Espindola <espindola@google.com>
15500
15501 * options.cc (General_options::parse_plugin_opt): New.
15502 (General_options::add_plugin): The argument now is just the filename.
15503 (General_options::add_plugin_option): New.
15504 * options.h (plugin_opt): New.
15505 (add_plugin): Change argument name.
15506 (add_plugin_option): New.
15507 * plugin.cc (Plugin::load): Don't parse the plugin option.
15508 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15509 (Plugin::add_option): New.
15510 (Plugin::args_): Change type.
15511 (Plugin::filename_): New.
15512 (Plugin_manager::add_plugin_option): New.
15513 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15514 * testsuite/Makefile.in: Regenerate.
15515
fd06b4aa
CC
155162008-12-05 Cary Coutant <ccoutant@google.com>
15517
15518 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15519 Handle --strip-lto-sections option.
15520 * options.h (strip_lto_sections): New option.
15521
6c52134c
CC
155222008-12-01 Cary Coutant <ccoutant@google.com>
15523
15524 * plugin.cc (ld_plugin_message): Change format parameter to const.
15525 Fix mismatch between new[] and delete.
15526
a45248e0
CC
155272008-11-14 Cary Coutant <ccoutant@google.com>
15528
15529 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15530 instead of -1U.
15531
c82fbeee
CS
155322008-11-05 Craig Silverstein <csilvers@google.com>
15533
15534 * options.cc (General_options::parse_dynamic_list): New function.
15535 * options.h (General_options): New flags dynamic_list,
15536 dynamic_list_data, dynamic_list_cpp_new, and
15537 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15538 (General_options::in_dynamic_list): New function.
15539 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15540 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15541 (Lex::can_continue_name): Likewise.
15542 (yylex): Likewise.
15543 (read_script_file): New parameter script_options.
15544 (read_dynamic_list): New function.
15545 (Script_options::define_dynamic_list): New function.
15546 (dynamic_list_keyword_parsecodes): New variable.
15547 (dynamic_list_keywords): New variable.
15548 * script.h (Script_options::define_dynamic_list): New function
15549 prototype.
15550 (read_dynamic_list): New function prototype.
15551 * symtab.cc (strprefix): New macro.
15552 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15553 dynamic_list_data, dynamic_list_cpp_new, and
15554 dynamic_list_cpp_typeinfo.
15555 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15556 (dynamic_list_expr): New rule.
15557 (dynamic_list_nodes): Likewise.
15558 (dynamic_list_node): Likewise.
15559 * testsuite/Makefile.am (dynamic_list): New test.
15560 * testsuite/Makefile.in: Regenerated.
15561 * testsuite/dynamic_list.t: New file.
15562 * testsuite/dynamic_list.sh: New file.
15563
e0bb29a5
CS
155642008-11-05 Craig Silverstein <csilvers@google.com>
15565
15566 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15567 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15568 (t11_last): Likewise.
15569 * testsuite/ver_test_6.c (main): Likewise.
15570
4e1e25e0
CC
155712008-10-07 Cary Coutant <ccoutant@google.com>
15572
15573 * options.c (General_options::finalize): Add check for -static and
15574 -shared.
15575 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15576 is not empty.
15577
92f03fcb
CC
155782008-10-02 Cary Coutant <ccoutant@google.com>
15579
15580 * plugin.cc (make_sized_plugin_object): Fix conditional
15581 compilation to work when not all targets are enabled.
15582
fbd8a257
CC
155832008-09-29 Cary Coutant <ccoutant@google.com>
15584
15585 * archive.cc (Archive::get_file_and_offset): Use filename instead
15586 of name to get library path.
15587 (Archive::include_member): Unlock external member of a thin archive.
15588
15589 * testsuite/Makefile.am (TEST_AR): New variable.
15590 (thin_archive_test_1): New test.
15591 (thin_archive_test_2): New test.
81636b3f
CC
15592 * testsuite/Makefile.in: Regenerate.
15593 * testsuite/thin_archive_main.cc: New file.
15594 * testsuite/thin_archive_test_1.cc: New file.
15595 * testsuite/thin_archive_test_2.cc: New file.
15596 * testsuite/thin_archive_test_3.cc: New file.
15597 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15598
eff45813
CC
155992008-09-29 Cary Coutant <ccoutant@google.com>
15600
15601 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15602 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15603 instead of -1U.
15604 (Sized_relobj::do_finalize_local_symbols): Likewise.
15605 (Sized_relobj::map_to_kept_section): Likewise.
15606 * object.h (Sized_relobj::invalid_address): New constant.
15607 (Sized_relobj::do_output_section_offset): Check for invalid_address
15608 and return -1ULL.
15609 * output.cc (Output_reloc::local_section_offset): Use constant
15610 invalid_address instead of -1U.
15611 (Output_reloc::get_address): Likewise.
15612 (Output_section::output_address): Change -1U to -1ULL.
15613 * output.h (Output_reloc::invalid_address): New constant.
15614 * reloc.cc (Sized_relobj::write_sections): Use constant
15615 invalid_address instead of -1U.
15616 (Sized_relobj::relocate_sections): Likewise.
15617 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15618 values for merge sections.
15619 * target-reloc.h (relocate_for_relocatable): Use constant
15620 invalid_address instead of -1U.
15621
89fc3421
CC
156222008-09-19 Cary Coutant <ccoutant@google.com>
15623
15624 Add plugin functionality for link-time optimization (LTO).
15625 * configure.ac (plugins): Add --enable-plugins option.
15626 * configure: Regenerate.
15627 * config.in: Regenerate.
15628 * Makefile.am (LIBDL): New variable.
15629 (CCFILES): Add plugin.cc.
15630 (HFILES): Add plugin.h.
15631 (ldadd_var): Add LIBDL.
15632 * Makefile.in: Regenerate.
15633
15634 * archive.cc: Include "plugin.h".
15635 (Archive::setup): Don't preread archive symbols when using a plugin.
15636 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15637 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15638 files.
15639 (Archive::include_member): Add symbols from plugin objects.
15640 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15641 * descriptors.cc (Descriptors::open): Check for file descriptors
15642 abandoned by plugins.
15643 (Descriptors::claim_for_plugin): New function.
15644 * descriptors.h (Descriptors::claim_for_plugin): New function.
15645 (Open_descriptor::is_claimed): New field.
15646 (claim_descriptor_for_plugin): New function.
15647 * fileread.cc (File_read::claim_for_plugin): New function.
15648 * fileread.h (File_read::claim_for_plugin): New function.
15649 (File_read::descriptor): New function.
15650 * gold.cc: Include "plugin.h".
15651 (queue_initial_tasks): Add task to call plugin hooks for generating
15652 new object files.
15653 * main.cc: Include "plugin.h".
15654 (main): Load plugin libraries.
15655 * object.h (Pluginobj): Declare.
15656 (Object::pluginobj): New function.
15657 (Object::do_pluginobj): New function.
15658 (Object::set_target): New function.
15659 * options.cc: Include "plugin.h".
15660 (General_options::parse_plugin): New function.
15661 (General_options::General_options): Initialize plugins_ field.
15662 (General_options::add_plugin): New function.
15663 * options.h (Plugin_manager): Declare.
15664 (General_options): Add --plugin option.
15665 (General_options::has_plugins): New function.
15666 (General_options::plugins): New function.
15667 (General_options::add_plugin): New function.
15668 (General_options::plugins_): New field.
15669 * plugin.cc: New file.
15670 * plugin.h: New file.
15671 * readsyms.cc: Include "plugin.h".
15672 (Read_symbols::do_read_symbols): Check for archive before checking
15673 for ELF file. Call plugin hooks to claim files.
15674 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15675 from a real object file; force override when processing replacement
15676 files.
15677 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15678 (Symbol::init_base_object): Likewise.
15679 (Symbol::init_base_output_data): Likewise.
15680 (Symbol::init_base_output_segment): Likewise.
15681 (Symbol::init_base_constant): Likewise.
15682 (Symbol::init_base_undefined): Likewise.
15683 (Symbol::output_section): Assert that object is not a plugin.
15684 (Symbol_table::add_from_pluginobj): New function.
15685 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15686 undefined.
15687 (Symbol_table::sized_write_globals): Likewise.
15688 (Symbol_table::add_from_pluginobj): Instantiate template.
15689 * symtab.h (Sized_pluginobj): Declare.
15690 (Symbol::in_real_elf): New function.
15691 (Symbol::set_in_real_elf): New function.
15692 (Symbol::in_real_elf_): New field.
15693 (Symbol_table::add_from_pluginobj): New function.
15694
15695 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15696 (LIBDL): New variable.
15697 (LDADD): Add LIBDL.
15698 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15699 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15700 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15701 (MOSTLYCLEANFILES): Likewise.
15702 * testsuite/Makefile.in: Regenerate.
15703 * testsuite/plugin_test.c: New file.
15704 * testsuite/plugin_test_1.sh: New file.
15705 * testsuite/plugin_test_2.sh: New file.
15706
de31bda5
ILT
157072008-09-16 Ian Lance Taylor <iant@google.com>
15708
9c2d0ef9
ILT
15709 * target-reloc.h (relocate_section): Check whether a symbol is
15710 defined by the ABI before reporting an undefined symbol error.
15711 * target.h (Target::is_defined_by_abi): Make parameter const.
15712 (Target::do_is_defined_by_abi): Likewise.
15713 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15714 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15715 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15716 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15717 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15718 * testsuite/Makefile.in: Rebuild.
15719
de31bda5
ILT
15720 * fileread.cc (make_view): Add casts to avoid warning.
15721
9fa33bee
AO
157222008-09-16 Alexandre Oliva <aoliva@redhat.com>
15723
15724 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15725 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15726
183fd0e3
AO
157272008-09-16 Alexandre Oliva <aoliva@redhat.com>
15728
15729 * options.h (General_options::output_is_executable): New.
15730 (General_options::output_is_pie): New.
15731 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15732 for shared libraries.
15733 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15734
7be8330a
CD
157352008-09-11 Chris Demetriou <cgd@google.com>
15736
15737 * options.h (origin): New -z option.
15738 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15739 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15740 in DT_FLAGS_1.
15741
a9caad02
CC
157422008-09-05 Cary Coutant <ccoutant@google.com>
15743
15744 * fileread.cc (File_read::make_view): Add check for attempt to map
15745 beyond end of file.
15746
ae6dce4d
CC
157472008-09-05 Cary Coutant <ccoutant@google.com>
15748
15749 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15750 explicit instantiations.
15751
d7ab2a47
KVH
157522008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15753
15754 PR gold/6858
15755 * options.cc (General_options::finalize): Allow undefined symbols
15756 in shlibs if linking -shared.
15757
15758 PR gold/6859
15759 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15760 symbols as not needing a dynsym entry.
15761
1e52a9c1
CS
157622008-08-20 Craig Silverstein <csilvers@google.com>
15763
15764 * fileread.cc (File_read::open): Do not lock the file unless it
15765 was successfully opened.
15766
d85c80a3
CC
157672008-08-14 Cary Coutant <ccoutant@google.com>
15768
15769 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15770 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15771 * testsuite/tls_test.cc (struct int128): 128-bit struct
15772 for testing TLS relocs with non-zero addend.
15773 (v12): New TLS variable.
15774 (t12): New test.
15775 (t_last): Add check for v12.
15776 * testsuite/tls_test.h (t12): New function.
15777 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15778
2d924fd9
ILT
157792008-08-13 Ian Lance Taylor <iant@google.com>
15780
15781 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15782 set tls_segment_ or relro_segment_.
15783 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15784 when appropriate.
15785 * output.h (Output_section::clear_is_relro): New function.
15786 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15787 sections specially even when output_data_ is empty.
15788 (Output_segment::maximum_alignment): When first section is relro,
15789 only force alignment for PT_LOAD segments.
15790 * script.cc (script_data_segment_align): New function.
15791 (script_data_segment_relro_end): New function.
15792 * script-c.h (script_data_segment_align): Declare.
15793 (script_data_segment_relro_end): Declare.
15794 * script-sections.h (class Script_sections): Declare
15795 data_segment_align and data_segment_relro_end. Add fields
15796 segment_align_index_ and saw_relro_end_.
15797 * script-sections.cc (class Sections_element): Add set_is_relro
15798 virtual function. Add new bool* parameter to place_orphan_here.
15799 Add get_output_section virtual function.
15800 (class Output_section_definition): Add set_is_relro. Add new
15801 bool* parameter to place_orphan_here. Add get_output_section.
15802 Add is_relro_ field.
15803 (Output_section_definition::Output_section_definition): Initialize
15804 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15805 and is_relro_ fields.
15806 (Output_section_definition::place_orphan_here): Add is_relro
15807 parameter.
15808 (Output_section_definition::set_section_addresses): Set relro for
15809 output section.
15810 (Output_section_definition::alternate_constraint): Likewise.
15811 (class Orphan_output_section): Add new bool* parameter to
15812 place_orphan_here. Add get_output_section.
15813 (Orphan_output_section::place_orphan_here): Add is_relro
15814 parameter.
15815 (Script_sections::Script_sections): Initialize
15816 data_segment_align_index_ and saw_relro_end_.
15817 (Script_sections::data_segment_align): New function.
15818 (Script_sections::data_segment_relro_end): New function.
15819 (Script_sections::place_orphan): Set or clear is_relro.
15820 (Script_sections::set_section_addresses): Force alignment of first
15821 TLS section.
15822 * yyscript.y (exp): Call script_data_segment_align and
15823 script_data_segment_relro_end.
15824 * testsuite/relro_script_test.t: New file.
15825 * testsuite/relro_test.cc (using_script): Declare.
15826 (t1, t2): Test using_script.
15827 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15828 (relro_script_test_SOURCES): Define.
15829 (relro_script_test_DEPENDENCIES): Define.
15830 (relro_script_test_LDFLAGS): Define.
15831 (relro_script_test_LDADD): Define.
15832 (relro_script_test.so): New target.
15833 * testsuite/Makefile.in: Rebuild.
15834
f827c9a9
CC
158352008-08-06 Cary Coutant <ccoutant@google.com>
15836
15837 * archive.cc (Archive::total_archives, Archive::total_members)
15838 (Archive::total_members_loaded): New variables.
15839 (Archive::setup): Add parameter. Add option to preread
15840 archive symbols.
15841 (Archive::read_armap): Add counter.
15842 (Archive::get_file_and_offset): New function.
15843 (Archive::get_elf_object_for_member): New function.
15844 (Archive::read_all_symbols): New function.
15845 (Archive::read_symbols): New function.
15846 (Archive::add_symbols): Add counters.
15847 (Archive::include_all_members): Use armap to find members if it's
15848 already built.
15849 (Archive::include_member): Skip reading symbols if already read.
15850 Factored code into Archive::get_file_and_offset and
15851 Archive::get_elf_object_for_member. Changed call to
15852 Mapfile::report_include_archive_member.
15853 (Archive::print_stats): New function.
15854 * archive.h: Declare Object and Read_symbols_data classes.
15855 (Archive::Archive): Add initializers for new members.
15856 (Archive::setup): Add parameter.
15857 (Archive::print_stats): New function.
15858 (Archive::total_archives, Archive::total_members)
15859 (Archive::total_members_loaded): New variables.
15860 (Archive::get_file_and_offset): New function.
15861 (Archive::get_elf_object_for_member): New function.
15862 (Archive::read_all_symbols): New function.
15863 (Archive::read_symbols): New function.
15864 (Archive::Archive_member): New class.
15865 (Archive::members_): New member.
15866 (Archive::num_members_): New member.
15867 * main.cc: Include archive.h.
15868 (main): Call Archive::print_stats.
15869 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15870 archive parameter; member_name is now the fully-decorated name.
15871 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15872 * options.h: (General_options): Add --preread-archive-symbols option.
15873 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15874 Archive::setup.
15875
de4c45bd
ILT
158762008-08-04 Ian Lance Taylor <iant@google.com>
15877
15878 * symtab.h (Symbol::use_plt_offset): New function.
15879 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15880 * powerpc.cc (Relocate::relocate): Likewise.
15881 * sparc.cc (Relocate::relocate): Likewise.
15882 * x86_64.cc (Relocate::relocate): Likewise.
15883 * testsuite/weak_plt.sh: New test.
15884 * testsuite/weak_plt_main.cc: New test.
15885 * testsuite/weak_plt_shared.cc: New test.
15886 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15887 (check_PROGRAMS): Add weak_plt.
15888 (check_DATA): Add weak_plt_shared.so.
15889 (weak_plt_main_pic.o, weak_plt): New targets.
15890 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15891 * testsuite/Makefile.in: Rebuild.
15892
15893 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15894 gcctestdir/ld.
15895 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15896 * testsuite/Makefile.in: Rebuild.
15897
323ee3f4
AM
158982008-08-04 Alan Modra <amodra@bigpond.net.au>
15899
15900 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15901 * Makefile.in: Regenerate.
15902 * po/POTFILES.in: Regenerate.
15903
7c07ecec
ILT
159042008-07-29 Ian Lance Taylor <iant@google.com>
15905
15906 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15907 symbols before other symbols.
15908 * testsuite/script_test_2.cc (test_addr): Declare.
15909 (test_addr_alias): Declare.
15910 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15911 values.
7c07ecec
ILT
15912 * testsuite/script_test_2.t: Define test_addr_alias and
15913 test_addr.
15914
5778530e
ILT
159152008-07-24 Ian Lance Taylor <iant@google.com>
15916
2a00e4fb
ILT
15917 PR 5990
15918 * descriptors.cc: New file.
15919 * descriptors.h: New file.
15920 * gold-threads.h (class Hold_optional_lock): New class.
15921 * fileread.cc: Include "descriptors.h".
15922 (File_read::~File_read): Release descriptor rather than closing
15923 it.
15924 (File_read::open) [file]: Call open_descriptor rather than open.
15925 Set is_descriptor_opened_.
15926 (File_read::open) [memory]: Assert that descriptor is not open.
15927 (File_read::reopen_descriptor): New function.
15928 (File_read::release): Release descriptor.
15929 (File_read::do_read): Make non-const. Reopen descriptor.
15930 (File_read::read): Make non-const.
15931 (File_read::make_view): Reopen descriptor.
15932 (File_read::do_readv): Likewise.
15933 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15934 Update declarations.
15935 * layout.cc: Include "descriptors.h".
15936 (Layout::create_build_id): Use open_descriptor rather than open.
15937 * output.cc: Include "descriptors.h".
15938 (Output_file::open): Use open_descriptor rather than open.
15939 * archive.cc (Archive::const_iterator): Change Archive to be
15940 non-const.
15941 (Archive::begin, Archive::end): Make non-const.
15942 (Archive::count_members): Likewise.
15943 * archive.h (class Archive): Update declarations.
15944 * object.h (Object::read): Make non-const.
15945 * Makefile.am (CCFILES): Add descriptors.cc.
15946 (HFILES): Add descriptors.h.
15947 * Makefile.in: Rebuild.
15948
801647d1
ILT
15949 PR 6716
15950 * gold.h: Always include <clocale>. Add Solaris workarounds
15951 following code in binutils/sysdep.h.
15952
5edd166e
ILT
15953 PR 6048
15954 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15955 this->eh_frame_hdr_ is NULL before using it.
15956
c89ad728
ILT
15957 * dynobj.cc (Versions::Versions): Update comment.
15958
aa86f06b
ILT
15959 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15960 the base version name.
15961
5778530e
ILT
15962 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15963 array size plus one.
15964 (Stringpool_template::set_string_offsets): Subtract one from key
15965 before using it as an array index.
15966 (Stringpool_template::get_offset_with_length): Likewise.
15967 (Stringpool_template::write_to_buffer): Likewise.
15968 * stringpool.h (Stringpool_template::get_offset_from_key):
15969 Likewise.
15970
057ead22
ILT
159712008-07-23 Ian Lance Taylor <iant@google.com>
15972
7f649c59
ILT
15973 PR 6658
15974 * object.h (Merged_symbol_value::value): Do our best to handle a
15975 negative addend.
15976
057ead22
ILT
15977 PR 6647
15978 * script.cc (Version_script_info::get_versions): Don't add empty
15979 version tag to return value.
15980 (Version_script_info::get_symbol_version_helper): Change return
15981 type to bool. Add pversion parameter. Change all callers.
15982 (script_register_vers_node): Don't require a non-NULL tag.
15983 * script.h (class Version_script_info): Update declarations.
15984 (Version_script_info::get_symbol_version): Change return type to
15985 bool. Add version parameter. Change all callers.
15986 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15987 handling. Handle an empty version from a version script.
15988 (Symbol_table::define_special_symbol): Likewise.
15989 * testsuite/ver_test_10.script: New file.
15990 * testsuite/ver_test_10.sh: New file.
15991 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15992 (check_DATA): Add ver_test_10.syms.
15993 (ver_test_10.syms, ver_test_10.so): New target.
15994 * testsuite/Makefile.in: Rebuild.
15995
58e54ac2
CD
159962008-07-23 Simon Baldwin <simonb@google.com>
15997
15998 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15999 to zero for undefined symbols from dynamic libraries.
16000
95d14cd3
ILT
160012008-07-23 Ian Lance Taylor <iant@google.com>
16002
16003 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16004 Change all callers.
16005 * symtab.h (class Symbol_table): Update declaration.
16006 * testsuite/ver_test_9.cc: New file.
16007 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16008 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16009 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16010 (ver_test_9.so, ver_test_9.o): New targets.
16011 * testsuite/Makefile.in: Rebuild.
16012
92de84a6
ILT
160132008-07-22 Ian Lance Taylor <iant@google.com>
16014
34810851
ILT
16015 * options.h (class General_options): Define --check-sections.
16016 * layout.cc (Layout::set_segment_offsets): Handle
16017 --check-sections.
16018
af6156ef
ILT
16019 * options.h (class General_options): Define -n/--nmagic and
16020 -N/--omagic.
16021 * options.cc (General_options::finalize): For -n/--nmagic or
16022 -N/--omagic, set -static.
16023 * layout.cc (Layout::attach_allocated_section_to_segment): If
16024 -N/--omagic, don't put read-only and read-write sections in
16025 different segments.
16026 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16027 finding a read-only segment.
16028 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16029 don't set the minimum segment alignment to the common page size,
16030 and don't set the file offset to the address modulo the page size.
16031 * script-sections.cc (Script_sections::create_segments): If
16032 -n/--omagic, don't put read-only and read-write sections in
16033 different segments.
16034
92de84a6
ILT
16035 * cref.cc: New file.
16036 * cref.h: New file.
16037 * options.h (class General_options): Add --print-symbol-counts.
16038 * main.cc (main): Issue defined symbol report if requested.
16039 * archive.cc (Archive::interpret_header): Make into a const member
16040 function.
16041 (Archive::add_symbols): Call Input_objects::archive_start and
16042 archive_stop.
16043 (Archive::const_iterator): Define new class.
16044 (Archive::begin, Archive::end): New functions.
16045 (Archive::include_all_members): Rewrite to use iterator.
16046 (Archive::count_members): New function.
16047 * archive.h (class Archive): Update declarations.
16048 (Archive::filename): New function.
16049 * object.cc: Include "cref.h".
16050 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16051 (Sized_relobj::do_get_global_symbol_counts): New function.
16052 (Input_objects::add_object): Add object to cross-referencer.
16053 (Input_objects::archive_start): New function.
16054 (Input_objects::archive_stop): New function.
16055 (Input_objects::print_symbol_counts): New function.
16056 * object.h: Declare Cref and Archive.
16057 (Object::get_global_symbol_counts): New function.
16058 (Object::do_get_global_symbol_counts): New pure virtual function.
16059 (class Sized_relobj): Add defined_count_ field. Update
16060 declarations.
16061 (class Input_objects): Add cref_ field. Update constructor.
16062 Update declarations.
16063 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16064 defined_count_.
16065 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16066 symbol counts.
16067 (Sized_dynobj::do_get_global_symbol_counts): New function.
16068 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16069 defined_count_. Update declarations. Define Symbols typedef.
16070 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16071 parameter. Change all callers.
16072 (Symbol_table::add_from_dynobj): Add sympointers and defined
16073 parameters. Change all callers.
16074 * symtab.h (class Symbol_table): Update declarations.
16075 * Makefile.am (CCFILES): Add cref.cc.
16076 (HFILES): Add cref.h.
16077 * Makefile.in: Rebuild.
16078
3f7c5e1d
CD
160792008-07-22 Simon Baldwin <simonb@google.com>
16080
16081 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16082 to zero when writing undefined symbols.
16083
e0b64032
ILT
160842008-07-22 Ian Lance Taylor <iant@google.com>
16085
16086 * output.cc (Output_section::add_input_section): Don't try to
16087 merge empty merge sections.
16088
096b02cf
CS
160892008-07-21 Craig Silverstein <csilvers@google.com>
16090
16091 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16092 Include symbol version in error message.
cd536b21 16093
1d1f116d
CD
160942008-07-20 Chris Demetriou <cgd@google.com>
16095
cd536b21 16096 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16097 (RANDOM_SEED_CFLAGS): New substituted variable.
16098 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16099 * configure: Rebuild.
16100 * Makefile.in: Likewise.
16101 * testsuite/Makefile.in: Likewise.
16102
a18f591e
ILT
161032008-07-18 Ian Lance Taylor <iant@google.com>
16104
16105 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16106 where we see NAME/NULL and NAME/VERSION as separate symbols.
16107 * testsuite/ver_test_main.cc (main): Call t4.
16108 (t4, t4_2a): Define.
16109 * testsuite/ver_test_2.cc (t4_2): Define.
16110 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16111 * testsuite/ver_test_4.cc (t4_2a): Define.
16112 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16113 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16114
c6e3f6ed
ILT
161152008-07-17 Ian Lance Taylor <iant@google.com>
16116
16117 * dynobj.cc (Versions::add_def): If we give an error about a
16118 missing version, go ahead and create the version anyhow.
16119
ef9beddf
ILT
161202008-07-10 Ian Lance Taylor <iant@google.com>
16121
16122 Handle output sections with more than 0x7fffffff bytes.
16123 * object.h (class Relobj): Change map_to_output_ to
16124 output_sections_, and just keep a section pointer. Change all
16125 uses. Move comdat group support to Sized_relobj.
16126 (Relobj::is_section_specially_mapped): Remove.
16127 (Relobj::output_section): Remove poff parameter. Change all
16128 callers.
16129 (Relobj::output_section_offset): New function.
16130 (Relobj::set_section_offset): Rewrite.
16131 (Relobj::map_to_output): Remove.
16132 (Relobj::output_sections): New function.
16133 (Relobj::do_output_section_offset): New pure virtual function.
16134 (Relobj::do_set_section_offset): Likewise.
16135 (class Sized_relobj): Add section_offsets_ field. Add comdat
16136 group support from Relobj. Update declarations.
16137 (Sized_relobj::get_output_section_offset): New function.
16138 (Sized_relobj::do_output_section_offset): New function.
16139 (Sized_relobj::do_set_section_offset): New function.
16140 * object.cc (Relobj::output_section_address): Remove.
16141 (Sized_relobj::Sized_relobj): Initialize new fields.
16142 (Sized_relobj::include_section_group): Cast find_kept_object to
16143 Sized_relobj.
16144 (Sized_relobj::include_linkonce_section): Likewise.
16145 (Sized_relobj::do_layout): Use separate arrays for output section
16146 and output offset.
16147 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16148 output_sections.
16149 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16150 output_sections and section_offsets.
16151 (Sized_relobj::write_local_symbols): Likewise.
16152 (map_to_kept_section): Compute output address directly.
16153 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16154 output_sections and section_offsets.
16155 (Sized_relobj::write_sections): Likewise.
16156 (Sized_relobj::relocate_sections): Likewise.
16157 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16158 * output.h (class Output_reloc): Update declarations. Change
16159 u2_.relobj to Sized_relobj*.
16160 (class Output_data_reloc): Change add functions to use
16161 Sized_relobj*.
16162 * output.cc (Output_reloc::Output_reloc): Change relobj to
16163 Sized_relobj*.
16164 (Output_reloc::local_section_offset): Change return type to
16165 Elf_Addr. Use get_output_section_offset.
16166 (Output_reloc::get_address): Likewise.
16167 (Output_section::is_input_address_mapped): Don't call
16168 is_section_specially_mapped.
16169 (Output_section::output_offset): Likewise.
16170 (Output_section::output_address): Likewise.
16171 (Output_section::starting_output_address): Likewise.
16172 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16173 parameter to Sized_relobj*.
16174 (Copy_relocs::need_copy_reloc): Likewise.
16175 (Copy_relocs::save): Likewise.
16176 * copy-relocs.h (class Copy_relocs): Update declarations.
16177 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16178 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16179 * target-reloc.h (relocate_for_relocatable): Change
16180 offset_in_output_section type to Elf_Addr. Change code that uses
16181 it as well.
16182 * layout.cc (Layout::layout): Always set *off.
16183 * mapfile.cc (Mapfile::print_input_section): Use
16184 output_section_offset.
16185 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16186 Sized_relobj*.
16187 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16188 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16189 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16190
5cb66f97
ILT
161912008-07-03 Ian Lance Taylor <iant@google.com>
16192
16193 * layout.cc (Layout::include_section): Do not discard unrecognized
16194 SHT_STRTAB sections.
16195
afe47622
CS
161962008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16197
16198 * script.cc (Lex::can_continue_name): Make '?' allowable in
16199 version-script names.
16200 * testsuite/version_script.map: Change glob pattern to use '?'
16201
5adf9721
ILT
162022008-06-30 Manish Singh <yosh@gimp.org>
16203
16204 PR 6585
16205 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16206 Correct typo.
16207
e6fde208
ILT
162082008-06-30 Ian Lance Taylor <iant@google.com>
16209
16210 PR 6660
16211 PR 6682
16212 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16213 versions]: Don't try to read the value in the contents, since we
16214 don't use it. Use the template endianness when writing.
16215
3f2e6a2d
CC
162162008-06-25 Cary Coutant <ccoutant@google.com>
16217
16218 * fileread.cc (File_read::make_view): Assert on zero-length view.
16219 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16220 symbol table when there are no symbols to read.
16221
c43d3a48
CS
162222008-06-23 Craig Silverstein <csilvers@google.com>
16223
16224 * version.cc (version_string): Bump to 1.7
16225
5f494ea0
CS
162262008-06-18 Craig Silverstein <csilvers@google.com>
16227
16228 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16229 constant 0xFFFF to type Valtype.
16230 (Powerpc_relocate_functions::rel16_ha): Likewise.
16231
c42e122e
ILT
162322008-06-17 Ian Lance Taylor <iant@google.com>
16233
f34787f8
ILT
16234 * output.h (Output_section::Input_section): Initialize p2align_ to
16235 zero for Output_section_data constructors.
16236 (Output_section::Input_section::addralign): If not an input
16237 section, return the alignment of the Output_section_data.
16238 * testsuite/copy_test.cc: New file.
16239 * testsuite/copy_test_1.cc: New file.
16240 * testsuite/copy_test_2.cc: New file.
16241 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16242 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16243 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16244 (copy_test_1_pic.o, copy_test_1.so): New targets.
16245 (copy_test_2_pic.o, copy_test_2.so): New targets.
16246 * testsuite/Makefile.in: Rebuild.
16247
c42e122e
ILT
16248 * script-sections.cc (Script_sections::place_orphan): Initialize
16249 local variable exact.
16250
ce3ac18a
DE
162512008-06-13 David Edelsohn <edelsohn@gnu.org>
16252
16253 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16254
42cacb20
DE
162552008-06-12 David Edelsohn <edelsohn@gnu.org>
16256 David S. Miller <davem@davemloft.net>
16257
16258 * powerpc.cc: New file.
16259 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16260 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16261 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16262 * Makefile.in: Rebuild.
16263
7b308235
ILT
162642008-06-09 Ian Lance Taylor <iant@google.com>
16265
16266 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16267 <exception>.
16268 (throwing, orig_terminate): New static variables.
16269 (terminate_handler): New static function.
16270 (t2): Set terminate handler.
16271
f0b886e3
ILT
162722008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16273
16274 PR 6584
cd536b21 16275 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16276 alignment.
16277
3e90f135
CC
162782008-05-30 Cary Coutant <ccoutant@google.com>
16279
16280 * archive.cc (Archive::include_all_members) Correct to step
16281 over symbol table and extended name table in thin archives.
16282
e09ad04a
ILT
162832008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16284
16285 PR 6407
16286 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16287 calculation.
16288
62b01cb5
ILT
162892008-05-28 Caleb Howe <cshowe@google.com>
16290
16291 * reduced_debug_output.cc: New file.
16292 * reduced_debug_output.h: New file.
92de84a6 16293 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16294 * options.cc (General_options::finalize): Add strip_debug_non_line
16295 to the strip heirarchy.
16296 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16297 fields.
16298 * layout.cc: Include "reduced_debug_output.h".
16299 (Layout::Layout): Initialize new fields.
16300 (line_only_debug_sections): New static array.
16301 (is_lines_only_debug_sections): New static inline function.
16302 (Layout::include_section): Handle --strip-debug-non-line.
16303 (Layout::make_output_section): If --strip-debug-non-line, build
16304 new output sections for .debug_abbrev and .debug_info.
16305 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16306 gold. Warn about possible overflow.
16307 (read_signed_LEB_128): Likewise.
16308 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16309 (read_signed_LEB_128): Declare.
16310 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16311 (HFILES): Add reduced_debug_output.h.
16312 * Makefile.in: Rebuild.
16313
7d9e3d98
ILT
163142008-05-21 Ian Lance Taylor <iant@google.com>
16315
16316 * mapfile.cc: New file.
16317 * mapfile.h: New file.
16318 * options.h (class General_options): Add -M/--print-map and -Map.
16319 * options.cc (General_options::finalize): Make -M equivalent to
16320 -Map -.
16321 * main.cc: Include <cstdio> and "mapfile.h".
16322 (main): Open mapfile if requested.
16323 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16324 constructor. Change caller.
16325 (queue_initial_tasks): Add mapfile parameter. Change caller.
16326 (queue_middle_tasks): Likewise.
16327 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16328 declarations.
16329 * archive.cc: Include "mapfile.h".
16330 (Archive::add_symbols): Add mapfile parameter. Change all
16331 callers. Pass mapfile, symbol, and reason to include_member.
16332 (Archive::include_all_members): Add mapfile parameter. Change all
16333 callers.
16334 (Archive::include_member): Add mapfile, sym, and why parameters.
16335 Change all callers. Report inclusion to map file.
16336 * archive.h: Include "fileread.h".
16337 (class Archive): Update declarations.
16338 (Archive::file): New const method.
16339 (class Add_archive_symbols): Add mapfile_ field. Update
16340 constructor. Change all callers.
16341 * readsyms.h (class Read_symbols): Likewise.
16342 (class Finish_group): Likewise.
16343 (class Read_script): Likewise.
16344 * common.cc: Include "mapfile.h".
16345 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16346 all callers.
16347 (Symbol_table::do_allocate_commons): Likewise.
16348 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16349 symbol allocation to mapfile.
16350 * common.h (class Allocate_commons_task): Add mapfile_ field.
16351 Update constructor. Change all callers.
16352 * symtab.h (class Symbol_table): Update declarations.
16353 * layout.cc: Include "mapfile.h".
16354 (Layout_task_runner::run): Print information to mapfile.
16355 (Layout::create_gold_note): Change Output_data_fixed_space to
16356 Output_data_zero_fill.
16357 (Layout::create_build_id): Likewise.
16358 (Layout::print_to_mapfile): New function.
16359 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16360 constructor. Change caller.
16361 (class Layout): Declare print_to_mapfile.
16362 * output.cc (Output_section::Input_section::print_to_mapfile): New
16363 function.
16364 (Output_section::add_input_section): If producing a map, always
16365 add to input_sections_ list.
16366 (Output_section::do_print_to_mapfile): New function.
16367 (Output_segment::print_sections_to_mapfile): New function.
16368 (Output_segment::print_section_list_to_mapfile): New function.
16369 * output.h: Include "mapfile.h".
16370 (Output_data::print_to_mapfile): New function.
16371 (Output_data::do_print_to_mapfile): New virtual function.
16372 (Output_segment_headers::do_print_to_mapfile): New function.
16373 (Output_file_header::do_print_to_mapfile): New function.
16374 (Output_data_const::do_print_to_mapfile): New function.
16375 (class Output_data_const_buffer): Add map_name_ field. Update
16376 constructor. Change all callers. Add do_print_to_mapfile
16377 function.
16378 (class Output_data_fixed_space): Likewise.
16379 (class Output_data_space): Likewise.
16380 (class Output_data_zero_fill): New class.
16381 (Output_data_strtab::do_print_to_mapfile): New function.
16382 (Output_data_reloc_base::do_print_to_mapfile): New function.
16383 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16384 (Output_data_group::do_print_to_mapfile): New function.
16385 (Output_data_got::do_print_to_mapfile): New function.
16386 (Output_data_dynamic::do_print_to_mapfile): New function.
16387 (Output_symtab_xindex::do_print_to_mapfile): New function.
16388 (class Output_section): Declare do_print_to_mapflie. Declare
16389 print_to_mapfile in Input_section.
16390 (class Output_segment): Declare new functions.
16391 * object.h (Sized_relobj::symbol_count): New function.
16392 * script-sections.cc
16393 (Output_section_element_dot_assignment::set_section_addresses):
16394 Change Output_data_fixed_space to Output_data_zero_fill.
16395 (Output_data_expression::do_print_to_mapfile): New function.
16396 * script.cc (read_input_script): Add mapfile parameter. Change
16397 all callers.
16398 * script.h (read_input_script): Update declaration.
16399 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16400 (Eh_frame::do_print_to_mapfile): New function.
16401 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16402 (Output_merge_string::do_print_to_mapfile): New function.
16403 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16404 function.
16405 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16406 function.
16407 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16408 function.
16409 * Makefile.am (CCFILES): Add mapfile.cc.
16410 (HFILES): Add mapfile.h.
16411 * Makefile.in: Rebuild.
16412
9f1d377b
ILT
164132008-05-19 Ian Lance Taylor <iant@google.com>
16414
16415 * options.h (class General_options): Add -z relro.
16416 * layout.cc (Layout::Layout): Initialize relro_segment_.
16417 (Layout::add_output_section_data): Return the output section.
16418 (Layout::make_output_section): Rcognize relro sections and mark
16419 them appropriately.
16420 (Layout::attach_allocated_section_to_segment): Put relro sections
16421 in a PT_GNU_RELRO segment.
16422 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16423 section as relro.
16424 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16425 PT_TLS segments.
16426 (Layout::linkonce_mapping): Map d.rel.ro.local to
16427 .data.rel.ro.local.
16428 (Layout::output_section_name): Us .data.rel.ro.local for any
16429 section which begins with that.
16430 * layout.h (class Layout): Update add_output_section_data
16431 declaration. Add relro_segment_ field.
16432 * output.cc (Output_section::Output_section): Initialize is_relro_
16433 and is_relro_local_ fields.
16434 (Output_segment::add_output_section): Group relro sections.
16435 (Output_segment::is_first_section_relro): New function.
16436 (Output_segment::maximum_alignment): If there is a relro section,
16437 align the segment to the common page size.
16438 (Output_segment::set_section_addresses): Track whether we are
16439 looking at relro sections. If the last section is a relro
16440 section, align to the common page size.
16441 (Output_segment::set_section_list_addresses): Add in_relro
16442 parameter. Change all callers. Align to the page size when
16443 moving from relro to non-relro section.
16444 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16445 segment.
16446 * output.h (class Output_section): Add is_relro_ and
16447 is_relro_local_ fields.
16448 (Output_section::is_relro): New function.
16449 (Output_section::set_is_relro): New function.
16450 (Output_section::is_relro_local): New function.
16451 (Output_section::set_is_relro_local): New function.
16452 (class Output_segment): Update declarations.
16453 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16454 * sparc.cc (Target_sparc::got_section): Likewise.
16455 * x86_64.cc (Target_x86_64::got_section): Likewise.
16456 * testsuite/relro_test_main.cc: New file.
16457 * testsuite/relro_test.cc: New file.
16458 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16459 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16460 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16461 (relro_test.so, relro_test_pic.o): New targets.
16462 * testsuite/Makefile.in: Rebuild.
16463
a984ee1d
ILT
164642008-05-16 Ian Lance Taylor <iant@google.com>
16465
01676dcd
ILT
16466 * output.cc (Output_segment::add_output_section): Remove front
16467 parameter.
16468 * output.h (class Output_segment): Remove
16469 add_initial_output_section and overloaded add_output_section.
16470 Update declaration of remaining add_output_section.
16471 * layout.cc (Layout::create_interp): Call add_output_section
16472 rather than add_initial_output_section.
16473 (Layout::finish_dynamic_section): Likewise.
16474
497897f9
ILT
16475 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16476 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16477 know the dynamic type.
16478 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16479 field. Initialize it in constructor.
16480 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16481 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16482 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16483 reloc.
16484
a984ee1d
ILT
16485 * output.cc (Output_reloc::get_address): Change return type to
16486 Elf_Addr.
16487 * output.h (class Output_reloc): Update get_address declaration.
16488 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16489 for section addresses.
16490
55ba0940
ILT
164912008-05-09 Ian Lance Taylor <iant@google.com>
16492
16493 PR 6493
16494 * gold.cc (gold_nomem): Use return value of write.
16495
75517b77
ILT
164962008-05-08 Ian Lance Taylor <iant@google.com>
16497
16498 * symtab.c (Symbol::init_base_output_data): Add version
16499 parameter. Change all callers.
16500 (Symbol::init_base_output_segment): Likewise.
16501 (Symbol::init_base_constant): Likewise.
16502 (Symbol::init_base_undefined): Likewise.
16503 (Sized_symbol::init_output_data): Likewise.
16504 (Sized_symbol::init_output_segment): Likewise.
16505 (Sized_symbol::init_constant): Likewise.
16506 (Sized_symbol::init_undefined): Likewise.
16507 (Symbol_table::do_define_in_output_data): If the new symbol has a
16508 version, mark it as the default.
16509 (Symbol_table::do_define_in_output_segment): Likewise.
16510 (Symbol_table::do_define_as_constant): Likewise.
16511 * symtab.h (class Symbol): Update declarations.
16512 (class Sized_symbol): Likewise.
16513 * resolve.cc (Symbol::override_version): New function.
c42e122e 16514 (Symbol::override_base): Call override_version.
75517b77
ILT
16515 (Symbol::override_base_with_special): Likewise.
16516 * testsuite/ver_script_8.script: New file.
16517 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16518 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16519 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16520 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16521
f1f70eae
ILT
165222008-05-06 Ian Lance Taylor <iant@google.com>
16523
f3e9c5c5
ILT
16524 PR 6049
16525 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16526 functions.
16527 (class General_options): Remove existing --undefined, and add
16528 --no-undefined instead. Add new --undefined as synonym for -u.
16529 * archive.cc (Archive::add_symbols): Check whether symbol was
16530 named with -u.
16531 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16532 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16533 all uses. Add IS_UNDEFINED. Update declarations to split
16534 different versions of init_base. Declare init_base_undefined.
16535 (Symbol::is_defined): Handle IS_UNDEFINED.
16536 (Symbol::is_undefined): Likewise.
16537 (Symbol::is_weak_undefined): Call is_undefined.
16538 (Symbol::is_absolute): Handle IS_CONSTANT.
16539 (class Sized_symbol): Update declarations to split different
16540 versions of init. Declare init_undefined.
16541 (class Symbol_table): Declare new functions.
16542 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16543 Change all callers.
16544 (Symbol::init_base_output_data): Likewise.
16545 (Symbol::init_base_output_segment): Likewise.
16546 (Symbol::init_base_constant): Likewise.
16547 (Symbol::init_base_undefined): New function.
16548 (Sized_symbol::init_object): Rename from init. Change all
16549 callers.
16550 (Sized_symbol::init_output_data): Likewise.
16551 (Sized_symbol::init_output_segment): Likewise.
16552 (Sized_symbol::init_constant): Likewise.
16553 (Sized_symbol::init_undefined): New function.
16554 (Symbol_table::add_undefined_symbols_from_command_line): New
16555 function.
16556 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16557 function.
16558 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16559 (Symbol::output_section): Likewise.
16560 (Symbol::set_output_section): Likewise.
16561 (Symbol_table::sized_finalize_symbol): Likewise.
16562 (Symbol_table::sized_write_globals): Likewise.
16563 * resolve.cc (Symbol_table::should_override): Likewise.
16564 (Symbol::override_base_with_special): Likewise.
16565
8bdcdf2c
ILT
16566 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16567 symbol, change it to have default visibility.
16568 * testsuite/protected_1.cc: New file.
16569 * testsuite/protected_2.cc: New file.
16570 * testsuite/protected_3.cc: New file.
16571 * testsuite/protected_main_1.cc: New file.
16572 * testsuite/protected_main_2.cc: New file.
16573 * testsuite/protected_main_3.cc: New file.
16574 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16575 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16576 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16577 (protected_1.so): New target.
16578 (protected_1_pic.o, protected_2_pic.o): New targets.
16579 (protected_3_pic.o): New target.
16580 (check_PROGRAMS): Add protected_2.
16581 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16582 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16583 * testsuite/Makefile.in: Rebuild.
16584
2b706932
ILT
16585 * options.h (DEFINE_var): Add set_user_set_##varname__.
16586 (DEFINE_bool_alias): New macro.
16587 (class General_options): Define -Bstatic using DEFINE_bool_alias
16588 rather than DEFINE_special. Add --undefined as an alias for -z
16589 defs.
16590 * options.cc (General_options::parse_Bstatic): Remove.
16591
d82a5bcc
ILT
16592 * options.h (class General_options): Add --fatal-warnings.
16593 * main.cc (main): Implement --fatal-warnings.
16594 * errors.h (Errors::warning_count): New function.
16595
f1f70eae
ILT
16596 * options.h (class General_options): Add -Bsymbolic-functions.
16597 * symtab.h (Symbol::is_preemptible): Check for
16598 -Bsymbolic-functions.
16599
8825ac63
ILT
166002008-05-05 Ian Lance Taylor <iant@google.com>
16601
d98bc257
ILT
16602 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16603 as noVARNAME rather than no-VARNAME.
16604 (class General_options): Add option -z combreloc.
16605 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16606 get_address.
16607 (Output_reloc::sort_before) [SHT_REL]: New function.
16608 (Output_reloc::sort_before) [SHT_RELA]: New function.
16609 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16610 Sort_relocs_comparison.
16611 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16612 parameter. Change all callers.
16613 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16614 sort_relocs parameter. Change all callers.
16615 * output.cc (Output_reloc::get_address): New function, broken out
16616 of write_rel.
16617 (Output_reloc::write_rel): Call it.
16618 (Output_reloc::compare): New function.
16619 (Output_data_reloc_base::do_write): Optionally sort relocs.
16620
60b2b4e7
ILT
16621 * configure.ac: If targ_extra_obj is set, link it in.
16622 * configure.tgt: Initialize all variables.
16623 (x86_64*): Set targ_extra_obj and targ_extra_size.
16624 * configure: Rebuild.
16625
8825ac63
ILT
16626 * object.cc (Sized_relobj::include_section_group): Adjust section
16627 indexes read from group data. Build vector to pass to
16628 layout_group.
16629 * layout.cc (Layout::layout_group): Add flags and shndxes
16630 parameters. Remove contents parameter. Change caller. Update
16631 explicit instantiations.
16632 * layout.h (class Layout): Update layout_group declaration.
16633 * output.cc (Output_data_group::Output_data_group): Add flags and
16634 input_shndxes parameters. Remove contents parameter. Change
16635 caller.
16636 (Output_data_group::do_write): Change input_sections_ to
16637 input_shndxes_.
16638 * output.h (class Output_data_group): Update constructor
16639 declaration. Rename input_sections_ to input_shndxes_.
16640 * testsuite/many_sections_test.cc: Add template.
16641
e94cf127
CC
166422008-04-30 Cary Coutant <ccoutant@google.com>
16643
4418b2d5
CC
16644 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16645
e94cf127
CC
16646 * layout.cc (Layout::include_section): Refactored check for debug
16647 info section.
16648 (Layout::add_comdat): Add new parameters. Change type
16649 of signature parameter. Add object and shndx to signatures table.
16650 (Layout::find_kept_object): New function.
16651 * layout.h: Include <cstring>.
16652 (Layout::is_debug_info_section): New function.
16653 (Layout::add_comdat): Add new parameters.
16654 (Layout::find_kept_object): New function.
16655 (Layout::Kept_section): New struct.
16656 (Layout::Signatures): Change type of map range.
16657 * object.cc (Relobj::output_section_address): New function.
16658 (Sized_relobj::include_section_group): Add new parameters. Change
16659 calls to Layout::add_comdat. Change to build table of kept comdat
16660 groups and table mapping discarded sections to kept sections.
16661 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16662 (Sized_relobj::do_layout): Change calls to include_section_group and
16663 include_linkonce_section.
16664 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16665 value to zero when section is discarded.
16666 (Sized_relobj::map_to_kept_section): New function.
16667 * object.h (Relobj::output_section_address): New function.
16668 (Relobj::Comdat_group): New type.
16669 (Relobj::find_comdat_group): New function.
16670 (Relobj::Comdat_group_table): New type.
16671 (Relobj::Kept_comdat_section): New type.
16672 (Relobj::Kept_comdat_section_table): New type.
16673 (Relobj::add_comdat_group): New function.
16674 (Relobj::set_kept_comdat_section): New function.
16675 (Relobj::get_kept_comdat_section): New function.
16676 (Relobj::comdat_groups_): New field.
16677 (Relobj::kept_comdat_sections_): New field.
16678 (Symbol_value::input_value): Update comment.
16679 (Sized_relobj::map_to_kept_section) New function.
16680 (Sized_relobj::include_linkonce_section): Add new parameter.
16681 * target-reloc.h (Comdat_behavior): New type.
16682 (get_comdat_behavior): New function.
16683 (relocate_section): Add code to map a discarded section to the
16684 corresponding kept section when applying a relocation.
16685
e4e5049b
CS
166862008-04-30 Craig Silverstein <csilvers@google.com>
16687
16688 * dwarf_reader.cc (next_generation_count): New static var.
16689 (Addr2line_cache_entry): New struct.
16690 (addr2line_cache): New static var.
16691 (Dwarf_line_info::one_addr2line): Added caching.
16692 (Dwarf_line_info::clear_addr2line_cache): New function.
16693 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16694 cache-size parameter.
16695 (Dwarf_line_info::one_addr2line_cache): New function.
16696 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16697 new cache-size argument to one_addr2line(), and clear cache.
16698
d09e9154
CC
166992008-04-28 Cary Coutant <ccoutant@google.com>
16700
16701 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16702 R_386_PC8 relocations.
16703
7ef73768
ILT
167042008-04-23 Ian Lance Taylor <iant@google.com>
16705
55438702
ILT
16706 * object.cc (Sized_relobj::include_section_group): Check for
16707 invalid section group.
16708
c165fb93
ILT
16709 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16710 header size.
16711
7ef73768
ILT
16712 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16713 than read for file header.
16714 * archive.cc (Archive::include_member): Likewise.
16715
6194aaab
L
167162008-04-23 Paolo Bonzini <bonzini@gnu.org>
16717
16718 * aclocal.m4: Regenerate.
16719 * configure: Regenerate.
16720
d491d34e
ILT
167212008-04-19 Ian Lance Taylor <iant@google.com>
16722
5ea2bac6
ILT
16723 * version.cc (version_string): Bump to 1.6.
16724
7bc3e21a
ILT
16725 * testsuite/Makefile.am (many_sections_r_test): New target.
16726 (many_sections_r_test_SOURCES): Remove.
16727 (many_sections_r_test_DEPENDENCIES): Remove.
16728 (many_sections_r_test_LDFLAGS): Remove.
16729 (many_sections_r_test_LDADD): Remove.
16730
7fcd3aa9
ILT
16731 * object.cc (Sized_relobj::do_add_symbols): Always pass
16732 local_symbol_count_ to add_from_relobj.
16733
4c94d6ae
ILT
16734 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16735 every thousand variables.
16736 * testsuite/Makefile.in: Rebuild.
16737
d491d34e
ILT
16738 * object.cc (Xindex::initialize_symtab_xindex): New function.
16739 (Xindex::read_symtab_xindex): New function.
16740 (Xindex::sym_xindex_to_shndx): New function.
16741 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16742 available.
16743 (Sized_relobj::do_initialize_xindex): New function.
16744 (Sized_relobj::do_read_symbols): Adjust section links.
16745 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16746 parameter. Change all callers.
16747 (Sized_relobj::include_section_group): Adjust section links and
16748 symbol section indexes.
16749 (Sized_relobj::do_layout): Adjust section links.
16750 (Sized_relobj::do_count_local_symbols): Adjust section links and
16751 symbol section indexes.
16752 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16753 ordinary and special symbols.
16754 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16755 dynsym_xindex parameters. Change all callers. Adjust section
16756 links. Use SHN_XINDEX when needed.
16757 (Sized_relobj::get_symbol_location_info): Adjust section links.
16758 Don't get fooled by special symbols.
16759 * object.h (class Xindex): Define.
16760 (class Object): Add xindex_ parameter. Declare virtual functoin
16761 do_initialize_xindex.
16762 (Object::adjust_sym_shndx): New function.
16763 (Object::set_xindex): New protected function.
16764 (class Symbol_value): Add is_ordinary_shndx_ field.
16765 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16766 (Symbol_value::value): Assert ordinary section.
16767 (Symbol_value::initialize_input_to_output_map): Likewise.
16768 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16769 Change all callers.
16770 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16771 all callers.
16772 (class Sized_relobj): Update declarations.
16773 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16774 parameter. Change all callers.
16775 (Sized_relobj::adjust_shndx): New function.
16776 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16777 field.
16778 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16779 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16780 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16781 (Sized_dynobj::read_dynsym_section): Adjust section links.
16782 (Sized_dynobj::read_dynamic): Likewise.
16783 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16784 section links.
16785 (Sized_dynobj::do_initialize_xindex): New function.
16786 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16787 do_initialize_xindex.
16788 (Sized_dynobj::adjust_shndx): New function.
16789 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16790 dynsym_xindex_ fields.
16791 (Layout::finalize): Add a call to set_section_indexes before
16792 creating the symtab sections.
16793 (Layout::set_section_indexes): Don't do anything if the section
16794 already has a section index.
16795 (Layout::create_symtab_sections): Add shnum parameter. Change
16796 caller. Create .symtab_shndx section if needed.
16797 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16798 caller.
16799 (Layout::allocated_output_section_count): New function.
16800 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16801 needed.
16802 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16803 fields. Update declarations.
16804 (Layout::symtab_xindex): New function.
16805 (Layout::dynsym_xindex): New function.
16806 (class Write_symbols_task): Add layout_ field.
16807 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16808 Change caller.
16809 * output.cc (Output_section_headers::Output_section_headers): Add
16810 shstrtab_section parameter. Change all callers.
16811 (Output_section_headers::do_sized_write): Store overflow values
16812 for section count and section string table section index in
16813 section header zero.
16814 (Output_file_header::do_sized_write): Check for overflow of
16815 section count and section string table section index.
16816 (Output_symtab_xindex::do_write): New function.
16817 (Output_symtab_xindex::endian_do_write): New function.
16818 * output.h (class Output_section_headers): Add shstrtab_section_.
16819 Update declarations.
16820 (class Output_symtab_xindex): Define.
16821 (Output_section::has_out_shndx): New function.
16822 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16823 field.
16824 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16825 Change all callers.
16826 (Sized_symbol::init): Likewise.
16827 (Symbol::output_section): Check for ordinary symbol.
16828 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16829 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16830 callers.
16831 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16832 Change all callers. Simplify handling of symbols from sections
16833 not included in the link.
16834 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16835 distinction.
16836 (Weak_alias_sorter::operator()): Assert that symbols are
16837 ordinary.
16838 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16839 distinction.
16840 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16841 parameters. Change all callers.
16842 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16843 symbol distinction. Use SHN_XINDEX when needed.
16844 (Symbol_table::write_section_symbol): Add symtab_xindex
16845 parameter. Change all callers.
16846 (Symbol_table::sized_write_section_symbol): Likewise. Use
16847 SHN_XINDEX when needed.
16848 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16849 declarations.
16850 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16851 (Symbol::is_defined): Check is_ordinary.
16852 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16853 (Symbol::is_absolute, Symbol::is_common): Likewise.
16854 (class Sized_symbol): Update declarations.
16855 (class Symbol_table): Update declarations.
16856 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16857 parameters. Change all callers.
16858 (Sized_symbol::override): Likewise.
16859 (Symbol_table::override): Likewise.
16860 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16861 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16862 is_ordinary, and orig_st_shndx parameters. Change all callers.
16863 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16864 to be in an ordinary section.
16865 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16866 object and is_ordinary parameters. Change all callers.
16867 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16868 Change all callers. Don't add undefined or non-ordinary symbols
16869 to reloc_map_.
16870 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16871 Change all callers.
16872 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16873 declarations.
16874 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16875 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16876 (Sized_relobj::relocate_sections): Likewise.
16877 * target-reloc.h (scan_relocs): Adjust section symbol index.
16878 (scan_relocatable_relocs): Likewise.
16879 * i386.cc (Scan::local): Check for ordinary symbols.
16880 * sparc.cc (Scan::local): Likewise.
16881 * x86_64.cc (Scan::local): Likewise.
16882 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16883 to symbol_section_and_value.
16884 * testsuite/many_sections_test.cc: New file.
16885 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16886 (check_PROGRAMS): Add many_sections_test.
16887 (many_sections_test_SOURCES): Define.
16888 (many_sections_test_DEPENDENCIES): Define.
16889 (many_sections_test_LDFLAGS): Define.
16890 (BUILT_SOURCES): Add many_sections_define.h.
16891 (many_sections_define.h): New target.
16892 (BUILT_SOURCES): Add many_sections_check.h.
16893 (many_sections_check.h): New target.
16894 (check_PROGRAMS): Add many_sections_r_test.
16895 (many_sections_r_test_SOURCES): Define.
16896 (many_sections_r_test_DEPENDENCIES): Define.
16897 (many_sections_r_test_LDFLAGS): Define.
16898 (many_sections_r_test_LDADD): Define.
16899 (many_sections_r_test.o): New target.
16900 * testsuite/Makefile.in: Rebuild.
16901
c5818ff1
CC
169022008-04-17 Cary Coutant <ccoutant@google.com>
16903
16904 * errors.cc (Errors::info): New function.
16905 (gold_info): New function.
16906 * errors.h (Errors::info): New function.
16907 * gold.h (gold_info): New function.
16908 * object.cc (Input_objects::add_object): Print trace output.
16909 * options.cc (options::parse_set): New function.
16910 (General_options::parse_wrap): Deleted.
16911 (General_options::General_options): Deleted initializer.
16912 * options.h (options::String_set): New typedef.
16913 (options::parse_set): New function.
16914 (DEFINE_set): New macro.
16915 (General_options::wrap): Changed to use DEFINE_set. Changed
16916 callers of any_wrap_symbols and is_wrap_symbol.
16917 (General_options::trace, General_options::trace_symbol):
16918 New options.
16919 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16920 (General_options::wrap_symbols_): Deleted.
16921 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16922
b5be4a7c
DM
169232008-04-17 David S. Miller <davem@davemloft.net>
16924
16925 * options.cc (General_options::parse_V): New function.
16926 * options.h: Add entries for -V and -Qy.
16927
155a0dd7
ILT
169282008-04-17 Ian Lance Taylor <iant@google.com>
16929
16930 * common.cc (Symbol_table::allocate_commons): Remove options
16931 parameter. Change caller.
16932 (Symbol_table::do_allocate_commons): Remove options parameter.
16933 Change caller. Just call do_allocate_commons_list twice.
16934 (Symbol_table::do_allocate_commons_list): New function, broken out
16935 of do_allocate_commons.
16936 * common.h (class Allocate_commons_task): Remove options_ field.
16937 Update constructor.
16938 * symtab.cc (Symbol_table::Symbol_table): Initialize
16939 tls_commons_.
16940 (Symbol_table::add_from_object): Put TLS common symbols on
16941 tls_commons_ list.
16942 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16943 which are IN_OUTPUT_DATA.
16944 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16945 allocate_commons and do_allocate_commons declarations. Declare
16946 do_allocate_commons_list.
16947 * gold.cc (queue_middle_tasks): Update creation of
16948 Allocate_commons_task to not pass options.
16949 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16950 (TLS_TEST_C_FLAGS): New variable.
16951 (tls_test_c_pic.o): New target.
16952 (tls_test_shared.so): Link in tls_test_c_pic.o.
16953 (tls_test_c_pic_ie.o): New target.
16954 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16955 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16956 (tls_test_c.o): New target.
16957 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16958 (tls_pic_test_LDADD): Likewise.
16959 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16960 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16961 (tls_test_c_gnu2.o): New target.
16962 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16963 tls_test_c_gnu2.o.
16964 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16965 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16966 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16967 * testsuite/tls_test.cc: Include "config.h".
16968 (t_last): Call t11_last.
16969 * testsuite/tls_test.h (t11, t11_last): Declare.
16970 * testsuite/tls_test_c.c: New file.
16971 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16972 * configure.ac: Check for OpenMP support.
16973 * configure, config.in, Makefile.in: Rebuild.
16974 * testsuite/Makefile.in: Rebuild.
16975
edfbb029
CC
169762008-04-16 Cary Coutant <ccoutant@google.com>
16977
16978 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16979 (Target_i386::tls_base_symbol_defined_): New field.
16980 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16981 (Target_i386::Scan::global): Likewise.
16982 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16983 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16984 (Target_x86_64::tls_base_symbol_defined_): New field.
16985 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16986 (Target_x86_64::Scan::global): Likewise.
16987
f3c69fca
CC
169882008-04-16 Cary Coutant <ccoutant@google.com>
16989
16990 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16991 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16992 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16993 building shared libraries.
16994 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16995 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16996 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16997 * testsuite/Makefile.in: Rebuild.
16998 * testsuite/weak_undef.h: New file.
16999 * testsuite/weak_undef_file1.cc: Add extra test cases.
17000 * testsuite/weak_undef_file2.cc: Likewise.
17001 * testsuite/weak_undef_test.cc: Likewise.
17002
7c414435
DM
170032008-04-16 David S. Miller <davem@davemloft.net>
17004
32b769e1
DM
17005 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17006 Add issued_non_pic_error_ field. Declare check_non_pic.
17007 (Target_sparc::Scan::check_non_pic): New function.
17008 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17009 (Target_sparc::Scan::global): Likewise.
17010
11936fb1
DM
17011 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17012 * configure: Rebuild.
17013
7c414435
DM
17014 * options.h (DEFINE_enable): New macro.
17015 (new_dtags): New enable option.
17016 (initfirst, interpose, loadfltr, nodefaultlib,
17017 nodelete, nodlopen, nodump): New -z options.
17018 * layout.cc (Layout:finish_dynamic_section): If new
17019 dtags enabled, emit DT_RUNPATH. Also, emit a
17020 DT_FLAGS_1 containing any specified -z flags.
17021
85c7bf8b
ILT
170222008-04-16 Ian Lance Taylor <iant@google.com>
17023
12c0daef
ILT
17024 * copy-relocs.cc: New file.
17025 * copy-relocs.h: New file.
17026 * reloc.cc: Remove Copy_relocs code.
17027 * reloc.h: Likewise.
17028 * reloc-types.h (struct Reloc_types) [both versions]: Add
17029 get_reloc_addend_noerror.
17030 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17031 variants of add_global which take an addend which must be zero.
17032 * i386.cc: Include "copy-relocs.h".
17033 (class Target_i386): Change type of copy_relocs_ to variable,
17034 update initializer.
17035 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17036 Change all callers.
17037 (Target_i386::do_finalize_sections): Change handling of
17038 copy_relocs_.
17039 * sparc.cc: Include "copy-relocs.h".
17040 (class Target_sparc): Change type of copy_relocs_ to variable,
17041 update initializer.
17042 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17043 Change all callers.
17044 (Target_sparc::do_finalize_sections): Change handling of
17045 copy_relocs_.
17046 * x86_64.cc: Include "copy-relocs.h".
17047 (class Target_x86_64): Change type of copy_relocs_ to variable,
17048 update initializer.
17049 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17050 class. Change all callers.
17051 (Target_x86_64::do_finalize_sections): Change handling of
17052 copy_relocs_.
17053 * Makefile.am (CCFILES): Add copy-relocs.cc.
17054 (HFILES): Add copy-relocs.h.
17055
4f4995b6
ILT
17056 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17057
85c7bf8b
ILT
17058 * testsuite/script_test_4.sh: Permit leading zeroes.
17059
4f2a9edd
ILT
170602008-04-15 Ian Lance Taylor <iant@google.com>
17061
e6188289
ILT
17062 * script-sections.cc (Script_sections::create_segments): Use
17063 header_size_adjustment even when there is enough room for the
17064 headers.
17065 * testsuite/script_test_4.sh: New file.
17066 * testsuite/script_test_4.t: New file.
17067 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17068 (check_DATA): Add script_test_4.stdout.
17069 (MOSTLYCLEANFILES): Likewise.
17070 (script_test_4): New target.
17071 (script_test_4.stdout): New target.
17072 * testsuite/Makefile.in: Rebuild.
17073
4f2a9edd
ILT
17074 * sparc.cc: Add definitions for Output_data_plt_sparc class
17075 constants.
17076
f5314dd5
DM
170772008-04-14 David S. Miller <davem@davemloft.net>
17078
17079 * sparc.cc: New file.
17080 * Makefile.am (TARGETSOURCES): Add sparc.cc
17081 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17082 * configure.tgt: Document targ_extra_size and
17083 targ_extra_big_endian. Add entries for sparc-* and
17084 sparc64-*.
17085 * configure.ac: Handle targ_extra_size and
17086 targ_extra_big_endian.
17087 * Makefile.in: Rebuild.
17088 * configure: Likewise.
17089 * po/POTFILES.in: Likewise.
17090 * po/gold.pot: Likewise.
17091
154e0e9a
ILT
170922008-04-14 Ian Lance Taylor <iant@google.com>
17093
17094 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17095 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17096 in the name/type/flags to section mapping. Don't call
17097 allocate_output_section.
17098 (Layout::choose_output_section): Change parameter from adjust_name
17099 to is_input_section. Don't permit input sections after sections
17100 are attached to segments. Don't call allocate_output_section.
17101 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17102 not write_enable_output_section.
17103 (Layout::make_output_section): Don't push to
17104 unattached_section_list_ nor call attach_to_segment. Call
17105 attach_section_to_segment if sections are attached.
17106 (Layout::attach_sections_to_segments): New function.
17107 (Layout::attach_section_to_segment): New function.
17108 (Layout::attach_allocated_section_to_segment): Rename from
17109 attach_to_segment. Remove flags parameter.
17110 (Layout::allocate_output_section): Remove function.
17111 (Layout::write_enable_output_section): Remove function.
17112 * layout.h (class Layout): Update for above changes. Add new
17113 field sections_are_attached_.
17114 * output.h (Output_section::update_flags_for_input_section): New
17115 function.
17116 * output.cc (Output_section::add_input_section): Call
17117 update_flags_for_input_section.
17118 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17119
009a67a2
CC
171202008-04-11 Cary Coutant <ccoutant@google.com>
17121
17122 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17123 thought unnecessary.
17124 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17125
759b1a24
ILT
171262008-04-11 Ian Lance Taylor <iant@google.com>
17127
17128 * output.h (class Output_section_data): Remove inline definition
17129 of set_addralign.
17130 * output.cc (Output_section_data::set_addralign): New function.
17131
c2b45e22
CC
171322008-04-11 Cary Coutant <ccoutant@google.com>
17133
17134 Add support for TLS descriptors for i386 and x86_64.
17135 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17136 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17137 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17138 GOT_TYPE_TLS_DESC.
17139 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17140 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17141 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17142 relocations.
17143 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17144 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17145 Fix problem with initial-exec relocations.
17146 (Target_i386::Relocate::relocate_tls): Likewise.
17147 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17148 relaxation.
17149 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17150 support for section-plus-offset dynamic table entries.
17151 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17152 (Output_data_dynamic::Dynamic_entry): Add support for
17153 section-plus-offset dynamic table entries.
17154 (Output_data_dynamic::Classification): Likewise.
17155 (Output_data_dynamic::classification_): Renamed offset_.
17156 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17157 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17158 (Target_x86_64::make_plt_section): New function.
17159 (Target_x86_64::reserve_tlsdesc_entries): New function.
17160 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17161 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17162 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17163 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17164 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17165 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17166 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17167 add extra PLT entry for TLS descriptors.
17168 (Output_data_plt_x86_64::got_): New field.
17169 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17170 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17171 fields.
17172 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17173 descriptors.
17174 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17175 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17176 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17177 R_386_TLS_DESC_CALL relocations.
17178 (Target_x86_64::Scan::global): Likewise.
17179 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17180 for TLS descriptors.
17181 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17182 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17183 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17184 GD-to-IE relaxation.
17185 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17186 and TLS_DESCRIPTORS.
17187 * Makefile.in: Rebuild.
17188 * configure: Rebuild.
17189 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17190 (tls_test_shared2.so): New target.
17191 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17192 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17193 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17194 (tls_shared_gd_to_ie_test_LDADD): New variable.
17195 (tls_shared_gnu2_gd_to_ie_test): New target.
17196 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17197 New targets.
17198 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17199 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17200 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17201 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17202 (tls_shared_gnu2_test): New target.
17203 (tls_test_gnu2_shared.so): New target.
17204 (tls_shared_gnu2_test_SOURCES): New variable.
17205 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17206 (tls_shared_gnu2_test_LDFLAGS): New variable.
17207 (tls_shared_gnu2_test_LDADD): New variable.
17208 * testsuite/Makefile.in: Rebuild.
17209 * testsuite/Makefile.
17210
83bfb6b7
ILT
172112008-04-11 Ian Lance Taylor <iant@google.com>
17212
17213 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17214 justsyms.t.
17215 * testsuite/Makefile.in: Rebuild.
17216
17217 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17218 long.
17219 * testsuite/script_test_2.cc (main): Adjust test.
17220
706e1f5e
ILT
172212008-04-11 David S. Miller <davem@davemloft.net>
17222 Ian Lance Taylor <iant@google.com>
17223
17224 * options.h (General_options): Add entries for '-Y' and
17225 '-relax'.
17226 * options.cc (General_options:finalize): If -Y was used, add those
17227 entries to the library path instead of the default "/lib" and
17228 "/usr/lib".
17229
7c98e6bb
DM
172302008-04-11 David S. Miller <davem@davemloft.net>
17231
17232 * testsuite/justsyms.t: Start at 0x100.
17233 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17234 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17235 long.
17236 * testsuite/script_test_2.cc: Adjust string and section length
17237 checks.
7c98e6bb 17238
99a37bfd
ILT
172392008-04-09 Ian Lance Taylor <iant@google.com>
17240
2cefc357
ILT
17241 PR gold/5996
17242 * script-sections.cc (Sections_element::allocate_to_segment): Add
17243 orphan parameter.
17244 (Output_section_definition::allocate_to_segment): Likewise.
17245 (Orphan_output_section::allocate_to_segment): Likewise.
17246 (Script_sections::attach_sections_using_phdrs_clause): Don't
17247 propagate non-PT_LOAD segments to orphan sections.
17248 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17249 readelf rather than objdump.
17250 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17251 .interp section and PT_INTERP segment are the same size.
17252 * testsuite/Makefile.in: Rebuild.
17253
99a37bfd
ILT
17254 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17255 aliases for symbols defined in the same object.
17256 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17257 (weak_alias_test_SOURCES): New variable.
17258 (weak_alias_test_DEPENDENCIES): New variable.
17259 (weak_alias_test_LDFLAGS): New variable.
17260 (weak_alias_test_LDADD): New variable.
17261 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17262 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17263 (weak_alias_test_3.o): New target.
17264 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17265 * testsuite/weak_alias_test_main.cc: New file.
17266 * testsuite/weak_alias_test_1.cc: New file.
17267 * testsuite/weak_alias_test_2.cc: New file.
17268 * testsuite/weak_alias_test_3.cc: New file.
17269
780e49c5
ILT
172702008-04-08 Ian Lance Taylor <iant@google.com>
17271
cdb0b8f5
ILT
17272 * options.h (class General_options): Add --noinhibit-exec option.
17273 * main.cc (main): Check --noinhibit-exec.
17274
0864d551
ILT
17275 * options.h (class General_options): Define --wrap as a special
17276 option. Add wrap_symbols_ field.
17277 (General_options::any_wrap_symbols): New function.
17278 (General_options::is_wrap_symbol): New function.
17279 * options.cc (General_options::parse_wrap): New function.
17280 (General_options::General_options): Initialize wrap_symbols_.
17281 * symtab.cc (Symbol_table::wrap_symbol): New function.
17282 (Symbol_table::add_from_object): Handle --wrap.
17283 * symtab.h (class Symbol_table): Declare wrap_symbol.
17284 * target.h (Target::wrap_char): New function.
17285 (Target::Target_info): Add wrap_char field.
17286 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17287 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17288 * testsuite/testfile.cc (Target_test::test_target_info):
17289 Likewise.
17290
789aa6de
ILT
17291 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17292 there is one.
17293
2c38906f
ILT
17294 * layout.h (class Layout): Add added_eh_frame_data_ field.
17295 * layout.cc (Layout::Layout): Initialize new field.
17296 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17297 output section until we find a section we merged successfully.
17298 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17299 that the size be non-zero.
17300
780e49c5
ILT
17301 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17302 qualifier.
17303
7fcd0256
ILT
173042008-04-08 Craig Silverstein <csilvers@google.com>
17305
17306 * configure.ac: Export new conditional variable HAVE_ZLIB.
17307 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17308 on HAVE_ZLIB.
17309 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17310 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17311
6835af53
ILT
173122008-04-07 Ian Lance Taylor <iant@google.com>
17313
e24f324c
ILT
17314 * version.cc (version_string): Set to "1.5".
17315
a036edd8
ILT
17316 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17317 Add issued_non_pic_error_ field. Declare check_non_pic.
17318 (Target_x86_64::Scan::check_non_pic): New function.
17319 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17320 (Target_x86_64::Scan::global): Likewise.
17321
624f8810
ILT
17322 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17323 addend parameter. Change caller. Handle merge sections.
17324 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17325 Address to Addend. Don't add in the result of
17326 local_section_offset, pass down the addend and use the returned
17327 value.
17328 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17329 Update declarations of local_section_offset and symbol_value.
17330 * testsuite/two_file_test_1.cc (t18): New function.
17331 * testsuite/two_file_test_2.cc (f18): New function.
17332 * testsuite/two_file_test_main.cc (main): Call t18.
17333 * testsuite/two_file_test.h (t18, f18): Declare.
17334
6835af53
ILT
17335 * configure.ac: Don't test for objdump, c++filt, or readelf.
17336 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17337 conditionals.
17338 (TEST_READELF): New variable.
17339 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17340 (check_PROGRAMS): Add two_file_strip_test.
17341 (two_file_strip_test): New target.
17342 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17343 (two_file_same_shared_strip_test_SOURCES): New variable.
17344 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17345 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17346 (two_file_same_shared_strip_test_LDADD): New variable.
17347 (two_file_shared_strip.so): New target.
17348 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17349 (ver_test_5.syms, ver_test_7.syms): Likewise.
17350 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17351 (strip_test_3.stdout): Use TEST_OBJDUMP.
17352 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17353
86925eef
CC
173542008-04-04 Cary Coutant <ccoutant@google.com>
17355
17356 * symtab.h (Symbol::is_weak_undefined): New function.
17357 (Symbol::is_strong_undefined): New function.
17358 (Symbol::is_absolute): New function.
17359 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17360 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17361 absolute symbols.
17362 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17363 (weak_undef_test): New target.
17364 * testsuite/Makefile.in: Rebuild.
17365 * testsuite/weak_undef_file1.cc: New file.
17366 * testsuite/weak_undef_file2.cc: New file.
17367 * testsuite/weak_undef_test.cc: New file.
17368
126f3ece
ILT
173692008-04-03 Craig Silverstein <csilvers@google.com>
17370
17371 * compressed_output.h (class Output_compressed_section): Use
17372 unsigned buffer.
17373 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17374 add zlib header.
17375 (zlib_compressed_suffix): Removed.
17376 (Output_compressed_section::set_final_data_size): Use unsigned
17377 buffers.
17378 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17379 Fix linker invocation.
17380 (flagstest_o_specialfile_and_compress_debug_sections):
17381 Likewise.
17382 * testsuite/Makefile.in: Regenerated.
17383
deae2a14
DM
173842008-04-02 David S. Miller <davem@davemloft.net>
17385
17386 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17387 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17388
70752818
ILT
173892008-04-02 Craig Silverstein <csilvers@google.com>
17390
17391 * TODO: New file.
17392
39d0cb0e
ILT
173932008-04-02 Ian Lance Taylor <iant@google.com>
17394
17395 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17396 parameters. Update for new key type to views_. Change all
17397 callers.
17398 (File_read::read): Adjust for byteshift in returned view.
17399 (File_read::add_view): New function, broken out of
17400 find_and_make_view.
17401 (File_read::make_view): New function, broken out of
17402 find_and_make_view.
17403 (File_read::find_or_make_view): Add offset and aligned
17404 parameters. Rewrite accordingly. Change all callers.
17405 (File_read::get_view): Add offset and aligned parameters. Adjust
17406 for byteshift in return value.
17407 (File_read::get_lasting_view): Likewise.
17408 * fileread.h (class File_read): Update declarations.
17409 (class File_read::View): Add byteshift_ field. Add byteshift to
17410 constructor. Add byteshift method.
17411 * archive.h (Archive::clear_uncached_views): New function.
17412 (Archive::get_view): Add aligned parameter. Change all callers.
17413 * object.h (Object::get_view): Add aligned parameter. Change all
17414 callers.
17415 (Object::get_lasting_view): Likewise.
17416
17417 * fileread.cc (File_read::release): Don't call clear_views if
17418 there are multiple objects.
17419 * fileread.h (File_read::clear_uncached_views): New function.
17420 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17421 on the archive.
17422
a1207466
CC
174232008-03-31 Cary Coutant <ccoutant@google.com>
17424
17425 Add thin archive support.
17426 * archive.cc (Archive::armagt): New const.
17427 (Archive::setup): Remove task parameter and calls to unlock.
17428 (Archive::unlock_nested_archives): New function.
17429 (Archive::read_header): Add nested_off parameter. Change
17430 all callers.
17431 (Archive::interpret_header): Likewise.
17432 (Archive::include_all_members): Change to handle thin
17433 archives.
17434 (Archive::include_member): Likewise.
17435 * archive.h (Archive::Archive): Add new parameters and
17436 initializers.
17437 (Archive::armagt): New const.
17438 (Archive::setup): Remove task parameter.
17439 (Archive::unlock_nested_archives): New function.
17440 (Archive::read_header): Add nested_off parameter.
17441 (Archive::interpret_header): Likewise.
17442 (Archive::Nested_archive_table): New typedef.
17443 (Archive::is_thin_archive_): New field.
17444 (Archive::nested_archives_): New field.
17445 (Archive::options_): New field.
17446 (Archive::dirpath_): New field.
17447 (Archive::task_): New field.
17448 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17449 for thin archives. Pass additional parameters to
17450 Archive::Archive. Unlock the archive file after calling
17451 Archive::setup.
cd536b21 17452
479f6503
ILT
174532008-03-29 Ian Lance Taylor <iant@google.com>
17454
686c8caf
ILT
17455 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17456 version symbol to be local.
17457 * testsuite/ver_test_4.sh: New file.
17458 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17459 (check_DATA): Add ver_test_4.syms.
17460 (ver_test_4.syms): New target.
17461 * testsuite/Makefile.in: Rebuild.
17462
ab794b6b
ILT
17463 * output.cc
17464 (Output_section::Input_section_sort_entry::has_priority): New
17465 function.
17466 (Output_section::Input_section_sort_entry::match_file_name): New
17467 function.
17468 (Output_section::Input_section_sort_entry::match_section_name):
17469 Remove.
17470 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17471 Remove.
17472 (Output_section::Input_section_sort_entry::match_section_file):
17473 Remove.
17474 (Output_section::Input_section_sort_compare::operator()): Rewrite
17475 using new Input_section_sort_entry functions. Sort crtbegin and
17476 crtend first. Sort sections with no priority before sections with
17477 a priority.
17478 * testsuite/initpri1.c (d3): Check j != 4.
17479 (cd5): New constructor/destructor function.
17480 (main): Check j != 2.
17481
479f6503
ILT
17482 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17483 new symbol when resolving, don't call set_is_default.
17484 * testsuite/ver_test_7.cc: New file.
17485 * testsuite/ver_test_7.sh: New file.
17486 * testsuite/Makefile.am (ver_test_7.so): New target.
17487 (ver_test_7.o): New target.
17488 (check_SCRIPTS): Add ver_test_7.sh.
17489 (check_DATA): Add ver_test_7.syms.
17490 (ver_test_7.syms): New target.
17491
2fd32231
ILT
174922008-03-28 Ian Lance Taylor <iant@google.com>
17493
17494 * layout.cc (Layout::layout): If we see an input section with a
17495 name that needs sorting, set the must_sort flag for the output
17496 section.
17497 (Layout::make_output_section): If the name of the output section
17498 indicates that it might require sorting, set the may_sort flag.
17499 * output.h (Output_section::may_sort_attached_input_sections): New
17500 function.
17501 (Output_section::set_may_sort_attached_input_sections): New
17502 function.
17503 (Output_section::must_sort_attached_input_sections): New
17504 function.
17505 (Output_section::set_must_sort_attached_input_sections): New
17506 function.
17507 (class Output_section): Declare Input_section_sort_entry. Define
17508 Input_section_sort_compare. Declare
17509 sort_attached_input_sections. Add new fields:
17510 may_sort_attached_input_sections_,
17511 must_sort_attached_input_sections_,
17512 attached_input_sections_are_sorted_.
17513 * output.cc (Output_section::Output_section): Initialize new
17514 fields.
17515 (Output_section::add_input_section): Add an entry to
17516 input_sections_ if may_sort or must_sort are true.
17517 (Output_section::set_final_data_size): Call
17518 sort_attached_input_sections if necessary.
17519 (Output_section::Input_section_sort_entry): Define new class.
17520 (Output_section::Input_section_sort_compare::operator()): New
17521 function.
17522 (Output_section::sort_attached_input_sections): New function.
17523 * configure.ac: Check whether the compiler supports constructor
17524 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17525 * testsuite/initpri1.c: New file.
17526 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17527 CONSTRUCTOR_PRIORITY.
17528 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17529 (initpri1_LDFLAGS): New variable.
17530 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17531
18e6b24e
ILT
175322008-03-27 Ian Lance Taylor <iant@google.com>
17533
49bdd526
ILT
17534 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17535 * testsuite/common_test_1.c: New file.
17536 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17537 (common_test_1_SOURCES): New variable.
17538 (common_test_1_DEPENDENCIES): New variable.
17539 (common_test_1_LDFLAGS): New variable.
17540
18e6b24e
ILT
17541 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17542 and commons_ correctly when NAME/VERSION does not override
17543 NAME/NULL.
17544 * testsuite/ver_test_6.c: New file.
17545 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17546 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17547 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17548
04bf7072
ILT
175492008-03-26 Ian Lance Taylor <iant@google.com>
17550
5871526f
ILT
17551 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17552 of an undefined symbol from a version script.
17553 * testsuite/Makefile.am (ver_test_5.so): New target.
17554 (ver_test_5.o): New target.
17555 (check_SCRIPTS): Add ver_test_5.sh.
17556 (check_DATA): Add ver_test_5.syms.
17557 (ver_test_5.syms): New target.
17558 * testsuite/ver_test_5.cc: New file.
17559 * testsuite/ver_test_5.script: New file.
17560 * testsuite/ver_test_5.sh: New file.
17561 * Makefile.in, testsuite/Makefile.in: Rebuild.
17562
04bf7072
ILT
17563 PR gold/5986
17564 Fix problems building gold with gcc 4.3.0.
17565 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17566 (gold_error_at_location, gold_warning_at_location): Use it.
17567 * configure.ac: Check whether we can compile and use a template
17568 function with a printf attribute.
17569 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17570 when jumping over bytes.
17571 * object.cc: Instantiate Object::read_section_data.
17572 * debug.h: Include <cstring>
17573 * dwarf_reader.cc: Include <algorithm>
17574 * main.cc: Include <cstring>.
17575 * options.cc: Include <cstring>.
17576 * output.cc: Include <cstring>.
17577 * script.cc: Include <cstring>.
17578 * script.h: Include <string>.
17579 * symtab.cc: Include <cstring> and <algorithm>.
17580 * target-select.cc: Include <cstring>.
17581 * version.cc: Include <string>.
17582 * testsuite/testmain.cc: Include <cstdlib>.
17583 * configure, config.in: Rebuild.
17584
874c5b28
ILT
175852008-03-25 Ian Lance Taylor <iant@google.com>
17586
819d6c3a
ILT
17587 * options.cc: Include "../bfd/bfdver.h".
17588 (options::help): Print bug reporting address.
17589
f4b2c6f5
ILT
17590 * version.cc (print_version): Adjust output for current value of
17591 BFD_VERSION_STRING.
17592
17593 * NEWS: New file.
17594
e96caa79
ILT
17595 * options.cc (options::help): Print list of supported targets.
17596 * target-select.h: Include <vector>.
17597 (class Target_selector): Make machine_, size_, and is_big_endian_
17598 fields const. Add bfd_name_ and instantiated_target_ fields.
17599 (Target_selector::Target_selector): Add bfd_name parameter.
17600 (Target_selector::recognize): Make non-virtual, call
17601 do_recognize.
17602 (Target_selector::recognize_by_name): Make non-virtual, call
17603 do_recognize_by_name.
17604 (Target_selector::supported_names): New function.
17605 (Target_selector::bfd_name): New function.
17606 (Target_selector::do_instantiate_target): New pure virtual
17607 function.
17608 (Target_selector::do_recognize): New virtual function.
17609 (Target_selector::do_recognize_by_name): New virtual function.
17610 (Target_selector::instantiate_target): New private function.
17611 (supported_target_names): Declare.
17612 * target-select.cc (Target_selector::Target_selector): Update for
17613 new parameter and fields.
17614 (select_target_by_name): Check that the name matches before
17615 calling recognize_by_name.
17616 (supported_target_names): New function.
17617 * i386.cc (class Target_selector_i386): Update Target_selector
17618 constructor call. Remove recognize and recognize_by_name. Add
17619 do_instantiate_target.
17620 * x86_64.cc (class Target_selector_x86_64): Likewise.
17621 * testsuite/testfile.cc (class Target_selector_test): Update for
17622 changes to Target_selector.
17623
874c5b28
ILT
17624 * README: Rewrite, with some notes on unsupported features.
17625
0a65a3a7
CC
176262008-03-24 Cary Coutant <ccoutant@google.com>
17627
17628 * i386.cc (Target_i386::Got_type): New enum declaration.
17629 (Target_i386::Scan::local): Updated callers of Output_data_got
17630 member functions.
17631 (Target_i386::Scan::global): Likewise.
17632 (Target_i386::Relocate::relocate): Likewise.
17633 (Target_i386::Relocate::relocate_tls): Likewise.
17634 * object.h (Got_offset_list): New class.
17635 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17636 (Sized_relobj::local_got_offset): Likewise.
17637 (Sized_relobj::set_local_got_offset): Likewise.
17638 (Sized_relobj::local_has_tls_got_offset): Removed.
17639 (Sized_relobj::local_tls_got_offset): Removed.
17640 (Sized_relobj::set_local_tls_got_offset): Removed.
17641 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17642 * output.cc (Output_data_got::add_global): Added got_type parameter.
17643 (Output_data_got::add_global_with_rel): Likewise.
17644 (Output_data_got::add_global_with_rela): Likewise.
17645 (Output_data_got::add_global_pair_with_rel): New function.
17646 (Output_data_got::add_global_pair_with_rela): New function.
17647 (Output_data_got::add_local): Added got_type parameter.
17648 (Output_data_got::add_local_with_rel): Likewise.
17649 (Output_data_got::add_local_with_rela): Likewise.
17650 (Output_data_got::add_local_pair_with_rel): New function.
17651 (Output_data_got::add_local_pair_with_rela): New function.
17652 (Output_data_got::add_global_tls): Removed.
17653 (Output_data_got::add_global_tls_with_rel): Removed.
17654 (Output_data_got::add_global_tls_with_rela): Removed.
17655 (Output_data_got::add_local_tls): Removed.
17656 (Output_data_got::add_local_tls_with_rel): Removed.
17657 (Output_data_got::add_local_tls_with_rela): Removed.
17658 * output.h (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 * resolve.cc (Symbol::override_base_with_special): Removed
17675 reference to has_got_offset_ field.
17676 * symtab.cc (Symbol::init_fields): Replaced initialization
17677 of got_offset_ with got_offsets_. Removed initialization
17678 of has_got_offset_
53fcba31 17679 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17680 (Symbol::got_offset): Likewise.
17681 (Symbol::set_got_offset): Likewise.
17682 (Symbol::has_tls_got_offset): Removed.
17683 (Symbol::tls_got_offset): Removed.
17684 (Symbol::set_tls_got_offset): Removed.
17685 (Symbol::got_offset_): Removed.
17686 (Symbol::tls_mod_got_offset_): Removed.
17687 (Symbol::tls_pair_got_offset_): Removed.
17688 (Symbol::got_offsets_): New field.
17689 (Symbol::has_got_offset): Removed.
17690 (Symbol::has_tls_mod_got_offset): Removed.
17691 (Symbol::has_tls_pair_got_offset): Removed.
17692 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17693 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17694 member functions.
17695 (Target_x86_64::Scan::global): Likewise.
17696 (Target_x86_64::Relocate::relocate): Likewise.
17697 (Target_x86_64::Relocate::relocate_tls): Likewise.
17698
bd52eafb
BE
176992008-03-25 Ben Elliston <bje@au.ibm.com>
17700
17701 * yyscript.y: Fix spelling error in comment.
17702
8b105e34
ILT
177032008-03-24 Ian Lance Taylor <iant@google.com>
17704
8ed814a9
ILT
17705 * options.h (class General_options): Define build_id option.
17706 * layout.h (class Layout): Declare write_build_id, create_note,
17707 create_build_id. Add build_id_note_ member.
17708 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17709 "libiberty.h", "md5.h", "sha1.h".
17710 (Layout::Layout): Initialize eh_frame_data_,
17711 eh_frame_hdr_section_, and build_id_note_.
17712 (Layout::finalize): Call create_build_id.
17713 (Layout::create_note): New function, broken out of
17714 Layout::create_gold_note.
17715 (Layout::create_gold_note): Call create_note.
17716 (Layout::create_build_id): New function.
17717 (Layout::write_build_id): New function.
17718 (Close_task_runner::run): Call write_build_id.
17719
8b105e34
ILT
17720 * x86_64.cc: Correct license to GPLv3.
17721
086a1841
ILT
177222008-03-23 Ian Lance Taylor <iant@google.com>
17723
17724 * options.cc: Include "demangle.h".
17725 (parse_optional_string): New function.
17726 (parse_long_option): Handle takes_optional_argument.
17727 (parse_short_option): Update dash_z initializer. Handle
17728 takes_optional_argument.
17729 (General_options::General_options): Initialize do_demangle_.
17730 (General_options::finalize): Set do_demangle_. Handle demangling
17731 style.
17732 * options.h (parse_optional_string): Declare.
17733 (struct One_option): Add optional_arg field. Update constructor.
17734 Update call constructor calls. Add takes_optional_argument
17735 function.
17736 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17737 (DEFINE_optional_string): Define.
17738 (General_options::demangle): Change from DEFINE_bool to
17739 DEFINE_optional_string.
17740 (General_options::no_demangle): New function.
17741 (General_options::do_demangle): New function.
17742 (General_options::set_do_demangle): New function.
17743 (General_options::execstack_status_): Move definition to end of
17744 class definition.
17745 (General_options::static_): Likewise.
17746 (General_options::do_demangle_): New field.
17747 * object.cc (big_endian>::get_symbol_location_info): Call
17748 Options::do_demangle, not Options::demangle.
17749 * symtab.cc (demangle): Likewise.
17750
cbb93e63
ILT
177512008-03-22 Ian Lance Taylor <iant@google.com>
17752
17753 * gold.h: Include <cstddef> and <sys/types.h>
17754 * options.h: Include <cstring>.
17755
ec531623
ILT
177562008-03-21 Ian Lance Taylor <iant@google.com>
17757
17758 * Added source code to GNU binutils.
752937aa 17759\f
b90efa5b 17760Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17761
17762Copying and distribution of this file, with or without modification,
17763are permitted in any medium without royalty provided the copyright
17764notice and this notice are preserved.
17765
17766Local Variables:
17767mode: change-log
17768left-margin: 8
17769fill-column: 74
17770version-control: never
17771End:
This page took 1.166342 seconds and 4 git commands to generate.