[GOLD] ppc64 out-of-line register save/restore functions
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
d49044c7
AM
12015-09-02 Alan Modra <amodra@gmail.com>
2
3 PR 18878
4 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
5 (Target_powerpc::Branch_info::make_stub): Determine whether long
6 branch stub is for save/restore function.
7 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
8 (Stub_table): Add need_save_res_.
9 (Stub_table:clear_stubs): Clear need_save_res_.
10 (Stub_table:set_address_and_size): Add save/restore section size.
11 (Stub_table::add_long_branch_entry): Add save_res param. Set
12 need_save_res_, but don't add space for save/restore stubs.
13 (Stub_table::find_long_branch_entry): Return offset to local copy
14 of save/restore func.
15 (Stub_table::do_write): Don't output save/restore stubs. Instead
16 copy the save/restore functions.
17 (Output_data_save_res:contents): New accessor.
18 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
19
7c61d651
CC
202015-08-25 Cary Coutant <ccoutant@gmail.com>
21
22 PR gold/18847
23 * script-sections.cc (Memory_region::set_address): New method.
24 (Script_sections::find_memory_region): Add explicit_only parameter.
25 (Output_section_definition::set_section_addresses): Handle case where
26 script specifies both address and vma region.
27 * script-sections.h (Script_sections::find_memory_region): Add
28 explicit_only parameter.
29
4bfacfd3
CC
302015-08-25 Cary Coutant <ccoutant@gmail.com>
31
32 PR gold/18859
33 * object.cc (Input_objects::add_object): Store objects in a map,
34 indexed by soname; update as-needed flag when necessary.
35 * object.h (Object::clear_as_needed): New method.
36 (Input_objects::so_names_): Change from set to map.
37
1757d35c
CC
382015-08-25 Cary Coutant <ccoutant@gmail.com>
39
40 PR gold/14746
41 * expression.cc (Expression::Expression_eval_info): Add
42 is_valid_pointer field.
43 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
44 Adjust all callers.
45 (Addr_expression::value_from_output_section): Check whether address
46 is valid.
47 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
48 if evaluation failed due to address that is not yet valid.
49 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
50 parameter.
51
3ac0a36c
CC
522015-08-25 Cary Coutant <ccoutant@gmail.com>
53
54 PR gold/18866
55 PR gold/18703
56 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
57
9215b98b
AM
582015-08-20 Alan Modra <amodra@gmail.com>
59
60 PR gold/18846
61 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
62 Subtract os->address() from addend.
63 * powerpc.cc (relocate_relocs): Likewise.
64
40fc1451
SD
652015-08-12 Simon Dardis <simon.dardis@imgtec.com>
66
67 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
68 lazy_stub_normal_1, lazy_stub_normal_1_n64,
69 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
70 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
71 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
72 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
73 of 'addu/daddu'.
74
37a42ee9
L
752015-07-27 H.J. Lu <hongjiu.lu@intel.com>
76
77 * configure: Regenerated.
78
ab3b14b0
DK
792015-07-26 Doug Kwan <dougkwan@google.com>
80
81 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
82 disassembler output format.
83
cdb06167
HS
842015-07-23 Ian Coolidge <icoolidge@google.com>
85 Plumb --pic-veneer option for gold.
86
87 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
88 generation.
89 * options.h (General_options): Add --pic-veneer option.
90
5b2af7dd
L
912015-07-22 H.J. Lu <hongjiu.lu@intel.com>
92
93 PR gold/18663
94 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
95 script_test_1a.cc script_test_1b.cc.
96 (script_test_11_r.o): Replace script_test_11.o with
97 script_test_11a.o script_test_11b.o.
98 (script_test_11.o): Removed.
99 (script_test_11a.o): New.
100 (script_test_11b.o): Likewise.
101 * testsuite/Makefile.in: Regenerated.
102 * testsuite/script_test_1.h: New file.
103 * testsuite/script_test_1b.cc: Likewise.
104 * testsuite/script_test_11.h: Likewise.
105 * testsuite/script_test_11b.c: Likewise.
106 * testsuite/script_test_1.cc: Renamed to ...
107 * testsuite/script_test_1a.cc: This.
108 Include "script_test_1.h".
109 (main): Call check_int and check_ptr.
110 * testsuite/script_test_11.c: Renamed to ...
111 * testsuite/script_test_11a.c: This.
112 Include "script_test_11.h".
113 (main): Call ptr_equal.
114
cd78ea77
L
1152015-07-22 H.J. Lu <hongjiu.lu@intel.com>
116
117 PR gold/18628
118 * testsuite/ifuncdep2.c (global): Change protected to hidden.
119 * testsuite/ifuncmod1.c (global): Likewise.
120 * testsuite/ifuncmod5.c (global): Likewise.
121
f945ba50
AM
1222015-07-22 Alan Modra <amodra@gmail.com>
123
124 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
125
5417c94d
CC
1262015-07-21 Cary Coutant <ccoutant@gmail.com>
127
128 PR gold/18548
129 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
130 forced local symbol even when oldsym != NULL.
131 (Symbol_table::do_define_in_output_segment): Likewise.
132 (Symbol_table::do_define_as_constant): Likewise.
133
cb5cf5e2
CC
1342015-07-21 Cary Coutant <ccoutant@gmail.com>
135
b8c6c5ef 136 PR gold/18698
cb5cf5e2
CC
137 * archive.cc (Library_base::should_include_member): Don't use entry
138 point for relocatable links, or if target is not yet valid.
139 * parameters.cc (Parameters::entry): Check target_valid().
140
0ef3814f
HS
1412015-07-20 Han Shen <shenhan@google.com>
142
143 Optimize erratum 843419 fix.
144
145 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
146 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
147 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
148 (E843419_stub): New sub-class of Erratum_stub.
149 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
150 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
151 (AArch64_relobj::create_erratum_stub): Add 1 argument.
152 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
153
2bca0377
HS
1542015-07-20 Han Shen <shenhan@google.com>
155
156 Fix arm elf header flags wrt hardfp bit.
157
158 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
159
f54f5e31
L
1602015-07-20 H.J. Lu <hongjiu.lu@intel.com>
161
162 PR gold/18689
163 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
164 from input group section for relocatable link.
165 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
166 (check_DATA): Add pr18689.stdout.
167 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
168 (pr18689.stdout): New rule.
169 (pr18689a.o): Likewise.
170 (pr18689b.o): Likewise.
171 (pr18689.o): Likewise.
172 * testsuite/pr18689.c: New file.
173 * testsuite/pr18689.sh: Likewise.
174 * testsuite/Makefile.in: Regenerated.
175
c20ceeb2
YW
1762015-07-20 Yiran Wang <yiran@google.com>
177 Cary Coutant <ccoutant@gmail.com>
178
179 PR gold/15574
180 * resolve.cc (Symbol_table): Remove warning about references
181 from shared objects to hidden symbols.
182 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
183 * testsuite/Makefile.in: Regenerate.
184 * testsuite/hidden_test.sh: Check dynamic symbol table; update
185 expected error messages.
186
19a7fe52
L
1872015-07-14 H.J. Lu <hongjiu.lu@intel.com>
188
189 * compressed_output.cc (Output_compressed_section::set_final_data_size):
190 Make --compress-debug-sections=zlib the same as
191 --compress-debug-sections=zlib-gabi.
192 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
193 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
194 ".zdebug_".
195 * testsuite/Makefile.in: Regenerated.
196
fb8b9dbc
L
1972015-07-12 H.J. Lu <hongjiu.lu@intel.com>
198
199 PR gold/18322
200 * compressed_output.cc (zlib_compress): Add argument for
201 compression header size. Set header size to compression header
202 size if it isn't 0. Don't write out the zlib header here.
203 (Output_compressed_section::set_final_data_size): Support
204 zlib-gnu and zlib-gabi compressions. Pass compression header
205 size to zlib_compress and write out compression header. Set
206 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
207 clear the SHF_COMPRESSED bit
208 * options.h (compress_debug_sections): Add zlib-gnu and
209 zlib-gabi.
210 * output.h (Output_section::set_flags): New.
211 * testsuite/Makefile.am (check_PROGRAMS): Add
212 flagstest_compress_debug_sections_none,
213 flagstest_compress_debug_sections_gnu and
214 flagstest_compress_debug_sections_gabi.
215 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
216 flagstest_compress_debug_sections.stdout,
217 flagstest_compress_debug_sections.cmp,
218 flagstest_compress_debug_sections.check,
219 flagstest_compress_debug_sections_gnu.stdout,
220 flagstest_compress_debug_sections_gnu.cmp,
221 flagstest_compress_debug_sections_gnu.check,
222 flagstest_compress_debug_sections_gabi.stdout,
223 flagstest_compress_debug_sections_gabi.cmp and
224 flagstest_compress_debug_sections_gabi.check.
225 (flagstest_compress_debug_sections_none): New.
226 (flagstest_compress_debug_sections_none.stdout): Likewise.
227 (flagstest_compress_debug_sections.stdout): Likewise.
228 (flagstest_compress_debug_sections.check): Likewise.
229 (flagstest_compress_debug_sections.cmp): Likewise.
230 (flagstest_compress_debug_sections_gnu): Likewise.
231 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
232 (flagstest_compress_debug_sections_gnu.check): Likewise.
233 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
234 (flagstest_compress_debug_sections_gabi): Likewise.
235 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
236 (flagstest_compress_debug_sections_gnu.check): Likewise.
237 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
238 * testsuite/Makefile.in: Regenerated.
239
48058663
L
2402015-07-12 H.J. Lu <hongjiu.lu@intel.com>
241
242 PR gold/18321
243 * compressed_output.h (decompress_input_section): Add arguments
244 for ELF class, big endian and sh_flags.
245 * compressed_output.cc (decompress_input_section): Likewise.
246 Support the SHF_COMPRESSED section.
247 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
248 functions.
249 * plugin.h (Pluginobj): Likewise.
250 * layout.cc (Layout::get_output_section_flags): Also clear the
251 SHF_COMPRESSED bit.
252 * object.h (Compressed_section_info): Add flag to store sh_flags.
253 (Object): Add pure virtual elfsize and is_big_endian member
254 functions.
255 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
256 prefix here.
257 (build_compressed_section_map): Check SHF_COMPRESSED for
258 uncompressed size. Store sh_flags in Compressed_section_info.
259 Pass size, big_endian and sh_flags to decompress_input_section.
260 Skip the ".debug"/".zdebug" prefix when passing section name to
261 need_decompressed_section.
262 (Sized_relobj_file<size, big_endian>::do_find_special_section):
263 Don't check ".zdebug_*" sections.
264 (Object::decompressed_section_contents): Pass ELF class, big
265 endian and sh_flags to decompress_input_section.
266 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
267 Likewise.
268 * testsuite/Makefile.am (check_DATA): Add
269 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
270 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
271 gdb_index_test_2_gabi.stdout.
272 (debug_msg_cdebug_gabi.o): New.
273 (odr_violation1_cdebug_gabi.o): Likewise.
274 (odr_violation2_cdebug_gabi.o): Likewise.
275 (debug_msg_cdebug_gabi.err): Likewise.
276 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
277 (gdb_index_test_cdebug_gabi.o): Likewise.
278 (gdb_index_test_2_gabi): Likewise.
279 (gdb_index_test_2_gabi.stdout): Likewise.
280 * testsuite/gdb_index_test_2_gabi.sh: New file.
281 * testsuite/Makefile.in: Regenerated.
282
73854cdd
HS
2832015-07-09 Han Shen <shenhan@google.com>
284
285 Use "gold_info" instead of "gold_warning" for erratum fix.
286
287 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
288 'gold_info'.
289 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
290
61163dfa
HS
2912015-07-09 Han Shen <shenhan@google.com>
292
293 Drop missing symbol warning for arm/aarch64.
294
295 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
296 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
297 symbol warning.
298
b91deca9
HS
2992015-07-07 Han Shen <shenhan@google.com>
300
301 Make gold aarch64 accept long form of mapping symbols.
302
303 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
304 of mapping symbols.
305
15162bef
DK
3062015-06-29 Doug Kwan <dougkwan@google.com>
307
308 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
309 at address expected by test.
310 * testsuite/arm_cortex_a8_b.s: Ditto.
311 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
312 * testsuite/arm_cortex_a8_bl.s: Ditto.
313 * testsuite/arm_cortex_a8_blx.s: Ditto.
314 * testsuite/arm_cortex_a8_local.s: Ditto.
315 * testsuite/arm_fix_v4bx.s: Ditto.
316 * testsuite/arm_unaligned_reloc.s: Ditto.
317 * testsuite/thumb_bl_out_of_range.s: Ditto.
318 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
319 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 320
56b06706
HS
3212015-06-29 Han Shen <shenhan@google.com>
322
323 Patch for erratum 843419 internal error.
324
72f4393d
L
325 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
326 (Erratum_stub::update_erratum_insn): New method.
327 (Stub_table::relocate_stubs): Modified to place relocated insn.
328 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 329
2f0c79aa
HS
3302015-06-12 Han Shen <shenhan@google.com>
331
332 Fix erratum 835769.
333
72f4393d
L
334 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
335 defintion outside class definition.
336 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
337 (AArch64_insn_utilities::aarch64_op31): New member.
338 (AArch64_insn_utilities::aarch64_ra): New member.
339 (AArch64_insn_utilities::aarch64_mac): New member.
340 (AArch64_insn_utilities::aarch64_mlxl): New member.
341 (ST_E_835769): New global enum member.
342 (Stub_table::relocate_stubs): Add 835769 handler.
343 (Stub_template_repertoire::Stub_template_repertoire): Install new
344 stub type.
345 (AArch64_relobj::scan_errata): This func is renamed from
346 scan_erratum_843419.
347 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
348 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
349 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
350 (Target_aarch64::scan_erratum_835769_span): New method.
351 (Target_aarch64::create_erratum_stub): New method.
352 (Target_aarch64::is_erratum_835769_sequence): New method.
353 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
354 code into create_erratum_stub.
355 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 356
5d7908e0
CC
3572015-06-11 Cary Coutant <ccoutant@gmail.com>
358
359 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
360 outside class body.
361 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
362
dd68f8fa
CC
3632015-06-11 Cary Coutant <ccoutant@gmail.com>
364
365 PR gold/17731
366 * layout.cc (corresponding_uncompressed_section_name): New function.
367 (Layout::choose_output_section): Call it.
368 * layout.h (corresponding_uncompressed_section_name): New function.
369 * script-sections.cc (Input_section_info::set_section_name): Check
370 for compressed debug section (.zdebug style).
371
a3a0c391
JY
3722015-06-11 Jing Yu <jingyu@google.com>
373
374 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
375 * testsuite/Makefile.in: Regenerate.
376
970cdef2
DI
3772015-06-11 Davide Italiano <dccitaliano@gmail.com>
378
379 * gold.h (is_cident): Correct typo.
380
a48d0c12
HS
3812015-06-10 Han Shen <shenhan@google.com>
382 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
383
384 Now fixing for 843419 is fully functional.
385
386 The first part of the erratum fix CL is here -
387 https://sourceware.org/ml/binutils/2015-04/msg00229.html
388
389 * aarch64.cc(global enum): New constants representing stub types.
390 (Stub_template): New POD struct.
391 (Stub_template_repertoire): New class.
392 (Stub_base): New class.
393 (Erratum_stub): New class.
394 (Reloc_stub): Refactored to be a subclass of Stub_base.
395 (Reloc_stub::Stub_type): Removed.
396 (Reloc_stub::offset): Moved to Stub_base.
397 (Reloc_stub::set_offset): Moved to Stub_base.
398 (Reloc_stub::destination_address): Moved to Stub_base.
399 (Reloc_stub::set_destination_address): Moved to Stub_base.
400 (Reloc_stub::reset_destination_address): Moved to Stub_base.
401 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
402 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
403 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
404 (Reloc_stub::write): Moved to Stub_base.
405 (Reloc_stub::invalid_offset): Moved to Stub_base.
406 (Reloc_stub::invalid_address): Moved to Stub_base.
407 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
408 (Reloc_stub::stub_insns_): Moved to Stub_base.
409 (Reloc_stub::offset_): Moved to Stub_base.
410 (Reloc_stub::destination_address_): Moved to Stub_base.
411 (Stub_table::The_aarch64_relobj): New typedef.
412 (Stub_table::The_erratum_stub): New typedef.
413 (Stub_table::The_erratum_stub_less): New typedef.
414 (Stub_table::The_erratum_stub_set): New typedef.
415 (Stub_table::The_erratum_stub_set_iter): New typedef.
416 (Stub_table::empty): Added emptiness testing for erratum stubs.
417 (Stub_table::add_erratum_stub): New method to add an erratum stub.
418 (Stub_table::find_erratum_stub): New method.
419 (Stub_table::find_erratum_stubs_for_input_section): New method.
420 (Stub_table::erratum_stub_address): New method.
421 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
422 (Stub_table::do_addralign): Modified to handle erratum stubs.
423 (Stub_table::erratum_stubs_): New member.
424 (Stub_table::erratum_stub_size_): New member.
425 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
426 (Stub_table::do_write): Modified to handle erratum stubs.
427 (AArch64_relobj::The_erratum_stub): New typedef.
428 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
429 (AArch64_relobj::fix_errata): New method.
430 (Target_aarch64::The_reloc_stub_type): Removed.
431 (Target_aarch64::The_erratum_stub): New typede.
432 (AArch64_relocate_functions::construct_b): New method.
433
1e1b2efc
NC
4342015-06-08 Nick Clifton <nickc@redhat.com>
435
436 * po/fr.po: New French Translation.
437
b8cf5075
CC
4382015-06-07 Cary Coutant <ccoutant@gmail.com>
439
440 PR gold/18288
441 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
442 callers. Don't use STT_COMMON to check for common symbols.
443 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
444 symbol that's not in a common section.
445 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
446 common symbols.
447
bdd2d2b7
CC
4482015-06-04 Cary Coutant <ccoutant@gmail.com>
449
450 PR gold/18200
451 * Makefile.am (diststuff): Add target.
452 * Makefile.in: Regenerate.
453
cd3c333f
CC
4542015-06-04 Cary Coutant <ccoutant@gmail.com>
455
456 PR gold/17498
457 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
458 temporary locals in merge sections.
459 * options.cc (General_options::parse_discard_all): New method.
460 (General_options::parse_discard_locals): New method.
461 (General_options::parse_discard_none): New method.
462 (General_options::General_options): Initialize discard_locals_.
463 * options.h (--discard-all): Convert to special option.
464 (--discard-locals): Likewise.
465 (--discard-none): New option.
466 (General_options::discard_all): New method.
467 (General_options::discard_locals): New method.
468 (General_options::discard_sec_merge): New method.
469 (General_options::Discard_locals): New enum.
470 (General_options::discard_locals_): New data member.
471
8086551f
CC
4722015-06-03 Cary Coutant <cary@google.com>
473
474 * script-sections.cc (Script_sections::Script_sections): Initialize
475 segments_created_.
476 (Script_sections::create_note_and_tls_segments): Set flag when
477 segments are created.
478 (Script_sections::expected_segment_count): Count PT_INTERP.
479 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
480 segments are created.
481 * script-sections.h (Script_sections::segments_created_): New data
482 member.
483
374082df
CC
4842015-06-03 Cary Coutant <ccoutant@gmail.com>
485
486 PR gold/15370
487 * script-sections.cc
488 (Output_section_element_input::set_section_addresses): When there
489 are several patterns with no sort spec, put all sections in the same
490 bin.
491 * testsuite/Makefile.am (script_test_12): New testcase.
492 (script_test_12i): New testcase.
493 * testsuite/Makefile.in: Regenerate.
494 * testsuite/script_test_12.t: New test linker script.
495 * testsuite/script_test_12i.t: New test linker script.
496 * testsuite/script_test_12a.c: New test source file.
497 * testsuite/script_test_12b.c: New test source file.
498
775ed62e
CC
4992015-06-02 Cary Coutant <ccoutant@gmail.com>
500
501 * nacl.h (Sniff_file): Switch parameters to get_view to get an
502 aligned view.
503
9c7fe3c5
CC
5042015-06-03 Cary Coutant <ccoutant@gmail.com>
505
72f4393d
L
506 PR gold/17819
507 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
508 separate task to schedule the build id computation.
509 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
510 add Output_file and offset.
511 (Hash_task::run): Get and release the input views.
512 (Hash_task::is_runnable): Always return NULL (always runnable).
513 (Layout::queue_build_id_tasks): Remove.
514 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
515 parameters; use them instead of class members.
516 (Build_id_task_runner::run): New function.
517 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
518 to write_build_id.
519 * layout.h (Layout::queue_build_id_tasks): Remove.
520 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
521 parameters.
522 (Layout::array_of_hashes_): Remove.
523 (Layout::size_of_array_of_hashes_): Remove.
524 (Layout::input_view_): Remove.
525 (Build_id_task_runner): New class.
526 (Close_task_runner::Close_task_runner): Add array_of_hashes and
527 size_of_hashes parameters.
528 (Close_task_runner::array_of_hashes_): New data member.
529 (Close_task_runner::size_of_hashes_): New data member.
530 * testsuite/Makefile.am
531 (flagstest_compress_debug_sections_and_build_id_tree): New test.
532 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 533
400f8944
RÁE
5342015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
535
536 * merge.cc (get_input_merge_map): Update for data structure change.
537 (get_or_make_input_merge_map): Update for data structure change.
538 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
539 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
540
bbec1a5d
AM
5412015-05-16 Alan Modra <amodra@gmail.com>
542
543 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
544 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
545 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
546 (lis_0): Rename from lis_0_0.
547
efc6fa12
CC
5482015-04-29 Cary Coutant <cary@google.com>
549 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
550
551 * gc.h (Garbage_collection::is_section_garbage): Change Object*
552 to Relobj*.
553 (Garbage_collection::add_reference): Likewise.
554 (Garbage_collection::gc_process_relocs): Likewise. Don't push
555 object/shndx pair onto *secvec for dynamic objects. Don't follow
556 relocations pointing to dynamic objects for GC.
557 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
558 (Icf::unfold_section): Likewise.
559 (Icf::is_section_folded): Likewise.
560 (Icf::get_folded_section): Likewise.
561 * icf.h: (Icf::get_folded_section): Likewise.
562 (Icf::unfold_section): Likewise.
563 (Icf::is_section_folded): Likewise.
564 (Icf::section_has_function_pointers): Likewise.
565 (Icf::set_section_has_function_pointers): Likewise.
566 * object.h (Section_id): Likewise.
567 (Const_section_id): Likewise.
568 * output.cc (Output_section::update_section_layout): Likewise.
569 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
570 Likewise.
571 * plugin.cc (update_section_order): Likewise.
572 (unique_segment_for_sections): Likewise.
573 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
574 (Target_powerpc::do_gc_add_reference): Likewise.
575 (Target_powerpc::gc_process_relocs): Likewise.
576 (Target_powerpc::do_gc_add_reference): Likewise.
577 * symtab.cc (Symbol_table::is_section_folded): Likewise.
578 (Symbol_table::gc_mark_symbol): Likewise.
579 * symtab.h: (Symbol_table::is_section_folded): Likewise.
580 * target.h: (Sized_target::gc_add_reference): Likewise.
581 (Sized_target::do_gc_add_reference): Likewise.
582
f9d3ecaa
NC
5832015-04-29 Nick Clifton <nickc@redhat.com>
584
585 * po/fi.po: Updated Finnish translation.
586
faa2211d
AM
5872015-04-28 Alan Modra <amodra@gmail.com>
588
589 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
590 than unsigned int for find_global_entry result temp. Compare
591 against invalid_address.
592 (Target_powerpc::do_plt_address_for_global): Likewise.
593 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
594 on plt call stub existence for debug info. Do assert for plt
595 and global entry stub existence if an alloc section.
596
6ec65f28
AM
5972015-04-28 Alan Modra <amodra@gmail.com>
598
599 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
600 on missing global entry stub due to bogus debug info.
601
7a2a1c79
HS
6022015-04-27 Han Shen <shenhan@google.com>
603
604 * options.h (--fix-cortex-a53-843419): Rename option.
605 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
606 option.
607 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
608
cfbf0e3c
RÁE
6092015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
610
611 PR gold/18327
612 * output.cc (Output_section::is_input_address_mapped): Assume a missing
613 entry is mapped.
614 * testsuite/Makefile.am: Add the eh_test test.
615 * testsuite/Makefile.in: Regenerate.
616 * testsuite/eh_test_a.cc: New test.
617 * testsuite/eh_test_b.cc: New test.
618
6ec65f28
AM
6192015-04-23 Sriraman Tallam <tmsriram@google.com>
620
a100d66f
ST
621 * options.h (--weak-unresolved-symbols): New option.
622 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
623 binding to weak with new option.
624 * symtab.h (is_weak_undefined): Check for new option.
625 (is_strong_undefined): Check for new option.
626 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
627 * testsuite/Makefile.in: Regenerate.
628 * testsuite/weak_unresolved_symbols_test.cc: New file.
629
4b889c30
IC
6302015-04-20 Ian Coolidge <icoolidge@google.com>
631
632 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
633 GNU_UNIQUE.
634
4277535c
RÁE
6352015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
636
637 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
638 push_back.
639 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
640 * object.cc (Sized_relobj_file::do_layout): Use push_back.
641 * powerpc.cc (process_gc_mark): Use push_back.
642 (Target_powerpc::do_gc_mark_symbol): Use push_back.
643 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
644
7a2a1c79 6452015-04-16 Han Shen <shenhan@google.com>
5019d64a 646
6ec65f28
AM
647 * aarch64.cc (AArch64_insn_utilities): New utility class.
648 (AArch64_relobj::Mapping_symbol_position): New struct.
649 (AArch64_relobj::Mapping_symbol_info): New typedef.
650 (AArch64_relobj::do_count_local_symbols): New function overriding
651 parent's implementation.
652 (AArch64_relobj::mapping_symbol_info_): New member
653 (AArch64_relobj::scan_erratum_843419): New method.
654 (Target_aarch64::scan_erratum_843419_span): New method.
655 (Target_aarch64::is_erratum_843419_sequence): New method.
656 * options.h (fix_cortex_a53): New option.
5019d64a 657
a6a17750
CC
6582015-04-09 Cary Coutant <ccoutant@google.com>
659
660 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
661 in a PIE link.
662 * testsuite/Makefile.am (tls_pie_test.sh): New test.
663 * testsuite/Makefile.in: Regenerate.
664 * testsuite/tls_pie_test.sh: New.
665
437ddf0c
CC
6662015-04-09 Cary Coutant <ccoutant@google.com>
667
668 * debug.h (DEBUG_LOCATION): New.
669 (DEBUG_ALL): Include DEBUG_LOCATION.
670 (debug_string_to_enum): Add DEBUG_LOCATION.
671 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
672 output to print correct context.
673 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
674 up to 4 more locations at the beginning of the function.
675 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
676 result before sorting list of line numbers.
677 * testsuite/debug_msg.sh: Allow range of line numbers for
678 canonical results on optimized code.
679
24491327
HS
6802015-04-07 HC Yen <hc.yen@mediatek.com>
681
682 Add AArch32 support for gold linker.
683 gold/
684 * arm.cc: Add V8 arch combine table.
685
7fa5525f
RÁE
6862015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
687
688 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
689
5368dcf2
RÁE
6902015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
691
692 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
693 to find by using the return value of insert.
694
9dbb4b02
RÁE
6952015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
696
697 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
698 constructor call.
699
1fa29f10
IT
7002015-04-06 Ilya Tocar <ilya.tocar@intel.com>
701
702 PR gold/17641
703 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
704 (Target_x86_64::Scan::local): Don't create GOT entry, when we
705 can convert mov to lea.
706 (Target_x86_64::Scan::global): Ditto.
707 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
708 %reg to lea foo(%rip), %reg if possible.
709 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
710 * testsuite/x86_64_mov_to_lea1.s: New.
711 * testsuite/x86_64_mov_to_lea2.s: Ditto.
712 * testsuite/x86_64_mov_to_lea3.s: Ditto.
713 * testsuite/x86_64_mov_to_lea4.s: Ditto.
714 * testsuite/x86_64_mov_to_lea.sh: Ditto.
715
39f3de7c
L
7162015-04-02 H.J. Lu <hongjiu.lu@intel.com>
717
718 * configure: Regenerated.
719
c4fc4724
IT
7202015-04-01 Ilya Tocar <ilya.tocar@intel.com>
721
722 PR gold/17640
723 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
724 (Target_i386::Scan::local): Don't create GOT entry, when we
725 can convert GOT to GOTOFF.
726 (Target_i386::Scan::global): Ditto.
727 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
728 lea foo@GOTOFF(%reg), %reg if possible.
729 * testsuite/Makefile.am (i386_mov_to_lea): New test.
730 * testsuite/i386_mov_to_lea1.s: New.
731 * testsuite/i386_mov_to_lea2.s: Ditto.
732 * testsuite/i386_mov_to_lea3.s: Ditto.
733 * testsuite/i386_mov_to_lea4.s: Ditto.
734 * testsuite/i386_mov_to_lea5.s: Ditto.
735 * testsuite/i386_mov_to_lea.sh: Ditto.
736
918357b9
L
7372015-04-01 H.J. Lu <hongjiu.lu@intel.com>
738
739 * Makefile.am (ZLIB): New.
740 (ZLIBINC): Likewise.
741 (AM_CFLAGS): Add $(ZLIBINC).
742 (AM_CXXFLAGS): Likewise.
743 (ldadd_varldadd_var): Add $(ZLIB).
744 (incremental_dump_LDADD): Likewise.
745 (dwp_LDADD): Likewise.
746 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
747 <zlib.h>.
748 (zlib_compress): Don't check HAVE_ZLIB_H.
749 (zlib_decompress): Likewise.
750 * options.h (compress_debug_sections): Likewise.
751 * configure.ac (AM_CONDITIONAL): Removed.
752 * testsuite/Makefile.am (ZLIB): New.
753 (LDADD): Add $(ZLIB).
754 Don't check HAVE_ZLIB.
755 * Makefile.in: Regenerated.
756 * config.in: Likewise.
757 * configure: Likewise.
758 * testsuite/Makefile.in: Likewise.
759
6b0ad2eb
JY
7602015-03-30 Jing Yu <jingyu@google.com>
761
762 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
763 TLSLD_ADD_DTPREL_LO12_NC.
764 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
765 _TLS_MODULE_BASE_ point to the start of tls segment.
766 (Target_aarch64::optimize_tls_reloc): Add cases for
767 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
768 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
769 (Target_aarch64::Scan::local): Likewise.
770 (Target_aarch64::Scan::global): Likewise.
771 (Target_aarch64::Relocate::relocate): Likewise.
772 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
773 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
774 relocations.
775
0916f9e7
RÁE
7762015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
777
778 * merge.cc (Object_merge_map::add_mapping): call
779 Object_merge_map::Input_merge_map::add_mapping.
780 (Object_merge_map::Input_merge_map::add_mapping): New.
781 (Output_merge_data::do_add_input_section): Call
782 get_or_make_input_merge_map before a loop.
783 (Output_merge_string<Char_type>::finalize_merged_data): Call
784 get_or_make_input_merge_map before a loop.
785 * merge.h (Object_merge_map): Make Input_merge_map public.
786 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
787 (Relobj::get_or_create_merge_map): New.
788 * object.h (Relobj::get_or_create_merge_map): New.
789
282c9750
AM
7902015-03-24 Alan Modra <amodra@gmail.com>
791
792 PR 18147
793 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
794 relocation errors for branches to strong undefined symbols.
795
67f95b96
RÁE
7962015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
797
798 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
799 (Object_merge_map::is_merge_section_for): Remove.
800 (Object_merge_map::find_merge_section): New.
801 * merge.h (Object_merge_map::is_merge_section_for): Remove.
802 (Object_merge_map::find_merge_section): New.
803 (Object_merge_map::get_input_merge_map): Add a const version.
804 * object.cc (Relobj::is_merge_section_for): Remove.
805 (Relobj::find_merge_section): New.
806 * object.h (Relobj::is_merge_section_for): Remove.
807 (Relobj::find_merge_section): New.
808 * output.cc
809 (Output_section::Input_section::is_merge_section_for): Remove.
810 (Output_section::add_merge_input_section): Don't call
811 add_merge_input_section.
812 (Output_section::find_merge_section): Return const. Use
813 object->find_merge_section.
814 (Output_section::build_lookup_maps): Don't build a map for
815 merge sections.
816 (Output_section::is_input_address_mapped): Return false if
817 section is not found.
818 (Output_section::find_starting_output_address): Use
819 find_merge_section instead of is_merge_section_for.
820 (Output_section::add_script_input_section): Don't build a map for
821 merge sections.
822 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
823 (Output_section_lookup_maps::find_merge_section): Remove.
824 (Output_section_lookup_maps::add_merge_input_section) Remove.
825 (Output_section::find_merge_section): Return const.
826
152f7024
CC
8272015-03-22 Cary Coutant <cary@google.com>
828
829 PR gold/18106
830 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
831 non-SIB form of lea, with nop after the call.
832
bccffdfd
CC
8332015-03-21 Cary Coutant <cary@google.com>
834
835 PR gold/14217
836 * output.cc (Output_segment::is_first_section_relro): Don't ignore
837 .tdata section.
838 (Output_segment::set_section_addresses): Don't align size of relro
839 segment for .tbss.
840
1c582fe7
CC
8412015-03-21 Cary Coutant <cary@google.com>
842
843 PR gold/18010
844 * stringpool.cc (Stringpool_template): Don't optimize if section
845 alignment is greater than sizeof(char).
846
410da591
CC
8472015-03-21 Cary Coutant <cary@google.com>
848
849 PR gold/18048
850 * script-c.h (script_include_directive): Add first_token parameter.
851 * script.cc (script_include_directive): Add first_token parameter, and
852 pass it to read_script_file.
853 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
854 (PARSING_MEMORY_DEF): New tokens.
855 (top): Add new productions for INCLUDE files.
856 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
857 Pass PARSING_LINKER_SCRIPT to script_include_directive.
858 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
859 (section_cmd): Pass PARSING_SECTION_CMDS.
860 (file_or_sections_cmd): Remove.
861 (memory_def): Pass PARSING_MEMORY_DEF.
862 * testsuite/Makefile.am (memory_test_2): New test.
863 * testsuite/Makefile.in: Regenerate.
864 * testsuite/memory_test_inc.t: New script file.
865 * testsuite/memory_test_inc_1.t.src: New script file.
866 * testsuite/memory_test_inc_2.t.src: New script file.
867 * testsuite/memory_test_inc_3.t.src: New script file.
868
0d5bbdb0
CC
8692015-03-21 Cary Coutant <cary@google.com>
870
871 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
872 (Sized_relobj_dwo::setup): Build compressed section map.
873 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
874 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
875 section map.
876 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
877 compressed_sections_ field.
878 (build_compressed_section_map): Take Object instead of
879 Sized_relobj_file parameter; add decompress_if_needed parameter.
880 (Sized_relobj_file::do_find_special_sections): Store compressed
881 section map in parent Object.
882 (Sized_relobj_file::do_decompressed_section_contents): Move
883 implementation to Object::decompressed_section_contents.
884 (Sized_relobj_file::do_discard_decompressed_sections): Move
885 implementation to Object::discard_decompressed_sections.
886 * object.h (build_compressed_section_map): Declare.
887 (Object::Object): Add compressed_sections_ field.
888 (Object::section_is_compressed): Move implementation here.
889 (Object::decompressed_section_contents): De-virtualize.
890 (Object::discard_decompressed_sections): De-virtualize.
891 (Object::do_section_is_compressed): Delete.
892 (Object::do_decompressed_section_contents): Delete.
893 (Object::set_compressed_sections): New method.
894 (Object::compressed_sections): New method.
895 (Object::compressed_sections_): New data member.
896 (Compressed_section_info, Compressed_section_map): Move to top of file.
897 (Sized_relobj_file::do_section_is_compressed): Delete.
898 (Sized_relobj_file::do_decompressed_section_contents): Delete.
899 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
900 (Sized_relobj_file::compressed_sections_): Move to Object class.
901
bd9e0d46
CC
9022015-03-21 Cary Coutant <ccoutant@google.com>
903
904 PR gold/18152
905 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
906 deferred objects.
907
943c8b43
CC
9082015-03-11 Cary Coutant <ccoutant@google.com>
909
910 * options.cc (General_options::finalize): Don't allow -z relro
911 with incremental linking.
912 * testsuite/Makefile.am (incremental_test): Add -z norelro.
913 (incremental_test_2): Likewise.
914 (incremental_test_3): Likewise.
915 (incremental_test_4): Likewise.
916 (incremental_test_5): Likewise.
917 (incremental_test_6): Likewise.
918 (incremental_copy_test): Likewise.
919 (incremental_common_test_1): Likewise.
920 (incremental_comdat_test_1): Likewise.
921 * testsuite/Makefile.in: Regenerate.
922
e1663197
CC
9232015-03-09 Cary Coutant <ccoutant@google.com>
924
925 PR gold/14675
926 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
927 return enum indicating whether .eh_frame section is empty, optimizable,
928 unrecognized, or an end marker. Adjust explicit instantiations.
929 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
930 (Eh_frame::add_ehframe_input_section): Change return type.
931 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
932 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
933 to the .eh_frame output section until we see the end marker.
934 (Layout::finalize_eh_frame_section): New.
935 * layout.h: (Layout::finalize_eh_frame_section): New.
936
beb8418f
L
9372015-03-05 H.J. Lu <hongjiu.lu@intel.com>
938
939 * output.cc (Relobj::initialize_input_to_output_map<size>):
940 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
941
48c73428
CC
9422015-03-04 Cary Coutant <ccoutant@google.com>
943
944 * parameters.cc (Parameters::set_target_once): Call
945 Target::select_as_default_target just once from here...
946 (set_parameters_target): ...instead of from here.
947
9482015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
949
950 * ehframe.cc (Cie::set_output_offset): Pass in and use a
951 Output_section_data instead of a Merge_map.
952 (Eh_frame::Eh_frame): Don't initialize merge_map_.
953 (Eh_frame::read_cie): Use add_merge_mapping instead of
954 Merge_map::add_mapping.
955 (Eh_frame::read_fde): Ditto.
956 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
957 (Eh_frame::do_output_offset): Use merge_output_offset istead of
958 merge_map_->get_output_offset.
959 (Eh_frame::do_is_merge_section_for): Delete.
960 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
961 instead of a Merge_map.
962 (Cie::set_output_offset): Pass in a Output_section_data instead of a
963 Merge_map.
964 (Eh_frame::do_is_merge_section_for): Delete.
965 (Eh_frame::merge_map_): Delete.
966 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
967 and use a Output_section_data instead of a Merge_map.
968 (Object_merge_map::add_mapping): Ditto.
969 (Object_merge_map::get_output_offset): Remove the merge_map argument.
970 (Object_merge_map::is_merge_section_for): Pass in and use a
971 Output_section_data instead of a Merge_map.
972 (Merge_map): Delete.
973 (Output_merge_base::do_output_offset): Use merge_output_offset instead
974 of merge_map_.get_output_offset.
975 (Output_merge_base::do_is_merge_section_for): Delete.
976 (Output_merge_data::do_add_input_section): Use
977 object->add_merge_mapping instead of add_mapping.
978 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
979 * merge.h (Merge_map): Delete forward declaration.
980 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
981 instead of a Merge_map.
982 (Object_merge_map::get_output_offset): Remove the merge_map argument.
983 (Object_merge_map::is_merge_section_for): Pass in and use a
984 Output_section_data instead of a Merge_map.
985 (Input_merge_map::Object_merge_map::merge_map): Replace with
986 output_data.
987 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
988 Output_section_data instead of a Merge_map.
989 (Merge_map): Delete.
990 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
991 (Output_merge_base::do_is_merge_section_for): Delete.
992 (Output_merge_base::add_mapping): Delete.
993 (Output_merge_base::merge_map_): Delete.
994 * object.cc (Relobj::initialize_input_to_output_map): New.
995 (Relobj::initialize_input_to_output_map): New.
996 (Relobj::merge_output_offset): New.
997 (Relobj::is_merge_section_for): New.
998 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
999 bits.
1000 * object.h (Relobj::merge_map): Delete.
1001 (initialize_input_to_output_map): New.
1002 (set_merge_map): Delete.
1003 (add_merge_mapping): New.
1004 (merge_output_offset): New.
1005 (is_merge_section_for): New.
1006 * output.cc (Output_section::Input_section::is_merge_section_for):
1007 Use object->is_merge_section_for.
1008 * output.h (Output_section_data::is_merge_section_for): Delete.
1009 (Output_section_data::do_is_merge_section_for): Delete.
1010 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1011 Use object->initialize_input_to_output_map.
1012 (Merged_symbol_value<size>::value_from_output_section): Use
1013 object->merge_output_offset.
1014
48c73428 10152015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1016 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1017
1018 * output.cc (Output_section::add_merge_input_section): Do not
1019 attempt to merge sections with an entsize of 0.
1020
48c73428 10212015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1022
1023 * attributes.h (class Output_attributes_section_data ): Add
1024 do_print_to_mapfile function.
1025
ec86f434
AM
10262015-02-24 Alan Modra <amodra@gmail.com>
1027
1028 PR 18010
1029 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1030 complain if value is not a multiple of four.
1031 (Target_powerpc::Relocate::relocate): Correct handling of
1032 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1033
be66981e
L
10342015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1035
1036 * configure.ac (default_size): Set to 32 for x32.
1037 * configure: Regenerated.
1038
e3ee8ed4
AM
10392015-02-18 Alan Modra <amodra@gmail.com>
1040
1041 PR 17954
1042 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1043 visibility.
1044
3a935c6c
RÁE
10452015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1046
1047 * gc.h (Garbage_collection::add_reference): Don't use find.
1048
e0a1e121
RÁE
10492015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1050
1051 * object.cc (write_local_symbols): avoid std::vector copy.
1052
45a4fb1a
RÁE
10532015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1054
1055 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1056
2d9afefe
MW
10572015-02-09 Mark Wielaard <mjw@redhat.com>
1058
1059 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1060 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1061
e9c1bdad
CC
10622015-02-16 Cary Coutant <ccoutant@google.com>
1063
1064 PR gold/13577
1065 PR gold/16992
1066 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1067 DF_SYMBOLIC if --dynamic-list option is used.
1068 * options.cc (General_options::finalize): --dynamic-list is not
1069 mutually exclusive with -Bsymbolic.
1070 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1071 listed in --dynamic-list.
1072 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1073 -Bsymbolic-functions.
1074 * testsuite/Makefile.in: Regenerate.
1075
0ed4b0bf
CC
10762015-02-16 Cary Coutant <ccoutant@google.com>
1077
1078 PR gold/17971
1079 * incremental.cc: Remove redundant include of "output.h".
1080
1a920511
JY
10812015-02-12 Jing Yu <jingyu@google.com>
1082
1083 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1084 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1085 New relocation.
1086 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1087 TLSLE_MOVW_* relocations.
1088 (Target_aarch64::Scan::global): Likewise.
1089 (Target_aarch64::Relocate::relocate): Likewise.
1090 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1091 for new TLSLE_MOVW_* relocations.
1092
07f107f3
WN
10932015-02-11 Will Newton <will.newton@linaro.org>
1094
1095 PR gold/13321
1096 * arm.cc (Target_arm::make_plt_section): Create an ARM
1097 state mapping symbol at the start of the PLT.
1098
e051a5b5
L
10992015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1100
1101 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1102 Replace two_file_shared_2.so with two_file_shared_1.so.
1103 * testsuite/Makefile.in: Regenerated.
1104
dddcc5b9
AM
11052015-02-09 Alan Modra <amodra@gmail.com>
1106
1107 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1108 plugin_test_thin.a and defsym_test.
1109 * testsuite/Makefile.in: Regenerate.
1110
b39b8b9d
RÁE
11112015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1112
1113 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1114 body.
1115
b66d1c52
CC
11162015-02-04 Peter Collingbourne <pcc@google.com>
1117
1118 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1119 forwarding symbols when computing symbol resolution info for plugins.
1120 * plugin.h (Plugin_manager::symtab): New method.
1121 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1122
23081de0
CC
11232015-02-03 Cary Coutant <ccoutant@google.com>
1124 Peter Collingbourne <pcc@google.com>
1125
1126 PR gold/15660
1127 * archive.cc (Thin_archive_object_unlocker): New class.
1128 (Archive::include_member): Unlock external members of thin archives.
1129 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1130 (plugin_test_2): Likewise.
1131 (plugin_test_3): Likewise.
1132 (plugin_test_4): Likewise.
1133 (plugin_test_5): Likewise.
1134 (plugin_test_6): Likewise.
1135 (plugin_test_7): Likewise.
1136 (plugin_test_8): Likewise.
1137 (plugin_test_9): Likewise.
1138 (plugin_test_10): Likewise.
1139 (plugin_test_11): New test case.
1140 * testsuite/Makefile.in: Regenerate.
1141 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1142 file to decide whether to claim file.
1143 (all_symbols_read_hook): Likewise.
1144 * testsuite/plugin_test_1.sh: Adjust expected output.
1145 * testsuite/plugin_test_2.sh: Likewise.
1146 * testsuite/plugin_test_3.sh: Likewise.
1147 * testsuite/plugin_test_6.sh: Likewise.
1148 * testsuite/plugin_test_tls.sh: Likewise.
1149 * testsuite/plugin_test_11.sh: New testcase.
1150
11512015-02-03 Cary Coutant <ccoutant@google.com>
1152
1153 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1154 file descriptors when debugging enabled. Add debug output.
1155 (Descriptors::release): Add debug output.
1156 (Descriptors::close_some_descriptor): Likewise.
1157 (Descriptors::close_all): Likewise.
1158 * fileread.cc (File_read::lock): Likewise.
1159 (File_read::unlock): Likewise.
1160
24dd5808
CC
11612015-02-02 Cary Coutant <ccoutant@google.com>
1162
1163 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1164 executable output file.
1165
fa89cc82
HS
11662015-01-22 Han Shen <shenhan@google.com>
1167
1168 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1169 (Target_arm::do_plt_address_for_global): New method.
1170 (Target_arm::do_plt_address_for_local): New method.
1171 (Target_arm::rel_irelative_section): New method.
1172 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1173 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1174 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1175 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1176 (Target_arm::Scan::check_non_pic): Add ifunc support.
1177 (Target_arm::Scan::local): Add ifunc support.
1178 (Target_arm::Scan::global): Add ifunc support.
1179 (Target_arm::make_plt_section): New method.
1180 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1181 (Target_arm::make_local_ifunc_plt_entry): New method.
1182 (Target_arm::got_irelative_): New member.
1183 (Target_arm::rel_irelative_): New member.
1184 (Target_arm::got_section): Add creation for got_irelative_.
1185 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1186 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1187 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1188 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1189 (Output_data_plt_arm::IRelative_data): New type.
1190 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1191 (Output_data_plt_arm::add_entry): Add more parameters.
1192 (Output_data_plt_arm::add_relocation): New method.
1193 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1194 (Output_data_plt_arm::rel_irelative): New method.
1195 (Output_data_plt_arm::entry_count): Modified.
1196 (Output_data_plt_arm::address_for_global): New method.
1197 (Output_data_plt_arm::address_for_local): New method.
23081de0 1198gold/
fa89cc82
HS
1199 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1200 (Output_data_plt_arm::insert_irelative_data): New method.
1201 (Output_data_plt_arm::irelative_rel_): New member.
1202 (Output_data_plt_arm::got_): New member.
1203 (Output_data_plt_arm::got_irelative_): New member.
1204 (Output_data_plt_arm::irelative_count_): New member.
1205 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1206 (Output_data_plt_arm::irelative_data_vec_): New member.
1207 (Output_data_plt_arm::do_write): Write out irelative entries.
1208 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1209 more parameters to ctor.
1210 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1211 more parameters to ctor.
1212 * output.h (Output_data_reloc::add_local_relative): New method.
1213 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1214
0f81d3f0
AM
12152015-01-29 Alan Modra <amodra@gmail.com>
1216
1217 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1218 and GOT_TLSGD to LE optimization.
1219
65d92137
CC
12202015-01-28 Cary Coutant <ccoutant@google.com>
1221
1222 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1223 for undef TLS symbols.
1224 (Target_x86_64::Relocate::relocate_tls): Likewise.
1225 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1226
5485698a
CC
12272015-01-25 Cary Coutant <ccoutant@google.com>
1228
1229 * output.cc (Output_segment::set_section_addresses): Fix calculation
1230 of size of relro segment.
1231
b01a4b04
AM
12322015-01-22 Alan Modra <amodra@gmail.com>
1233
1234 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1235 condition for need of ifunc plt entry.
1236 (Target_powerpc::Scan::global <got relocs>): Likewise.
1237
3d0064a9
CC
12382015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1239
1240 * mips.cc (reloc_high): Add r_sym.
1241 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1242 reloc_high constructor.
1243 (Mips_relocate_functions::relgot16_local): Likewise.
1244 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1245 r_type to decide whether LO16 matches HI16.
1246 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1247 rello16 and relgot16_local.
1248
a5cd8f05
CC
12492015-01-09 Cary Coutant <ccoutant@google.com>
1250
1251 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1252 unless alignment is larger than page size.
1253
4fc1b9d4
L
12542015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1255 Cary Coutant <ccoutant@google.com>
1256
1257 PR gold/17729
1258 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1259 (DEFAULT_TARGET_X32): Set for x32.
1260 * x86_64.cc (cmp_insn_32): New.
1261 (lea_r10_insn_32): Likewise.
1262 (lea_r11_insn_32): Likewise.
1263 (cmp_insn_64): Likewise.
1264 (lea_r10_insn_64): Likewise.
1265 (lea_r11_insn_64): Likewise.
1266 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1267 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1268 (check_DATA): Add split_x32 files.
1269 (split_x32_[1234n].o): New targets.
1270 (split_x32_[124]): New targets.
1271 (split_x32_[1234r].stdout): New targets.
1272 * testsuite/split_x32.sh: New file.
1273 * testsuite/split_x32_1.s: Likewise.
1274 * testsuite/split_x32_2.s: Likewise.
1275 * testsuite/split_x32_3.s: Likewise.
1276 * testsuite/split_x32_4.s: Likewise.
1277 * testsuite/split_x32_n.s: Likewise.
1278 * configure: Regenerated.
1279 * testsuite/Makefile.in: Likewise.
1280
e749cab8
L
12812015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1282
1283 PR gold/17809
1284 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1285 x32.
1286
af759df0
AM
12872015-01-02 Alan Modra <amodra@gmail.com>
1288
1289 * version.cc (print_version): Just print current year.
1290 * dwp.cc (print_version): Likewise.
1291
b90efa5b
AM
12922015-01-01 Alan Modra <amodra@gmail.com>
1293
1294 Update year range in copyright notice of all files.
1295
f12d1e8a
AM
12962014-12-25 Alan Modra <amodra@gmail.com>
1297
1298 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1299 new enums.
1300 (Target_arm::merge_object_attributes, ): Likewise.
1301
5c294fee
TG
13022014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1303
1304 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1305 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1306 AEABI_VFP_args_vfp to check that.
1307 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1308 value and replace hardcoded values by enum values.
1309
e30880c2
CC
13102014-12-22 Cary Coutant <ccoutant@google.com>
1311
1312 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1313
bd040da1
L
13142014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1315
1316 PR gold/14608
1317 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1318 to "return i * i * 3;".
1319
e02a4046
CC
13202014-12-16 Cary Coutant <ccoutant@google.com>
1321
1322 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1323 (Mapfile::print_output_data): Use current_data_size() to avoid
1324 assert for sections requiring postprocessing; if address is not valid,
1325 print 0.
1326 (Mapfile::print_output_section): Use current_data_size(); print note
1327 that addresses and sizes are before compression.
1328
add6016b
L
13292014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1330
1331 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1332 Cast current_group_size to unsigned long when reporting error.
1333
0bf32ea9
JY
13342014-12-10 Jing Yu <jingyu@google.com>
1335
1336 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1337 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1338 Update error message.
1339 (Target_aarch64::do_relax): Use absolute value of option
1340 stub_group_size. Replace local variable with class member
1341 stub_group_size_.
1342
cbcb23fa
AM
13432014-12-04 Alan Modra <amodra@gmail.com>
1344
1345 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1346 addend of PLTREL24 reloc when not generating a plt stub. Make
1347 max_branch_offset an "Address".
fbad6518 1348 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1349 (Target_powerpc::Relocate::relocate): Likewise.
1350
1611bc4a
AM
13512014-12-04 Alan Modra <amodra@gmail.com>
1352
1353 PR 17670
1354 * symtab.cc (Symbol::set_undefined): Remove assertion.
1355 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1356 on symbols defined in discarded sections, instead return false.
1357 Rearrange params, update all callers.
1358 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1359 branches to syms in discarded sections.
1360 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1361 undefined and flag as discarded.
1362 (Target_powerpc::Relocate::relocate): Localize variable.
1363
4759c34e
L
13642014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1365
1366 PR gold/17675
1367 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1368 * testsuite/Makefile.in: Regenerated.
1369
1f98a074
AM
13702014-12-03 Alan Modra <amodra@gmail.com>
1371
1372 PR 17566
1373 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1374 when adding dynamic relocations against section symbols.
1375
fb257835
DI
13762014-12-01 Dimitry Ivanov <dimitry@google.com>
1377
1378 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1379 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1380 * options.h (General_options): New -z option (global).
1381
d8e60314
CC
13822014-12-01 Cary Coutant <ccoutant@google.com>
1383
1384 PR gold/17578
1385 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1386 is given.
1387 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1388 given but some inputs require executable stack.
1389
982bbd97
CC
13902014-11-26 Cary Coutant <ccoutant@google.com>
1391
1392 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1393 .debug_str_offsets; strip .debug_gnu_pubnames and
1394 .debug_gnu_pubtypes.
1395 (lines_only_debug_sections): Strip all four new sections.
1396
bb779192
HS
13972014-11-26 Jing Yu <jingyu@google.com>
1398
1399 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1400 register to be x0 when to relax TLSDESC_LD64_LO12.
1401
a3e60ddb
AM
14022014-11-26 Alan Modra <amodra@gmail.com>
1403
1404 * powerpc.cc (struct Stub_table_owner): New.
1405 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1406 unsigned int vector. Update all references.
1407 (powerpc_relobj::set_stub_table): Take an unsigned int param
1408 rather than a Stub_table. Update callers.
1409 (Powerpc_relobj::clear_stub_table): New function.
1410 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1411 stub_group_size_ vars.
1412 (Target_powerpc::new_stub_table): Delete.
1413 (max_branch_delta): New function, extracted from..
1414 (Target_powerpc::Relocate::relocate): ..here..
1415 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1416 status on whether stub created successfully.
1417 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1418 default sizing to..
1419 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1420 reduce on relax failure.
1421 (Target_powerpc::group_sections): Add "no_size_errors" param.
1422 Use stub_group_size_. Set up group info in a temp vector,
1423 before building Stub_table vector. Account for input sections
1424 possibly already converted to relaxed sections.
1425 (Stub_table::init): Delete. Merge into..
1426 (Stub_table::Stub_table): ..here.
1427 (Stub_table::can_reach_stub): New function.
1428 (Stub_table::add_plt_call_entry): Add "from" parameter and
1429 return true iff stub could be reached.
1430 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1431 param too.
1432 (Stub_table::clear_stubs): Add "all" param.
1433
a20605cf
AM
14342014-11-26 Alan Modra <amodra@gmail.com>
1435
1436 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1437 (Target_powerpc::group_sections): Use it.
1438
43b64deb
CC
14392014-11-25 Cary Coutant <ccoutant@google.com>
1440
1441 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1442 (Binary_to_elf::write_symbol): Add st_size parameter.
1443 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1444
c924eb67
CC
14452014-11-25 Cary Coutant <ccoutant@google.com>
1446
1447 PR gold/17639
1448 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1449 (Sized_relobj_file::do_layout): Handle deferred sections properly
1450 during GC pass 1. Don't add reloc sections to deferred list twice.
1451 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1452 (Sized_relobj_file::is_deferred_layout_): New data member.
1453
9d585188
L
14542014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1455
1456 PR gold/17619
1457 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1458 Check PC-relative offset overflow in PLT entry.
1459
3ffaac20
AM
14602014-11-21 Alan Modra <amodra@gmail.com>
1461
1462 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1463 for undefined weaks.
1464
0cfb0717
AM
14652014-11-20 Alan Modra <amodra@gmail.com>
1466
1467 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1468 from --stub-group-size parameter divided by 1024.
1469 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1470 template parameter. Update all uses.
1471 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1472 has_stub_value. Set for long branches. Don't report overflow for
1473 branch to undefined weak symbols. Print info message on
1474 overflowing branch to stub.
1475
f9dffbf0
AM
14762014-11-20 Alan Modra <amodra@gmail.com>
1477
1478 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1479
e88ba8d5
L
14802014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1481
1482 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1483 entry for R_X86_64_GOTPLT64.
1484 (Target_x86_64<size>::Relocate::relocate): Update comments for
1485 R_X86_64_GOTPLT64.
1486
d37ffe25
ED
14872014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1488
1489 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1490 * plugin.h: add lock definition
1491
9726c3c1
HS
14922014-10-29 Han Shen <shenhan@google.com>
1493 Jing Yu <jingyu@google.com>
1494
1495 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1496 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1497 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1498 Symbol::TLS_REF.
1499 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1500 method.
1501 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1502 (Target_aarch64::tls_ld_to_le): New method.
1503 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1504 for 64bit targets.
1505 (Output_data_plt_aarch64::irelative_rel_): New data member.
1506 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1507 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1508 (Output_data_plt_aarch64::add_relocation): New method.
1509 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1510 offset. Add got_irelative size to got size.
1511 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1512 type string with the new typename.
1513 (AArch64_relocate_functions::update_adr): Replace parameter x with
1514 immed.
1515 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1516 (AArch64_relocate_functions::reloc_common): New method.
1517 (AArch64_relocate_funcsions::rela_general): Extract common part out
1518 into reloc_common method.
1519 (AArch64_relocate_functions::rela_general): Likewise.
1520 (AArch64_relocate_functions::pcrela_general): Likewise.
1521 (AArch64_relocate_functions::adr): New method.
1522 (AArch64_relocate_functions::adrp): Calculate immed before calling
1523 update_adr.
1524 (AArch64_relocate_functions::adrp): Likewise.
1525 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1526 comparing x to 0. Calculate immed from ~x when x < 0.
1527 (Target_aarch64::optimize_tls_reloc): Add new cases for
1528 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1529 TLSLD_MOVW_DTPREL_G0_NC.
1530 (Target_aarch64::possible_function_pointer_reloc): Implement this
1531 method.
1532 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1533 comment.
1534 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1535 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1536 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1537 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1538 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1539 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1540 (Target_aarch64::make_plt_entry): Call add_entry with two more
1541 parameters.
1542 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1543 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1544 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1545 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1546 (Target_aarch64::Relocate::relocate_tls): Add cases for
1547 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1548 TLSLD_MOVW_DTPREL_G0_NC.
1549 * testsuite/icf_safe_so_test.cc: Correct test comment.
1550 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1551
80272b8c
AM
15522014-10-22 Alan Modra <amodra@gmail.com>
1553
1554 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1555 thread_starter.
1556
998a69f4
AS
15572014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1558
1559 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1560
aed56ec5
CC
15612014-10-17 Cary Coutant <ccoutant@google.com>
1562
1563 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1564 Add "typename" keyword.
1565
bb779192 15662014-10-15 Han Shen <shenhan@google.com>
72f4393d 1567 Jing Yu <jingyu@google.com>
83a01957
HS
1568
1569 Patch for gold aarch64 backend to support relaxation.
1570 * aarch64-reloc.def: Change format.
1571 * aarch64.cc (class Reloc_stub): New class.
1572 (class Stub_table): New class.
1573 (class AArch64_relobj): New class.
1574 (class AArch64_input_section): New class.
1575 (class AArch64_output_section): New class.
1576 (Target_aarch64::new_stub_table): New method.
1577 (Target_aarch64::new_aarch64_input_section): New method.
1578 (Target_aarch64::find_aarch64_input_section): New method.
1579 (Target_aarch64::scan_section_for_stubs): New method.
1580 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1581 (Target_aarch64::relocate_stub): New method.
1582 (Target_aarch64::current_target): New method.
1583 (Target_aarch64::do_make_elf_object): New method.
1584 (Target_aarch64::do_may_relax): New method.
1585 (Target_aarch64::do_relax): New method.
1586 (Target_aarch64::group_sections): New method.
1587 (Target_aarch64::scan_reloc_for_stub): New method.
1588 (Target_aarch64::do_make_output_section): New method.
1589 (Target_aarch64::stub_tables_): New data member.
1590 (Target_aarch64::aarch64_input_section_map_): New data member.
1591 (AArch64_relocate_functions::maybe_apply_stub): New method.
1592
db4c9594
CC
15932014-09-30 Cary Coutant <ccoutant@google.com>
1594
1595 PR gold/17432
1596 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1597
cd6da036
KC
15982014-09-30 Kito Cheng <kito@0xlab.org>
1599
1600 PR gold/13597
1601 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1602 hash table before sysv-style hash table.
1603
5f772412
ST
16042014-09-29 Sriraman Tallam <tmsriram@google.com>
1605
1606 * options.h (--pic-executable): Add negative to alias to -no-pie.
1607
5efeedf6
CC
16082014-09-26 Cary Coutant <ccoutant@google.com>
1609
1610 PR gold/16773
1611 * object.cc (Sized_relobj_file): Compute value of section symbols
1612 for TLS sections the same as TLS symbols.
1613
1707f183
CC
16142014-09-25 Cary Coutant <ccoutant@google.com>
1615
1616 PR gold/17432
1617 * resolve.cc (Symbol_table::resolve): Override common placeholder
1618 symbols, but adjust sizes.
1619 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1620 symbols to common lists.
1621
00cac886
AM
16222014-09-24 Alan Modra <amodra@gmail.com>
1623
1624 * po/POTFILES.in: Regenerate.
1625
635aa30e 16262014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1627 Cary Coutant <ccoutant@google.com>
635aa30e 1628
71b9b91b 1629 PR gold/14860
635aa30e
CC
1630 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1631 on input_sections_blocker.
1632 * layout.cc (Write_sections_task::locks): Unblock
1633 input_sections_blocker_.
1634 * layout.h (Write_sections_task::Write_sections_task): Add
1635 input_sections_blocker.
1636 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1637 to DEPENDENCIES.
1638 * testsuite/Makefile.in: Regenerate.
1639
c0c71592
RÁE
16402014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1641
1642 * testsuite/Makefile.am (plugin_test_10): New test.
1643 * testsuite/Makefile.in: Regenerate
1644 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1645 * testsuite/plugin_test_10.sh: New file.
1646
6168c2a1
RÁE
16472014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1648
1649 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1650 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1651 during the replacement phase.
1652
3a531937
JY
16532014-09-17 Han Shen <shenhan@google.com>
1654 Jing Yu <jingyu@google.com>
1655
1656 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1657 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1658 * aarch64.cc (Target_aarch64): Add data members
1659 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1660 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1661 constructor.
1662 (Target_aarch64::do_reloc_symbol_index): New method.
1663 (Target_aarch64::do_reloc_addend): New method.
1664 (Target_aarch64::add_tlsdesc_info): New method.
1665 (Target_aarch64::do_dynsym_value): New method.
1666 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1667 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1668 (Target_aarch64::make_data_plt): Add new parameters: got,
1669 got_irelative. Pass them to do_make_data_plt.
1670 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1671 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1672 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1673 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1674 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1675 (Target_aarch64::got_tlsdesc_section): New method.
1676 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1677 (Target_aarch64::define_tls_base_symbol): New method.
1678 (Target_aarch64::reserve_tlsdesc_entries): New method.
1679 (Target_aarch64::got_mod_index_entry): New method.
1680 (Target_aarch64::rela_tlsdesc_section): New method.
1681 (Target_aarch64::rela_irelative_section): New method.
1682 (Target_aarch64::Tlsdesc_info): New struct.
1683 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1684 relocations and tlsdesc relocations.
1685 (Target_aarch64::optimize_tls_reloc): Implement method.
1686 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1687 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1688 in constructor.
1689 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1690 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1691 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1692 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1693 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1694 (Output_data_plt_aarch64::rela_irelative): New method.
1695 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1696 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1697 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1698 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1699 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1700 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1701 (Output_data_plt_aarch64_standard): New member variables:
1702 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1703 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1704 New parameter: got, got_irelative.
1705 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1706 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1707 (Output_data_plt_aarch64::do_write): Replace got_address with
1708 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1709 (AArch64_relocate_functions::update_movnz): New method.
1710 (AArch64_relocate_functions): Correct format.
1711 (AArch64_relocate_functions::movnz): New method.
1712 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1713 before the switch. Add new cases to switch.
00cac886 1714 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1715 tlsgd tlsdesc cases.
1716 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1717 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1718 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1719 Call reloc_name_in_error_message to print unsupported reloc.
1720 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1721 make_data_plt.
1722 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1723 relocs. Fill in some more dynamic tags.
1724 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1725 Skip call tls_get_addr when tlsgd is relaxed.
1726 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1727 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1728 tlsdesc->ie relaxation.
1729
62661c93
SS
17302014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1731
1732 * mips.cc (Target_mips_nacl): New class.
1733 (Target_selector_mips_nacl): New class.
1734 (target_selector_mips32): Rename from target_selector_mips32be and use
1735 Target_selector_mips_nacl instead of Target_selector_mips.
1736 (target_selector_mips32el): Rename from target_selector_mips32 and use
1737 Target_selector_mips_nacl instead of Target_selector_mips.
1738 (target_selector_mips64): Rename from target_selector_mips64be and use
1739 Target_selector_mips_nacl instead of Target_selector_mips.
1740 (target_selector_mips64el): Rename from target_selector_mips64 and use
1741 Target_selector_mips_nacl instead of Target_selector_mips.
1742 (Target_mips::mips_info): Add const attribute.
1743
54674d38
CC
17442014-09-02 Cary Coutant <ccoutant@google.com>
1745
1746 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1747 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1748 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1749 (Sized_incr_dynobj::do_section_name): Likewise.
1750 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1751 (Sized_incr_dynobj::do_section_name): Likewise.
1752 * object.h (Object::section_name): Likewise.
1753 (Object::do_section_name): Likewise.
1754 (Sized_relobj_file::do_section_name): Likewise.
1755 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1756 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1757
9860cbcf
CC
17582014-09-02 Cary Coutant <ccoutant@google.com>
1759
1760 PR gold/17005
1761 * ehframe.cc (Fde::write): Add output_offset parameter.
1762 (Cie::write): Likewise.
1763 (Eh_frame::set_final_data_size): Account for offset within output
1764 section.
1765 (Eh_frame::do_sized_write): Likewise.
1766 * ehframe.h (Fde::write): Add output_offset parameter.
1767 (Cie::write): Likewise.
1768 * output.cc (Output_section::Input_section_sort_entry): Remove
1769 section_has_name_; add output_section_name parameter. Use
1770 output section name for non-input sections.
1771 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1772 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1773 (Output_section::Input_section_sort_compare): Remove logic for
1774 sections without names.
1775 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1776 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1777 Likewise.
1778 (Output_section::Input_section_sort_section_name_compare): Likewise.
1779
8e33481e
HS
17802014-08-29 Han Shen <shenhan@google.com>
1781 Jing Yu <jingyu@google.com>
1782
1783 * aarch64-reloc-property.cc
1784 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1785 reference reloc property in the table.
1786 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1787 3 other entries.
1788 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1789 2 new overloaded methods.
1790 (Output_data_got_aarch64::do_write): Add code to write out
1791 static relocs.
1792 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1793 static relocs.
1794 (Output_data_got_aarch64::static_relocs): New vector to
1795 hold static relocs.
1796 (Target_aarch64::TCB_SIZE): New const static memeber.
1797 (Target_aarch64::tcb_size): New method.
1798 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1799 (Target_aarch64::Relocate::relocate_tls): New method.
1800 (Target_aarch64::Scan::local): Add code handling new reloc types.
1801 (Target_aarch64::Scan::global): Add code handling new reloc types.
1802
81233653
ST
18032014-08-13 Sriraman Tallam <tmsriram@google.com>
1804
1805 * options.h (-no-pie): Add option.
1806
9363c7c3
JY
18072014-08-08 Jing Yu <jingyu@google.com>
1808 Han Shen <shenhan@google.com>
1809
1810 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1811 (DEFFILES): add aarch64-reloc.def.
1812 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1813 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1814 * Makefile.in: Regenerate.
1815 * aarch64-reloc-property.cc: New file.
1816 * aarch64-reloc-property.h: New file.
1817 * aarch64-reloc.def: New file.
1818 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1819 with tab to make the format consistent.
1820 (Output_data_got_aarch64::symbol_table_): New method.
1821 (Target_aarch64::do_plt_address_for_global): New method.
1822 (Target_aarch64::do_plt_address_for_local): New method.
1823 (Target_aarch64::do_select_as_default_target): New method.
1824 (Target_aarch64::do_make_data_plt): New method.
1825 (Target_aarch64::make_data_plt): New method.
1826 (Output_data_plt_aarch64::has_irelative_section): New method.
1827 (Output_data_plt_aarch64::address_for_global): New method.
1828 (Output_data_plt_aarch64::address_for_local): New method.
1829 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1830 (Output_data_plt_aarch64::add_entry): Implement contents.
1831 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1832 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1833 the got_pov entry to plt0.
1834 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1835 Implement contents.
1836 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1837 (AArch64_howto): New struct.
1838 (aarch64_howto[]): New static const array.
1839 (AArch64_relocate_functions): New class.
1840 (Target_aarch64::Scan::get_reference_flags): Remove method.
1841 (Target_aarch64::Scan::local): Implement to support a few relocations.
1842 (Target_aarch64::Scan::global): Implement to support a few relocations.
1843 (Target_aarch64::make_plt_section): Implement contents.
1844 (Target_aarch64::make_plt_entry): Implement contents.
1845 (Target_aarch64::do_finalize_sections): Implement contents.
1846 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1847 (Target_aarch64::relocate_section): Implement contents.
1848
ad9fe6c1
AM
18492014-08-06 Alan Modra <amodra@gmail.com>
1850
1851 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1852
7cd4e5b7
AM
18532014-08-06 Alan Modra <amodra@gmail.com>
1854
1855 PR 13227
1856 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1857
5ad9b0a7
ST
18582014-07-21 Sriraman Tallam <tmsriram@google.com>
1859
1860 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1861 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1862
e051745c
CC
18632014-07-08 Cary Coutant <ccoutant@google.com>
1864
1865 * expression.cc (struct Expression::Expression_eval_info): Add
1866 new fields type_pointer, vis_pointer, and nonvis_pointer.
1867 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1868 nonvis_pointer parameters. Adjust all calls.
1869 (Symbol_expression::value): Update type, visibility, and nonvis bits
1870 in caller.
1871 * script.cc (Symbol_assignment::sized_finalize): Update type,
1872 visibility, and remaining st_other bits for new symbol.
1873 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1874 vis_pointer, and nonvis_pointer parameters.
1875 * symtab.h (Symbol::set_type): New method.
1876
1877 * testsuite/Makefile.am (defsym_test): New test.
1878 * testsuite/Makefile.in: Regenerate.
1879 * testsuite/defsym_test.c: New file.
1880 * testsuite/defsym_test.sh: New file.
1881
f35c4853
CC
18822014-07-08 Cary Coutant <ccoutant@google.com>
1883
1884 PR gold/15639
1885 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1886 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1887 (Sized_dynobj::base_read_symbols): ...new method.
1888 * object.h (Sized_relobj_file::base_read_symbols): New method.
1889 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1890 (Sized_relobj_file::base_read_symbols): ...new method.
1891 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1892 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1893 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1894
2900af2d
AM
18952014-07-04 Alan Modra <amodra@gmail.com>
1896
1897 * po/POTFILES.in: Regenerate.
1898
053a4d68
JY
18992014-07-02 Jing Yu <jingyu@google.com>
1900
1901 * aarch64.cc: New file
1902 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1903 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1904 * Makefile.in: Regenerate.
1905 * configure.tgt: Add entries for aarch64*.
1906 * configure.ac: Likewise.
1907 * configure: Likewise.
1908
7b549045
AM
19092014-06-27 Alan Modra <amodra@gmail.com>
1910
1911 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1912
cb818dbf
CC
19132014-06-24 Cary Coutant <ccoutant@google.com>
1914
1915 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1916 sections.
1917 (Dwo_file::sized_read_unit_index): Likewise.
1918
9810d34d
SS
19192014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1920
1921 * mips.cc: New file.
1922 * Makefile.am (TARGETSOURCES): Add mips.cc
1923 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1924 * configure.tgt: Add entries for mips*.
1925 * configure.ac: Likewise.
1926 * Makefile.in: Regenerate.
1927 * configure: Likewise.
1928
9baa787b
CC
19292014-06-09 Cary Coutant <ccoutant@google.com>
1930
1931 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1932 unit_length is within section bounds.
1933
8f89af0a
CC
19342014-06-09 Cary Coutant <ccoutant@google.com>
1935
1936 PR gold/16980
1937 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1938 map.
1939
a47622ac
AM
19402014-06-07 Alan Modra <amodra@gmail.com>
1941
1942 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1943
4320c691
CC
19442014-06-06 Cary Coutant <ccoutant@google.com>
1945
1946 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1947 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1948 (Dwarf_pubnames_table::read_header): Likewise.
1949 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1950 .debug_gnu_pubtypes.
1951
270c9937
JB
19522014-06-05 Joel Brobecker <brobecker@adacore.com>
1953
1954 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1955 * Makefile.in, configure: Regenerate.
1956
397998fc
AM
19572014-06-03 Alan Modra <amodra@gmail.com>
1958
1959 * powerpc.cc (addis_12_2): Define.
1960 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1961
61f5c66f
AM
19622014-06-03 Alan Modra <amodra@gmail.com>
1963
1964 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1965 st_other output.
1966
f6971787
AM
19672014-06-02 Alan Modra <amodra@gmail.com>
1968
1969 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1970 Only ignore relocs on ELFv1.
1971 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1972
f6fb8322
CC
19732014-05-30 Cary Coutant <ccoutant@google.com>
1974
1975 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1976 * testsuite/Makefile.in: Regenerate.
1977 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1978
c23dd342
L
19792014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1980
1981 PR gold/16945
1982 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1983 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1984
5fe7ffdc
AM
19852014-05-15 Alan Modra <amodra@gmail.com>
1986
1987 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
1988 Compare FDE contents with DW_CFA_nop rather than 0.
1989
a82bef93
ST
19902014-05-13 Sriraman Tallam <tmsriram@google.com>
1991
1992 * symtab.h (may_need_copy_reloc): Remove check for position independent
1993 code.
1994 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
1995 position independence before pc absolute may_need_copy_reloc call.
1996 Add check for executable output befor pc relative may_need_copy_reloc
1997 call.
1998 * i386.cc: Ditto.
1999 * arm.cc: Ditto.
2000 * sparc.cc: Ditto.
2001 * tilegx.cc: Ditto.
2002 * powerpc.cc: Add check for no position independence before
2003 may_need_copy_reloc calls.
2004 * testsuite/pie_copyrelocs_test.cc: New file.
2005 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2006 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2007 * Makefile.in: Regenerate.
a82bef93 2008
53c66605
ML
20092014-05-08 Martin Liška <mliska@suse.cz>
2010
2011 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2012
57b2284c
CC
20132014-05-06 Cary Coutant <ccoutant@google.com>
2014
2015 PR gold/16900
2016 * i386.cc (Output_data_got_plt_i386): New class.
2017 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2018 parameter. Change all callers.
2019 (Output_data_plt_i386::layout_): Remove.
2020 (Output_data_plt_i386::got_plt_): Change type.
2021 (Target_i386::got_plt_): Change type. Change all references.
2022 (Target_i386::got_section): Create instance of new class.
2023 (Output_data_got_plt_i386::do_write): New function.
2024 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2025 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2026 parameter. Change all callers.
2027 (Output_data_plt_x86_64::layout_): Remove.
2028 (Output_data_plt_x86_64::got_plt_): Change type.
2029 (Target_x86_64::got_plt_): Change type. Change all references.
2030 (Target_x86_64::got_section): Create instance of new class.
2031 (Output_data_got_plt_x86_64::do_write): New function.
2032 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2033 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2034 class.
2035
6b97515d 20362014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2037
6b97515d
CC
2038 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2039 if we have pubnames/pubtypes.
2040
d1bddd3c
CC
20412014-05-02 Cary Coutant <ccoutant@google.com>
2042
5fe7ffdc
AM
2043 * defstd.cc (in_segment): Define __ehdr_start here...
2044 * layout.cc (Layout::finalize): ...Instead of here. Set the
2045 output segment when known.
2046 * resolve.cc (Symbol::override_base_with_special): Remember
2047 the original binding.
2048 * symtab.cc (Symbol::set_output_segment): New function.
2049 (Symbol::set_undefined): New function.
2050 * symtab.h (Symbol::is_weak_undefined): Check original undef
2051 binding.
2052 (Symbol::is_strong_undefined): New function.
2053 (Symbol::set_output_segment): New function.
2054 (Symbol::set_undefined): New function.
2055 * target-reloc.h (is_strong_undefined): Remove.
2056 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2057 Check for hidden undefs.
2058 (relocate_section): Call Symbol::is_strong_undefined.
2059
2060 * testsuite/Makefile.am (ehdr_start_test_1)
2061 (ehdr_start_test_2, ehdr_start_test_3)
2062 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2063 * testsuite/Makefile.in: Regenerate.
2064 * testsuite/ehdr_start_def.cc: New source file.
2065 * testsuite/ehdr_start_test.cc: New source file.
2066 * testsuite/ehdr_start_test.t: New linker script.
2067 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2068
7849f6d8
CC
20692014-04-23 Cary Coutant <ccoutant@google.com>
2070
bf2cc635 2071 PR gold/16870
7849f6d8
CC
2072 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2073
99fd8cff
CC
20742014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2075
2076 * layout.cc (Layout::include_section): Allow a target to decide
2077 whether to include a section.
2078 * target.h (Target::should_include_section): New function.
2079 (Target::do_should_include_section): New function.
2080
91f43acd
CC
20812014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2082
2083 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2084 inline into ...
2085 (Copy_relocs::emit): ... here.
2086 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2087 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2088 (Copy_reloc_entry::entries_): Change from private to protected.
2089
c4eb27e1
ST
20902014-04-02 Sriraman Tallam <tmsriram@google.com>
2091
2092 * icf.cc (get_section_contents): Replace copies of reloc
2093 vectors with const references.
2094
ae447ddd
CC
20952014-04-02 Cary Coutant <ccoutant@google.com>
2096
2097 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2098 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2099 * configure: Regenerate.
2100 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2101 -fno-use-linker-plugin.
2102 (LINK1, CXXLINK1): Add it to the link command.
2103 * testsuite/Makefile.in: Regenerate.
2104
fa47fa92
AM
21052014-03-12 Alan Modra <amodra@gmail.com>
2106
2107 * Makefile.in: Regenerate.
2108
9b12c500
CC
21092014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2110
2111 * symtab.h (Symbol::set_nonvis): New function.
2112
beacaa96
CC
21132014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2114
2115 * symtab.cc (Sized_symbol<32>::init_output_data):
2116 Instantiate the template.
2117 (Sized_symbol<64>::init_output_data): Likewise.
2118
800d9823
CC
21192014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2120
2121 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2122 adjust dynamic symbol value.
2123 * target.h (Target::adjust_dyn_symbol): New function.
2124 (Target::do_adjust_dyn_symbol): New function.
2125
918fc1f8 21262014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2127
918fc1f8
CC
2128 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2129 Get the value of DYNAMIC_CUSTOM dynamic entry.
2130 * output.h (Output_data_dynamic::add_custom): New function.
2131 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2132 dynamic entry.
2133 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2134 * target.h (Target::dynamic_tag_custom_value): New function.
2135 (Target::do_dynamic_tag_custom_value): New function.
2136
98ff9231
CC
21372014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2138
2139 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2140 dynsym indexes.
2141 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2142 (Target::do_has_custom_set_dynsym_indexes): New function.
2143 (Target::set_dynsym_indexes): New function.
2144 (Target::do_set_dynsym_indexes): New function.
2145
b80eed39
AM
21462014-03-07 Alan Modra <amodra@gmail.com>
2147
2148 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2149 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2150 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2151 (Powerpc_relocate_functions::has_overflow_bitfield,
2152 overflowed): Use the above.
2153 (Target_powerpc::Relocate::relocate): Correct overflow checking
2154 for a number of relocations. Modify overflow test for 16-bit
2155 fields in instructions to signed/unsigned according to whether
2156 the field takes a signed or unsigned value.
2157
4b95cf5c
AM
21582014-03-05 Alan Modra <amodra@gmail.com>
2159
2160 Update copyright years.
2161
45965137
AM
21622014-03-05 Alan Modra <amodra@gmail.com>
2163
2164 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2165 R_PPC64_ADDR64_LOCAL.
2166 (Target_powerpc::Relocate::relocate): Likewise.
2167
2c80b753
AM
21682014-03-03 Alan Modra <amodra@gmail.com>
2169
2170 * dwp.cc (print_version): Update copyright year to current.
2171
c1c69e83
AM
21722014-02-10 Alan Modra <amodra@gmail.com>
2173
2174 * po/gold.pot: Regenerate.
2175
dd0c4e70
CC
21762014-02-06 Cary Coutant <ccoutant@google.com>
2177
2178 Fix problem where -u is ignored when a weak undef is seen.
2179
2180 * archive.cc (Library_base::should_include_member): Reorder
2181 code to check for -u option if a weak undef has already been seen.
2182 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2183 * testsuite/Makefile.in: Regenerate.
2184 * testsuite/weak_undef_file3.cc: New file.
2185 * testsuite/weak_undef_file4.cc: New file.
2186 * testsuite/weak_undef_test_2.cc: New file.
2187
1a221d3d
CC
21882014-02-05 Cary Coutant <ccoutant@google.com>
2189
2190 Fix issues with gold undefined symbol diagnostics.
2191
2192 PR binutils/15435
2193 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2194 check to here.
2195 * target-reloc.h (is_strong_undefined): New function.
2196 (relocate_section): Move undef vtable symbol check from here.
2197 Check for is_strong_undefined.
2198
e889f0a4 21992014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2200
e889f0a4
CC
2201 Fix problems with the --dynamic-list option.
2202
2203 PR gold/13577
2204 * options.cc (General_options::parse_dynamic_list):
2205 Set have_dynamic_list_.
2206 (General_options::General_options): Initialize have_dynamic_list_.
2207 (General_options::finalize): Turn off -Bsymbolic and
2208 -Bsymbolic-functions if --dynamic-list provided.
2209 * options.h (General_options::have_dynamic_list): New function.
2210 (General_options::have_dynamic_list_): New data member.
2211 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2212 correctly.
5fe7ffdc 2213
e889f0a4
CC
2214 PR gold/16530
2215 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2216 in --dynamic-list, mark it.
5fe7ffdc 2217
e889f0a4
CC
2218 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2219 (dynamic_list_2): New test case.
2220 * testsuite/Makefile.in: Regenerate.
2221 * testsuite/dynamic_list_2.cc: New file.
2222 * testsuite/dynamic_list_2.t: New file.
2223 * testsuite/dynamic_list_lib1.cc: New file.
2224 * testsuite/dynamic_list_lib2.cc: New file.
2225 * testsuite/gc_dynamic_list_test.c: New file.
2226 * testsuite/gc_dynamic_list_test.sh: New file.
2227 * testsuite/gc_dynamic_list_test.t: New file.
2228
ec673e64
CC
22292014-01-28 Cary Coutant <ccoutant@google.com>
2230
2231 Add .gdb_index version 7 support.
2232
2233 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2234 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2235 debug sections.
2236 (Dwarf_ranges_table::read_ranges_table): Likewise.
2237 (Dwarf_pubnames_table::read_section): Check for GNU-style
2238 sections, and for compressed debug sections.
2239 (Dwarf_pubnames_table::read_header): Compute end address of table.
2240 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2241 for end of list by offset, not by offset == 0.
2242 (Dwarf_info_reader::do_read_string_table): Check for compressed
2243 debug sections.
2244 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2245 Initialize new data members.
2246 (Dwarf_pubnames_table::next_name): return flag_byte.
2247 (Dwarf_pubnames_table::end_of_table_): New data member.
2248 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2249 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2250 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2251 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2252 read skeleton type unit DIEs.
2253 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2254 (Gdb_index::do_write): Write flag_byte.
2255 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2256 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2257 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2258 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2259
221fd5d5
L
22602014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2261
2262 * version.cc (print_version): Update copyright year to 2014.
2263
6c09fb0b
ILT
22642013-12-19 Dimitry Andric <dimitry@andric.com>
2265
2266 * stringpool.cc (Stringpool_template::reserve): Add
2267 HAVE_UNORDERED_MAP case.
2268 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2269
8356f2d0
CC
22702013-12-18 Cary Coutant <ccoutant@google.com>
2271
2272 * configure.ac: Check for <unordered_set> and <unordered_map>.
2273 * config.in: Regenerate.
2274 * configure: Regenerate.
2275 * system.h: Use <unordered_set> and <unordered_map> if available.
2276
f2c7d7ee
RM
22772013-12-10 Roland McGrath <mcgrathr@google.com>
2278
2279 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2280 with $(INSTALL_PROGRAM_ENV).
2281 * Makefile.in: Regenerate.
2282
6632e8cc
CC
22832013-11-22 Cary Coutant <ccoutant@google.com>
2284
2285 * configure.ac: Add check for which library is needed for
2286 dlopen.
2287 * configure: Regenerate.
2288
0c075858
CC
22892013-11-22 Cary Coutant <ccoutant@google.com>
2290
2291 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2292 assembler.
2293 * testsuite/Makefile.in: Regenerate.
2294
f49fe902
L
22952013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2296
2297 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2298 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2299 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2300 (Target_x86_64<size>::Scan::local): Likewise.
2301 (Target_x86_64<size>::Scan::global): Likewise.
2302 (Target_x86_64<size>::Relocate::relocate): Likewise.
2303 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2304 Likewise.
2305 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2306 R_X86_64_PC32_BND.
2307
2308 * testsuite/Makefile.am (check_PROGRAMS): Add
2309 exception_x86_64_bnd_test.
2310 (exception_x86_64_bnd_test_SOURCES): New macro.
2311 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2312 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2313 (exception_x86_64_bnd_test_LDADD): Likewise.
2314 (exception_x86_64_bnd_1.o): New rule.
2315 (exception_x86_64_bnd_2.o): Likewise.
2316 * testsuite/Makefile.in: Regenerated.
2317
9055360d
AM
23182013-11-15 Alan Modra <amodra@gmail.com>
2319
2320 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2321 accessor.
2322 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2323 Only call ppc64_local_entry_offset for 64-bit. Restrict
2324 symval_for_branch lookup to ELFv1.
2325 (Stub_table::add_plt_call_entry): Use unsigned int off.
2326 (Output_data_glink::Address, invalid_address): New.
2327 (Output_data_glink::add_eh_frame): Move out of line. Add
2328 support for ELFv2.
2329 (Output_data_glink::add_global_entry, find_global_entry,
2330 global_entry_address): New functions.
2331 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2332 ge_size): New variables.
2333 (Output_data_glink::set_final_data_size): Add global entry
2334 stub sizing.
2335 (Output_data_glink::do_write): Write global entry stubs.
2336 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2337 parameter. Return true for ELFv2. Adjust callers.
2338 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2339 ELFv1. Similarly for ifunc and dynamic relocation processing
2340 specific to ELFv1. Recognize that symbols are defined on
2341 their plt entries for ELFv2.
2342 (Target_powerpc::symval_for_branch): Assert if called for
2343 ELFv2 or ppc32.
2344 (Target_powerpc::Relocate::relocate): Use global entry plt
2345 stub for symbol value if such exists on ELFv2.
2346 (Target_powerpc::Relocate::relocate): Don't call
2347 symval_for_branch when ELFv2. Do adjust for local entry
2348 offset when ELFv2.
2349 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2350 plt stub for ELFv2.
2351 (Target_powerpc::do_plt_address_for_global): Similarly.
2352
cafdd569
CC
23532013-11-14 Cary Coutant <ccoutant@google.com>
2354
2355 Revert patch -- this did not fix the problem, and there is
2356 no race there.
2357
2358 2013-11-14 Cary Coutant <ccoutant@google.com>
2359
2360 PR gold/14860
2361 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2362 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2363 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2364 updating fde_offsets_.
2365 (Eh_frame_hdr::lock_): New data member.
2366
94e49e16
CC
23672013-11-14 Cary Coutant <ccoutant@google.com>
2368
2369 * dwp.cc (Dwo_file_entry): New type.
2370 (File_list): Use Dwo_file_entry.
2371 (Dwo_file::verify): New function.
2372 (Dwo_file::verify_dwo_list): New function.
2373 (Dwo_file::sized_verify_dwo_list): New function.
2374 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2375 list.
2376 (Dwp_options): New enum type.
2377 (dwp_options): Add --verify-only.
2378 (usage): Likewise.
2379 (main): Likewise.
2380 * dwp.h (gold_info): Add declaration.
2381
7cdd7d57
CC
23822013-11-14 Cary Coutant <ccoutant@google.com>
2383
2384 PR gold/14860
2385 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2386 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2387 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2388 updating fde_offsets_.
2389 (Eh_frame_hdr::lock_): New data member.
2390
1d946cb3
CC
23912013-11-06 Cary Coutant <ccoutant@google.com>
2392
2393 PR gold/15758
2394 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2395 before reloc sections.
2396
4f65b40e
AM
23972013-11-04 Alan Modra <amodra@gmail.com>
2398
2399 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2400 (Symbol::needs_dynamic_reloc): Test new flag.
2401 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2402 (Target_powerpc::Scan::get_reference_flags): Add target param.
2403 Return FUNC_DESC_ABI for 64-bit ELFv1.
2404 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2405 call.
2406 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2407 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2408
908794a9
CC
24092013-10-31 Cary Coutant <ccoutant@google.com>
2410
2411 Restore support for dwp v2 DWARF package file format.
2412
2413 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2414 tu_length parameter. Adjust all callers.
2415 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2416 * dwp.cc: Include dwarf.h.
2417 (Section_bounds): New struct type.
2418 (Unit_set): New struct type.
2419 (Dwo_file::Dwo_file): Initialize new data member.
2420 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2421 Combine and rename to...
2422 (Dwo_file::read_unit_index): ...this.
2423 (Dwo_file::sized_read_compunit_index)
2424 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2425 (Dwo_file::sized_read_unit_index): ...this.
2426 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2427 parameters; add section_id parameter.
2428 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2429 (Dwo_file::add_unit_set): ...this.
2430 (Dwo_file::shndx_map_): Remove.
2431 (Dwo_file::sect_offsets_): New data member.
2432 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2433 (Dwp_output_file::add_section): Rename to...
2434 (Dwp_output_file::add_contribution): ...this.
2435 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2436 (Dwp_output_file::add_tu_set): Likewise.
2437 (Dwp_output_file::Contribution): New type.
2438 (Dwp_output_file::Section::contributions): New data member.
2439 (Dwp_output_file::Cu_or_tu_set): Remove.
2440 (Dwp_output_file::Section::Section): New ctor.
2441 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2442 (Dwp_output_file::Dwp_index::Section_table): New type.
2443 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2444 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2445 parameter.
2446 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2447 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2448 (Dwp_output_file::Dwp_index::section_table): New member function.
2449 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2450 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2451 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2452 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2453 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2454 (Dwp_output_file::Dwp_index::section_table_): New data member.
2455 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2456 (Dwp_output_file::add_output_section): New member function.
2457 (Dwp_output_file::write_new_section): New member function.
2458 (Dwp_output_file::write_contributions): New member function.
2459 (Dwp_output_file::section_id_map_): New data member.
2460 (class Dwo_id_info_reader): Remove.
2461 (class Unit_reader): New class.
2462 (get_dwarf_section_name): New function.
2463 (Dwo_file::read_executable): Adjust initializations of class data.
2464 (Dwo_file::read): Add support for v2 package file format.
2465 (Dwo_file::read_unit_index): Likewise.
2466 (Dwo_file::sized_read_unit_index): Likewise.
2467 (Dwo_file::copy_section): Likewise.
2468 (Dwo_file::add_unit_set): Likewise.
2469 (Dwp_output_file::add_output_section): Likewise.
2470 (Dwp_output_file::add_contribution): Likewise.
2471 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2472 for empty slot.
2473 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2474 file format.
2475 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2476 slot.
2477 (Dwp_output_file::initialize): Remove unused function.
2478 (Dwp_output_file::finalize): Add support for v2 package file format.
2479 (Dwp_output_file::write_index): Likewise.
2480 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2481 function prototype.
2482
2500c017
CC
24832013-10-31 Cary Coutant <ccoutant@google.com>
2484
2485 * configure.ac: Fix check for -fmerge-constants.
2486 * configure.ac: Regenerate.
2487
dd0845d7
RM
24882013-10-30 Roland McGrath <mcgrathr@google.com>
2489
2490 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2491 Correct 9-byte nop sequence to match what the assembler generates.
2492
b4f7960d
AM
24932013-10-30 Alan Modra <amodra@gmail.com>
2494
2495 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2496 ppc64_local_entry_offset, ppc64_local_entry_offset,
2497 do_read_symbols): New functions.
2498 (Powerpc_relobj::e_flags_, st_other_): New vars.
2499 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2500 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2501 (Powerpc_relobj::e_flags_): New var.
2502 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2503 and adjust for ELFv2.
2504 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2505 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2506 (Powerpc_dynobj::do_find_special_sections): Likewise.
2507 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2508 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2509 to ELFv2 local entry.
2510 (Target_powerpc::do_relax): No thread safe barriers needed for
2511 ELFv2.
2512 (Output_data_plt_powerpc::initial_plt_entry_size_,
2513 plt_entry_size): Delete. Replace all uses with
2514 first_plt_entry_offset() and plt_entry_size().
2515 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2516 reserved_size parm. Update callers.
2517 (Output_data_plt_powerpc::entry_count): Update.
2518 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2519 and use Target_powerpc::first_plt_entry_offset().
2520 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2521 rename to plt_entry_size.
2522 (Output_data_plt_powerpc::add_ifunc_entry,
2523 add_local_ifunc_entry): Adjust reloc for ELFv2.
2524 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2525 (glink_eh_frame_fde_64v2): New.
2526 (Stub_table::plt_call_size): Support ELFv2 sizing.
2527 (Output_data_glink::add_eh_frame): Use the new FDE.
2528 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2529 (Stub_table::do_write): Write ELFv2 stubs and glink.
2530 (Target_powerpc::Relocate::relocate): Replaces nop after call
2531 with ld 2,24(1) and adjust local offset destination for ELFv2.
2532
f9c6b907
AM
25332013-10-30 Alan Modra <amodra@gmail.com>
2534
2535 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2536 (Target_powerpc::Scan::global, local): Likewise.
2537 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2538 on all ppc64 @h and @ha relocs.
2539
e84fe78f
AM
25402013-10-14 Alan Modra <amodra@gmail.com>
2541
2542 * output.h (Output_data_got::add_constant): Tidy.
2543 (Output_data_got::add_constant_pair): New function.
2544 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2545 methods used so as to first call reserve_ent().
2546
679e4abf
RM
25472013-10-11 Roland McGrath <mcgrathr@google.com>
2548
44dcb735
RM
2549 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2550 add_got_entry and add_got_entry_pair.
2551
13323c49
RM
2552 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2553 (HAVE_PUBNAMES): Likewise.
2554 * configure: Regenerate.
2555
1496b446
RM
2556 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2557 * testsuite/Makefile.in: Regenerate.
2558
cc84c10b
RM
2559 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2560 Remove const from declaration.
2561 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2562 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2563 * output.h (Output_file_header): Remove const from member target_
2564 and corresponding constructor argument.
2565 * output.cc (Output_file_header::Output_file_header): Update prototype.
2566 (Output_file_header::do_sized_write): Use this->target_ in place
2567 of parameters()->target().
2568
52f66a2c
RM
2569 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2570
2b64b551
RM
2571 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2572 * configure: Regenerate.
2573 * Makefile.in: Regenerate.
2574 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2575 * testsuite/merge_string_literals_2.c: Likewise.
2576 * testsuite/Makefile.am
2577 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2578 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2579 literal -fmerge-constants.
2580 * testsuite/Makefile.in: Regenerate.
2581
43819297
RM
2582 * i386.cc (Target_i386): Remove unused member dynbss_.
2583 * arm.cc (Target_arm): Likewise.
2584 * powerpc.cc (Target_powerpc): Likewise.
2585 * sparc.cc (Target_sparc): Likewise.
2586 * tilegx.cc (Target_tilegx): Likewise.
2587 * x86_64.cc (Target_x86_64): Likewise.
2588 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2589 type_signature_, type_offset_.
2590 * plugin.h (Plugin_hook): Remove unused member layout_.
2591 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2592 mapfile_.
2593 (Read_member): Remove unused members input_objects_, symtab_,
2594 mapfile_, layout_.
2595 (Check_library): Remove unused member symtab_.
2596 * archive.h (Lib_group): Remove unused member lib_.
2597 * archive.cc (Lib_group::Lib_group): Update initializer.
2598 * incremental.h (Incremental_binary): Remove unused member target_.
2599 (Incremental_script_entry): Removed unused member script_.
2600 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2601 * icf.h (Icf): Remove unused member num_tracked_relocs.
2602
39d9ead7
RM
2603 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2604 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2605 its only use.
2606 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2607
679e4abf
RM
2608 * archive.h: Use struct rather than class for forward declaration
2609 of Read_symbols_data.
2610
54de2ea6
CC
26112013-10-07 Cary Coutant <ccoutant@google.com>
2612
2613 PR gold/16010
2614 * testsuite/Makefile.am (icf_test): Fix dependencies.
2615 (icf_safe_test): Likewise.
2616 (icf_safe_so_test): Likewise.
2617 (large_symbol_alignment): Add empty _LDADD rule.
2618 * testsuite/Makefile.in: Regenerate.
2619
b14016f0
L
26202013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2621
2622 PR gold/15927
2623 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2624 relocation for R_X86_64_32 on x32.
2625
eb426534
RM
26262013-08-27 Roland McGrath <mcgrathr@google.com>
2627
2628 * output.cc (Output_segment::set_section_addresses): Take new
2629 Target* argument. If target->isolate_execinstr() and the segment
2630 is executable and starts at a target->abi_pagesize() boundary,
2631 pad its end out to a target->abi_pagesize() boundary with code fill.
2632 * output.h (Output_segment::set_section_addresses): Update decl.
2633 * layout.h (Layout::check_output_data_for_reset_values): Take new
2634 argument RELAX_OUTPUTS.
2635 (Layout): New member relax_output_list_.
2636 (Layout::add_relax_output): New method.
2637 * layout.cc (Layout::Layout): Update constructor.
2638 (Layout::reset_relax_output): New method.
2639 (Layout::clean_up_after_relaxation): Call it.
2640 (Layout::prepare_for_relaxation): Update caller.
2641 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2642 Call reset_relax_output before re-processing segments for
2643 isolate_execinstr case.
2644 (Layout::write_data): Handle relax_output_list_.
2645 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2646 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2647
9aff4b7a
NC
26482013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2649
2650 PR binutils/15834
2651 * object.h: Fix typos.
2652
93f8221c
RM
26532013-08-16 Roland McGrath <mcgrathr@google.com>
2654
2655 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2656 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2657
e44c3715
CC
26582013-08-07 Cary Coutant <ccoutant@google.com>
2659
2660 Revert support for v2 DWP files:
2661
2662 2013-03-01 Cary Coutant <ccoutant@google.com>
2663
2664 Add dwp support for v2 DWARF package file format.
2665 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2666 tu_length parameter. Adjust all callers.
2667 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2668 * dwp.cc: Include dwarf.h.
2669 (Section_bounds): New struct type.
2670 (Unit_set): New struct type.
2671 (Dwo_file::Dwo_file): Initialize new data member.
2672 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2673 Combine and rename to...
2674 (Dwo_file::read_unit_index): ...this.
2675 (Dwo_file::sized_read_compunit_index)
2676 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2677 (Dwo_file::sized_read_unit_index): ...this.
2678 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2679 parameters; add section_id parameter.
2680 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2681 (Dwo_file::add_unit_set): ...this.
2682 (Dwo_file::shndx_map_): Remove.
2683 (Dwo_file::sect_offsets_): New data member.
2684 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2685 (Dwp_output_file::add_section): Rename to...
2686 (Dwp_output_file::add_contribution): ...this.
2687 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2688 (Dwp_output_file::add_tu_set): Likewise.
2689 (Dwp_output_file::Contribution): New type.
2690 (Dwp_output_file::Section::contributions): New data member.
2691 (Dwp_output_file::Cu_or_tu_set): Remove.
2692 (Dwp_output_file::Section::Section): New ctor.
2693 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2694 (Dwp_output_file::Dwp_index::Section_table): New type.
2695 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2696 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2697 parameter.
2698 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2699 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2700 (Dwp_output_file::Dwp_index::section_table): New member function.
2701 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2702 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2703 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2704 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2705 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2706 (Dwp_output_file::Dwp_index::section_table_): New data member.
2707 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2708 (Dwp_output_file::add_output_section): New member function.
2709 (Dwp_output_file::write_new_section): New member function.
2710 (Dwp_output_file::write_contributions): New member function.
2711 (Dwp_output_file::section_id_map_): New data member.
2712 (class Dwo_id_info_reader): Remove.
2713 (class Unit_reader): New class.
2714 (get_dwarf_section_name): New function.
2715 (Dwo_file::read_executable): Adjust initializations of class data.
2716 (Dwo_file::read): Add support for v2 package file format.
2717 (Dwo_file::read_unit_index): Likewise.
2718 (Dwo_file::sized_read_unit_index): Likewise.
2719 (Dwo_file::copy_section): Likewise.
2720 (Dwo_file::add_unit_set): Likewise.
2721 (Dwp_output_file::add_output_section): Likewise.
2722 (Dwp_output_file::add_contribution): Likewise.
2723 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2724 for empty slot.
2725 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2726 file format.
2727 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2728 slot.
2729 (Dwp_output_file::initialize): Remove unused function.
2730 (Dwp_output_file::finalize): Add support for v2 package file format.
2731 (Dwp_output_file::write_index): Likewise.
2732 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2733 function prototype.
2734
c6905c28
CC
27352013-07-31 Cary Coutant <ccoutant@google.com>
2736
2737 * object.cc (Sized_relobj::do_output_section_address): New function.
2738 (Sized_relobj): Instantiate explicitly.
2739 * object.h (Object::output_section_address): New function.
2740 (Object::do_output_section_address): New function.
2741 (Sized_relobj::do_output_section_address): New function.
2742 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2743
27442013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2745 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2746
2747 * parameters.cc (Parameters::entry): Return target-specific entry
2748 symbol name.
2749 * target.h (Target::entry_symbol_name): New function.
2750 (Target_info::entry_symbol_name): New data member.
2751
2752 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2753 * i386.cc (Target_i386::i386_info): Likewise.
2754 (Target_i386_nacl::i386_nacl_info): Likewise.
2755 * sparc.cc (Target_sparc::sparc_info): Likewise.
2756 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2757 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2758 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2759 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2760
234d4ab8
SA
27612013-07-22 Sterling Augustine <saugustine@google.com>
2762
2763 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2764 Convert parameter shndx to local variable. Add parameters symtab
2765 and symtab_size. Scan over section names. Find relocation
2766 section corresponding to current section. Create and initialize
2767 reloc_mapper_ and reloc_type_.
2768 (Dwarf_pubnames_table::read_header): Add assertion. Change
2769 unit_length to off_t. Initialize member unit_length_. Fill in field
2770 cu_offset_.
2771 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2772 Initialize new fields unit_length_ and cu_offset_.
2773 (Dwarf_pubnames_table::read_section): Update prototype.
2774 (Dwarf_pubnames_table::cu_offset): New member function.
2775 (Dwarf_pubnames_table::subsection_size): Likewise.
2776 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2777 New fields.
2778 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2779 member functions public.
2780 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2781 Update comment. Rework logic. Move repeated parts to...
2782 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2783 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2784 pubtypes_table_, and stmt_list_offset.
2785 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2786 Gdb_index::find_pubtype_offset,
2787 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2788 (Gdb_index::pubnames_read): Update prototype and rework logic.
2789 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2790 Forward declare.
2791 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2792 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2793 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2794 Gdb_index::map_pubtable_to_dies):
2795 Declare functions.
2796 (Gdb_index::pubnames_read): Update declaration.
2797 (Gdb_index::Pubname_offset_map): New type.
2798 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2799 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2800 Gdb_index::stmt_list_offset): Declare.
2801 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2802 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2803 Gdb_index::pubtypes_offset_): Remove.
2804
a3ed37d8
RM
28052013-07-19 Roland McGrath <mcgrathr@google.com>
2806
2807 * options.h (General_options): Add -Trodata-segment option.
2808 * parameters.cc (Parameters::check_rodata_segment): New function.
2809 (Parameters::set_target_once): Call it.
2810 * parameters.h (Parameters): Declare it (private member function).
2811 * layout.cc (load_seg_unusable_for_headers): New function, broken
2812 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2813 then validate rodata segment rather than text segment.
2814 (relaxation_loop_body): Call that.
2815 (is_text_segment): New function. Don't admit a non-executable
2816 segment if TARGET->isolate_execinstr().
2817 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2818
eb5b4ded
CC
28192013-07-15 Shawn Landden <shawnlandden@gmail.com>
2820
2821 PR gold/15070
2822 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2823 * nacl.h (Sniff_file::View::View): Request aligned view.
2824
4d5effb9
CC
28252013-07-11 Cary Coutant <ccoutant@google.com>
2826
2827 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2828 correct BRLT entry size.
2829
ba8ca3e7
AM
28302013-07-03 Alan Modra <amodra@gmail.com>
2831
2832 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2833 comment.
2834
267257d2
CC
28352013-07-01 Cary Coutant <ccoutant@google.com>
2836
2837 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2838 reloc_type_.
2839 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2840 (Dwarf_ranges_table::lookup_reloc): New function.
2841 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2842 reloc_type_.
2843 (Dwarf_ranges_table::lookup_reloc): New function.
2844 (Dwarf_ranges_table::reloc_type_): New data member.
2845
06f30c9d
CC
28462013-06-27 Jing Yu <jingyu@google.com>
2847
2848 PR gold/15662
2849 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2850 function.
2851 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2852 (Target_powerpc::do_relax): Call the above.
2853
a2d7bf59
AM
28542013-06-27 Cary Coutant <ccoutant@google.com>
2855
2856 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2857 on garbage collected .opd section.
2858
28592013-06-27 Alan Modra <amodra@gmail.com>
2860
2861 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2862 is non-zero.
2863 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2864 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2865
32364e50
CC
28662013-06-14 Cary Coutant <ccoutant@google.com>
2867
2868 * resolve.cc (Symbol::override_base): Don't override st_type
2869 from plugin placeholder symbols.
2870 (Symbol_table::resolve): Likewise.
2871 (Symbol_table::should_override): Don't complain about TLS mismatch
2872 if the TO symbol is a plugin placeholder.
2873 * testsuite/Makefile.am (plugin_test_tls): New test.
2874 * testsuite/Makefile.in: Regenerate.
2875 * testsuite/plugin_test_tls.sh: New test script.
2876 * testsuite/two_file_test_2_tls.cc: New test source.
2877 * testsuite/two_file_test_tls.cc: New test source.
2878
7fb47cc9
CC
28792013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2880
2881 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2882 the maximum segment alignment is larger than the page size.
2883 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2884 correctly aligns the symbols with large alignemnt.
2885 * testsuite/Makefile.in: Regenerate.
2886 * testsuite/large_symbol_alignment.cc: New file.
2887
6934001a
CC
28882013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2889 Sriraman Tallam <tmsriram@google.com>
2890
2891 * options.h (sort_section): New option.
2892 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2893 Rename from Input_section_sort_section_name_special_ordering_compare.
2894 (Input_section_sort_section_name_compare): New struct.
2895 * output.cc (Output_section::Input_section_sort_section_name_compare::
2896 operator()): New function.
2897 (Output_section::sort_attached_input_sections): Use new sort function
2898 for .text if --sort-section=name is specified.
2899 * layout.cc (Layout::make_output_section):
2900 Add sorting by name when --sort-section=name is specified.
2901 * testsuite/Makefile.am (text_section_grouping): Test option
2902 --sort-section=name.
2903 * testsuite/Makefile.in: Regenerate.
2904 * testsuite/section_sorting_name.cc: New file.
2905 * testsuite/section_sorting_name.sh: New file.
2906
93acabad
CC
29072013-05-21 Cary Coutant <ccoutant@google.com>
2908
2909 * symtab.h (Symbol::is_cxx_vtable): New function.
2910 * target-reloc.h (relocate_section): Check for vtable symbol.
2911 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2912 * testsuite/Makefile.in: Regenerate.
2913 * testsuite/missing_key_func.cc: New test source.
2914 * testsuite/missing_key_func.sh: New test script.
2915
60e8b3fc
CC
29162013-05-21 Cary Coutant <ccoutant@google.com>
2917
2b64b551
RM
2918 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2919 type of enclosing symbol.
2920 (Relocate_info::location): Check symbol type when describing symbol.
2921 * object.h (Symbol_location_info): Remove unused line_number;
2922 add enclosing_symbol_type.
2923 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2924
9df9de2c
CC
29252013-05-13 Cary Coutant <ccoutant@google.com>
2926
2b64b551
RM
2927 * configure.ac: Export DEFAULT_TARGET.
2928 * configure: Regenerate.
2929 * Makefile.in: Regenerate.
2930 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2931 * testsuite/Makefile.in: Regenerate.
2932 * testsuite/debug_msg.sh: Delete duplicate tests.
2933 Don't check undef_int error message match for powerpc where the
2934 source file and line number aren't available.
9df9de2c 2935
bbc5ae17
RM
29362013-05-10 Roland McGrath <mcgrathr@google.com>
2937
2938 * options.h (General_options): Add --rosegment-gap option.
2939 * options.cc (finalize): --rosegment-gap implies --rosegment.
2940 * layout.cc (set_segment_offsets): Let user option override
2941 target->rosegment_gap().
2942
0c6e6c39
RM
29432013-05-10 Roland McGrath <mcgrathr@google.com>
2944
2945 * options.h (General_options): Remove leading space from help
2946 messages for -nostdlib and --rosegment.
2947
cde7cb01
MR
29482013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2949
2950 PR ld/15365
2951 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2952
f31ae5b8
AM
29532013-05-03 Alan Modra <amodra@gmail.com>
2954
2955 * merge.cc (Output_merge_string::do_add_input_section): Correct
2956 scan for number of strings. Rename vars to avoid shadowing.
2957 Include missing terminator in input_size_.
2958
d3a7cd45
L
29592013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2960
2961 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2962 Restore empty string handling.
2963
6ad3daba
CC
29642013-05-01 Cary Coutant <ccoutant@google.com>
2965
2966 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2967 uninitialized warning.
2968
e31908b6
CC
29692013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2970
2971 * output.cc (Output_section::add_merge_input_section): Allow
2972 to merge sections if the alignment is more than character size.
2973 * merge.h (Output_merge_string::Output_merge_string): Remove
2974 assert.
2975 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2976 only not-null strings. Check the alignment of strings.
2977 * stringpool.h
2978 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2979 alignment as the argument.
2980 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2981 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2982 Align non-zero length strings according to the addralign_.
2983 (Stringpool_template<Stringpool_char>::set_string_offsets):
2984 Updating offsets according to the given alignment.
2985 * testsuite/Makefile.am (text_section_grouping): Test if string
2986 literals are getting merged.
2987 * testsuite/Makefile.in: Regenerate.
2988 * testsuite/merge_string_literals_1.c: New file.
2989 * testsuite/merge_string_literals_2.c: Ditto.
2990 * testsuite/merge_string_literals.sh: Ditto.
2991
0e804863
ILT
29922013-04-26 Ian Lance Taylor <iant@google.com>
2993
2994 * target-reloc.h (relocate_section): If the reloc offset is out of
2995 range, pass VIEW as NULL to relocate.relocate.
2996 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
2997 * i386.cc (Target_i386::Relocate::relocate): Likewise.
2998 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
2999 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3000 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3001 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3002
e7c5ea40
CC
30032013-04-26 Geoff Pike <gpike@chromium.org>
3004
3005 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3006 * layout.cc (Hash_task): New class.
3007 (Layout::queue_build_id_tasks): New function.
3008 (Layout::write_build_id): Handle single-thread portion of build ID
3009 computation. (In some cases, all of it is single-threaded.) Replace
3010 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3011 functionality in fewer lines of code.
3012 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3013 * options.h (General_options): make "--build-id" default to tree
3014 rather than sha1. Add two new options related to --build-id=tree:
3015 --build-id-chunk-size-for-treehash and
3016 --build-id-min-file-size-for-treehash.
3017 * Makefile.am: add testing of --build-id=tree and related new options
3018 (these tests will be invoked by "make check").
3019 * Makefile.in: Regenerate.
3020
49926cd0
AM
30212013-04-25 Alan Modra <amodra@gmail.com>
3022
3023 * configure.tgt: Add powerpcle and powerpc64le.
3024
a4034750
AM
30252013-04-22 Alan Modra <amodra@gmail.com>
3026
3027 PR gold/15355
3028 * layout.cc (Layout::segment_precedes): Allow more than one
3029 segment with the same type and flags.
3030
e79c84aa
CC
30312013-04-15 Cary Coutant <ccoutant@google.com>
3032
3033 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3034 allocate space in file for BSS sections.
3035
2199fbe7
CC
30362013-04-15 Cary Coutant <ccoutant@google.com>
3037
3038 * script-sections.cc (Orphan_output_section): Reset address
3039 to zero after each orphaned section for relocatable links.
3040
502e8a84
CC
30412013-04-15 Cary Coutant <ccoutant@google.com>
3042
a4034750
AM
3043 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3044 section starting address for relocatable link.
3045 * testsuite/Makefile.am (script_test_11): New test.
3046 * testsuite/Makefile.in: Regenerate.
3047 * testsuite/script_test_11.c: New source file.
3048 * testsuite/script_test_11.t: New linker script.
502e8a84 3049
0cfdc767
AM
30502013-04-13 Alan Modra <amodra@gmail.com>
3051
3052 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3053 owner when sections are not adjacent and exceed group size.
3054 (Target_powerpc::group_sections): Handle corner case.
3055 (Target_powerpc::Branch_info::make_stub): Handle case where
3056 stub table doesn't exist due to branches in non-exec sections.
3057 (Target_powerpc::Relocate::relocate): Likewise.
3058
6830ee24
AM
30592013-04-11 Alan Modra <amodra@gmail.com>
3060
3061 PR gold/15354
3062 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3063 .branch_lt to match bfd ld. Adjust comments throughout file.
3064
54a3d865
ILT
30652013-04-04 Ian Lance Taylor <iant@google.com>
3066
3067 GCC PR c++/56840
3068 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3069 sections before checking whether they are included in the link.
3070
9993ba11
ST
30712013-03-29 Sriraman Tallam <tmsriram@google.com>
3072
3073 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3074 object before calling the plugin claim_file handler. Pass the elf
3075 object of the archive to the plugin. Delete the elf object if the
3076 plugin claims the file.
3077
ebacd51e
AM
30782013-03-21 Alan Modra <amodra@gmail.com>
3079
3080 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3081 segment when omagic.
3082
117be58f
AM
30832013-03-21 Alan Modra <amodra@gmail.com>
3084
3085 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3086 comparison warning.
3087 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3088 uninitialized" warning.
3089
32e2b61d
AM
30902013-03-20 Alan Modra <amodra@gmail.com>
3091
3092 * symtab.h (Symbol::clear_version): New function.
3093 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3094 is_needed by weak references. Clear version for symbols defined
3095 in as-needed objects that are not needed.
3096
b3ccdeb5
AM
30972013-03-15 Alan Modra <amodra@gmail.com>
3098
3099 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3100 static and public. Add report_err param. Return false for data refs.
3101 (Target_powerpc::rela_dyn_section): New overloaded function.
3102 (Target_powerpc::plt_, iplt_): Elucidate.
3103 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3104 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3105 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3106 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3107 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3108 push_branch and make_plt_entry for ifunc syms when
3109 reloc_needs_plt_for_ifunc.
3110 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3111 for ifunc unless reloc_needs_plt_for_ifunc.
3112
ad3d8a2f
AM
31132013-03-15 Alan Modra <amodra@gmail.com>
3114
3115 * gc.h (gc_process_relocs): Don't look through function descriptors.
3116 * icf.cc (get_section_contents): Do so here instead.
3117
4d9aa155
AM
31182013-03-13 Alan Modra <amodra@gmail.com>
3119
3120 * powerpc.cc (is_branch_reloc): Forward declare.
3121 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3122 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3123 false for 64-bit, true for 32-bit non-branch relocs.
3124 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3125 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3126 nm output.
3127 (icf_safe_test): Generate linker map file as well as nm output.
3128 (icf_safe_so_test): Likewise.
3129 * testsuite/Makefile.in: Regenerate.
3130 * testsuite/icf_test.sh: Parse linker map file to determine
3131 section folding.
3132 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3133 * testsuite/icf_safe_so_test.sh: Likewise.
3134 (X86_32_or_ARM_specific_safe_fold): Merge into..
3135 (arch_specific_safe_fold): ..this.
3136 (X86_64_specific_safe_fold): Delete unused function.
3137
57420c20
AM
31382013-03-12 Alan Modra <amodra@gmail.com>
3139
3140 * gc.h (gc_process_relocs): Look through function descriptors
3141 to determine shndx, symvalue and addend used by ICF. Tidy
3142 variable duplication.
3143
dc3714f3
AM
31442013-03-11 Alan Modra <amodra@gmail.com>
3145
3146 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3147 * layout.cc (Layout_task_runner::run): ..to here.
3148 * symtab.h (struct Symbol_location): Extract from..
3149 (class Symbol_table): ..here.
3150 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3151 * target.h (class Target): Add function_location and
3152 do_function_location functions.
3153 (class Sized_target): Add do_function_location.
3154 * object.h (class Sized_relobj_file): Move find_shdr..
3155 (class Object): ..to here.
3156 * object.cc: Likewise. Update to suit. Instantiate.
3157 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3158 * powerpc.cc (class Powerpc_dynobj): New.
3159 (Target_powerpc::do_function_location): New function.
3160 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3161 (Powerpc_dynobj::do_read_symbols): New function.
3162 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3163
956b03bb
ILT
31642013-03-08 Ian Lance Taylor <iant@google.com>
3165
3166 * options.cc (General_options::string_to_object_format): Accept
3167 "default".
3168
4bead2d5
AM
31692013-03-08 Alan Modra <amodra@gmail.com>
3170
3171 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3172 pointer to Post_fde.
3173 (struct Post_fde): Move definition to here..
3174 * ehframe.cc (struct Post_fde): ..from here.
3175 (Cie::write): Don't alloc Post_fde.
3176 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3177
02e60bf7
AM
31782013-03-07 Alan Modra <amodra@gmail.com>
3179
3180 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3181 relocation referencing .LC0.
3182 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3183
8343f03a
AM
31842013-03-07 Alan Modra <amodra@gmail.com>
3185
3186 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3187 always_inline. Add assembly for powerpc to avoid GOT.
3188
3366d57c
AM
31892013-03-07 Alan Modra <amodra@gmail.com>
3190
3191 * testsuite/script_test_10.sh: Don't test .bss section
3192 header number.
3193
6c77229c
AM
31942013-03-06 Alan Modra <amodra@gmail.com>
3195
3196 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3197 (Target_powerpc::symval_for_branch): Add symtab param. Update
3198 all callers. Handle folded sections.
3199 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3200 to Powerpc_relobj.
3201 (Global_symbol_visitor_opd::operator()): Likewise.
3202
a39e4af6
AM
32032013-03-04 Alan Modra <amodra@gmail.com>
3204
3205 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3206 * testsuite/Makefile.in: Regenerate.
3207
d5834edb
CC
32082013-03-01 Cary Coutant <ccoutant@google.com>
3209
3210 Add dwp support for v2 DWARF package file format.
3211 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3212 tu_length parameter. Adjust all callers.
3213 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3214 * dwp.cc: Include dwarf.h.
3215 (Section_bounds): New struct type.
3216 (Unit_set): New struct type.
3217 (Dwo_file::Dwo_file): Initialize new data member.
3218 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3219 Combine and rename to...
3220 (Dwo_file::read_unit_index): ...this.
3221 (Dwo_file::sized_read_compunit_index)
3222 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3223 (Dwo_file::sized_read_unit_index): ...this.
3224 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3225 parameters; add section_id parameter.
3226 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3227 (Dwo_file::add_unit_set): ...this.
3228 (Dwo_file::shndx_map_): Remove.
3229 (Dwo_file::sect_offsets_): New data member.
3230 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3231 (Dwp_output_file::add_section): Rename to...
3232 (Dwp_output_file::add_contribution): ...this.
3233 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3234 (Dwp_output_file::add_tu_set): Likewise.
3235 (Dwp_output_file::Contribution): New type.
3236 (Dwp_output_file::Section::contributions): New data member.
3237 (Dwp_output_file::Cu_or_tu_set): Remove.
3238 (Dwp_output_file::Section::Section): New ctor.
3239 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3240 (Dwp_output_file::Dwp_index::Section_table): New type.
3241 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3242 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3243 parameter.
3244 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3245 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3246 (Dwp_output_file::Dwp_index::section_table): New member function.
3247 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3248 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3249 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3250 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3251 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3252 (Dwp_output_file::Dwp_index::section_table_): New data member.
3253 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3254 (Dwp_output_file::add_output_section): New member function.
3255 (Dwp_output_file::write_new_section): New member function.
3256 (Dwp_output_file::write_contributions): New member function.
3257 (Dwp_output_file::section_id_map_): New data member.
3258 (class Dwo_id_info_reader): Remove.
3259 (class Unit_reader): New class.
3260 (get_dwarf_section_name): New function.
3261 (Dwo_file::read_executable): Adjust initializations of class data.
3262 (Dwo_file::read): Add support for v2 package file format.
3263 (Dwo_file::read_unit_index): Likewise.
3264 (Dwo_file::sized_read_unit_index): Likewise.
3265 (Dwo_file::copy_section): Likewise.
3266 (Dwo_file::add_unit_set): Likewise.
3267 (Dwp_output_file::add_output_section): Likewise.
3268 (Dwp_output_file::add_contribution): Likewise.
3269 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3270 for empty slot.
3271 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3272 file format.
3273 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3274 slot.
3275 (Dwp_output_file::initialize): Remove unused function.
3276 (Dwp_output_file::finalize): Add support for v2 package file format.
3277 (Dwp_output_file::write_index): Likewise.
3278 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3279 function prototype.
3280
a68a081d
CC
32812013-03-01 Cary Coutant <ccoutant@google.com>
3282
3283 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3284 function into class definition in header file.
3285 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3286 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3287 New function.
3288 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3289
9d5781f8
AM
32902013-02-28 Alan Modra <amodra@gmail.com>
3291
3292 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3293 * target.cc (Target::do_plt_fde_location): New function.
3294 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3295 accessor function, and constructor param.
3296 (struct Post_fde, Post_fdes): Declare.
3297 (Cie::write): Add post_fdes param.
3298 * ehframe.cc (Fde::write): Use plt_fde_location.
3299 (struct Post_fde): Define.
3300 (Cie::write): Stash FDEs added post merge mapping.
3301 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3302 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3303 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3304 other FDEs.
3305 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3306 (Target_powerpc::has_glink): New function.
3307 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3308 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3309 glink_eh_frame_fde_32, default_fde): New data.
3310 (Stub_table::eh_frame_added_): New var.
3311 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3312 Make const.
3313 (Stub_table::add_eh_frame): New function.
3314 (Output_data_glink::add_eh_frame): New function.
3315 (Target_powerpc::make_glink_section): Call add_eh_frame.
3316
214383dd
ILT
33172013-02-15 Ian Lance Taylor <iant@google.com>
3318
3319 * options.h (DEFINE_uint64_alias): Define.
3320 (class General_options): Add -Ttext-segment as an alias for
3321 -Ttext.
3322
91c2b899
AM
33232013-02-15 Alan Modra <amodra@gmail.com>
3324
3325 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3326 (Stub_table::do_write): ..here, two places.
3327 (Stub_table::plt_call_size): Use it here too.
3328
20e2a8aa
ILT
33292013-02-11 Ian Lance Taylor <iant@google.com>
3330
3331 * descriptors.cc (Descriptors::close_all): New function.
3332 * descriptors.h (class Descriptors): Declare close_all.
3333 (close_all_descriptors): New inline function.
3334 * plugin.cc: Include "descriptors.h".
3335 (Plugin_manager::cleanup): Call close_all_descriptors.
3336
8952bc69
AM
33372013-02-06 Alan Modra <amodra@gmail.com>
3338
3339 * README: Update coding style link.
3340
29bd8b6b
CC
33412013-01-28 Cary Coutant <ccoutant@google.com>
3342
a4034750
AM
3343 * dwp.cc (File_list): New typedef.
3344 (Dwo_name_info_reader): New class.
3345 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3346 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3347 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3348 (Dwo_file::read_executable): New function.
3349 (Dwo_file::read): Move common setup code to ...
3350 (Dwo_file::make_object): ... here.
3351 (dwp_options): Add --exec/-e.
3352 (usage): Likewise.
3353 (main): Likewise.
29bd8b6b 3354
c6ac678d
ST
33552013-01-24 Sriraman Tallam <tmsriram@google.com>
3356
3357 * layout.cc (Layout::layout): Check for option text_reorder.
3358 (Layout::make_output_section): Ditto.
3359 * options.h (text_reorder): New option.
3360 * output.cc (Input_section_sort_compare): Remove special ordering
3361 of section names.
3362 (Output_section::
3363 Input_section_sort_section_name_special_ordering_compare::
3364 operator()): New function.
3365 (Output_section::sort_attached_input_sections): Use new sort function
3366 for .text.
3367 * output.h (Input_section_sort_section_name_special_ordering_compare):
3368 New struct.
3369 * testsuite/Makefile.am (text_section_grouping): Test option
3370 --no-text-reorder
3371 * testsuite/Makefile.in: Regenerate.
3372 * testsuite/text_section_grouping.sh: Check order of functions without
3373 default text reordering.
3374
50701cc1
MF
33752013-01-18 Mike Frysinger <vapier@gentoo.org>
3376
3377 * options.h (General_options): Change default to true for new_dtags.
3378
b1b00fcc
MF
33792013-01-18 Mike Frysinger <vapier@gentoo.org>
3380
3381 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3382 when enable_new_dtags is false. Only add DT_RUNPATH when
3383 enable_new_dtags is true.
3384
ec5b8187
AM
33852013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3386
3387 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3388 used in declaration and definition consistent.
3389 (Target_powerpc::symval_for_branch): Ditto.
3390
a880d4c4
ST
33912013-01-16 Sriraman Tallam <tmsriram@google.com>
3392
3393 * testsuite/plugin_final_layout.cc: Fix comment.
3394
7c381248
ST
33952013-01-16 Sriraman Tallam <tmsriram@google.com>
3396
3397 * layout.cc (Layout::layout): Do not do default sorting for
3398 text sections when section ordering is specified.
3399 (make_output_section): Ditto.
3400 * testsuite/plugin_final_layout.cc: Name the function sections
3401 to catch reordering issues.
3402
e2458743
AM
34032013-01-15 Alan Modra <amodra@gmail.com>
3404
3405 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3406 plt-thread-safe.
3407
431ed302
AM
34082013-01-15 Alan Modra <amodra@gmail.com>
3409
3410 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3411 * testsuite/Makefile.in: Regenerate.
3412
0ec6429b
AM
34132013-01-14 Alan Modra <amodra@gmail.com>
3414
3415 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3416 * testsuite/Makefile.in: Regenerate.
3417
0bf402d5
ILT
34182013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3419
36af3926 3420 PR bfd/14430
0bf402d5
ILT
3421 Fix mingw gold build with plugins enabled
3422 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3423 * configure.ac: Export DLOPEN_LIBS and add headers check.
3424 * plugin.cc: Handle non-dlfcn case.
3425 * Makefile.in: Regenerate.
3426 * config.in: Regenerate.
3427 * configure: Regenerate.
3428 * testsuite/Makefile.in: Regenerate.
3429
9e9143bc
ST
34302013-01-09 Sriraman Tallam <tmsriram@google.com>
3431
3432 * output.h (sort_attached_input_sections): Change to be public.
3433 * script-sections.cc
3434 (Output_section_definition::set_section_addresses): Sort
3435 attached input sections according to section order before linker
3436 script assigns section addresses.
3437 (Orphan_output_section::set_section_addresses): Sort
3438 attached input sections according to section order before linker
3439 script assigns section addresses.
3440 * Makefile.am (final_layout.sh): Use a simple linker script to
3441 check if section ordering still works.
3442 * Makefile.in: Regenerate.
3443
679af368
ILT
34442013-01-09 Ben Cheng <bccheng@google.com>
3445
3446 * arm.cc (Target_arm::attributes_accept_div): New function.
3447 (Target_arm::attributes_forbid_div): New function.
3448 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3449 attribute using the same new functions as what bfd/elf32_arm.c
3450 does.
3451
3136a00e
CC
34522013-01-07 Cary Coutant <ccoutant@google.com>
3453
3454 PR gold/14993
3455 * output.cc (Output_section::add_input_section): For incremental
3456 updates, don't track input sections that are allocated from patch
3457 space.
3458
f2a6224b
L
34592013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3460 Ian Lance Taylor <iant@google.com>
3461
3462 PR gold/14897
3463 * configure.ac (--enable-ld): Removed.
3464 (install_as_default): Set to yes only for --enable-gold=default
3465 or --disable-ld.
3466 * configure: Regenerated.
3467
4f46f626
L
34682013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3469
3470 * options.h (General_options): Add -fuse-ld= for GCC linker
3471 option compatibility.
3472
26e4ef59
CC
34732013-01-04 Cary Coutant <ccoutant@google.com>
3474
3475 * configure.ac: Fix typo restoring CXXFLAGS.
3476 * configure: Regenerate.
3477
3d587466
CC
34782013-01-04 Cary Coutant <ccoutant@google.com>
3479
4f46f626
L
3480 * testsuite/Makefile.am (CXXLINK_S): New macro.
3481 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3482 * testsuite/Makefile.in: Regenerate.
3d587466 3483
44db6695
L
34842013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3485
3486 * version.cc (print_version): Update copyright year to 2013.
3487
edcac0c1
ILT
34882012-12-20 Ian Lance Taylor <iant@google.com>
3489
3490 * layout.cc (Layout::special_ordering_of_input_section): New
3491 function.
3492 (Layout::layout): If input section requires special ordering, must
3493 sort input sections.
3494 (Layout::make_output_section): May sort .text input sections.
3495 (Layout::is_section_name_prefix_grouped): Remove.
3496 * layout.h (class Layout): Declare
3497 special_ordering_of_input_section. Don't declare
3498 is_section_name_prefix_grouped.
3499 * output.cc (Output_section::add_input_section): Revert last
3500 change.
3501 (Output_section::Input_section_sort::match_file_name): Don't crash
3502 if called on output section data.
3503 (Output_section::Input_section_sort_compare): Sort based on
3504 special ordering.
3505 (Output_section::Input_section_sort_section_order_index_compare):
3506 Revert last patch.
3507 (Output_section::sort_attached_input_sections): Likewise.
3508
28f2a4ac
ST
35092012-12-18 Sriraman Tallam <tmsriram@google.com>
3510
edcac0c1 3511 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3512 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3513 * output.cc (Output_section::add_input_section): Check if section
3514 name contains special prefix. Keep input sections to sort such
3515 sections.
3516 (Output_section::Input_section_sort_section_order_index_compare
3517 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3518 (Output_section::sort_attached_input_sections): Add condition to
3519 Input_section_entry constructor call.
28f2a4ac
ST
3520 * testsuite/Makefile.am (text_section_grouping): New test.
3521 * testsuite/Makefile.in: Regenerate.
3522 * testsuite/text_section_grouping.cc: New file.
3523 * testsuite/text_section_grouping.sh: New file.
3524
5bf135a7
NC
35252012-12-17 Nick Clifton <nickc@redhat.com>
3526
3527 * Makefile.am: Add copyright notice.
3528 * NEWS: Likewise.
3529 * README: Likewise.
3530 * configure.ac: Likewise.
3531 * ftruncate.c: Likewise.
3532 * Makefile.in: Regenerate.
3533
59965708
CC
35342012-12-14 Cary Coutant <ccoutant@google.com>
3535
a4034750
AM
3536 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3537 --no-as-needed flag.
3538 (exception_separate_shared_12_test): Likewise.
3539 (incremental_copy_test): Likewise.
3540 * testsuite/Makefile.in: Regenerate.
59965708 3541
2a77e2ab
CC
35422012-12-14 Cary Coutant <ccoutant@google.com>
3543
3544 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3545 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3546
e3deeb9c
AM
35472012-12-12 Alan Modra <amodra@gmail.com>
3548
3549 * powerpc.cc (class Track_tls): New.
3550 (class Relocate, class Scan): Inherit Track_tls.
3551 (Target_powerpc::Scan::local, global): Track tls optimization
3552 and avoid creating plt entry for __tls_get_addr if all uses
3553 are optimized away.
3554 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3555
d8f5a274
AM
35562012-12-12 Alan Modra <amodra@gmail.com>
3557
3558 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3559 Replace no_toc_optimize with toc_optimize.
3560 * output.h (Output_section::input_sections): Provide non-const variant.
3561 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3562 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3563 accessors.
3564 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3565 (class Sort_toc_sections): New.
3566 (Target_powerpc::do_finalize_sections): Sort toc sections.
3567 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3568
4c8a1de1
RM
35692012-12-10 Roland McGrath <mcgrathr@google.com>
3570
3571 * testsuite/binary_unittest.cc (read_all): New function.
3572 (Sized_binary_test): Use it instead of ::read.
3573 * fileread.cc (do_read): Don't assume pread always reads the whole
3574 amount in a single call.
3575
edc27beb
AM
35762012-12-10 Alan Modra <amodra@gmail.com>
3577
3578 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3579 Set EM_PPC64 or EM_PPC here.
3580 (Target_selector_powerpc::do_recognize): Delete.
3581
906b9150
AM
35822012-12-10 Alan Modra <amodra@gmail.com>
3583
3584 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3585 stub_table_.
3586 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3587
418c15ae
RM
35882012-12-07 Roland McGrath <mcgrathr@google.com>
3589
3590 * testsuite/binary_unittest.cc (Sized_binary_test):
3591 Use open_descriptor rather than ::open.
3592
decdd3bc
AM
35932012-12-07 Alan Modra <amodra@gmail.com>
3594
3595 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3596 typedef and invalid_address constant.
3597 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3598 instantiate constants.
3599
db399005
ILT
36002012-12-06 Roland McGrath <mcgrathr@google.com>
3601
3602 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3603 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3604 * aclocal.m4: Regenerate.
3605 * configure: Regenerate.
3606 * Makefile.in: Regenerate.
3607 * testsuite/Makefile.in: Regenerate.
3608
aba6bc71
AM
36092012-12-07 Alan Modra <amodra@gmail.com>
3610
3611 * options.h (General_options): Add no_toc_optimize.
3612 * powerpc.cc (ok_lo_toc_insn): New function.
3613 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3614
9e69ed50
AM
36152012-12-06 Alan Modra <amodra@gmail.com>
3616
3617 * options.h (General_options): Add plt_align, plt_static_chain,
3618 plt_thread_safe. Update stub_group_size help text.
3619 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3620 for new plt_thread_safe_ var.
3621 (use_plt_offset): Correct comments.
3622 (Target_powerpc::do_relax): Look for thread creation symbols to
3623 determine default plt_thread_safe value. Clear plt call stubs
3624 as well as branch stubs each iteration.
3625 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3626 insn constants.
3627 (l, hi, ha, write_insn): Move earlier.
3628 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3629 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3630 plt stubs too.
3631 (Stub_table::update_size): Adjust.
3632 (Stub_table::prev_size, set_prev_size): Delete.
3633 (Stub_table::stub_align): Let --plt-align affect result.
3634 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3635 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3636 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3637 (Stub_table::do_write): Support more stub variants.
3638
f43ba157
AM
36392012-12-04 Alan Modra <amodra@gmail.com>
3640
3641 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3642 (Target_powerpc::do_define_standard_symbols): New function.
3643
34171bc5
AM
36442012-12-03 Alan Modra <amodra@gmail.com>
3645
3646 * output.h: Formatting, whitespace.
3647
dc9589e9 36482012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3649
3650 * layout.h (Layout::get_executable_sections): Declare.
3651 * layout.cc (Layout::get_executable_sections): New function.
3652 * arm.cc (Target_arm::group_sections): Use it.
3653 (Arm_output_section::group_sections): Delete now redundant test.
3654 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3655 param to handle relative relocs.
3656 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3657 (Output_data_reloc::add_absolute): Adjust.
3658 (Output_data_reloc::add_relative): New function.
3659 (Output_data::reset_data_size): New function.
3660 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3661 (Output_section::set_addralign): New function.
3662 (Output_section::checkpoint_set_addralign): New function.
3663 (Output_section::clear_section_offsets_need_adjustment): New function.
3664 (Output_section::input_sections): Make public.
3665 * powerpc.cc (class Output_data_brlt_powerpc): New.
3666 (class Stub_table, class Stub_control): New.
3667 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3668 stub_table_, set_stub_table, stub_table): New vectors and accessor
3669 functions.
3670 (Target_powerpc::do_may_relax, do_relax, push_branch,
3671 new_stub_table, stub_tables, brlt_section, group_sections,
3672 add_branch_lookup_table, find_branch_lookup_table,
3673 write_branch_lookup_table, make_brlt_section): New functions.
3674 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3675 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3676 branch_info_): New vars.
3677 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3678 make call stubs here.
3679 (Output_data_glink): Remove all call stub handling from this class.
3680 (Target_powerpc::Scan::local, global): Save interesting branch
3681 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3682 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3683 functions on final link.
3684 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3685 Handle long branch destinations too.
3686 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3687 do_plt_address_for_local): Adjust lookup of plt call stubs.
3688
627b30b7
AM
36892012-11-30 Alan Modra <amodra@gmail.com>
3690
3691 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3692 relocs against protected symbols when building 32-bit shared libs.
3693
40b469d7
AM
36942012-11-30 Alan Modra <amodra@gmail.com>
3695
3696 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3697 param. Call got_section() to make .got. Update all callers
3698 and their callers and so on.
3699
bb66a627
AM
37002012-11-30 Alan Modra <amodra@gmail.com>
3701
3702 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3703 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3704 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3705 value if it already exists.
3706
d2cf1c6c
L
37072012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3708
3709 PR gold/14858
3710 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3711
edccdf7c
RM
37122012-11-14 Roland McGrath <mcgrathr@google.com>
3713
3714 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3715 than bfc instruction for data sandboxing.
3716
6febeb74
AM
37172012-11-08 Alan Modra <amodra@gmail.com>
3718
3719 * po/POTFILES.in: Regenerate.
3720
0a6f1bf2
AM
37212012-11-05 Alan Modra <amodra@gmail.com>
3722
3723 * configure.ac: Apply 2012-09-10 change to config.in here.
3724 * configure: Regenerate.
3725
26a4e9cb
AM
37262012-11-05 Alan Modra <amodra@gmail.com>
3727
3728 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3729 (struct Opd_ent): Use "Address" rather than "Offset".
3730 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3731 (Target_powerpc::got_section): Make public.
3732 (Target_powerpc::scan_relocs): Move code setting symbols..
3733 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3734 Create _SDA_BASE_ only when referenced.
3735
cc928013
RM
37362012-11-02 Roland McGrath <mcgrathr@google.com>
3737
3738 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3739 from last change.
3740
50ed5eb1
RM
37412012-11-01 Roland McGrath <mcgrathr@google.com>
3742
62fe925a
RM
3743 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3744 for offset_in_output_section parameter.
3745 (Sized_target::relocate_special_relocatable): Likewise.
3746 * arm.cc (Target_arm::relocate_relocs): Likewise.
3747 (Target_arm::relocate_special_relocatable): Likewise.
3748 * i386.cc (Target_i386::relocate_relocs): Likewise.
3749 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3750 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3751 * target-reloc.h (relocate_relocs): Likewise.
3752 * testsuite/testfile.cc (Target_test): Likewise.
3753 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3754 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3755
3756 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3757 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3758
3759 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3760 parameter, which is unused in the [!F_SETFD] case.
3761
50ed5eb1
RM
3762 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3763 SYMNDX to off_t before comparing it to this->data_size().
3764 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3765 * incremental.cc (Output_section_incremental_inputs::do_write):
3766 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3767
2cadc0bf
RM
3768 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3769
3bfcb652
NC
37702012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3771
3772 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3773 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3774 in EABI_VER5.
3775
c1a8d56e
CC
37762012-10-29 Cary Coutant <ccoutant@google.com>
3777
3778 * dwp.cc (usage): Add file and exit status parameters;
3779 add --help and --version options.
3780 (print_version): New function.
3781 (main): Add --help and --version options.
3782
b2490a7b
L
37832012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3784
3785 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3786 final_layout_sequence.txt.
3787 * testsuite/Makefile.in: Regenerated.
3788
aa543512
L
37892012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3790
3791 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3792 COMPILE generated by automake.
3793 (LINK1): Likewise.
3794 (CXXCOMPILE1): Likewise.
3795 (CXXLINK1): Likewise.
3796 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3797 (LINK): Likewise.
3798 (CXXCOMPILE): Likewise.
3799 (CXXLINK): Likewise.
3800 * testsuite/Makefile.in: Regenerated.
3801
d361fafb
L
38022012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3803
3804 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3805 on bad fwrite return.
3806
598c7410
L
38072012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3808
3809 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3810 on val.
3811
35c813e2
CC
38122012-10-23 Cary Coutant <ccoutant@google.com>
3813
3814 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3815 * testsuite/Makefile.in: Regenerate.
3816 * testsuite/dwp_test.h: New source file.
3817 * testsuite/dwp_test_1.cc: New source file.
3818 * testsuite/dwp_test_1.s: New source file.
3819 * testsuite/dwp_test_1.sh: New source file.
3820 * testsuite/dwp_test_1b.cc: New source file.
3821 * testsuite/dwp_test_1b.s: New source file.
3822 * testsuite/dwp_test_2.cc: New source file.
3823 * testsuite/dwp_test_2.s: New source file.
3824 * testsuite/dwp_test_2.sh: New source file.
3825 * testsuite/dwp_test_main.cc: New source file.
3826 * testsuite/dwp_test_main.s: New source file.
3827
77429909
CC
38282012-10-23 Cary Coutant <ccoutant@google.com>
3829
3830 * dwp.h: New header file.
3831 * dwp.cc: New source file.
3832 * gold.h: Move shared declarations to system.h.
3833 * system.h: New header file.
3834 * Makefile.am: Add dwp.
3835 * Makefile.in: Regenerate.
3836
ed5d6712
CC
38372012-10-23 Cary Coutant <ccoutant@google.com>
3838
3839 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3840 Dwarf_info_reader::read_from_pointer.
3841 (Dwarf_pubnames_table::read_header): Likewise.
3842 (Dwarf_pubnames_table::next_name): Likewise.
3843 (Dwarf_die::read_attributes): Likewise.
3844 (Dwarf_die::skip_attributes): Likewise.
3845 (Dwarf_info_reader::read_from_pointer): New function template.
3846 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3847 (Dwarf_pubnames_table): Likewise.
3848 (Dwarf_info_reader::read_from_pointer): New function template.
3849 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3850 Dwarf_pubnames_table ctor.
3851
8787852d
CC
38522012-10-23 Cary Coutant <ccoutant@google.com>
3853
3854 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3855 abbrev_shndx.
3856 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3857 abbrev_shndx_.
3858 (Dwarf_info_reader::set_abbrev_shndx): New method.
3859 (Dwarf_info_reader::abbrev_shndx_): New data member.
3860
9fc236f3
CC
38612012-10-23 Cary Coutant <ccoutant@google.com>
3862
3863 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3864 from object, not parameters.
3865 (Dwarf_info_reader::parse): Likewise.
3866 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3867 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3868 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3869 methods.
3870
effe8365
CC
38712012-10-23 Cary Coutant <ccoutant@google.com>
3872
3873 * fileread.cc (Input_file::Input_file): New constructor.
3874 * fileread.h (class Input_file): Add new constructor.
3875
1698990d
AM
38762012-10-18 Alan Modra <amodra@gmail.com>
3877
3878 PR gold/14727
3879 * object.cc (Relobj::is_section_name_included): Also match
3880 .sdata personality section.
3881
168a4726
AM
38822012-10-18 Alan Modra <amodra@gmail.com>
3883
3884 * target-reloc.h (class Default_comdat_behavior): New, package up..
3885 (get_comdat_behaviour): ..this.
3886 (relocate_section): Add Relocate_comdat_behavior template arg,
3887 adjust code to suit.
3888 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3889 (Target_arm::scan_reloc_section): Likewise.
3890 * i386.cc (Target_i386::relocate_section): Likewise.
3891 * sparc.cc (Target_sparc::relocate_section): Likewise.
3892 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3893 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3894 * powerpc.cc (class Relocate_comdat_behavior): New.
3895 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3896 gold::relocate_section with new template arg.
3897
acc276d8
AM
38982012-10-18 Alan Modra <amodra@gmail.com>
3899
3900 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3901 dynamic relocs for GOT_TPREL got entries, without symbol if
3902 resolving locally.
3903 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3904 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3905 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3906
e10f9870
AM
39072012-10-17 Alan Modra <amodra@gmail.com>
3908
3909 PR gold/14726
3910 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3911
ae034989
ST
39122012-10-16 Sriraman Tallam <tmsriram@google.com>
3913
3914 * layout.cc (Layout::include_section): Keep sections marked
3915 SHF_EXCLUDE when doing relocatable links.
3916
f3a0ed29
AM
39172012-10-16 Alan Modra <amodra@gmail.com>
3918
3919 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3920 (Target_powerpc::do_finalize_sections): Call it.
3921 (Output_data_save_res): New class and supporting functions.
3922 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3923 normal symbols defined in object files.
3924
c6de8ed4
AM
39252012-10-12 Alan Modra <amodra@gmail.com>
3926
3927 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3928 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3929 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3930 section if scan_opd_relocs not yet called.
3931 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3932
03e25981
AM
39332012-10-12 Alan Modra <amodra@gmail.com>
3934
3935 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3936 add_local_ifunc_entry): Revert last change.
3937 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3938
c9824451
AM
39392012-10-05 Alan Modra <amodra@gmail.com>
3940
3941 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3942 do_plt_address_for_global): New functions.
3943 (Output_data_got_powerpc::do_write): Don't segfault when linking
3944 statically.
3945 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3946 add_local_ifunc_entry): Return true on adding entry..
3947 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3948 glink->add_entry call. Remove unused symtab param. Adjust calls.
3949 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3950 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3951 set up symbols here.
3952 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3953 syms here. Do so even when no .iplt. Don't segfault when linking
3954 statically.
3955 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3956 new variants without reloc param.
3957 (Glink_sym_ent::Glink_sym_ent): Likewise.
3958 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3959 reloc when refs will resolve to plt call stub.
3960 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3961 R_PPC_PLTREL24 to resolve locally.
3962 (Target_powerpc::Scan::global): Correct ifunc handling.
3963 (Target_powerpc::Relocate::relocate): Correct local sym glink
3964 lookup. Don't destroy "value" when we have a plt call stub,
3965 and when checking plt call validity.
3966 (Target_powerpc::do_dynsym_value): Simplify.
3967
19fec8c1
AM
39682012-10-05 Alan Modra <amodra@gmail.com>
3969
3970 * i386.cc (Output_data_plt_i386::address_for_global,
3971 address_for_local): Add plt offset to returned value. Adjust uses.
3972 * sparc.cc (Output_data_plt_sparc::address_for_global,
3973 address_for_local): Likewise.
3974 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3975 address_for_local): Likewise.
3976 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3977 address_for_local): Likewise.
3978 * target.h (Target::plt_address_for_global, plt_address_for_local):
3979 Update comment.
3980 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3981 (Output_data_got::Got_entry::write): Nor here.
3982 * output.h: Comment fix.
3983
e867b647
WL
39842012-10-02 Jiong Wang <jiwang@tilera.com>
3985
3986 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
3987 global_offset_table_ value for larget got.
3988 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
3989
e5d5f5ed
AM
39902012-09-29 Alan Modra <amodra@gmail.com>
3991
3992 * powerpc.cc (Target_powerpc::iplt_): New output section.
3993 (Target_powerpc::iplt_section, make_iplt_section,
3994 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
3995 (Target_powerpc::make_plt_entry): Handle ifunc syms.
3996 Target_powerpc::plt_entry_count): Count iplt entries too.
3997 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
3998 reloc section in constructor. New params.
3999 (Target_powerpc::make_plt_section): Create reloc section here instead.
4000 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4001 functions.
4002 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4003 (Output_data_glink::add_entry, find_entry): New functions to
4004 deal with local syms.
4005 (Glink_sym_ent): Add support for local syms.
4006 (Output_data_glink::do_write): Handle ifunc plt entries.
4007 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4008 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4009 (Target_powerpc::Relocate::relocate): Likewise.
4010 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4011
ec4dbad3
AM
40122012-09-25 Alan Modra <amodra@gmail.com>
4013
4014 * object.h (Sized_relobj_file::adjust_local_symbol,
4015 do_adjust_local_symbol): New functions.
4016 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4017 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4018 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4019 and irregular opd entry spacing.
4020 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4021 (Global_symbol_visitor_opd): New functor.
4022 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4023 on deleted opd entries.
4024
5c0b3823
WL
40252012-09-15 Jiong Wang <jiwang@tilera.com>
4026
4027 * tilegx.cc: New file.
4028 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4029 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4030 * configure.tgt: Add entries for tilegx*.
4031 * configure.ac: Likewise.
4032 * Makefile.in: Rebuild.
4033 * configure: Likewise.
4034 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4035 tilegx.
4036
bfdfa4cd
AM
40372012-09-13 Alan Modra <amodra@gmail.com>
4038
4039 * target-reloc.h (scan_relocs): Call scan.local for relocs
4040 against symbols in discarded sections. Pass is_discarded
4041 param.
4042 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4043 Add is_discarded param.
4044 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4045 is_discarded to flag opd entry as discarded. Don't emit dyn
4046 relocs on such entries.
4047 (Target_powerpc::Scan::global): Similarly detect and handle
4048 such opd entries.
4049 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4050 opd_ent_. Update all uses.
4051 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4052 (Target_powerpc::relocate_section): Zero out discarded opd
4053 entry relocs.
4054
d77a0555
ILT
40552012-09-12 Ian Lance Taylor <iant@google.com>
4056
4057 PR gold/14570
4058 * output.cc: Rename Output_data_got template parameter from size
4059 to got_size for all functions. Compile all variants of
4060 Output_data_got.
4061 (Output_data_got::Got_entry::write): Correct use of size for
4062 symbol value. Use local_is_tls rather than casting to
4063 Sized_relobj_file.
4064 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4065 (class Sized_relobj_file): Add do_local_is_tls.
4066 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4067
815a1205
AM
40682012-09-11 Alan Modra <amodra@gmail.com>
4069
4070 PR gold/14566
4071 * layout.cc (Layout::set_segment_offsets): When using
4072 common-page-size alignment, ensure we are on a new max-page-size
4073 page.
4074 * output.cc (Output_segment::set_section_addresses): Use
4075 abi_pagesize, not common_pagesize for relro boundary.
4076 (Output_segment::set_offset): Likewise.
4077
bd73a62d
AM
40782012-09-11 Alan Modra <amodra@gmail.com>
4079
4080 * output.h (Output_data_got::add_global_tls, add_local_tls,
4081 add_local_tls_pair): New functions.
4082 (Output_data_got::add_local_pair_with_rel): Remove second
4083 reloc param. Expand comment.
4084 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4085 use_plt_or_tls_offset_, similarly for constructor param.
4086 (Output_data_got::Got_entry::write): Add got_index param.
4087 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4088 add_local_tls_pair): New functions.
4089 (Output_data_got::Got_entry::write): Handle tls symbols
4090 with use_plt_or_tls_offset_ set specially.
4091 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4092 (Output_data_got::do_write): Replace iterator with index, pass
4093 index to entry write function.
4094 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4095 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4096 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4097 call.
4098 * i386.cc (Target_i386::Scan::local): Likewise.
4099 * sparc.cc (Target_sparc::Scan::local): Likewise.
4100 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4101 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4102 do_tls_offset_for_global): New functions.
4103 (Target_powerpc::Scan::local): Correct TLS relocations and got
4104 entry values.
4105 (Target_powerpc::Scan::global): Don't emit unnecessary
4106 dynamic relocations on TLS GOT entries.
4107
00716ab1
AM
41082012-09-10 Matthias Klose <doko@ubuntu.com>
4109
4110 * config.in: Disable sanity check for kfreebsd.
4111
c891b3f9
SA
41122012-09-10 Sterling Augustine <saugustine@google.com>
4113
4114 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4115 (Gdb_index::pubtypes_read): New parameter.
4116 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4117 to calls.
4118 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4119 pubtypes_object_.
4120
e81fea4d
AM
41212012-09-09 Alan Modra <amodra@gmail.com>
4122
4123 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4124 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4125 * gc.h (gc_process_relocs): Call target gc_add_reference.
4126 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4127 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4128 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4129 unnecessary cast.
4130 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4131 to cater for when we don't need code offset. Update use.
4132 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4133 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4134 set_opd_valid): New functions.
4135 (Target_powerpc::do_gc_add_reference): New function.
4136 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4137 stashed refs.
4138 (Target_powerpc::do_gc_mark_symbol): New function.
4139
d2d60eef
CC
41402012-09-06 Cary Coutant <ccoutant@google.com>
4141
4142 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4143 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4144 (Dwarf_die::skip_attributes): Likewise.
4145 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4146 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4147 (main): Call it.
4148 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4149
32ed4573
L
41502012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4151
4152 * testsuite/script_test_3.t: Add .got.plt output section
4153 statement.
4154 * testsuite/script_test_4.t: Likewise.
4155
f4baf0d4
AM
41562012-09-05 Alan Modra <amodra@gmail.com>
4157
4158 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4159 update all uses and lose "enum" when using type.
4160
864a1b56
AM
41612012-09-05 Alan Modra <amodra@gmail.com>
4162
4163 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4164 * configure: Regenerate.
4165 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4166 (plugin_final_layout.stdout): Likewise.
4167 (memory_test): Set page sizes to 0x1000.
4168 * testsuite/Makefile.in: Regenerate.
4169 * testsuite/discard_locals_test.sh: Add FIXME comment.
4170 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4171 * testsuite/pr14265.t: Add .got output section statement.
4172 * testsuite/script_test_2.t: Likewise.
4173 * testsuite/script_test_3.t: Likewise.
4174 * testsuite/script_test_4.t: Likewise.
4175 * testsuite/script_test_5.t: Likewise.
4176 * testsuite/script_test_6.t: Likewise.
4177 * testsuite/script_test_7.t: Likewise.
4178 * testsuite/script_test_9.t: Likewise.
4179
3ea0a085
AM
41802012-09-05 Alan Modra <amodra@gmail.com>
4181
4182 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4183 (Powerpc_relocate_functions::Status): New typedef.
4184 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4185 (Target_powerpc::Scan::local): Handle REL64.
4186 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4187 for REL32 and REL64.
4188 (Target_powerpc::symval_for_branch): New function, extracted from..
4189 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4190 checks. Report overflow errors.
4191
7404fe1b
AM
41922012-09-05 Alan Modra <amodra@gmail.com>
4193
4194 * object.h (Sized_relobj_file::emit_relocs): Delete.
4195 (Sized_relobj_file::emit_relocs_reltype): Delete.
4196 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4197 relocate_relocs for --emit-relocs.
4198 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4199 * output.h: Update comment.
4200 (Output_segment::first_section): New function.
4201 (Output_segment::first_section_load_address): Use first_section.
4202 * output.cc (Output_segment::first_section): New function extracted..
4203 (Output_segment::first_section_load_address): ..from here. Delete.
4204 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4205 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4206 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4207 adjust call to target.h function.
4208 * i386.cc (Target_i386): Likewise.
4209 * sparc.cc (Target_sparc): Likewise.
4210 * x86_64.cc (Target_x86_64): Likewise.
4211 * powerpc.cc (Target_powerpc): Likewise.
4212 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4213 first tls section has section symbol for optimised local dynamic
4214 output relocs.
4215 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4216 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4217 optimised tls code.
4218 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4219 Rename to relocate_relocs. Update error message.
4220
957564c9
AS
42212012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4222
4223 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4224 --just-symbols.
4225
dd93cd0a
AM
42262012-08-31 Alan Modra <amodra@gmail.com>
4227
4228 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4229 (Powerpc_relobj::toc_base_offset): New stub function.
4230 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4231 got_mod_index_offset to tlsld_got_offset. Update all refs.
4232 (Target_powerpc::Relocate::enum skip_tls): New.
4233 (Target_powerpc::call_tls_get_addr_): New var.
4234 (Target_powerpc::is_branch_reloc): Move to file scope.
4235 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4236 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4237 New functions.
4238 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4239 (powerpc_info): Correct common_pagesize for ppc64.
4240 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4241 (Powerpc_relocate_functions): Add overflow check enums and functions.
4242 Add non-shift version of rela, rela_ua. Delete all rel public
4243 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4244 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4245 addr16_ha3, addr14 functions.
4246 (Output_data_got_powerpc::add_constant_pair): New function.
4247 (Output_data_got_powerpc::got_base_offset): Likewise.
4248 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4249 (instruction constants): Sort, add some more.
4250 (Output_data_glink::do_write): Add and use Address typedef. Use
4251 object->toc_base_offset() stub for 64-bit.
4252 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4253 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4254 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4255 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4256 Always treat .opd relocs as against locally defined symbol.
4257 Correct condition for RELATIVE relocs.
4258 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4259 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4260 for 32-bit syms with a plt entry. Correct ppc64 toc base
4261 calculations. Handle TLS relocs, and more. Add overflow
4262 checking and adjust for Powerpc_relocate_functions changes.
4263 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4264 Reinstate --emit-relocs code with FIXME.
4265
a1373b60
AM
42662012-08-30 Alan Modra <amodra@gmail.com>
4267
4268 * layout.cc (Layout::set_segment_offsets): Set p_align to
4269 abi_pagesize, not common_pagesize.
4270 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4271 to determine whether file header can go in segment.
4272
703d02da
AM
42732012-08-30 Alan Modra <amodra@gmail.com>
4274
4275 * output.h (Output_reloc::Output_reloc <output section>): Add
4276 is_relative param. Adjust calls.
4277 (Output_reloc::add_output_section_relative): New functions.
4278 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4279 is_relative.
4280 (Output_reloc::symbol_value): Handle SECTION_CODE.
4281
16164a6b
ST
42822012-08-24 Sriraman Tallam <tmsriram@google.com>
4283
4284 * gold.cc (queue_middle_tasks): Call layout again when unique
4285 segments for sections is desired.
4286 * layout.cc (Layout::Layout): Initialize new members.
4287 (Layout::get_output_section_flags): New function.
4288 (Layout::choose_output_section): Call get_output_section_flags.
4289 (Layout::layout): Make output section for mapping to a unique segment.
4290 (Layout::insert_section_segment_map): New function.
4291 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4292 output sections marked so.
16164a6b
ST
4293 (Layout::segment_precedes): Check for unique segments when sorting.
4294 * layout.h (Layout::Unique_segment_info): New struct.
4295 (Layout::Section_segment_map): New typedef.
4296 (Layout::insert_section_segment_map): New function.
4297 (Layout::get_output_section_flags): New function.
4298 (Layout::is_unique_segment_for_sections_specified): New function.
4299 (Layout::set_unique_segment_for_sections_specified): New function.
4300 (Layout::unique_segment_for_sections_specified_): New member.
4301 (Layout::section_segment_map_): New member.
4302 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4303 Rename is_gc_pass_one to is_pass_one.
4304 Rename is_gc_pass_two to is_pass_two.
4305 Rename is_gc_or_icf to is_two_pass.
4306 Check for which pass based on whether symbols data is present.
4307 Make it two pass when unique segments for sections is desired.
4308 * output.cc (Output_section::Output_section): Initialize new
4309 members.
4310 * output.h (Output_section::is_unique_segment): New function.
4311 (Output_section::set_is_unique_segment): New function.
4312 (Output_section::is_unique_segment_): New member.
4313 (Output_section::extra_segment_flags): New function.
4314 (Output_section::set_extra_segment_flags): New function.
4315 (Output_section::extra_segment_flags_): New member.
4316 (Output_section::segment_alignment): New function.
4317 (Output_section::set_segment_alignment): New function.
4318 (Output_section::segment_alignment_): New member.
4319 (Output_segment::Output_segment): Initialize is_unique_segment_.
4320 (Output_segment::is_unique_segment): New function.
4321 (Output_segment::set_is_unique_segment): New function.
4322 (Output_segment::is_unique_segment_): New member.
4323 * plugin.cc (allow_unique_segment_for_sections): New function.
4324 (unique_segment_for_sections): New function.
4325 (Plugin::load): Add new functions to transfer vector.
4326 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4327 * Makefile.in: Regenerate.
4328 * testsuite/plugin_final_layout.sh: Check if unique segment
4329 functionality works.
4330 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4331 are available.
4332 (allow_unique_segment_for_sections): New global.
4333 (unique_segment_for_sections): New global.
4334 (claim_file_hook): Call allow_unique_segment_for_sections.
4335 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4336
1e2bee4f
CC
43372012-08-22 Cary Coutant <ccoutant@google.com>
4338
4339 * layout.cc (Layout::include_section): Don't assert on GROUP
4340 sections with --emit-relocs.
4341
1d5dfe78
CC
43422012-08-21 Cary Coutant <ccoutant@google.com>
4343
4344 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4345 if --export-dynamic-symbol names an undef symbol.
4346
c9269dff
AM
43472012-08-18 Alan Modra <amodra@gmail.com>
4348
4349 * powerpc.cc: Formatting and white space.
4350 (Powerpc_relobj): Rename got2_section_ to special_.
4351 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4352 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4353 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4354 (Target_powerpc): Add Address typedef and invalid_address. Use
4355 throughout.
4356 (Target_powerpc::is_branch_reloc): New function.
4357 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4358 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4359 for dst_mask, value and addend.
4360 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4361 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4362 (Output_data_glink::do_write): Correct toc base. Don't try to use
4363 uint16_t for 24-bit offset. Use get_output_section_offset and
4364 check return.
4365 (Target_powerpc::Scan::local): Handle more relocs.
4366 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4367 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4368 Plug in toc restoring insn after plt calls. Translate branches
4369 to function descriptor symbols to corresponding entry point.
4370 (Target_powerpc::relocate_for_relocatable): Check return from
4371 get_output_section_offset.
4372 * symtab.h: Comment typo.
4373
b1759dce
ILT
43742012-08-14 Ian Lance Taylor <iant@google.com>
4375
4376 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4377 unsupported_relocal_local to call unsupported_reloc_global.
4378
b9b2ae8b
NC
43792012-08-14 Nick Clifton <nickc@redhat.com>
4380
4381 PR ld/14265
4382 * script-sections.cc (Sections_element::output_section_name): Add
4383 keep return parameter.
4384 (Output_section_element::match_name): Add keep return parameter.
4385 Return the value of the keep_ member.
4386 * script-sections.h (class Output_section): Update
4387 output_section_name prototype.
4388 * layout.cc (Layout::keep_input_section): New public member
4389 function.
4390 (Layout::choose_output_section): Pass keep parameter to
4391 output_section_name.
4392 * layout.h (class Layout): Add keep_input_section.
4393 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4394 sections.
4395 * testsuite/Makefile.am: Add a test.
4396 * testsuite/Makefile.in: Regenerate.
4397 * testsuite/pr14265.c: Source file for the test.
4398 * testsuite/pr14265.t: Linker script for the test.
4399 * testsuite/pr14265.sh: Shell script for the test.
4400
921b5322
AM
44012012-08-14 Alan Modra <amodra@gmail.com>
4402
4403 * target.h (Target::output_section_name): New function.
4404 (Target::do_output_section_name): New function.
4405 * layout.cc (Layout::choose_output_section): Call the above.
4406 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4407
6ce78956
AM
44082012-08-14 Alan Modra <amodra@gmail.com>
4409
4410 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4411 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4412 for replace_constant call.
4413 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4414 (Output_data_glink::do_print_to_mapfile): New function.
4415 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4416 (Target_powerpc::Relocate::relocate): Likewise.
4417
d1a8cabd
AM
44182012-08-14 Alan Modra <amodra@gmail.com>
4419
4420 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4421 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4422 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4423 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4424 all references to shndx_. Handle special case for R_PPC_PLTREL24
4425 here.
4426 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4427 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4428 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4429 here.
4430 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4431 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4432
d83ce4e3
AM
44332012-08-12 Alan Modra <amodra@gmail.com>
4434
4435 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4436 (glink insn constants): Use uint32_t.
4437 (Output_data_glink::add_entry): Use insert, not [] operator.
4438
cf43a2fe
AM
44392012-08-11 Alan Modra <amodra@gmail.com>
4440
4441 * object.h (Sized_relobj_file::find_shdr): New function.
4442 (Sized_relobj_file::find_special_sections): New function.
4443 * object.cc (Sized_relobj_file::find_shdr): New function.
4444 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4445 (Sized_relobj_file::find_special_sections): New function, split out..
4446 (Sized_relobj_file::do_read_symbols): ..from here.
4447 * output.h (Output_data_got::replace_constant): New function.
4448 (Output_data_got::num_entries): New function.
4449 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4450 (Output_data_got::got_offset): Protected rather than private.
4451 (Output_data_got::replace_got_entry): New function.
4452 * output.cc (Output_data_got::replace_got_entry): New function.
4453 * powerpc.cc (class Powerpc_relobj): New.
4454 (class Powerpc_relocate_functions): Delete all psymval variants or
4455 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4456 Implement _ha functions using corresponding _hi function.
4457 (Powerpc_relobj::find_special_sections): New function.
4458 (Target_powerpc::do_make_elf_object): New function.
4459 (class Output_data_got_powerpc): New.
4460 (class Output_data_glink): New.
4461 (class Powerpc_scan_relocatable_reloc): New.
4462 Many more changes througout file.
4463
3c892704
NC
44642012-08-09 Nick Clifton <nickc@redhat.com>
4465
4466 * po/vi.po: Updated Vietnamese translation.
4467
82435b3b
ILT
44682012-08-07 Ian Lance Taylor <iant@google.com>
4469
4470 * layout.cc (Layout::add_target_dynamic_tags): If
4471 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4472 plt_rel.
4473
a6dc81d2
NC
44742012-07-30 Nick Clifton <nickc@redhat.com>
4475
4476 * po/gold.pot: Updated template.
4477 * po/es.po: Updated Spanish translation.
4478
f1415016
CC
44792012-07-18 Cary Coutant <ccoutant@google.com>
4480
4481 PR gold/14344
4482 * configure.ac: Add check for -gpubnames support.
4483 * configure: Regenerate.
4484 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4485 support; force -gno-pubnames.
4486 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4487 support.
4488 (gdb_index_test_4): New test.
4489 * testsuite/Makefile.in: Regenerate.
4490 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4491 * testsuite/gdb_index_test_2.sh: Likewise.
4492 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4493 * testsuite/gdb_index_test_4.sh: New script.
4494 * testsuite/gdb_index_test_comm.sh: New script with common code;
4495 don't look for space after colon.
4496
b7fd7c37
ST
44972012-07-16 Sriraman Tallam <tmsriram@google.com>
4498
4499 * gold.cc (queue_middle_tasks): Update function order only after
4500 deferred objects due to plugins are processed.
4501
1f3212db
ILT
45022012-07-11 Ian Lance Taylor <iant@google.com>
4503
4504 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4505 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4506 (Target_arm::scan_reloc_for_stub): Likewise.
4507 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4508 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4509 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4510 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4511 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4512
81c82a68
ILT
45132012-07-10 Dodji Seketeli <dodji@redhat.com>
4514 Ian Lance Taylor <iant@google.com>
4515
4516 PR gold/14309
4517 * configure.ac: Test whether std::tr1::hash<off_t> works.
4518 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4519 needed.
4520 * output.h (class Output_fill): Add virtual destructor.
4521 * configure, config.in: Rebuild.
4522
eabc84f4
RM
45232012-06-22 Roland McGrath <mcgrathr@google.com>
4524
4525 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4526
370e30b6
RÁE
45272012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4528
4529 * plugin.cc (Plugin::load): Handle position independent executables.
4530
fb1b895d
CC
45312012-06-06 Cary Coutant <ccoutant@google.com>
4532
4533 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4534 add .debug_macro.
4535 (lines_only_debug_sections): Likewise.
4536 (gdb_fast_lookup_sections): New static array.
4537 (is_gdb_debug_section): Rename formal parameter.
4538 (is_lines_only_debug_section): Likewise.
4539 (is_gdb_fast_lookup_section): New function.
4540 (Layout::include_section): Check for ".zdebug_" prefix; pass
4541 section name suffix to is_gdb_debug_section, et al.; check for
4542 fast-lookup sections when building .gdb_index.
4543 * options.h (--strip-debug-gdb): Update GDB version number.
4544
7c0640fa
CC
45452012-06-06 Cary Coutant <ccoutant@google.com>
4546
4547 * configure.ac: Add check for fallocate.
4548 * configure: Regenerate.
4549 * config.in: Regenerate.
4550
4551 * options.h (class General_options): Add --mmap-output-file and
4552 --posix-fallocate options.
4553 * output.cc: (posix_fallocate): Remove; replace with...
4554 (gold_fallocate): New function.
4555 (Output_file::map_no_anonymous): Call gold_fallocate.
4556 (Output_file::map): Check --mmap-output-file option.
4557
2a49eb69
DK
45582012-06-05 Jing Yu <jingyu@google.com>
4559
4560 * gold.h (textdomain): Add do {} to empty while(0).
4561 (bindtextdomain): Likewise.
4562
fad072ac
CC
45632012-06-04 Cary Coutant <ccoutant@google.com>
4564
4565 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4566 has_dynsym_index.
4567
8cc69fb6
ST
45682012-05-25 Sriraman Tallam <tmsriram@google.com>
4569
4570 * symtab.cc (Symbol_table::define_special_symbol):
4571 Initialize *poldsym to prevent uninitialized variable errors.
4572
1be75daa
CC
45732012-05-23 Cary Coutant <ccoutant@google.com>
4574
4575 * layout.cc (Layout::section_name_mapping): Add rules to handle
4576 exact match on .data.rel.ro.local or .data.rel.ro.
4577 (Layout::output_section_name): Check for exact matches.
4578
9b689de0
CC
45792012-05-23 Cary Coutant <ccoutant@google.com>
4580
4581 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4582 more carefully.
4583
b24fdbf5
CC
45842012-05-22 Cary Coutant <ccoutant@google.com>
4585
4586 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4587 object before exporting symbol.
4588
e550e1a2
L
45892012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4590
4591 * testsuite/tls_test.cc: Include "config.h" first.
4592 * testsuite/tls_test_c.c: Likewise.
4593
df7b86aa
NC
45942012-05-17 Daniel Richard G. <skunk@iskunk.org>
4595 Nick Clifton <nickc@redhat.com>
4596
4597 PR 14072
4598 * configure.in: Add check that sysdep.h has been included before
4599 any system header files.
4600 * configure: Regenerate.
4601 * config.in: Regenerate.
4602
1007b503
CC
46032012-05-14 Cary Coutant <ccoutant@google.com>
4604
4605 * layout.cc (Layout::make_output_section): Mark .tdata section
4606 as RELRO.
4607 * testsuite/relro_test.cc: Add a TLS variable.
4608
fd885f3a
L
46092012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4610
4611 PR gold/14091
4612 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4613 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4614 R_X86_64_64.
4615
80f5885c
CC
46162012-05-08 Cary Coutant <ccoutant@google.com>
4617
4618 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4619 (lines_only_debug_sections): Likewise.
4620
2e702c99
RM
46212012-05-02 Roland McGrath <mcgrathr@google.com>
4622
4623 * nacl.cc: New file.
4624 * nacl.h: New file.
4625 * Makefile.am (CCFILES, HFILES): Add them.
4626 * Makefile.in: Regenerate.
4627 * i386.cc (Output_data_plt_i386_nacl): New class.
4628 (Output_data_plt_i386_nacl_exec): New class.
4629 (Output_data_plt_i386_nacl_dyn): New class.
4630 (Target_i386_nacl): New class.
4631 (Target_selector_i386_nacl): New class.
4632 (target_selector_i386): Use it instead of Target_selector_i386.
4633 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4634 (Target_x86_64_nacl): New class.
4635 (Target_selector_x86_64_nacl): New class.
4636 (target_selector_x86_64, target_selector_x32): Use it instead of
4637 Target_selector_x86_64.
4638 * arm.cc (Output_data_plt_arm_nacl): New class.
4639 (Target_arm_nacl): New class.
4640 (Target_selector_arm_nacl): New class.
4641 (target_selector_arm, target_selector_armbe): Use it instead of
4642 Target_selector_arm.
4643
4644 * target-select.cc (select_target): Take new Input_file* and off_t
4645 arguments, pass them on to recognize method of selector.
4646 * object.cc (make_elf_sized_object): Update caller.
4647 * parameters.cc (parameters_force_valid_target): Likewise.
4648 * incremental.cc (make_sized_incremental_binary): Likewise.
4649 * target-select.h: Update decl.
4650 (Target_selector::recognize): Take new Input_file* argument,
4651 pass it on to do_recognize.
4652 (Target_selector::do_recognize): Take new Input_file* argument.
4653 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4654 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4655 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4656 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4657
4658 * target.h (Target::Target_info): New members isolate_execinstr
4659 and rosegment_gap.
4660 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4661 * arm.cc (Target_arm::arm_info): Update initializer.
4662 * i386.cc (Target_i386::i386_info): Likewise.
4663 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4664 * sparc.cc (Target_sparc::sparc_info): Likewise.
4665 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4666 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4667 * layout.cc (Layout::attach_allocated_section_to_segment):
4668 Take new const Target* argument. If target->isolate_execinstr(), act
4669 like --rosegment.
4670 (Layout::find_first_load_seg): Take new const Target* argument;
4671 if target->isolate_execinstr(), reject PF_X segments.
4672 (Layout::relaxation_loop_body): Update caller.
4673 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4674 reset file offset to zero when we hit LOAD_SEG, and then do a second
4675 loop over the segments before LOAD_SEG to reassign offsets after
4676 addresses have been determined. Handle target->rosegment_gap().
4677 (Layout::attach_section_to_segment): Take new const Target* argument;
4678 pass it to attach_allocated_section_to_segment.
4679 (Layout::make_output_section): Update caller.
4680 (Layout::attach_sections_to_segments): Take new const Target* argument;
4681 pass it to attach_section_to_segment.
4682 * gold.cc (queue_middle_tasks): Update caller.
4683 * layout.h (Layout): Update method decls with new arguments.
4684
4685 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4686 Target_info pointer to use.
4687 (Target_arm::do_make_data_plt): New virtual method.
4688 (Target_arm::make_data_plt): New method that calls it.
4689 (Target_arm::make_plt_entry): Use it.
4690 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4691 for the section alignment.
4692 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4693 method.
4694 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4695 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4696 method.
4697 (Output_data_plt_arm::get_plt_entry_size): Call it.
4698 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4699 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4700 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4701 method.
4702 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4703 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4704 method instead of sizeof(plt_entry).
4705 (Output_data_plt_arm::add_entry): Likewise.
4706 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4707 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4708 than static method.
4709 (Target_arm::plt_entry_size): Likewise.
4710 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4711 Move to ...
4712 (Output_data_plt_arm_standard): ... here, new class.
4713 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4714 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4715 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4716
4717 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4718 Take additional argument for the PLT entry size.
4719 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4720 Use get_plt_entry_size method rather than plt_entry_size variable.
4721 (Output_data_plt_x86_64::reserve_slot): Likewise.
4722 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4723 (Output_data_plt_x86_64::add_entry): Likewise.
4724 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4725 (Output_data_plt_x86_64::address_for_global): Likewise.
4726 (Output_data_plt_x86_64::address_for_local): Likewise.
4727 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4728 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4729 Make method non-static.
4730 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4731 method.
4732 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4733 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4734 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4735 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4736 virtual method.
4737 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4738 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4739 virtual method.
4740 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4741 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4742 virtual method.
4743 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4744 (Output_data_plt_x86_64::plt_entry_size)
4745 (Output_data_plt_x86_64::first_plt_entry)
4746 (Output_data_plt_x86_64::plt_entry)
4747 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4748 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4749 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4750 (Output_data_plt_x86_64_standard): ... here, new class.
4751 (Target_x86_64::Target_x86_64): Take optional argument for the
4752 Target_info pointer to use.
4753 (Target_x86_64::do_make_data_plt): New virtual method.
4754 (Target_x86_64::make_data_plt): New method to call it.
4755 (Target_x86_64::init_got_plt_for_update): Use that.
4756 Call this->plt_->add_eh_frame method here.
4757 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4758 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4759 rather than static method.
4760 (Target_x86_64::plt_entry_size): Likewise.
4761 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4762 rather than plt_entry_size variable. Move guts of PLT filling to...
4763 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4764 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4765 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4766
4767 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4768 additional argument for the section alignment.
4769 Don't do add_eh_frame_for_plt here.
4770 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4771 non-static. Use get_plt_entry_size method rather than plt_entry_size
4772 variable.
4773 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4774 method.
4775 (Output_data_plt_i386::get_plt_entry_size): Call it.
4776 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4777 (Output_data_plt_i386::add_eh_frame): New method to call it.
4778 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4779 method.
4780 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4781 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4782 method.
4783 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4784 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4785 method instead of plt_entry_size.
4786 (Output_data_plt_i386::plt_entry_size)
4787 (Output_data_plt_i386::plt_eh_frame_fde_size)
4788 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4789 (Output_data_plt_i386_standard): ... here, new class.
4790 (Output_data_plt_i386_exec): New class.
4791 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4792 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4793 (Output_data_plt_i386::exec_plt_entry): Move to ...
4794 (Output_data_plt_i386_exec::plt_entry): ... here.
4795 (Output_data_plt_i386_dyn): New class.
4796 (Output_data_plt_i386::first_plt_entry): Move to ...
4797 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4798 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4799 (Output_data_plt_i386_dyn::plt_entry): ... here.
4800 (Target_i386::Target_i386): Take optional argument for the Target_info
4801 pointer to use.
4802 (Target_i386::do_make_data_plt): New virtual method.
4803 (Target_i386::make_data_plt): New method to call it.
4804 (Target_i386::make_plt_section): Use that.
4805 Call this->plt_->add_eh_frame method here.
4806 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4807 rather than plt_entry_size variable.
4808 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4809 (Output_data_plt_i386::address_for_local): Likewise.
4810 (Output_data_plt_i386::do_write): Likewise.
4811 Move guts of PLT filling to...
4812 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4813 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4814 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4815 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4816
b9b9f2ee
CC
48172012-05-01 Cary Coutant <ccoutant@google.com>
4818
4819 * dwarf_reader.cc (Dwarf_die::read_attributes)
4820 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4821 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4822 * reduced_debug_output.cc
4823 (Output_reduced_debug_info_section::get_die_end): Remove
4824 DW_FORM_GNU_ref_index. Add default case.
4825
57923f48
MW
48262012-04-26 Mark Wielaard <mjw@redhat.com>
4827
4828 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4829 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4830 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4831 DW_AT_high_pc as offset from DW_AT_low_pc.
4832
4833 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4834 * testsuite/Makefile.in: Regenerate.
4835 * testsuite/gdb_index_test_3.c: New test source file.
4836 * testsuite/gdb_index_test_3.sh: New test source file.
4837
2c54b4f4
ILT
48382012-04-25 Ian Lance Taylor <iant@google.com>
4839
4840 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4841 pointer.
4842 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4843 as a class, not a struct.
4844 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4845 (Target_arm::apply_cortex_a8_workaround): Likewise.
4846 * gc.h: Declare Reloc_types as a struct, not a class.
4847 * object.h: Declare Symbols_data as a struct.
4848 * reloc.h: Declare Read_relocs_data as a struct.
4849 * target.h: Declare Relocate_info as a struct.
4850
a5a5f7a3
DM
48512012-04-24 David S. Miller <davem@davemloft.net>
4852
4853 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4854 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4855 and R_SPARC_WPLT30.
4856
f038d496
CC
48572012-04-24 Cary Coutant <ccoutant@google.com>
4858
4859 * incremental-dump.cc (find_input_containing_global): Replace
4860 magic number with symbolic constant.
4861 (dump_incremental_inputs): Update version number.
4862 * incremental.cc (Output_section_incremental_inputs): Update version
4863 number; import symbolic constants from Incremental_inputs_reader.
4864 (Incremental_inputs::create_data_sections): Align relocations
4865 section correctly for 64-bit targets.
4866 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4867 constants; add padding.
4868 (Output_section_incremental_inputs::write_header): Add assert for
4869 header_size.
4870 (Output_section_incremental_inputs::write_input_files): Add assert
4871 for input_entry_size.
4872 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4873 add assert for object_info_size, input_section_entry_size,
4874 global_sym_entry_size.
4875 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4876 for data structure sizes; use them.
4877 (Incremental_input_entry_reader): Import symbolic constants from
4878 Incremental_inputs_reader; use them.
4879
a4d85145
DM
48802012-04-23 David S. Miller <davem@davemloft.net>
4881
4882 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4883 and elf_flags_set_.
4884 (Target_sparc::Target_sparc): Initialize new fields.
4885 (Target_sparc::do_make_elf_object): New function.
4886 (Target_sparc::do_adjust_elf_header): New function.
4887
1d509098
CC
48882012-04-23 Cary Coutant <ccoutant@google.com>
4889
4890 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4891 CU range table of gdb index.
4892
7ebeff7f
DM
48932012-04-20 David S. Miller <davem@davemloft.net>
4894
4895 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4896 instead of false.
4897
13cf9988
DM
48982012-04-16 David S. Miller <davem@davemloft.net>
4899
2a1079e8
DM
4900 * sparc.cc (Target_sparc::got_address): New function.
4901 (Sparc_relocate_functions::gdop_hix22): New function.
4902 (Sparc_relocate_functions::gdop_lox10): New function.
4903 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4904 relocs.
4905 (Target_sparc::Scan::local): Likewise if the global symbol is not
4906 preemptible and is not IFUNC.
4907 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4908 transformations for local and non-preemptible non-IFUNC global
4909 symbols.
4910
0bc964fc
DM
4911 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4912 writing out 64-bit part of ranges.
4913
661d7a80
DM
4914 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4915 -fpic and -fpie respectively.
4916 * Makefile.in: Regenerate.
4917
8c2bf391
DM
4918 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4919 (Target_sparc::Target_sparc): Initialize new field.
4920 (Target_sparc::do_plt_section_for_global): New function.
4921 (Target_sparc::do_plt_section_for_local): New function.
4922 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4923 (Target_sparc::make_plt_section): New function, broken out of
4924 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4925 (Target_sparc::make_plt_entry): Call make_plt_section.
4926 (Target_sparc::make_local_ifunc_plt_entry): New function.
4927 (Target_sparc::rela_ifunc_section): New function.
4928 (Target_sparc::plt_section): Remove const.
4929 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4930 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4931 and ifunc_count_ fields.
4932 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4933 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4934 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4935 (Output_data_plt_sparc::rela_ifunc): New function.
4936 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4937 (Output_data_plt_sparc::has_ifunc_section): New function.
4938 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4939 (Output_data_plt_sparc::address_for_global): New function.
4940 (Output_data_plt_sparc::address_for_local): New function.
4941 (Output_data_plt_sparc::plt_index_to_offset): New function.
4942 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4943 and entry_count.
4944 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4945 entry_count.
4946 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4947 R_SPARC_JMP_IREL to switch.
4948 (Target_sparc::Scan::check_non_pic): Likewise.
4949 (Target_sparc::Scan::local): Handle IFUNC symbols.
4950 (Target_sparc::Scan::local): Likewise.
4951 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4952 and plt_address_for_local.
4953 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4954 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4955
13cf9988
DM
4956 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4957 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4958 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4959 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4960 global relocs too.
4961 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4962 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4963 calls.
4964 * sparc.cc (Target_sparc::Scan::global): Likewise.
4965 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4966
31821be0
CC
49672012-04-16 Cary Coutant <ccoutant@google.com>
4968
4969 * archive.cc (Library_base::should_include_member): Check for
4970 --export-dynamic-symbol.
4971 * options.h (class General_options): Add --export-dynamic-symbol.
4972 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4973 --export-dynamic-symbol.
4974 (Symbol_table::gc_mark_undef_symbols): Likewise.
4975 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4976
2615994e
DM
49772012-04-12 David S. Miller <davem@davemloft.net>
4978
4979 * sparc.cc (Reloc::wdisp10): New relocation method.
4980 (Reloc::h34): Likewise.
4981 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4982 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4983 R_SPARC_WDISP10.
4984 (Target_sparc::Scan::local): Likewise.
4985 (Target_sparc::Scan::global): Likewise.
4986 (Target_sparc::Relocate::relocate): Likewise.
4987
6782735d
CC
49882012-04-09 Cary Coutant <ccoutant@google.com>
4989
4990 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
4991 low_pc == 0.
4992
8c7a0b00
ILT
49932012-04-06 Ian Lance Taylor <iant@google.com>
4994
4995 * timer.cc: #include <unistd.h>.
4996
58797674
RM
49972012-04-06 Roland McGrath <mcgrathr@google.com>
4998
4999 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5000 * config.in: Regenerate.
5001 * configure: Regenerate.
5002
44350750
NC
50032012-04-05 Nick Clifton <nickc@redhat.com>
5004
5005 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5006 (AM_LC_MESSAGES): Add.
5007 * aclocal.m4: Regenerate.
5008 * config.in: Regenerate.
5009 * configure: Regenerate.
5010
c1027032
CC
50112012-03-21 Cary Coutant <ccoutant@google.com>
5012
5013 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5014 * Makefile.in: Regenerate.
5015 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5016 (Sized_elf_reloc_mapper::symbol_section): New function.
5017 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5018 (make_elf_reloc_mapper): New function.
5019 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5020 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5021 (Dwarf_abbrev_table::do_get_abbrev): New function.
5022 (Dwarf_ranges_table::read_ranges_table): New function.
5023 (Dwarf_ranges_table::read_range_list): New function.
5024 (Dwarf_pubnames_table::read_section): New function.
5025 (Dwarf_pubnames_table::read_header): New function.
5026 (Dwarf_pubnames_table::next_name): New function.
5027 (Dwarf_die::Dwarf_die): New function.
5028 (Dwarf_die::read_attributes): New function.
5029 (Dwarf_die::skip_attributes): New function.
5030 (Dwarf_die::set_name): New function.
5031 (Dwarf_die::set_linkage_name): New function.
5032 (Dwarf_die::attribute): New function.
5033 (Dwarf_die::string_attribute): New function.
5034 (Dwarf_die::int_attribute): New function.
5035 (Dwarf_die::uint_attribute): New function.
5036 (Dwarf_die::ref_attribute): New function.
5037 (Dwarf_die::child_offset): New function.
5038 (Dwarf_die::sibling_offset): New function.
5039 (Dwarf_info_reader::check_buffer): New function.
5040 (Dwarf_info_reader::parse): New function.
5041 (Dwarf_info_reader::do_parse): New function.
5042 (Dwarf_info_reader::do_read_string_table): New function.
5043 (Dwarf_info_reader::lookup_reloc): New function.
5044 (Dwarf_info_reader::get_string): New function.
5045 (Dwarf_info_reader::visit_compilation_unit): New function.
5046 (Dwarf_info_reader::visit_type_unit): New function.
5047 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5048 Sized_elf_reloc_mapper.
5049 (Sized_dwarf_line_info::symbol_section): Remove function.
5050 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5051 (Sized_dwarf_line_info::read_line_mappings): Remove object
5052 parameter, adjust callers.
5053 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5054 * dwarf_reader.h: Include <sys/types.h>.
5055 (class Track_relocs): Remove forward declaration.
5056 (class Elf_reloc_mapper): New class.
5057 (class Sized_elf_reloc_mapper): New class.
5058 (class Dwarf_abbrev_table): New class.
5059 (class Dwarf_range_list): New class.
5060 (class Dwarf_ranges_table): New class.
5061 (class Dwarf_pubnames_table): New class.
5062 (class Dwarf_die): New class.
5063 (class Dwarf_info_reader): New class.
5064 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5065 (Sized_dwarf_line_info::symbol_section): Remove member function.
5066 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5067 base class.
5068 * gdb-index.cc: New source file.
5069 * gdb-index.h: New source file.
5070 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5071 and .debug_types sections, call Layout::add_to_gdb_index.
5072 (Sized_relobj_incr::do_section_name): Implement.
5073 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5074 return type; Implement.
5075 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5076 return type.
5077 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5078 parameter list and return type.
5079 (Sized_incr_dynobj::do_section_contents): Likewise.
5080 * layout.cc: Include gdb-index.h.
5081 (Layout::Layout): Initialize gdb_index_data_.
5082 (Layout::init_fixed_output_section): Check for .gdb_index section.
5083 (Layout::add_to_gdb_index): New function. Instantiate.
5084 * layout.h: Add forward declaration for class Gdb_index.
5085 (Layout::add_to_gdb_index): New member function.
5086 (Layout::gdb_index_data_): New data member.
5087 * main.cc: Include gdb-index.h.
5088 (main): Print statistics for gdb index.
5089 * object.cc (Object::section_contents): Move code into
5090 do_section_contents.
5091 (need_decompressed_section): Check for sections needed when building
5092 gdb index.
5093 (build_compressed_section_map): Likewise.
5094 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5095 gdb index.
5096 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5097 sections; call Layout::add_to_gdb_index.
5098 (Sized_relobj_file::do_decompressed_section_contents): Call
5099 do_section_contents directly.
5100 * object.h (Object::do_section_contents): Adjust parameter list and
5101 return type.
5102 (Object::do_decompressed_section_contents): Call do_section_contents
5103 directly.
5104 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5105 return type.
5106 * options.h (class General_options): Add --gdb-index option.
5107 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5108 list and return type.
5109 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5110 * reloc.h (Track_relocs::checkpoint): New function.
5111 (Track_relocs::reset): New function.
5112
5113 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5114 New test cases.
5115 * testsuite/Makefile.in: Regenerate.
5116 * testsuite/gdb_index_test.cc: New test source file.
5117 * testsuite/gdb_index_test_1.sh: New test source file.
5118 * testsuite/gdb_index_test_2.sh: New test source file.
5119
647f1574
DK
51202012-03-19 Doug Kwan <dougkwan@google.com>
5121
5122 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5123 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5124 __exidx_start and __exidx_end. Make symbol table parameter
5125 anonymous as it is not used.
5126 * gold.cc (queue_middle_tasks): Call target hook to define any
5127 target-specific symbols.
5128 * target.h (Target::define_standard_symbols): New method.
5129 (Target::do_define_standard_symbols): Same.
5130 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5131 * testsuite/Makefile.in: Regenerate.
5132 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5133 and __exidx_end.
5134 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5135 relocations are generated for __exidx_start and __exidx_end.
5136
7c6109da
DK
51372012-03-16 Doug Kwan <dougkwan@google.com>
5138
5139 * testsuite/Makefile.am: Disable test initpri3b.
5140 * testsuite/Makefile.in: Regenerate.
5141
7b8957f8
DK
51422012-03-15 Doug Kwan <dougkwan@google.com>
5143
5144 * arm.cc (Target_arm::got_section): Make .got section read-only
5145 if -z now is given.
5146
14dc9ef7
ILT
51472012-03-15 Ian Lance Taylor <iant@google.com>
5148
5149 PR gold/13850
5150 * layout.cc (Layout::make_output_section): Correctly mark
5151 SHT_INIT_ARRAY, et. al., as relro.
5152
fa40b62a
DK
51532012-03-14 Doug Kwan <dougkwan@google.com>
5154
5155 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5156 dynamic relocations for protected symbols in shared objects.
5157
fd325007
ILT
51582012-03-13 Ian Lance Taylor <iant@google.com>
5159
5160 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5161 keep the larger alignment.
5162
e8dd54e1
CC
51632012-03-12 Cary Coutant <ccoutant@google.com>
5164
5165 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5166 handling of DW_LNE_define_file.
5167
feb5f3b0
CC
51682012-03-12 Cary Coutant <ccoutant@google.com>
5169
5170 * reduced_debug_output.cc
5171 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5172 codes to switch.
5173
a1fb4256
CC
51742012-02-29 Cary Coutant <ccoutant@google.com>
5175
5176 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5177
5dd8762a
CC
51782012-02-29 Cary Coutant <ccoutant@google.com>
5179
5180 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5181 Call Object::decompressed_section_contents.
5182 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5183 New dtor.
5184 (Sized_dwarf_line_info::buffer_start_): New data member.
5185 * merge.cc (Output_merge_data::do_add_input_section): Call
5186 Object::decompressed_section_contents.
5187 (Output_merge_string::do_add_input_section): Likewise.
5188 * object.cc (need_decompressed_section): New function.
5189 (build_compressed_section_map): Decompress sections needed later.
5190 (Sized_relobj_file::do_decompressed_section_contents): New function.
5191 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5192 * object.h (Object::decompressed_section_contents): New function.
5193 (Object::discard_decompressed_sections): New function.
5194 (Object::do_decompressed_section_contents): New function.
5195 (Object::do_discard_decompressed_sections): New function.
5196 (Compressed_section_info): New type.
5197 (Compressed_section_map): Include decompressed section contents.
5198 (Sized_relobj_file::do_decompressed_section_contents): New function.
5199 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5200
7b5de7ee
CC
52012012-02-16 Cary Coutant <ccoutant@google.com>
5202
5203 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5204 * testsuite/Makefile.in: Regenerate.
5205
f9fa4a63
CC
52062012-02-14 Cary Coutant <ccoutant@google.com>
5207
5208 * options.cc (General_options::finalize): Disallow -pie and -static.
5209
2c175ebc
DK
52102012-02-03 Doug Kwan <dougkwan@google.com>
5211
5212 * arm.cc (Arm_relocate_functions::abs8,
5213 Arm_relocate_functions::abs16): Use
5214 Bits::has_signed_unsigned_overflow32.
5215 (Arm_relocate_functions::thm_abs8): Correct range of
5216 overflow check.
5217 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5218 in assertions.
5219
90cff06f
DK
52202012-02-02 Doug Kwan <dougkwan@google.com>
5221
5222 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5223 position independent outputs, not just shared objects.
5224
63887f3d
L
52252012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5226
5227 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5228 * configure: Regenerated.
5229
bef2b434
ILT
52302012-01-27 Ian Lance Taylor <iant@google.com>
5231
5232 * reloc.h (Bits): New class with static functions, copied from
5233 namespace utils in arm.cc.
5234 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5235 instead.
5236
c335b55d
L
52372012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5238
5239 * incremental.cc (write_info_blocks): Correct relocation offset.
5240
41194d9f
L
52412012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5242
5243 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5244 (Relocate::tls_gd_to_le): Likewise.
5245
1bae613c
L
52462012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5247
5248 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5249
24482ca0
L
52502012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5251
5252 * configure.ac: Check if -mcmodel=medium works.
5253 * configure: Regenerated.
5254
c2c7840a
CC
52552012-01-24 Cary Coutant <ccoutant@google.com>
5256
5257 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5258 definition and ...
5259 (read_unsigned_LEB_128_x): ... this new function.
5260 (read_signed_LEB_128): Replaced with inline definition and ...
5261 (read_signed_LEB_128_x): ... this new function.
5262 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5263 (read_unsigned_LEB_128): Add inline definition.
5264 (read_signed_LEB_128_x): New function.
5265 (read_signed_LEB_128): Add inline definition.
5266 * testsuite/Makefile.am (leb128_unittest): New unit test.
5267 * testsuite/Makefile.in: Regenerate.
5268 * testsuite/leb128_unittest.cc: New unit test.
5269
833de760 52702012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5271
5272 PR gold/13617
5273 * i386.cc (Target_i386::do_code_fill): When using a jmp
5274 instruction, pad with nop instructions.
5275 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5276
618d6666
L
52772012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5278
5279 * x86_64.cc (gc_process_relocs): Add typename on types used in
5280 template.
5281 (scan_relocs): Likewise.
5282 (relocate_section): Likewise.
5283 (apply_relocation): Likewise.
5284
3660ff06
L
52852012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5286
5287 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5288 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5289 under x32.
5290
fc51264f
L
52912012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5292
5293 * x86_64.cc: Initial support for x32.
5294
dd74ae06
CC
52952012-01-03 Cary Coutant <ccoutant@google.com>
5296
5297 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5298 Use abstract base class for GOT.
5299 * gold/output.h (class Output_data_got_base): New abstract base class.
5300 (class Output_data_got): Derive from new base class, adjust ctors.
5301 (Output_data_got::reserve_slot): Make virtual; rename to
5302 do_reserve_slot; Adjust callers.
5303 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5304 pointer to abstract base class.
5305 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5306
83896202
ILT
53072011-12-18 Ian Lance Taylor <iant@google.com>
5308
5309 * object.h (Relobj::local_symbol_value): New function.
5310 (Relobj::local_plt_offset): New function.
5311 (Relobj::local_has_got_offset): New function.
5312 (Relobj::local_got_offset): New function.
5313 (Relobj::set_local_got_offset): New function.
5314 (Relobj::do_local_symbol_value): New pure virtual function.
5315 (Relobj::do_local_plt_offset): Likewise.
5316 (Relobj::do_local_has_got_offset): Likewise.
5317 (Relobj::do_local_got_offset): Likewise.
5318 (Relobj::do_set_local_got_offset): Likewise.
5319 (Sized_relobj::do_local_has_got_offset): Rename from
5320 local_has_got_offset.
5321 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5322 (Sized_relobj::do_set_local_got_offset): Rename from
5323 set_local_got_offset.
5324 (Sized_relobj_file::do_local_plt_offset): Rename from
5325 local_plt_offset.
5326 (Sized_relobj_file::do_local_symbol_value): New function.
5327 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5328 local_plt_offset.
5329 * output.cc (Output_data_got::Got_entry::write): Change object to
5330 Relobj. Use local_symbol_value.
5331 (Output_data_got::add_global_with_rel): Change rel_dyn to
5332 Output_data_reloc_generic*. Use add_global_generic.
5333 (Output_data_got::add_global_with_rela): Remove. Change all
5334 callers to use add_global_with_rel.
5335 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5336 Output_data_reloc_generic*. Use add_global_generic.
5337 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5338 callers to use add_global_pair_with_rel.
5339 (Output_data_got::add_local): Change object to Relobj*.
5340 (Output_data_got::add_local_plt): Likewise.
5341 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5342 change rel_dyn to Output_data_reloc_generic*. Use
5343 add_local_generic.
5344 (Output_data_got::add_local_with_rela): Remove. Change all
5345 callers to use all_local_with_rel.
5346 (Output_data_got::add_local_pair_with_rel): Change object to
5347 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5348 add_output_section_generic.
5349 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5350 callers to use add_local_pair_with_rel.
5351 (Output_data_got::reserve_local): Change object to Relobj*.
5352 * output.h: (class Output_data_reloc_generic): Add pure virtual
5353 declarations for add_global_generic, add_local_generic,
5354 add_output_section_generic.
5355 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5356 functions for Output_data_reloc_generic. Update declarations for
5357 changes listed in output.cc.
5358 (class Output_data_got): Change template parameter to got_size.
5359 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5360 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5361 function.
5362 (Sized_relobj_incr::do_local_plt_offset): New function.
5363 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5364 add_global_generic.
5365
76677ad0
CC
53662011-12-17 Cary Coutant <ccoutant@google.com>
5367
5368 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5369 * resolve.cc (Symbol_table::resolve): Likewise.
5370 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5371 arrays.
5372 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5373
8b8dd8d5
ILT
53742011-12-16 Ian Lance Taylor <iant@google.com>
5375
5376 * output.h (Output_data_reloc_generic::add): Only call
5377 add_dynamic_reloc if this is a dynamic reloc section.
5378
d55525b9
L
53792011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5380
5381 PR gold/13505
5382 * target-reloc.h (apply_relocation): Replace <64, false> with
5383 <size, big_endian>.
5384
ff81c7c1
NC
53852011-11-25 Nick Clifton <nickc@redhat.com>
5386
5387 * po/it.po: New Italian translation.
5388
628f39be
SA
53892011-11-17 Sterling Augustine <saugustine@google.com>
5390
5391 * script.cc (script_include_directive): Implement.
5392 (read_script_file): New local variables name and search_path. Update
5393 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5394 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5395 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5396
98ef3ea4
SA
53972011-11-11 Sterling Augustine <saugustine@google.com>
5398
5399 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5400 (file_or_sections_cmd): Likewise.
5401
f4a8b6d7
DK
54022011-11-11 Doug Kwan <dougkwan@google.com>
5403
5404 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5405 if --just-symbols is given.
5406
29ab395d
DK
54072011-11-10 Doug Kwan <dougkwan@google.com>
5408
5409 PR gold/13362
5410 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5411 when processing data relocs.
5412 * reloc.h (Relocate_functions::rel_unaligned): New method.
5413 (Relocate_functions::pcrel_unaligned): Ditto.
5414 (Relocate_functions::rel32_unaligned): Ditto.
5415 (Relocate_functions::pcrel32_unaligned): Ditto.
5416
2c339f71
DK
54172011-11-09 Doug Kwan <dougkwan@google.com>
5418
5419 PR gold/13362
5420 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5421 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5422 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5423 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5424 (Relocate_functions::rel_unaligned): New.
5425 (Relocate_functions::rel32_unaligned): New.
5426 * target-reloc.h (relocate_for_relocatable): Add code to handle
5427 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5428 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5429 arm_unaligned_reloc_r): New targets.
5430 * testsuite/Makefile.in: Regenerate.
5431 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5432 linking.
5433
3f3cddf1
ILT
54342011-11-02 Ian Lance Taylor <iant@google.com>
5435
5436 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5437 NATIVE_LINKER.
5438 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5439 * options.cc (General_options::finalize): Use library search path
5440 from configure script if specified. If not native and no sysroot,
5441 only search TOOLLIBDIR.
5442 * options.h (Search_directory::Search_directory): Change name to
5443 const std::string&.
5444 (General_options::add_to_library_path_with_sysroot): Change arg to
5445 const std::string&.
5446 * configure, Makefile.in, config.in: Rebuild.
5447
a8e2273b
ILT
54482011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5449
5450 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5451 we are working around the ARM1176 Erratum.
5452 * options.h (General_options::fix_arm1176): Add option.
5453 * testsuite/Makefile.am: Add testcases, and keep current ones
5454 working.
5455 * testsuite/Makefile.in: Regenerate.
5456 * testsuite/arm_fix_1176.s: New file.
5457 * testsuite/arm_fix_1176.sh: Likewise.
5458
cd6eab1c
ILT
54592011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5460
5461 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5462 may_use_blx_.
5463 (Target_arm::may_use_blx): Remove method.
5464 (Target_arm::set_may_use_blx): Likewise.
5465 (Target_arm::may_use_v4t_interworking): New method.
5466 (Target_arm::may_use_v5t_interworking): Likewise.
5467 (Target_arm::may_use_blx_): Remove member variable.
5468 (Arm_relocate_functions::arm_branch_common): Check for v5T
5469 interworking.
5470 (Arm_relocate_functions::thumb_branch_common): Likewise.
5471 (Reloc_stub::stub_type_for_reloc): Likewise.
5472 (Target_arm::do_finalize_sections): Correct interworking checks.
5473 * testsuite/Makefile.am: Add new tests.
5474 * testsuite/Makefile.in: Regenerate.
5475 * testsuite/arm_farcall_arm_arm.s: New test.
5476 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5477 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5478 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5479 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5480 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5481 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5482 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5483
286adcf4
CC
54842011-10-31 Cary Coutant <ccoutant@google.com>
5485
5486 PR gold/13023
5487 * expression.cc (Expression::eval_with_dot): Add
5488 is_section_dot_assignment parameter.
5489 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5490 absolute and assigning to dot within a section.
5491 * script-sections.cc
5492 (Output_section_element_assignment::set_section_addresses): Pass
5493 dot_section to set_if_absolute.
5494 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5495 as is_section_dot_assignment flag to eval_with_dot.
5496 (Output_section_element_dot_assignment::set_section_addresses):
5497 Likewise.
5498 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5499 parameter. Also set value if relative to dot_section; set the
5500 symbol's output_section.
5501 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5502 parameter. Adjust all callers.
5503 (Expression::eval_maybe_dot): Likewise.
5504 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5505 Adjust all callers.
5506 * testsuite/script_test_2.t: Test assignment of an absolute value
5507 to dot within an output section element.
5508
9634ed06
CC
55092011-10-31 Cary Coutant <ccoutant@google.com>
5510
5511 * options.h (class General_options): Add --[no-]gnu-unique options.
5512 * symtab.cc (Symbol_table::sized_write_globals): Convert
5513 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5514
de4101c7
CC
55152011-10-31 Cary Coutant <ccoutant@google.com>
5516
5517 PR gold/13359
5518 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5519 unnecessary assertion.
5520 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5521
7257cc92
ST
55222011-10-31 Sriraman Tallam <tmsriram@google.com>
5523
5524 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5525 gc_mark_symbol.
5526 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5527 gc_mark_symbol.
5528 Change to just keep the section associated with symbol.
5529 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5530 they are externally visible and --export-dynamic is turned on.
5531 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5532
bfc34b3f
ILT
55332011-10-19 Ian Lance Taylor <iant@google.com>
5534
5535 PR gold/13163
5536 * script-sections.cc
5537 (Output_section_element_dot_assignment::needs_output_section): New
5538 function.
5539
ea0d8c47
ILT
55402011-10-19 Ian Lance Taylor <iant@google.com>
5541
5542 PR gold/13204
5543 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5544 --section-start option was seen.
5545 * options.h (General_options::any_section_start): New function.
5546
abd242a9
DM
55472011-10-18 David S. Miller <davem@davemloft.net>
5548
5549 PR binutils/13301
5550 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5551 member to track relocation locations that have moved during TLS
5552 reloc optimizations.
5553 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5554 (Target_sparc::Relocate::relocate): Adjust view down by 4
5555 bytes if it matches reloc_adjust_addr_.
5556 (Target_sparc::Relocate::relocate_tls): Always move the
5557 __tls_get_addr call delay slot instruction forward 4 bytes when
5558 performing relaxation.
5559
bab9090f
CC
55602011-10-18 Cary Coutant <ccoutant@google.com>
5561
5562 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5563 (Output_file::map_no_anonymous): Check for non-zero
5564 return code from posix_fallocate.
5565
f7c5b166
CC
55662011-10-17 Cary Coutant <ccoutant@google.com>
5567
5568 PR gold/13245
5569 * plugin.cc (is_visible_from_outside): Check for symbols
5570 referenced from dynamic objects.
5571 * resolve.cc (Symbol_table::resolve): Don't count references
5572 from dynamic objects as references from real ELF files.
5573 * testsuite/plugin_test_2.sh: Adjust expected result.
5574
b490c0bb
CC
55752011-10-17 Cary Coutant <ccoutant@google.com>
5576
5577 * gold.cc: Include timer.h.
5578 (queue_middle_tasks): Stamp time.
5579 (queue_final_tasks): Likewise.
5580 * main.cc (main): Store timer in parameters. Print timers
5581 for each pass.
5582 * parameters.cc (Parameters::Parameters): Initialize timer_.
5583 (Parameters::set_timer): New function.
5584 (set_parameters_timer): New function.
5585 * parameters.h (Parameters::set_timer): New function.
5586 (Parameters::timer): New function.
5587 (Parameters::timer_): New data member.
5588 (set_parameters_timer): New function.
5589 * timer.cc (Timer::stamp): New function.
5590 (Timer::get_pass_time): New function.
5591 * timer.h (Timer::stamp): New function.
5592 (Timer::get_pass_time): New function.
5593 (Timer::pass_times_): New data member.
5594
f475cf7b
CC
55952011-10-17 Cary Coutant <ccoutant@google.com>
5596
5597 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5598 task for members of lib groups.
5599
cdd7e244
CC
56002011-10-17 Cary Coutant <ccoutant@google.com>
5601
5602 PR gold/13288
4f95c8b4 5603 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5604 (File_read::make_view): Move bounds check (replace with assert)...
5605 (File_read::find_or_make_view): ... to here.
5606
dfb45471
CC
56072011-10-12 Cary Coutant <ccoutant@google.com>
5608
4f95c8b4 5609 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5610 ::read returns less than requested size.
5611
53bbcc1b
CC
56122011-10-10 Cary Coutant <ccoutant@google.com>
5613
4f95c8b4 5614 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5615 Initialize defined_count_.
5616 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5617 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5618 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5619 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5620 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5621 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5622 member.
5623 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5624 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5625 Return zeroes instead of internal error.
5626
397b129b
CC
56272011-10-10 Cary Coutant <ccoutant@google.com>
5628
5629 PR gold/13249
4f95c8b4 5630 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5631 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5632 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5633 (Output_reloc::type_): Adjust size of bit field.
5634 (Output_reloc::use_plt_offset_): New bit field.
5635 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5636 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5637 flag. Adjust all callers.
4f95c8b4 5638 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5639 creating RELATIVE relocations.
5640
d5698657
NC
56412011-10-10 Nick Clifton <nickc@redhat.com>
5642
5643 * po/es.po: Updated Spanish translation.
5644 * po/fi.po: Updated Finnish translation.
5645
6a59a5c2
DN
56462011-10-03 Diego Novillo <dnovillo@google.com>
5647
5648 * options.cc (parse_uint): Fix dereference of RETVAL.
5649
f0558624
ST
56502011-09-29 Sriraman Tallam <tmsriram@google.com>
5651
5652 * layout.h (section_order_map_): New member.
5653 (get_section_order_map): New member function.
5654 * output.cc (Output_section::add_input_section): Check for patterns
5655 only when --section-ordering-file is specified.
5656 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5657 output_sections have been formed.
5658 * layout.cc (Layout_Layout): Initialize section_order_map_.
5659 * plugin.cc (update_section_order): Store order in order_map. Do not
5660 update the order.
5661 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5662 * testsuite/Makefile.in: Regenerate.
5663 * testsuite/plugin_section_order.c: New file.
5664 * testsuite/plugin_final_layout.cc: New file.
5665 * testsuite/plugin_final_layout.sh: New file.
5666
a7dac153
CC
56672011-09-29 Cary Coutant <ccoutant@google.com>
5668
4f95c8b4 5669 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5670 Check for NULL.
4f95c8b4 5671 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5672 symbols during incremental update.
5673 (Symbol_table::add_from_dynobj): Likewise.
5674
eebd87a5
ILT
56752011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5676 Ian Lance Taylor <iant@google.com>
5677
5678 * symtab.cc (Symbol_table::define_special_symbol): Always
5679 canonicalize version string.
5680
403a3331
CC
56812011-09-26 Cary Coutant <ccoutant@google.com>
5682
4f95c8b4
CC
5683 * gold.cc (queue_initial_tasks): Move option checks ...
5684 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5685 some options; make others fatal.
5686
235061c2
CC
56872011-09-26 Cary Coutant <ccoutant@google.com>
5688
5689 gcc PR lto/47247
5690 * plugin.cc (get_symbols_v2): New function.
5691 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5692 (is_referenced_from_outside): New function.
5693 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5694 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5695 (get_symbols): Pass version parameter.
5696 (get_symbols_v2): New function.
5697 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5698 parameter.
5699 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5700 (onload): Add LDPT_GET_SYMBOLS_V2.
5701 (all_symbols_read_hook): Use get_symbols_v2; check for
5702 LDPR_PREVAILING_DEF_IRONLY_EXP.
5703 * testsuite/plugin_test_3.sh: Update expected results.
5704
dc87f620
ILT
57052011-09-23 Simon Baldwin <simonb@google.com>
5706
5707 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5708 configuration options.
5709 * configure: Regenerate.
5710 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5711 * Makefile.in: Regenerate.
5712 * testsuite/Makefile.in: Regenerate.
5713
a8279f82
ST
57142011-09-19 Sriraman Tallam <tmsriram@google.com>
5715
5716 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5717
0c9350c8
CC
57182011-09-19 Cary Coutant <ccoutant@google.com>
5719
5720 * incremental.cc (can_incremental_update): Fix typo in comment.
5721 * incremental.h (can_incremental_update): Likewise.
5722
aa06ae28
CC
57232011-09-18 Cary Coutant <ccoutant@google.com>
5724
5725 * incremental.cc (can_incremental_update): New function.
5726 * incremental.h (can_incremental_update): New function.
5727 * layout.cc (Layout::init_fixed_output_section): Call it.
5728 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5729 * object.cc (Sized_relobj_file::do_layout): Call
5730 can_incremental_update.
5731
ebb300b2
CC
57322011-09-13 Cary Coutant <ccoutant@google.com>
5733
5734 * configure.ac: Check for glibc support for gnu_indirect_function
5735 support with static linking, setting automake conditional
5736 IFUNC_STATIC.
5737 * Makefile.in: Regenerate.
5738 * configure: Regenerate.
5739
5740 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5741 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5742 for IFUNC_STATIC.
5743 * testsuite/Makefile.in: Regenerate.
5744
1206d0d5
CC
57452011-09-13 Cary Coutant <ccoutant@google.com>
5746
5747 * incremental.cc (Sized_relobj_incr::do_layout): Call
5748 report_comdat_group for kept comdat sections.
5749 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5750 * testsuite/Makefile.in: Regenerate.
5751 * testsuite/incr_comdat_test_1.cc: New source file.
5752 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5753 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5754 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5755
40b29874
ILT
57562011-09-13 Ian Lance Taylor <iant@google.com>
5757
5758 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5759 variable external_symbols_offset.
5760
1b045aac
ILT
57612011-09-12 Ian Lance Taylor <iant@google.com>
5762
5763 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5764 triggered if object has no symbols.
5765
24c6c55a
DM
57662011-09-09 David S. Miller <davem@davemloft.net>
5767
5768 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5769 (Output_fill_debug_line::do_write): Likewise.
5770
66570254
CC
57712011-08-29 Cary Coutant <ccoutant@google.com>
5772
5773 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5774 casts to match formatting specs.
5775 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5776
8ea8cd50
CC
57772011-08-26 Cary Coutant <ccoutant@google.com>
5778
5779 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5780 remaining hole size when allocating.
5781 (Layout::make_output_section): Set fill methods for debug sections.
5782 * layout.h (Free_list::Free_list_node): Move from private to
5783 public.
5784 (Free_list::set_min_hole_size): New function.
5785 (Free_list::begin, Free_list::end): New functions.
5786 (Free_list::min_hole_): New data member.
5787 * output.cc: Include dwarf.h.
5788 (Output_fill_debug_info::do_minimum_hole_size): New function.
5789 (Output_fill_debug_info::do_write): New function.
5790 (Output_fill_debug_line::do_minimum_hole_size): New function.
5791 (Output_fill_debug_line::do_write): New function.
5792 (Output_section::Output_section): Initialize new data member.
5793 (Output_section::set_final_data_size): Ensure patch space is larger
5794 than minimum hole size.
5795 (Output_section::do_write): Fill holes in debug sections.
5796 * output.h (Output_fill): New class.
5797 (Output_fill_debug_info): New class.
5798 (Output_fill_debug_line): New class.
5799 (Output_section::set_free_space_fill): New function.
5800 (Output_section::free_space_fill_): New data member.
5801 * testsuite/Makefile.am (incremental_test_3): Add
5802 --incremental-patch option.
5803 (incremental_test_4): Likewise.
5804 (incremental_test_5): Likewise.
5805 (incremental_test_6): Likewise.
5806 (incremental_copy_test): Likewise.
5807 (incremental_common_test_1): Likewise.
5808 * testsuite/Makefile.in: Regenerate.
5809
7cf80422
NC
58102011-08-26 Nick Clifton <nickc@redhat.com>
5811
5812 * po/es.po: Updated Spanish translation.
5813
c3f7b0e5
CC
58142011-08-01 Cary Coutant <ccoutant@google.com>
5815
5816 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5817 * gold/testsuite/Makefile.in: Regenerate.
5818 * gold/testsuite/justsyms_exec.c: New source file.
5819 * gold/testsuite/justsyms_lib.c: New source file.
5820
9590bf25
CC
58212011-08-01 Cary Coutant <ccoutant@google.com>
5822
5823 * layout.cc (Layout::set_segment_offsets): Don't realign text
5824 segment if -Ttext was specified.
5825 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5826 file type.
5827 * object.h (Sized_relobj_file::e_type): New function.
5828 (Sized_relobj_file::e_type_): New data member.
5829 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5830 base address for ET_EXEC files.
5831 * target.cc (Target::do_make_elf_object_implementation): Allow
5832 ET_EXEC files with --just-symbols option.
5833
dcd8d12e
CC
58342011-07-28 Cary Coutant <ccoutant@google.com>
5835
5836 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5837 Add thread_number parameter.
5838 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5839 * workqueue-threads.cc
5840 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5841 current thread if its thread number is greater than desired thread
5842 count.
5843 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5844 Add thread_number parameter.
5845 (Workqueue::should_cancel_thread): Likewise.
5846 (Workqueue::find_runnable_or_wait): Pass thread_number to
5847 should_cancel_thread.
5848 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5849 parameter.
5850
804eb480
ST
58512011-07-22 Sriraman Tallam <tmsriram@google.com>
5852
5853 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5854 only after checking if it cannot be forced local.
5855 * symtab.h (is_externally_visible): Check if the symbol is not forced
5856 local.
5857
f1ddb600
ILT
58582011-07-15 Ian Lance Taylor <iant@google.com>
5859
5860 * options.h (class General_options): Add --print-output-format.
5861 Move -EL next to -EB, for better --help output.
5862 * target-select.cc: Include <cstdio>, "options.h", and
5863 "parameters.h".
5864 (Target_selector::do_target_bfd_name): New function.
5865 (print_output_format): New function.
5866 * target-select.h (class Target_selector): Update declarations.
5867 (Target_selector::target_bfd_name): New function.
5868 (print_output_format): Declare.
5869 * main.cc: Include "target-select.h".
5870 (main): Handle --print-output-format.
5871 * gold.cc: Include "target-select.h".
5872 (queue_initial_tasks): Handle --print-output-format when there are
5873 no input files.
5874 * parameters.cc (parameters_force_valid_target): Give a better
5875 error message if -EB/-EL does not match target.
5876 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5877 function.
5878
7d172687
ILT
58792011-07-15 Ian Lance Taylor <iant@google.com>
5880
5881 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5882 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5883 (Output_data_plt_i386::do_write): Write address of .dynamic
5884 section to first entry in .got.plt section.
5885 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5886 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5887 Initialize layout_.
5888 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5889 section to first entry in .got.plt section.
5890 * layout.h (Layout::dynamic_section): New function.
5891
e9552f7e
ST
58922011-07-13 Sriraman Tallam <tmsriram@google.com>
5893
5894 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5895 to claim_file call.
5896 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5897 input_section_position_, and input_section_glob_.
5898 (read_layout_from_file): Call function section_ordering_specified.
5899 * layout.h (is_section_ordering_specified): New function.
5900 (section_ordering_specified): New function.
5901 (section_ordering_specified_): New boolean member.
5902 * main.cc(main): Call load_plugins after layout object is defined.
5903 * output.cc (Output_section::add_input_section): Use
5904 function section_ordering_specified to check if section ordering is
5905 needed.
5906 * output.cc (Output_section::add_relaxed_input_section): Use
5907 function section_ordering_specified to check if section ordering is
5908 needed.
5909 (Output_section::update_section_layout): New function.
5910 (Output_section::sort_attached_input_sections): Check if input section
5911 must be reordered.
5912 * output.h (Output_section::update_section_layout): New function.
5913 * plugin.cc (get_section_count): New function.
5914 (get_section_type): New function.
5915 (get_section_name): New function.
5916 (get_section_contents): New function.
5917 (update_section_order): New function.
58797674 5918 (allow_section_ordering): New function.
e9552f7e
ST
5919 (Plugin::load): Add the new interfaces to the transfer vector.
5920 (Plugin_manager::load_plugins): New parameter.
5921 (Plugin_manager::all_symbols_read): New parameter.
5922 (Plugin_manager::claim_file): New parameter. Save the elf object for
5923 unclaimed objects.
5924 (Plugin_manager::get_elf_object): New function.
5925 (Plugin_manager::get_view): Change to directly use the bool to check
5926 if get_view is called from claim_file_hook.
5927 * plugin.h (input_objects): New function
5928 (Plugin__manager::load_plugins): New parameter.
5929 (Plugin_manager::claim_file): New parameter.
5930 (Plugin_manager::get_elf_object): New function.
5931 (Plugin_manager::in_claim_file_handler): New function.
5932 (Plugin_manager::in_claim_file_handler_): New member.
5933 (layout): New function.
5934 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5935 handler with an extra parameter. Make the elf object before calling
5936 claim_file handler.
5937 * testsuite/plugin_test.c (get_section_count): New function pointer.
5938 (get_section_type): New function pointer.
5939 (get_section_name): New function pointer.
5940 (get_section_contents): New function pointer.
5941 (update_section_order): New function pointer.
5942 (allow_section_ordering): New function pointer.
5943 (onload): Check if the new interfaces exist.
5944
9446efde
ILT
59452011-07-13 Ian Lance Taylor <iant@google.com>
5946
5947 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5948 relro section.
5949 * x86_64.cc (Target_x86_64::got_section): Likewise.
5950 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5951 (relro_now_test_SOURCES): New variable.
5952 (relro_now_test_DEPENDENCIES): New variable.
5953 (relro_now_test_LDFLAGS): New variable.
5954 (relro_now_test_LDADD): New variable.
5955 (relro_now_test.so): New target.
5956 * testsuite/Makefile.in: Rebuild.
5957
07aa62f2
ILT
59582011-07-12 Ian Lance Taylor <iant@google.com>
5959
5960 PR gold/12980
5961 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5962 GLOB_DAT relocation rather than a RELATIVE relocation for a
5963 protected symbol when creating a shared library.
5964 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5965 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5966 * testsuite/protected_main_1.cc (main): Test that protected
5967 function has same address.
5968
e2153196
ILT
59692011-07-11 Ian Lance Taylor <iant@google.com>
5970
5971 PR gold/12979
5972 * options.h (class General_options): Add -Bgroup.
5973 * options.cc (General_options::finalize): If -Bgroup is set,
5974 default to --unresolved-symbols=report-all.
5975 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5976 * target-reloc.h (issue_undefined_symbol_error): Handle
5977 --unresolved-symbols=report-all.
5978
6daf5215
ILT
59792011-07-08 Ian Lance Taylor <iant@google.com>
5980
5981 PR gold/11985
5982 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5983 if linker script discards key sections.
5984 (Layout::create_dynamic_symtab): Likewise.
5985 (Layout::assign_local_dynsym_offsets): Likewise.
5986 (Layout::sized_create_version_sections): Likewise.
5987 (Layout::create_interp): Likewise.
5988 (Layout::finish_dynamic_section): Likewise.
5989 (Layout::set_dynamic_symbol_size): Likewise.
5990
beabb2c6
ILT
59912011-07-08 Ian Lance Taylor <iant@google.com>
5992
5993 PR gold/12386
5994 * options.h (class General_options): Add --unresolved-symbols.
5995 * target-reloc.h (issue_undefined_symbol_error): Check
5996 --unresolved-symbols. Add comments.
5997
9c16daf1
ILT
59982011-07-08 Ian Lance Taylor <iant@google.com>
5999
6000 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6001 expression more complex.
6002
191f1a2d
ILT
60032011-07-08 Ian Lance Taylor <iant@google.com>
6004
6005 PR gold/11317
6006 * target-reloc.h (issue_undefined_symbol_error): New inline
6007 function, broken out of relocate_section.
6008 (relocate_section): Call issue_undefined_symbol_error.
6009 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6010 there is no TLS segment if we are about to issue an undefined
6011 symbol error.
6012 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6013
62855347
ILT
60142011-07-08 Ian Lance Taylor <iant@google.com>
6015
6016 PR gold/12279
6017 * resolve.cc (Symbol_table::should_override): Add fromtype
6018 parameter. Change all callers. Give error when linking together
6019 TLS and non-TLS symbol.
6020 (Symbol_table::should_override_with_special): Add fromtype
6021 parameter. Change all callers.
6022 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6023 there is no TLS segment if we have reported some errors.
6024 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6025
67181c72
ILT
60262011-07-08 Ian Lance Taylor <iant@google.com>
6027
6028 PR gold/12372
6029 * target.h (Target::plt_address_for_global): New function.
6030 (Target::plt_address_for_local): New function.
6031 (Target::plt_section_for_global): Remove.
6032 (Target::plt_section_for_local): Remove.
6033 (Target::do_plt_address_for_global): New virtual function.
6034 (Target::do_plt_address_for_local): New virtual function.
6035 (Target::do_plt_section_for_global): Remove.
6036 (Target::do_plt_section_for_local): Remove.
6037 (Target::register_global_plt_entry): Add Symbol_table and Layout
6038 parameters.
6039 * output.cc (Output_data_got::Got_entry::write): Use
6040 plt_address_for_global and plt_address_for_local.
6041 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6042 address of output section.
6043 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6044 got_irelative_, and irelative_count_ fields. Update
6045 declarations.
6046 (Output_data_plt_i386::has_irelative_section): New function.
6047 (Output_data_plt_i386::entry_count): Add irelative_count_.
6048 (Output_data_plt_i386::set_final_data_size): Likewise.
6049 (class Target_i386): Add got_irelative_ and rel_irelative_
6050 fields. Update declarations.
6051 (Target_i386::Target_i386): Initialize new fields.
6052 (Target_i386::do_plt_address_for_global): New function replacing
6053 do_plt_section_for_global.
6054 (Target_i386::do_plt_address_for_local): New function replacing
6055 do_plt_section_for_local.
6056 (Target_i386::got_section): Create got_irelative_.
6057 (Target_i386::rel_irelative_section): New function.
6058 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6059 fields. Don't define __rel_iplt_{start,end}.
6060 (Output_data_plt_i386::add_entry): Add symtab and layout
6061 parameters. Change all callers. Use different PLT and GOT for
6062 IFUNC symbols.
6063 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6064 layout parameters. Change all callers. Use different PLT and
6065 GOT.
6066 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6067 (Output_data_plt_i386::rel_irelative): New function.
6068 (Output_data_plt_i386::address_for_global): New function.
6069 (Output_data_plt_i386::address_for_local): New function.
6070 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6071 IRELATIVE GOT when changing IFUNC GOT entries.
6072 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6073 reloc.
6074 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6075 if we didn't create an IRELATIVE GOT.
6076 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6077 plt_address_for_local.
6078 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6079 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6080 got_irelative_, and irelative_count_ fields. Update
6081 declarations.
6082 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6083 Initialize new fields. Remove symtab parameter. Change all
6084 callers.
6085 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6086 irelative_count_.
6087 (Output_data_plt_x86_64::has_irelative_section): New function.
6088 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6089 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6090 fields. Update declarations.
6091 (Target_x86_64::Target_x86_64): Initialize new fields.
6092 (Target_x86_64::do_plt_address_for_global): New function replacing
6093 do_plt_section_for_global.
6094 (Target_x86_64::do_plt_address_for_local): New function replacing
6095 do_plt_section_for_local.
6096 (Target_x86_64::got_section): Create got_irelative_.
6097 (Target_x86_64::rela_irelative_section): New function.
6098 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6099 all callers. Don't create __rel_iplt_{start,end}.
6100 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6101 parameters. Change all callers. Use different PLT and GOT for
6102 IFUNC symbols.
6103 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6104 layout parameters. Change all callers. Use different PLT and
6105 GOT.
6106 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6107 parameters. Change all callers. Use different PLT and GOT for
6108 IFUNC symbols.
6109 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6110 (Output_data_plt_x86_64::rela_irelative): New function.
6111 (Output_data_plt_x86_64::address_for_global): New function.
6112 (Output_data_plt_x86_64::address_for_local): New function.
6113 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6114 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6115 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6116 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6117 parameters.
6118 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6119 reloc.
6120 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6121 symbols if we didn't create an IRELATIVE GOT.
6122 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6123 plt_address_for_local.
6124 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6125 * testsuite/ifuncvar1.c: New test file.
6126 * testsuite/ifuncvar2.c: New test file.
6127 * testsuite/ifuncvar3.c: New test file.
6128 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6129 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6130 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6131 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6132 * testsuite/Makefile.in: Rebuild.
6133
33c15b45
CC
61342011-07-07 Cary Coutant <ccoutant@google.com>
6135
6136 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6137 (two_file_test_1_ndebug.o): Likewise.
6138 (two_file_test_1b_ndebug.o): Likewise.
6139 (two_file_test_2_ndebug.o): Likewise.
6140 (two_file_test_main_ndebug.o): Likewise.
6141 (incremental_test_2): Link with no-debug versions.
6142
f48b5fb7
CC
61432011-07-06 Cary Coutant <ccoutant@google.com>
6144
6145 * gold/incremental.cc
6146 (Output_section_incremental_inputs::write_info_blocks): Check for
6147 hidden and internal symbols.
6148
221597a5
CC
61492011-07-06 Cary Coutant <ccoutant@google.com>
6150
6151 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6152 Check disposition for startup file.
6153 (Incremental_inputs::report_command_line): Ignore
6154 --incremental-startup-unchanged option.
6155 * options.cc (General_options::parse_incremental_startup_unchanged):
6156 New function.
6157 (General_options::General_options): Initialize new data member.
6158 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6159 (General_options): Add --incremental-startup-unchanged option.
6160 (General_options::incremental_startup_disposition): New function.
6161 (General_options::incremental_startup_disposition_): New data member.
6162
e24719f6
CC
61632011-07-06 Cary Coutant <ccoutant@google.com>
6164
6165 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6166 input file index to Script_info ctor.
6167 (Sized_incremental_binary::do_file_has_changed): Find the
6168 command-line argument for files named in scripts.
6169 * incremental.h (Script_info::Script_info): New ctor
6170 with input file index.
6171 (Script_info::input_file_index): New function.
6172 (Script_info::input_file_index_): New data member.
6173 (Incremental_binary::get_library): Add const.
6174 (Incremental_binary::get_script_info): Add const.
6175 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6176 * testsuite/Makefile.am (incremental_test_5): New test case.
6177 (incremental_test_6): New test case.
6178 * testsuite/Makefile.in: Regenerate.
6179
8f7c81e8
CC
61802011-07-06 Cary Coutant <ccoutant@google.com>
6181
6182 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6183 debug output when command lines differ.
6184
9fbd3822
CC
61852011-07-06 Cary Coutant <ccoutant@google.com>
6186
6187 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6188 --incremental-patch option.
6189 * layout.cc (Free_list::allocate): Extend allocation beyond original
6190 end if enabled.
6191 (Layout::make_output_section): Mark sections that should get
6192 patch space.
6193 * options.cc (parse_percent): New function.
6194 * options.h (parse_percent): New function.
6195 (DEFINE_percent): New macro.
6196 (General_options): Add --incremental-patch option.
6197 * output.cc (Output_section::Output_section): Initialize new data
6198 members.
6199 (Output_section::add_input_section): Print section name when out
6200 of patch space.
6201 (Output_section::add_output_section_data): Likewise.
6202 (Output_section::set_final_data_size): Add patch space when
6203 doing --incremental-full.
6204 (Output_section::do_reset_address_and_file_offset): Remove patch
6205 space.
6206 (Output_segment::set_section_list_addresses): Print debug output
6207 only if --incremental-update.
6208 * output.h (Output_section::set_is_patch_space_allowed): New function.
6209 (Output_section::is_patch_space_allowed_): New data member.
6210 (Output_section::patch_space_): New data member.
6211 * parameters.cc (Parameters::incremental_full): New function.
6212 * parameters.h (Parameters::incremental_full): New function
6213 * testsuite/Makefile.am (incremental_test_2): Add test for
6214 --incremental-patch option.
6215 * testsuite/Makefile.in: Regenerate.
6216 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6217 (t18): Remove function body.
6218
f6cccc2c
DK
62192011-07-05 Doug Kwan <dougkwan@google.com>
6220
6221 PR gold/12771
6222 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6223 Arm_Address type for relocation result.
6224 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6225 overflow check.
6226 (Arm_relocate_functions::abs32): Use unaligned access.
6227 (Arm_relocate_functions::rel32): Ditto.
6228 (Arm_relocate_functions::prel31): Ditto.
6229 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6230 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6231 static data relocations.
6232 * testsuite/Makefile.in: Regnerate.
6233 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6234
28a13fec
ILT
62352011-07-05 Ian Lance Taylor <iant@google.com>
6236
6237 PR gold/12392
6238 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6239 symbols if necessary.
6240 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6241
24d47b34
ILT
62422011-07-05 Ian Lance Taylor <iant@google.com>
6243
6244 PR gold/12952
6245 * resolve.cc (Symbol::override_base_with_special): Simply override
6246 version with special symbol version, ignoring previous version.
6247
41f9cbbe
ILT
62482011-07-05 Ian Lance Taylor <iant@google.com>
6249
6250 * object.cc (Sized_relobj_file::include_section_group): Add
6251 information to comment about signature location.
6252
886288f1
ILT
62532011-07-02 Ian Lance Taylor <iant@google.com>
6254
6255 PR gold/12957
6256 * options.h (class General_options): Add -f and -F.
6257 * options.cc (General_options::finalize): Fatal error if -f/-F
6258 are used without -shared.
6259 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6260
ae3a6d4f
ILT
62612011-07-02 Ian Lance Taylor <iant@google.com>
6262
6263 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6264
21131061
ILT
62652011-07-01 Ian Lance Taylor <iant@google.com>
6266
6267 PR gold/12525
6268 PR gold/12952
6269 * resolve.cc (Symbol::override_base_with_special): Don't override
6270 the version if the overriding symbol has a different name.
6271 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6272 all callers. If we give an error about an undefined version,
6273 define the base version if necessary.
6274 * dynobj.h (class Versions): Update declaration.
6275 * testsuite/weak_alias_test_5.cc: New file.
6276 * testsuite/weak_alias_test.script: New file.
6277 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6278 and versioned_alias have the right value, and call t2.
6279 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6280 weak_alias_test_5.so.
6281 (weak_alias_test_LDADD): Likewise.
6282 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6283 * testsuite/Makefile.in: Rebuild.
6284
611062c0
ILT
62852011-07-01 Ian Lance Taylor <iant@google.com>
6286
6287 PR gold/12525
6288 * options.h (class General_options): Support -z notext.
6289 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6290 -Wl,-z,notext.
6291 (two_file_shared_nonpic.so): Likewise.
6292 (two_file_shared_mixed.so): Likewise.
6293 (two_file_shared_mixed_1.so): Likewise.
6294 (weak_undef_lib_nonpic.so): Likewise.
6295 (alt/weak_undef_lib_nonpic.so): Likewise.
6296 (tls_test_shared_nonpic.so): Likewise.
6297 * testsuite/Makefile.in: Rebuild.
6298
328c7c2f
ILT
62992011-07-01 Ian Lance Taylor <iant@google.com>
6300
6301 PR gold/12525
6302 * configure.ac: Test whether static linking works, setting
6303 the automake conditional HAVE_STATIC.
6304 * testsuite/Makefile.am: Disable tests using -static if
6305 HAVE_STATIC is not true.
6306 * configure, testsuite/Makefile.in: Rebuild.
6307
02d7cd44
ILT
63082011-07-01 Ian Lance Taylor <iant@google.com>
6309
6310 PR gold/12525
6311 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6312 Assert if we see DW_EH_PE_indirect.
6313 * target.h (Target::ehframe_datarel_base): New function.
6314 (Target::do_ehframe_datarel_base): New target function.
6315 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6316 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6317 function.
6318
07a60597
ILT
63192011-07-01 Ian Lance Taylor <iant@google.com>
6320
6321 PR gold/12571
6322 * options.h (class General_options): Add
6323 --ld-generated-unwind-info.
6324 * ehframe.cc (Fde::write): Add address parameter. Change all
6325 callers. If associated with PLT, fill in address and size.
6326 (Cie::set_output_offset): Only add merge mapping if there is an
6327 object.
6328 (Cie::write): Add address parameter. Change all callers.
6329 (Eh_frame::add_ehframe_for_plt): New function.
6330 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6331 input_offset_ fields into union u_, with new plt field.
6332 (Fde::Fde): Adjust for new union field.
6333 (Fde::Fde) [Output_data version]: New constructor.
6334 (Fde::add_mapping): Only add merge mapping if there is an object.
6335 (class Cie): Update declarations.
6336 (class Eh_frame): Declare add_ehframe_for_plt.
6337 * layout.cc (Layout::layout_eh_frame): Break out code into
6338 make_eh_frame_section, and call it.
6339 (Layout::make_eh_frame_section): New function.
6340 (Layout::add_eh_frame_for_plt): New function.
6341 * layout.h (class Layout): Update declarations.
6342 * merge.cc (Merge_map::add_mapping): Add assertion.
6343 * i386.cc: Include "dwarf.h".
6344 (class Output_data_plt_i386): Make first_plt_entry,
6345 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6346 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6347 and plt_eh_frame_fde.
6348 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6349 boundary. Call add_eh_frame_for_plt if appropriate.
6350 * x86_64.cc: Include "dwarf.h".
6351 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6352 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6353 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6354 and plt_eh_frame_fde.
6355 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6356 appropriate.
6357
14788a3f
ILT
63582011-06-29 Ian Lance Taylor <iant@google.com>
6359
6360 PR gold/12629
6361 * object.cc (Sized_relobj_file::layout_section): Change shdr
6362 parameter to be const.
6363 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6364 out of do_layout.
6365 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6366 appropriate. Call layout_eh_frame_section.
6367 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6368 sections.
6369 * object.h (class Sized_relobj_file): Update declarations.
6370
6c21fce1
ILT
63712011-06-29 Ian Lance Taylor <iant@google.com>
6372
37e41b03 6373 PR gold/12652
6c21fce1
ILT
6374 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6375 modifier.
6376 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6377
4d5e4e62
ILT
63782011-06-29 Ian Lance Taylor <iant@google.com>
6379
6380 PR gold/12675
6381 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6382 SHT_X86_64_UNWIND.
6383 * layout.cc (Layout::layout_eh_frame): Likewise.
6384
886f533a
ILT
63852011-06-29 Ian Lance Taylor <iant@google.com>
6386
6387 PR gold/12695
6388 * layout.cc (Layout::symtab_section_shndx): New function.
6389 * layout.h (class Layout): Declare symtab_section_shndx.
6390 * output.cc (Output_section::write_header): Call it.
6391
f3ae1b28
ILT
63922011-06-29 Ian Lance Taylor <iant@google.com>
6393
6394 PR gold/12818
6395 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6396 symbols which are not used in a relocation.
6397
aecf301f
ILT
63982011-06-28 Ian Lance Taylor <iant@google.com>
6399
6400 PR gold/12898
6401 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6402 script create indistinguishable segments.
6403 (Layout::set_segment_offsets): Use stable_sort when sorting
6404 segments. Pass this to Compare_segments constructor.
6405 * layout.h (class Layout): Make segment_precedes non-static.
6406 (class Compare_segments): Change from struct to class. Add
6407 layout_ field. Add constructor.
6408 * script-sections.cc
6409 (Script_sections::attach_sections_using_phdrs_clause): Rename
6410 local orphan to is_orphan. Don't report failure to put empty
6411 section in segment. On attachment failure, report name of
6412 section, and attach to first PT_LOAD segment.
6413
03ef7571
ILT
64142011-06-28 Ian Lance Taylor <iant@google.com>
6415
6416 PR gold/12934
6417 * target-select.cc (Target_selector::Target_selector): Add
6418 emulation parameter. Change all callers.
6419 (select_target_by_bfd_name): Rename from select_target_by_name.
6420 Change all callers.
6421 (select_target_by_emulation): New function.
6422 (supported_emulation_names): New function.
6423 * target-select.h (class Target_selector): Add emulation_ field.
6424 Update declarations.
6425 (Target_selector::recognize_by_bfd_name): Rename from
6426 recognize_by_name. Change all callers.
6427 (Target_selector::supported_bfd_names): Rename from
6428 supported_names. Change all callers.
6429 (Target_selector::recognize_by_emulation): New function.
6430 (Target_selector::supported_emulations): New function.
6431 (Target_selector::emulation): New function.
6432 (Target_selector::do_recognize_by_bfd_name): Rename from
6433 do_recognize_by_name. Change all callers.
6434 (Target_selector::do_supported_bfd_names): Rename from
6435 do_supported_names. Change all callers.
6436 (Target_selector::do_recognize_by_emulation): New function.
6437 (Target_selector::do_supported_emulations): New function.
6438 (select_target_by_bfd_name): Change name in declaration.
6439 (select_target_by_emulation): Declare.
6440 (supported_emulation_names): Declare.
6441 * parameters.cc (parameters_force_valid_target): Try to find
6442 target based on emulation from -m option.
6443 * options.h (class General_options): Change doc string for -m.
6444 * options.cc (help): Print emulations.
6445 (General_options::parse_V): Likewise.
6446 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6447 Add emulation parameter. Change all callers.
6448
200b2bb9
ILT
64492011-06-28 Ian Lance Taylor <iant@google.com>
6450
6451 * target.h (class Target): Add osabi_ field.
6452 (Target::osabi): New function.
6453 (Target::set_osabi): New function.
6454 (Target::Target): Initialize osabi_.
6455 (Target::do_adjust_elf_header): Make pure virtual.
6456 (Sized_target::do_adjust_elf_header): Declare.
6457 * target.cc (Sized_target::do_adjust_elf_header): New function.
6458 (class Sized_target): Instantiate all versions.
6459 * freebsd.h (class Target_freebsd): Remove.
6460 (Target_selector_freebsd::do_recognize): Call set_osabi on
6461 Target.
6462 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6463 (Target_selector_freebsd::set_osabi): Remove.
6464 * i386.cc (class Target_i386): Inherit from Sized_target rather
6465 than Target_freebsd.
6466 * x86_64.cc (class Target_x86_64): Likewise.
6467
b3ce541e
ILT
64682011-06-28 Ian Lance Taylor <iant@google.com>
6469
6470 * target.h (Target::can_check_for_function_pointers): Rewrite.
6471 Make non-virtual.
6472 (Target::can_icf_inline_merge_sections): Likewise.
6473 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6474 (Target::Target_info): Add can_icf_inline_merge_sections field.
6475 (Target::do_can_check_for_function_pointers): New virtual
6476 function.
6477 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6478 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6479 from can_check_for_function_pointers, move in file.
6480 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6481 section_may_have_icf_unsafe_poineters, move in file.
6482 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6483 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6484 Rename from can_check_for_function_pointers, move in file.
6485 (Target_i386::can_icf_inline_merge_sections): Remove.
6486 (Target_i386::i386_info): Initialize
6487 can_icf_inline_merge_sections.
6488 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6489 Initialize can_icf_inline_merge_sections.
6490 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6491 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6492 Rename from can_check_for_function_pointers, move in file.
6493 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6494 (Target_x86_64::x86_64_info): Initialize
6495 can_icf_inline_merge_sections.
6496 * testsuite/testfile.cc (Target_test::test_target_info):
6497 Likewise.
6498 * icf.cc (get_section_contents): Correct formatting.
6499
6d1c4efb
ILT
65002011-06-27 Ian Lance Taylor <iant@google.com>
6501
6502 * symtab.cc (Symbol::versioned_name): New function.
6503 (Symbol_table::add_to_final_symtab): Use versioned_name when
6504 appropriate.
6505 (Symbol_table::sized_write_symbol): Likewise.
6506 * symtab.h (class Symbol): Declare versioned_name.
6507 * stringpool.h (class Stringpool_template): Add variant of add
6508 which takes a std::basic_string.
6509 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6510 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6511 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6512 (ver_test_12.o): New target.
6513 * testsuite/Makefile.in: Rebuild.
6514
57eb9b50
DK
65152011-06-27 Doug Kwan <dougkwan@google.com>
6516
6517 * arm.cc (Arm_relocate_functions::thm_jump8,
6518 Arm_relocate_functions::thm_jump11): Use a wider signed
6519 type to compute offset.
6520 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6521 arm_thm_jump8.
6522 * testsuite/Makefile.in: Regenerate.
6523 * testsuite/arm_branch_in_range.sh: Check test results of
6524 arm_thm_jump11 and arm_thm_jump8.
6525 * testsuite/arm_thm_jump11.s: New test source file.
6526 * testsuite/arm_thm_jump11.t: New linker script.
6527 * testsuite/arm_thm_jump8.s: New test source file.
6528 * testsuite/arm_thm_jump8.t: New linker script.
6529
487b39df
ILT
65302011-06-24 Ian Lance Taylor <iant@google.com>
6531
6532 * layout.cc: Include "object.h".
6533 (ctors_sections_in_init_array): New static variable.
6534 (Layout::is_ctors_in_init_array): New function.
6535 (Layout::layout): Add entry to ctors_sections_in_init_array if
6536 appropriate.
6537 * layout.h (class Layout): Declare is_ctors_in_init_array.
6538 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6539 is_ctors_reverse_view is set.
6540 (Sized_relobj_file::write_sections): Add layout parameter. Change
6541 all callers. Set is_ctors_reverse_view field of View_size.
6542 (Sized_relobj_file::reverse_words): New function.
6543 * object.h (Sized_relobj_file::View_size): Add
6544 is_ctors_reverse_view field.
6545 (class Sized_relobj_file): Update declarations.
6546 * testsuite/initpri3.c: New test.
6547 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6548 initpri3b.
6549 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6550 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6551 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6552 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6553 * testsuite/Makefile.in: Rebuild.
6554
472076e4
CC
65552011-06-24 Cary Coutant <ccoutant@google.com>
6556
6557 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6558 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6559 (debug_msg_cdebug.err): New targets.
6560 * testsuite/Makefile.in: Regenerate.
6561 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6562 Fix checks for link with shared library.
6563
a60af0db
DK
65642011-06-24 Doug Kwan <dougkwan@google.com>
6565
6566 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6567 skip empty text sections.
6568 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6569
5393d741
ILT
65702011-06-22 Ian Lance Taylor <iant@google.com>
6571
6572 PR gold/12910
6573 * options.h (class General_options): Add --ctors-in-init-array.
6574 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6575 friends as SHT_PROGBITS for merging sections.
6576 (Layout::layout): Remove special handling of .init_array and
6577 friends. Don't sort if doing relocatable link. Sort for .ctors
6578 and .dtors if ctors_in_init_array.
6579 (Layout::make_output_section): Force correct section types for
6580 .init_array and friends. Don't sort if doing relocatable link,
6581 Don't sort .ctors and .dtors if ctors_in_init_array.
6582 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6583 (Layout::output_section_name): Add relobj parameter. Change all
6584 callers. Handle .ctors. and .dtors. in code rather than table.
6585 Handle .ctors and .dtors if ctors_in_init_array.
6586 (Layout::match_file_name): New function, moved from output.cc.
6587 * layout.h (class Layout): Update declarations.
6588 * output.cc: Include "layout.h".
6589 (Input_section_sort_entry::get_priority): New function.
6590 (Input_section_sort_entry::match_file_name): Just call
6591 Layout::match_file_name.
6592 (Output_section::Input_section_sort_init_fini_compare::operator()):
6593 Handle .ctors and .dtors. Sort by explicit priority rather than
6594 by name.
6595 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6596 * testsuite/initpri2.c: New test.
6597 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6598 (check_PROGRAMS): Add initpri2.
6599 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6600 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6601 * configure, testsuite/Makefile.in: Rebuild.
6602
e1f74f98
ILT
66032011-06-19 Ian Lance Taylor <iant@google.com>
6604
6605 PR gold/12880
6606 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6607 .interp section to a PT_INTERP segment even if we have seen a
6608 --dynamic-linker option. Don't do it if we have seen a PHDRS
6609 clause in a linker script.
6610 (Layout::finalize): Don't create a .interp section if we've
6611 already create a PT_INTERP segment.
6612 (Layout::create_interp): Always call choose_output_section (revert
6613 patch of 2011-06-17). Don't create PT_INTERP segment.
6614 * script-sections.cc
6615 (Script_sections::create_note_and_tls_segments): Add a .interp
6616 section to a PT_INTERP segment even if we have seen a
6617 --dynamic-linker option.
6618
766f91bb
ILT
66192011-06-18 Ian Lance Taylor <iant@google.com>
6620
6621 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6622 merely because a non-PT_LOAD segment has a dynamic reloc.
6623
0d212c3a
ILT
66242011-06-18 Ian Lance Taylor <iant@google.com>
6625
6626 * layout.cc (Layout::finish_dynamic_section): Don't create
6627 DT_FLAGS entry if not needed.
6628
911a5072
ILT
66292011-06-18 Ian Lance Taylor <iant@google.com>
6630
6631 PR gold/12745
6632 * layout.cc (Layout::layout_eh_frame): Correct handling of
6633 writable .eh_frame section.
6634
534b4e5f
ILT
66352011-06-17 Ian Lance Taylor <iant@google.com>
6636
6637 PR gold/12893
6638 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6639 symbol is redefined with the exact same object and value.
6640
10b4f102
ILT
66412011-06-17 Ian Lance Taylor <iant@google.com>
6642
6643 PR gold/12880
6644 * layout.h (class Layout): Add interp_segment_ field.
6645 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6646 (Layout::attach_allocated_section_to_segment): If making shared
6647 library, put .interp section in PT_INTERP segment.
6648 (Layout::finalize): Also call create_interp if -dynamic-linker
6649 option was used.
6650 (Layout::create_interp): Assert that there is no PT_INTERP
6651 segment. If not using a SECTIONS clause, use make_output_section.
6652 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6653 * script-sections.cc
6654 (Script_sections::create_note_and_tls_segments): If making shared
6655 library, put .interp section in PT_INTERP segment.
6656
a29b0dad
ILT
66572011-06-17 Ian Lance Taylor <iant@google.com>
6658
e588ea8d
ILT
6659 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6660 when making a shared library.
6661
66622011-06-17 Ian Lance Taylor <iant@google.com>
6663
6664 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6665 parameter. Change all callers. Don't issue warning about PC32
6666 against locally defined symbol.
a29b0dad 6667
9d3b0698
ILT
66682011-06-16 Ian Lance Taylor <iant@google.com>
6669
6670 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6671 occurs in same object.
6672
85b0f90c
AM
66732011-06-14 Alan Modra <amodra@gmail.com>
6674
6675 * po/POTFILES.in: Regenerate.
6676
a94907d9
ILT
66772011-06-09 Ian Lance Taylor <iant@google.com>
6678
6679 * script-sections.cc
6680 (Orphan_output_section::set_section_addresses): For a relocatable
6681 link set address to 0.
6682
4fb3a1c3
CC
66832011-06-09 Cary Coutant <ccoutant@google.com>
6684
6685 PR gold/12804
6686 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6687 used with --compress-debug-sections.
6688 * gold/object.cc (Sized_relobj_file::do_layout): Report
6689 uncompressed size of compressed input sections.
6690
61220854
CC
66912011-06-08 Cary Coutant <ccoutant@google.com>
6692
6693 PR gold/12804
6694 * testsuite/two_file_test_2_v1.cc: Change initialization of
6695 v2 to keep it in .data.
6696
e6455dfb
CC
66972011-06-07 Cary Coutant <ccoutant@google.com>
6698
6699 * common.cc (Symbol_table::do_allocate_commons_list): Call
6700 gold_fallback.
6701 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6702 (Errors::fallback): New function.
6703 (gold_fallback): New function.
6704 * errors.h (Errors::fallback): New function.
6705 * gold.cc (gold_exit): Change status parameter to enum; adjust
6706 all callers.
6707 (queue_initial_tasks): Call gold_fallback.
6708 * gold.h: Include cstdlib.
6709 (Exit_status): New enum type.
6710 (gold_exit): Change status parameter to enum.
6711 (gold_fallback): New function.
6712 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6713 (Layout::create_symtab_sections): Likewise.
6714 (Layout::create_shdrs): Likewise.
6715 * main.cc (main): Adjust call to gold_exit.
6716 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6717 (Output_data_got::add_got_entry_pair): Likewise.
6718 (Output_section::add_input_section): Likewise.
6719 (Output_section::add_output_section_data): Likewise.
6720 (Output_segment::set_section_list_addresses): Likewise.
6721 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6722
fb0e076f
CC
67232011-06-07 Cary Coutant <ccoutant@google.com>
6724
6725 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6726 for incremental links.
6727 * output.cc (Output_segment::set_section_list_addresses): Remove
6728 FIXME and test for TLS or BSS.
6729
a5ee4d5d
CC
67302011-06-07 Cary Coutant <ccoutant@google.com>
6731
6732 * testsuite/Makefile.am: Add incremental_copy_test,
6733 incremental_common_test_1.
6734 * testsuite/Makefile.in: Regenerate.
6735 * testsuite/common_test_1_v1.c: New source file.
6736 * testsuite/common_test_1_v2.c: New source file.
6737 * testsuite/copy_test_v1.cc: New source file.
6738
5146f448
CC
67392011-06-07 Cary Coutant <ccoutant@google.com>
6740
6741 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6742 update, allocate common from bss section's free list.
6743 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6744 linker-defined symbols.
6745 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6746 Skip GOT and PLT entries that are no longer referenced.
6747 (Output_section_incremental_inputs::write_info_blocks): Mark
6748 linker-defined symbols.
6749 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6750 * output.cc (Output_section::allocate): New function.
6751 * output.h (Output_section::allocate): New function.
6752 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6753 linker-defined symbols.
6754 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6755 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6756 (Symbol::init_base_output_data): Likewise.
6757 (Symbol::init_base_output_segment): Likewise.
6758 (Symbol::init_base_constant): Likewise.
6759 (Sized_symbol::init_output_data): Likewise.
6760 (Sized_symbol::init_output_segment): Likewise.
6761 (Sized_symbol::init_constant): Likewise.
6762 (Symbol_table::do_define_in_output_data): Likewise.
6763 (Symbol_table::do_define_in_output_segment): Likewise.
6764 (Symbol_table::do_define_as_constant): Likewise.
6765 * symtab.h (Symbol::is_predefined): New function.
6766 (Symbol::init_base_output_data): Add is_predefined parameter.
6767 (Symbol::init_base_output_segment): Likewise.
6768 (Symbol::init_base_constant): Likewise.
6769 (Symbol::is_predefined_): New data member.
6770 (Sized_symbol::init_output_data): Add is_predefined parameter.
6771 (Sized_symbol::init_output_segment): Likewise.
6772 (Sized_symbol::init_constant): Likewise.
6773 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6774
26d3c67d
CC
67752011-06-07 Cary Coutant <ccoutant@google.com>
6776
6777 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6778 instead of emit_copy_reloc.
6779 (Copy_relocs::emit_copy_reloc): Refactor.
6780 (Copy_relocs::make_copy_reloc): New function.
6781 (Copy_relocs::add_copy_reloc): Remove.
6782 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6783 section.
6784 (Copy_relocs::make_copy_reloc): New function.
6785 (Copy_relocs::add_copy_reloc): Remove.
6786 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6787 unchanged input files.
6788 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6789 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6790 Reserve BSS space for COPY relocations.
6791 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6792 (Output_section_incremental_inputs::write_info_blocks): Record
6793 whether a symbol is copied from a shared object.
6794 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6795 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6796 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6797 (Incremental_input_entry_reader::get_output_symbol_index): Add
6798 is_copy parameter.
6799 (Incremental_binary::emit_copy_relocs): New function.
6800 (Incremental_binary::do_emit_copy_relocs): New function.
6801 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6802 new data member.
6803 (Sized_incremental_binary::add_copy_reloc): New function.
6804 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6805 (Sized_incremental_binary::Copy_reloc): New struct.
6806 (Sized_incremental_binary::Copy_relocs): New typedef.
6807 (Sized_incremental_binary::copy_relocs_): New data member.
6808 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6809 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6810 * target.h (Sized_target::emit_copy_reloc): New function.
6811 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6812
7cdb37d9
CC
68132011-06-02 Cary Coutant <ccoutant@google.com>
6814
6815 PR gold/12163
6816 * gold/archive.cc (Archive::Archive): Initialize new data member.
6817 (Archive::include_all_members): Return if archive has already been
6818 included.
6819 * gold/archive.h (Archive::include_all_members_): New data member.
6820
cc643b88
NC
68212011-06-02 Nick Clifton <nickc@redhat.com>
6822
6823 * dynobj.h: Fix spelling mistake in comment.
6824 * output.cc: Likewise.
6825
f62a3ca7 68262011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6827 Asier Llano
f62a3ca7
DK
6828
6829 PR gold/12826
cc643b88 6830 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6831 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6832 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6833 redundant arm_exidx_test.so.
6834 * testsuite/Makefile.in: Regenerate.
6835 (check_SCRIPTS): Add pr12826.sh
6836 (check_DATA): Add pr12826.stdout
6837 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6838 * testsuite/pr12826.sh: New file.
6839 * testsuite/pr12826_1.s: Ditto.
6840 * testsuite/pr12826_1.s: Ditto.
6841
8dbe1edc
ILT
68422011-05-30 Ian Lance Taylor <iant@google.com>
6843
6844 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6845 sections.
6846
c49875be
ILT
68472011-05-29 Ian Lance Taylor <iant@google.com>
6848
6849 PR gold/12804
6850 * testsuite/Makefile.am: Use different file name for two_file_test
6851 temporary file for each incremental test.
6852 * testsuite/Makefile.in: Rebuild.
6853
69d53f7a
ILT
68542011-05-29 Ian Lance Taylor <iant@google.com>
6855
6856 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6857 binary input file is empty.
6858
41d0ab5f
ILT
68592011-05-27 Ian Lance Taylor <iant@google.com>
6860
6861 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6862 (ver_test_9.so): Likewise.
6863 * testsuite/Makefile.in: Rebuild.
6864
89d8a36b
CC
68652011-05-26 Cary Coutant <ccoutant@google.com>
6866
6867 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6868 * incremental.cc (Incremental_inputs::report_input_section): Fix
6869 comment, indentation.
6870 (Incremental_inputs::report_comdat_group): New function.
6871 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6872 of data for incremental input file entry.
6873 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6874 group count, COMDAT group signatures.
6875 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6876 an unchanged input file.
6877 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6878 Initialize new data member.
6879 (Incremental_object_entry::add_comdat_group): New function.
6880 (Incremental_object_entry::get_comdat_group_count): New function.
6881 (Incremental_object_entry::get_comdat_signature_key): New function.
6882 (Incremental_object_entry::groups_): New data member.
6883 (Incremental_inputs::report_comdat_group): New function.
6884 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6885 data for incremental input file entry.
6886 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6887 (Incremental_input_entry_reader::get_input_section): Adjust size of
6888 data for incremental input file entry.
6889 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6890 (Incremental_input_entry_reader::get_comdat_group_signature): New
6891 function.
6892 * object.cc (Sized_relobj::include_section_group): Report kept
6893 COMDAT groups for incremental links.
6894
1706a06f
ILT
68952011-05-24 David Meyer <pdox@google.com>
6896
6897 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6898 with name parameter. Add found_name parameter.
6899 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6900 * dirsearch.h (class Dirsearch): Update declaration.
6901
a10ae760
ILT
69022011-05-24 Ian Lance Taylor <iant@google.com>
6903
6904 * archive.cc (Library_base::should_include_member): Pull in object
6905 from archive if it defines the entry symbol.
6906 * parameters.cc (Parameters::entry): New function.
6907 * parameters.h (class Parameters): Declare entry.
6908 * output.h (class Output_file_header): Remove entry_ field.
6909 * output.cc (Output_file_header::Output_file_header): Remove entry
6910 parameter. Change all callers.
6911 (Output_file_header::entry): Use parameters->entry.
6912 * gold.cc (queue_middle_tasks): Likewise.
6913 * plugin.cc (Plugin_hook::run): Likewise.
6914
aa92d6ed
CC
69152011-05-24 Cary Coutant <ccoutant@google.com>
6916
6917 * gold.cc (queue_initial_tasks): Pass incremental base filename
6918 to Output_file::open_base_file; don't print error message.
6919 * incremental-dump.cc (main): Adjust call to
6920 Output_file::open_for_modification.
6921 * incremental-dump.cc (main): Likewise.
6922 * incremental.cc (Incremental_inputs::report_command_line):
6923 Ignore --incremental-base option when comparing command lines.
6924 Ignore parameter when given as separate argument.
6925 * options.h (class General_options): Add --incremental-base.
6926 * output.cc (Output_file::Output_file):
6927 (Output_file::open_base_file): Add base_name and writable parameters;
6928 read base file into new file; print error message here.
6929 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6930 callers.
6931 * output.h (Output_file::open_for_modification): Rename to...
6932 (Output_file::open_base_file): ...this; add base_name and
6933 writable parameters; adjust all callers.
6934 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6935 callers.
6936 * testsuite/Makefile.am (incremental_test_4): Test
6937 --incremental-base.
6938 * testsuite/Makefile.in: Regenerate.
6939
2eedd706
CC
69402011-05-24 Cary Coutant <ccoutant@google.com>
6941
6942 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6943 incremental_test_4.
6944 * testsuite/Makefile.in: Regenerate.
6945 * testsuite/two_file_test_1_v1.cc: New test source file.
6946 * testsuite/two_file_test_1b_v1.cc: New test source file.
6947 * testsuite/two_file_test_2_v1.cc: New test source file.
6948
0f1c85a6
CC
69492011-05-24 Cary Coutant <ccoutant@google.com>
6950
6951 * dynobj.h (Dynobj::do_dynobj): New function.
6952 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6953 flag and soname for shared objects.
6954 * incremental.cc (Incremental_inputs::report_object): Make
6955 either Incremental_object_entry or Incremental_dynobj_entry; add
6956 soname to string table.
6957 (Incremental_inputs::report_input_section): Add assertion.
6958 (Output_section_incremental_inputs::set_final_data_size): Adjust
6959 type of input file entry for shared libraries; adjust size of
6960 shared library info entry.
6961 (Output_section_incremental_inputs::write_input_files): Write
6962 as_needed flag for shared libraries.
6963 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6964 of input file entry for shared libraries; write soname.
6965 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6966 soname from incremental info.
6967 * incremental.h (enum Incremental_input_flags): Add
6968 INCREMENTAL_INPUT_AS_NEEDED.
6969 (Incremental_input_entry::Incremental_input_entry): Initialize new
6970 data member.
6971 (Incremental_input_entry::set_as_needed): New function.
6972 (Incremental_input_entry::as_needed): New function.
6973 (Incremental_input_entry::do_dynobj_entry): New function.
6974 (Incremental_input_entry::as_needed_): New data member.
6975 (Incremental_object_entry::Incremental_object_entry): Don't check
6976 for shared library.
6977 (Incremental_object_entry::do_type): Likewise.
6978 (class Incremental_dynobj_entry): New class.
6979 (Incremental_input_entry_reader::as_needed): New function.
6980 (Incremental_input_entry_reader::get_soname): New function.
6981 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6982 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6983 size of shared library info entry.
58797674 6984 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
6985 incremental link when adding DT_NEEDED entries.
6986 * object.h (Object::Object): Initialize new data member.
6987 (Object::dynobj): New function.
6988 (Object::set_as_needed): New function.
6989 (Object::as_needed): New function.
6990 (Object::do_dynobj): New function.
6991 (Object::as_needed_): New data member.
6992
6fa2a40b
CC
69932011-05-24 Cary Coutant <ccoutant@google.com>
6994
6995 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
6996 info; adjust display of GOT entries.
6997 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
6998 vector of input objects; remove file_status_.
6999 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7000 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7001 got_plt reader; call target hooks to reserve GOT entries.
7002 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7003 of input file info header and GOT info entry.
7004 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7005 relocation info.
7006 (Got_plt_view_info::got_descriptor): Remove.
7007 (Got_plt_view_info::sym_index): New data member.
7008 (Got_plt_view_info::input_index): New data member.
7009 (Local_got_offset_visitor::visit): Write input file index.
7010 (Global_got_offset_visitor::visit): Write 0 for input file index.
7011 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7012 with sym_index and input_index.
7013 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7014 incremental info GOT entry; replace got_descriptor with input_index.
7015 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7016 map from input file index to object.
7017 (Sized_relobj_incr::do_layout): Replace direct data member reference
7018 with accessor function.
7019 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7020 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7021 Adjust size of input file info header.
7022 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7023 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7024 (Incremental_input_entry_reader::get_input_section): Adjust size of
7025 input file info header.
7026 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7027 of incremental info GOT entry.
7028 (Incremental_got_plt_reader::get_got_desc): Remove.
7029 (Incremental_got_plt_reader::get_got_symndx): New function.
7030 (Incremental_got_plt_reader::get_got_input_index): New function.
7031 (Sized_incremental_binary::Sized_incremental_binary): Remove
7032 file_status_; add input_objects_.
7033 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7034 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7035 (Sized_incremental_binary::file_is_unchanged): Remove.
7036 (Sized_incremental_binary::set_input_object): New function.
7037 (Sized_incremental_binary::input_object): New function.
7038 (Sized_incremental_binary::file_status_): Remove.
7039 (Sized_incremental_binary::input_objects_): New data member.
7040 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7041 references.
7042 (Sized_relobj_incr::invalid_address): Move to base class.
7043 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7044 class.
7045 (Sized_relobj_incr::do_output_section_offset): Likewise.
7046 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7047 (Sized_relobj_incr::section_offsets_): Likewise.
7048 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7049 function.
7050 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7051 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7052 with accessor function.
7053 (Sized_relobj_file::do_layout): Likewise.
7054 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7055 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7056 (Sized_relobj_file::compute_final_local_value): Replace refs to
7057 section_offsets_ with accessor function.
7058 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7059 * object.h (Relobj::Relobj): Initialize new data members.
7060 (Relobj::add_dyn_reloc): New function.
7061 (Relobj::first_dyn_reloc): New function.
7062 (Relobj::dyn_reloc_count): New function.
7063 (Relobj::first_dyn_reloc_): New data member.
7064 (Relobj::dyn_reloc_count_): New data member.
7065 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7066 references.
7067 (Sized_relobj::Address): New typedef.
7068 (Sized_relobj::invalid_address): Move here from child class.
7069 (Sized_relobj::Sized_relobj): Initialize new data members.
7070 (Sized_relobj::sized_relobj): New function.
7071 (Sized_relobj::is_output_section_offset_invalid): Move here from
7072 child class.
7073 (Sized_relobj::get_output_section_offset): Likewise.
7074 (Sized_relobj::local_has_got_offset): Likewise.
7075 (Sized_relobj::local_got_offset): Likewise.
7076 (Sized_relobj::set_local_got_offset): Likewise.
7077 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7078 (Sized_relobj::clear_got_offsets): New function.
7079 (Sized_relobj::section_offsets): Move here from child class.
7080 (Sized_relobj::do_output_section_offset): Likewise.
7081 (Sized_relobj::do_set_section_offset): Likewise.
7082 (Sized_relobj::Local_got_offsets): Likewise.
7083 (Sized_relobj::local_got_offsets_): Likewise.
7084 (Sized_relobj::section_offsets_): Likewise.
7085 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7086 references.
7087 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7088 class.
7089 (Sized_relobj_file::sized_relobj): New function
7090 (Sized_relobj_file::local_has_got_offset): Move to base class.
7091 (Sized_relobj_file::local_got_offset): Likewise.
7092 (Sized_relobj_file::set_local_got_offset): Likewise.
7093 (Sized_relobj_file::get_output_section_offset): Likewise.
7094 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7095 (Sized_relobj_file::do_output_section_offset): Likewise.
7096 (Sized_relobj_file::do_set_section_offset): Likewise.
7097 (Sized_relobj_file::Local_got_offsets): Likewise.
7098 (Sized_relobj_file::local_got_offsets_): Likewise.
7099 (Sized_relobj_file::section_offsets_): Likewise.
7100 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7101 (all constructors).
7102 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7103 (Output_reloc::get_symbol_index): Likewise.
7104 (Output_reloc::local_section_offset): Likewise.
7105 (Output_reloc::get_address): Likewise.
7106 (Output_reloc::symbol_value): Likewise.
7107 (Output_data_got::reserve_slot): Move to class definition.
7108 (Output_data_got::reserve_local): New function.
7109 (Output_data_got::reserve_slot_for_global): Remove.
7110 (Output_data_got::reserve_global): New function.
7111 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7112 (all constructors, two instantiations).
7113 (Output_reloc::get_relobj): New function (two instantiations).
7114 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7115 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7116 (Output_data_reloc::add_global): Adjust type of relobj.
7117 (Output_data_reloc::add_global_relative): Likewise.
7118 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7119 (Output_data_reloc::add_local): Likewise.
7120 (Output_data_reloc::add_local_relative): Likewise.
7121 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7122 (Output_data_reloc::add_local_section): Likewise.
7123 (Output_data_reloc::add_output_section): Likewise.
7124 (Output_data_reloc::add_absolute): Likewise.
7125 (Output_data_reloc::add_target_specific): Likewise.
7126 (Output_data_got::reserve_slot): Move definition here.
7127 (Output_data_got::reserve_local): New function.
7128 (Output_data_got::reserve_global): New function.
7129 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7130 section_offsets_ with accessor function.
7131 (Sized_relobj_file::write_sections): Likewise.
7132 (Sized_relobj_file::do_relocate_sections): Likewise.
7133 * target.h (Sized_target::reserve_local_got_entry): New function.
7134 (Sized_target::reserve_global_got_entry): New function.
7135 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7136 (Target_x86_64::reserve_global_got_entry): New function.
7137 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7138
4829d394
CC
71392011-05-23 Cary Coutant <ccoutant@google.com>
7140
7141 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7142 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7143 bit when checking got_type.
7144 * incremental.cc (Sized_incremental_binary::setup_readers):
7145 Store symbol table and string table locations; initialize bit vector
7146 of file status flags.
7147 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7148 unchanged files.
7149 (Sized_incremental_binary::do_process_got_plt): New function.
7150 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7151 (Output_section_incremental_inputs::set_final_data_size): Record
7152 file index for each input file.
7153 (Output_section_incremental_inputs::write_got_plt): Store file index
7154 instead of input entry offset for each GOT entry.
7155 * incremental.h
7156 (Incremental_input_entry::Incremental_input_entry): Initialize new
7157 data member.
7158 (Incremental_input_entry::set_offset): Store file index.
7159 (Incremental_input_entry::get_file_index): New function.
7160 (Incremental_input_entry::file_index_): New data member.
7161 (Incremental_binary::process_got_plt): New function.
7162 (Incremental_binary::do_process_got_plt): New function.
7163 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7164 data members.
7165 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7166 (Sized_incremental_binary::set_file_is_unchanged): New function.
7167 (Sized_incremental_binary::file_is_unchanged): New function.
7168 (Sized_incremental_binary::do_process_got_plt): New function.
7169 (Sized_incremental_binary::file_status_): New data member.
7170 (Sized_incremental_binary::main_symtab_loc_): New data member.
7171 (Sized_incremental_binary::main_strtab_loc_): New data member.
7172 * output.cc (Output_data_got::Got_entry::write): Add case
7173 RESERVED_CODE.
7174 (Output_data_got::add_global): Call add_got_entry.
7175 (Output_data_got::add_global_plt): Likewise.
7176 (Output_data_got::add_global_with_rel): Likewise.
7177 (Output_data_got::add_global_with_rela): Likewise.
7178 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7179 (Output_data_got::add_global_pair_with_rela): Likewise.
7180 (Output_data_got::add_local): Call add_got_entry.
7181 (Output_data_got::add_local_plt): Likewise.
7182 (Output_data_got::add_local_with_rel): Likewise.
7183 (Output_data_got::add_local_with_rela): Likewise.
7184 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7185 (Output_data_got::add_local_pair_with_rela): Likewise.
7186 (Output_data_got::reserve_slot): New function.
7187 (Output_data_got::reserve_slot_for_global): New function.
7188 (Output_data_got::add_got_entry): New function.
7189 (Output_data_got::add_got_entry_pair): New function.
7190 (Output_section::add_output_section_data): Edit FIXME.
7191 * output.h
7192 (Output_section_data_build::Output_section_data_build): New
7193 constructor with size parameter.
7194 (Output_data_space::Output_data_space): Likewise.
7195 (Output_data_got::Output_data_got): Initialize new data member; new
7196 constructor with size parameter.
7197 (Output_data_got::add_constant): Call add_got_entry.
7198 (Output_data_got::reserve_slot): New function.
7199 (Output_data_got::reserve_slot_for_global): New function.
7200 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7201 (Output_data_got::add_got_entry): New function.
7202 (Output_data_got::add_got_entry_pair): New function.
7203 (Output_data_got::free_list_): New data member.
7204 * target.h (Sized_target::init_got_plt_for_update): New function.
7205 (Sized_target::register_global_plt_entry): New function.
7206 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7207 Initialize new data member; call init; add constructor with PLT count.
7208 (Output_data_plt_x86_64::init): New function.
7209 (Output_data_plt_x86_64::add_relocation): New function.
7210 (Output_data_plt_x86_64::reserve_slot): New function.
7211 (Output_data_plt_x86_64::free_list_): New data member.
7212 (Target_x86_64::init_got_plt_for_update): New function.
7213 (Target_x86_64::register_global_plt_entry): New function.
7214 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7215 incremental updates.
7216 (Output_data_plt_x86_64::add_relocation): New function.
7217 * testsuite/object_unittest.cc (Object_test): Set default options.
7218
ec69d6da
ILT
72192011-05-16 Ian Lance Taylor <iant@google.com>
7220
7221 * options.h (class General_options): Make -i a synonym for -r.
7222
732e31de
ILT
72232011-05-16 Ian Lance Taylor <iant@google.com>
7224
7225 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7226
403676b5
CC
72272011-05-10 Cary Coutant <ccoutant@google.com>
7228
7229 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7230 strip_all (-s).
7231
5b7b7d6e
ILT
72322011-05-06 Ian Lance Taylor <iant@google.com>
7233
7234 * layout.cc (Layout::layout): If the output section flags change,
7235 update the ordering.
7236
f0f9babf
CC
72372011-04-25 Cary Coutant <ccoutant@google.com>
7238
7239 * incremental-dump.cc (dump_incremental_inputs): Print local
7240 symbol info for each input file.
7241 * incremental.cc
7242 (Output_section_incremental_inputs::set_final_data_size): Add local
7243 symbol info to input file entries in incremental info.
7244 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7245 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7246 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7247 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7248 implementation.
7249 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7250 (Sized_incr_relobj::do_relocate): Write the local symbols.
7251 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7252 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7253 Adjust size of input file header.
7254 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7255 (Incremental_inputs_reader::get_local_symbol_count): New function.
7256 (Incremental_inputs_reader::get_input_section): Adjust size of input
7257 file header.
7258 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7259 (Sized_incr_relobj::This): New typedef.
7260 (Sized_incr_relobj::sym_size): New const data member.
7261 (Sized_incr_relobj::Local_symbol): New struct.
7262 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7263 (Sized_incr_relobj::do_local_symbol_offset): New function.
7264 (Sized_incr_relobj::local_symbol_count_): New data member.
7265 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7266 (Sized_incr_relobj::local_symbol_index_): New data member.
7267 (Sized_incr_relobj::local_symbol_offset_): New data member.
7268 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7269 (Sized_incr_relobj::local_symbols_): New data member.
7270 * object.h (Relobj::output_local_symbol_count): New function.
7271 (Relobj::local_symbol_offset): New function.
7272 (Relobj::do_output_local_symbol_count): New function.
7273 (Relobj::do_local_symbol_offset): New function.
7274 (Sized_relobj::do_output_local_symbol_count): New function.
7275 (Sized_relobj::do_local_symbol_offset): New function.
7276
d0a9ace3
ILT
72772011-04-22 Vladimir Simonov <sv@sw.ru>
7278
7279 * descriptors.cc (set_close_on_exec): New function.
7280 (Descriptors::open): Use set_close_on_exec.
7281 * output.cc (S_ISLNK): Define if not defined.
7282
94a3fc8b
CC
72832011-04-22 Cary Coutant <ccoutant@google.com>
7284
7285 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7286 global symbol map.
7287 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7288 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7289 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7290 relocations.
7291 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7292 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7293 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7294 * incremental.h
7295 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7296 function.
7297 (Incremental_binary::apply_incremental_relocs): New function.
7298 (Incremental_binary::do_apply_incremental_relocs): New function.
7299 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7300 data member.
7301 (Sized_incremental_binary::add_global_symbol): New function.
7302 (Sized_incremental_binary::global_symbol): New function.
7303 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7304 (Sized_incremental_binary::symbol_map_): New data member.
7305 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7306 * target.h (Sized_target::apply_relocation): New function.
7307 * target-reloc.h (apply_relocation): New function.
7308 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7309
c87e4302
DK
73102011-04-22 Doug Kwan <dougkwan@google.com>
7311
7312 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7313 flag of a SHT_ARM_EXIDX section.
2e702c99 7314 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7315 * testsuite/Makefile.in: Regenerate.
7316 * testsuite/arm_exidx_test.s: New file.
7317 * testsuite/arm_exidx_test.sh: Same.
7318
e7782cf6
CC
73192011-04-20 Cary Coutant <ccoutant@google.com>
7320
7321 PR gold/12689
7322 * archive.h (Incremental_archive_entry::Archive_member):
7323 Initialize arg_serial_ (second constructor).
7324
308ecdc7
ILT
73252011-04-17 Ian Lance Taylor <iant@google.com>
7326
7327 * object.cc (Relocate_info::location): Simplify location string.
7328 * errors.cc (Errors::error_at_location): Don't print program
7329 name.
7330 (Errors::warning_at_location): Likewise.
7331 (Errors::undefined_symbol): Likewise.
7332 * testsuite/debug_msg.sh: Update accordingly.
7333
bec5b579
CC
73342011-04-14 Cary Coutant <ccoutant@google.com>
7335
7336 * gold/layout.cc (Layout::symtab_section_offset): New function.
7337 * gold/layout.h (Layout::symtab_section_offset): New function.
7338 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7339
88597d34
ILT
73402011-04-12 Ian Lance Taylor <iant@google.com>
7341
7342 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7343 with MREMAP_MAYMOVE.
7344 * output.h (class Output_file): Add map_is_allocated_ field.
7345 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7346 not available, provide stubs. If mremap is not available, #define
7347 it to gold_mremap.
7348 (MREMAP_MAYMOVE): Define if not defined.
7349 (Output_file::Output_file): Initialize map_is_allocated_.
7350 (Output_file::resize): Check map_is_allocated_.
7351 (Output_file::map_anonymous): If mmap fails, use malloc.
7352 (Output_file::unmap): Don't do anything for an anonymous map.
7353 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7354 is not available, provide stubs.
7355 (File_read::View::~View): Use free rather than delete[].
7356 (File_read::make_view): Use malloc rather than new[]. If mmap
7357 fails, use malloc.
7358 (File_read::find_or_make_view): Use malloc rather than new[].
7359 * gold.h: Remove HAVE_REMAP code.
7360 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7361 exists. Rename mremap to gold_mremap. If mmap is not available
7362 don't do anything.
7363 * configure, config.in: Rebuild.
7364
11e361bc
ILT
73652011-04-11 Ian Lance Taylor <iant@google.com>
7366
7367 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7368 initialize local variable v.
7369
cdc29364
CC
73702011-04-11 Cary Coutant <ccoutant@google.com>
7371
7372 * archive.cc (Archive::include_member): Adjust call to
7373 report_object.
7374 (Add_archive_symbols::run): Track argument serial numbers.
7375 (Lib_group::include_member): Likewise.
7376 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7377 * archive.h (Incremental_archive_entry::Archive_member):
7378 Initialize arg_serial_.
7379 (Archive_member::arg_serial_): New data member.
7380 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7381 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7382 incremental link.
7383 (Sized_dynobj::do_for_all_local_got_entries): New function.
7384 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7385 function.
7386 * fileread.cc (get_mtime): New function.
7387 * fileread.h (get_mtime): New function.
7388 * gold.cc (queue_initial_tasks): Check for incremental update.
7389 (process_incremental_input): New function.
7390 (queue_middle_tasks): Don't force valid target for incremental
7391 update.
7392 * incremental-dump.cc (find_input_containing_global): Adjust
7393 size of symbol info entry.
7394 (dump_incremental_inputs): Dump argument serial number and
7395 in_system_directory flag; bias shndx by 1; print symbol names
7396 when dumping per-file symbol lists; use new symbol info readers.
7397 * incremental.cc
7398 (Output_section_incremental_inputs:update_data_size): New function.
7399 (Sized_incremental_binary::setup_readers): Setup input readers
7400 for each input file; build maps for files added from libraries
7401 and scripts.
7402 (Sized_incremental_binary::check_input_args): New function.
7403 (Sized_incremental_binary::do_check_inputs): Build map of argument
7404 serial numbers to input arguments.
7405 (Sized_incremental_binary::do_file_has_changed): Rename
7406 do_file_is_unchanged to this; compare file modification times.
7407 (Sized_incremental_binary::do_init_layout): New function.
7408 (Sized_incremental_binary::do_reserve_layout): New function.
7409 (Sized_incremental_binary::do_get_input_reader): Remove.
7410 (Sized_incremental_binary::get_symtab_view): New function.
7411 (Incremental_checker::can_incrementally_link_output_file): Remove.
7412 (Incremental_inputs::report_command_line): Exclude --debug options.
7413 (Incremental_inputs::report_archive_begin): Add parameter; track
7414 argument serial numbers; don't put input file entry for archive
7415 before archive members.
7416 (Incremental_inputs::report_archive_end): Put input file entry
7417 for archive after archive members.
7418 (Incremental_inputs::report_object): Add parameter; track argument
7419 serial numbers and in_system_directory flag.
7420 (Incremental_inputs::report_script): Add parameter; track argument
7421 serial numbers.
7422 (Output_section_incremental_inputs::set_final_data_size): Adjust
7423 size of symbol info entry; check for forwarding symbols.
7424 (Output_section_incremental_inputs::write_input_files): Write
7425 in_system_directory flag and argument serial number.
7426 (Output_section_incremental_inputs::write_info_blocks): Map section
7427 indices between incremental info and original input file; store
7428 input section index for each symbol.
7429 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7430 change operator() to visit().
7431 (class Global_got_offset_visitor): Likewise.
7432 (class Global_symbol_visitor_got_plt):
7433 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7434 classes.
7435 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7436 (Sized_incr_relobj::do_read_symbols): New function.
7437 (Sized_incr_relobj::do_layout): New function.
7438 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7439 (Sized_incr_relobj::do_add_symbols): New function.
7440 (Sized_incr_relobj::do_should_include_member): New function.
7441 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7442 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7443 (Sized_incr_relobj::do_section_size): New function.
7444 (Sized_incr_relobj::do_section_name): New function.
7445 (Sized_incr_relobj::do_section_contents): New function.
7446 (Sized_incr_relobj::do_section_flags): New function.
7447 (Sized_incr_relobj::do_section_entsize): New function.
7448 (Sized_incr_relobj::do_section_address): New function.
7449 (Sized_incr_relobj::do_section_type): New function.
7450 (Sized_incr_relobj::do_section_link): New function.
7451 (Sized_incr_relobj::do_section_info): New function.
7452 (Sized_incr_relobj::do_section_addralign): New function.
7453 (Sized_incr_relobj::do_initialize_xindex): New function.
7454 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7455 (Sized_incr_relobj::do_read_relocs): New function.
7456 (Sized_incr_relobj::do_gc_process_relocs): New function.
7457 (Sized_incr_relobj::do_scan_relocs): New function.
7458 (Sized_incr_relobj::do_count_local_symbols): New function.
7459 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7460 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7461 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7462 (Sized_incr_relobj::do_relocate): New function.
7463 (Sized_incr_relobj::do_set_section_offset): New function.
7464 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7465 (Sized_incr_dynobj::do_read_symbols): New function.
7466 (Sized_incr_dynobj::do_layout): New function.
7467 (Sized_incr_dynobj::do_add_symbols): New function.
7468 (Sized_incr_dynobj::do_should_include_member): New function.
7469 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7470 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7471 (Sized_incr_dynobj::do_section_size): New function.
7472 (Sized_incr_dynobj::do_section_name): New function.
7473 (Sized_incr_dynobj::do_section_contents): New function.
7474 (Sized_incr_dynobj::do_section_flags): New function.
7475 (Sized_incr_dynobj::do_section_entsize): New function.
7476 (Sized_incr_dynobj::do_section_address): New function.
7477 (Sized_incr_dynobj::do_section_type): New function.
7478 (Sized_incr_dynobj::do_section_link): New function.
7479 (Sized_incr_dynobj::do_section_info): New function.
7480 (Sized_incr_dynobj::do_section_addralign): New function.
7481 (Sized_incr_dynobj::do_initialize_xindex): New function.
7482 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7483 (make_sized_incremental_object): New function.
7484 (Incremental_library::copy_unused_symbols): New function.
7485 (Incremental_library::do_for_all_unused_symbols): New function.
7486 * incremental.h (enum Incremental_input_flags): New type.
7487 (class Incremental_checker): Remove.
7488 (Incremental_input_entry::Incremental_input_entry): Add argument
7489 serial number.
7490 (Incremental_input_entry::arg_serial): New function.
7491 (Incremental_input_entry::set_is_in_system_directory): New function.
7492 (Incremental_input_entry::is_in_system_directory): New function.
7493 (Incremental_input_entry::arg_serial_): New data member.
7494 (Incremental_input_entry::is_in_system_directory_): New data member.
7495 (class Script_info): Move here from script.h.
7496 (Script_info::Script_info): Add filename parameter.
7497 (Script_info::filename): New function.
7498 (Script_info::filename_): New data member.
7499 (Incremental_script_entry::Incremental_script_entry): Add argument
7500 serial number.
7501 (Incremental_object_entry::Incremental_object_entry): Likewise.
7502 (Incremental_object_entry::add_input_section): Build list of input
7503 sections with map to original shndx.
7504 (Incremental_object_entry::get_input_section_index): New function.
7505 (Incremental_object_entry::shndx_): New data member.
7506 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7507 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7508 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7509 serial number.
7510 (Incremental_inputs::report_archive_begin): Likewise.
7511 (Incremental_inputs::report_object): Likewise.
7512 (Incremental_inputs::report_script): Likewise.
7513 (class Incremental_global_symbol_reader): New class.
7514 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7515 and store flags and input file type.
7516 (Incremental_input_entry_reader::arg_serial): New function.
7517 (Incremental_input_entry_reader::type): Extract type from flags.
7518 (Incremental_input_entry_reader::is_in_system_directory): New function.
7519 (Incremental_input_entry_reader::get_input_section_count): Call
7520 accessor function for type.
7521 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7522 function for type; adjust size of global symbol entry.
7523 (Incremental_input_entry_reader::get_global_symbol_count): Call
7524 accessor function for type.
7525 (Incremental_input_entry_reader::get_object_count): Likewise.
7526 (Incremental_input_entry_reader::get_object_offset): Likewise.
7527 (Incremental_input_entry_reader::get_member_count): Likewise.
7528 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7529 (Incremental_input_entry_reader::get_member_offset): Likewise.
7530 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7531 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7532 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7533 (Incremental_input_entry_reader::get_global_symbol_reader): New
7534 function.
7535 (Incremental_input_entry_reader::get_output_symbol_index): New
7536 function.
7537 (Incremental_input_entry_reader::type_): Remove.
7538 (Incremental_input_entry_reader::flags_): New data member.
7539 (Incremental_inputs_reader::input_file_offset): New function.
7540 (Incremental_inputs_reader::input_file_index): New function.
7541 (Incremental_inputs_reader::input_file): Call input_file_offset.
7542 (Incremental_inputs_reader::input_file_at_offset): New function.
7543 (Incremental_relocs_reader::get_r_type): Reformat.
7544 (Incremental_relocs_reader::get_r_shndx): Reformat.
7545 (Incremental_relocs_reader::get_r_offset): Reformat.
7546 (Incremental_relocs_reader::data): New function.
7547 (Incremental_binary::Incremental_binary): Initialize new data members.
7548 (Incremental_binary::check_inputs): Add cmdline parameter.
7549 (Incremental_binary::file_is_unchanged): Remove.
7550 (Input_reader::arg_serial): New function.
7551 (Input_reader::get_unused_symbol_count): New function.
7552 (Input_reader::get_unused_symbol): New function.
7553 (Input_reader::do_arg_serial): New function.
7554 (Input_reader::do_get_unused_symbol_count): New function.
7555 (Input_reader::do_get_unused_symbol): New function.
7556 (Incremental_binary::input_file_count): New function.
7557 (Incremental_binary::get_input_reader): Change signature to use
7558 index instead of filename.
7559 (Incremental_binary::file_has_changed): New function.
7560 (Incremental_binary::get_input_argument): New function.
7561 (Incremental_binary::get_library): New function.
7562 (Incremental_binary::get_script_info): New function.
7563 (Incremental_binary::init_layout): New function.
7564 (Incremental_binary::reserve_layout): New function.
7565 (Incremental_binary::output_file): New function.
7566 (Incremental_binary::do_check_inputs): New function.
7567 (Incremental_binary::do_file_is_unchanged): Remove.
7568 (Incremental_binary::do_file_has_changed): New function.
7569 (Incremental_binary::do_init_layout): New function.
7570 (Incremental_binary::do_reserve_layout): New function.
7571 (Incremental_binary::do_input_file_count): New function.
7572 (Incremental_binary::do_get_input_reader): Change signature.
7573 (Incremental_binary::input_args_map_): New data member.
7574 (Incremental_binary::library_map_): New data member.
7575 (Incremental_binary::script_map_): New data member.
7576 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7577 new data members.
7578 (Sized_incremental_binary::output_section): New function.
7579 (Sized_incremental_binary::inputs_reader): Add const.
7580 (Sized_incremental_binary::symtab_reader): Add const.
7581 (Sized_incremental_binary::relocs_reader): Add const.
7582 (Sized_incremental_binary::got_plt_reader): Add const.
7583 (Sized_incremental_binary::get_symtab_view): New function.
7584 (Sized_incremental_binary::Inputs_reader): New typedef.
7585 (Sized_incremental_binary::Input_entry_reader): New typedef.
7586 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7587 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7588 (Sized_incremental_binary::do_file_has_changed): New function.
7589 (Sized_incremental_binary::do_init_layout): New function.
7590 (Sized_incremental_binary::do_reserve_layout): New function.
7591 (Sized_input_reader::Inputs_reader): Remove.
7592 (Sized_input_reader::Input_entry_reader): Remove.
7593 (Sized_input_reader::do_arg_serial): New function.
7594 (Sized_input_reader::do_get_unused_symbol_count): New function.
7595 (Sized_input_reader::do_get_unused_symbol): New function.
7596 (Sized_incremental_binary::do_input_file_count): New function.
7597 (Sized_incremental_binary::do_get_input_reader): Change signature;
7598 use index instead of filename.
7599 (Sized_incremental_binary::section_map_): New data member.
7600 (Sized_incremental_binary::input_entry_readers_): New data member.
7601 (class Sized_incr_relobj): New class.
7602 (class Sized_incr_dynobj): New class.
7603 (make_sized_incremental_object): New function.
7604 (class Incremental_library): New class.
7605 * layout.cc (Free_list::num_lists): New static data member.
7606 (Free_list::num_nodes): New static data member.
7607 (Free_list::num_removes): New static data member.
7608 (Free_list::num_remove_visits): New static data member.
7609 (Free_list::num_allocates): New static data member.
7610 (Free_list::num_allocate_visits): New static data member.
7611 (Free_list::init): New function.
7612 (Free_list::remove): New function.
7613 (Free_list::allocate): New function.
7614 (Free_list::dump): New function.
7615 (Free_list::print_stats): New function.
7616 (Layout_task_runner::run): Resize output file for incremental updates.
7617 (Layout::Layout): Initialize new data members.
7618 (Layout::set_incremental_base): New function.
7619 (Layout::init_fixed_output_section): New function.
7620 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7621 incremental updates.
7622 (Layout::create_gold_note): Do not create gold note section for
7623 incremental updates.
7624 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7625 for incremental updates.
7626 (Layout::set_section_offsets): For incremental updates, allocate space
7627 from free list.
7628 (Layout::create_symtab_sections): Layout with offsets relative to
7629 start of section; for incremental updates, allocate space from free
7630 list.
7631 (Layout::create_shdrs): For incremental updates, allocate space from
7632 free list.
7633 (Layout::finish_dynamic_section): For incremental updates, do not
7634 check --as-needed (fixed in subsequent patch).
7635 * layout.h (class Free_list): New class.
7636 (Layout::set_incremental_base): New function.
7637 (Layout::incremental_base): New function.
7638 (Layout::init_fixed_output_section): New function.
7639 (Layout::allocate): New function.
7640 (Layout::incremental_base_): New data member.
7641 (Layout::free_list_): New data member.
7642 * main.cc (main): Print Free_list statistics.
7643 * object.cc (Relobj::finalize_incremental_relocs): Add
7644 clear_counts parameter; clear counts only when clear_counts is set.
7645 (Sized_relobj::Sized_relobj): Initialize new base class.
7646 (Sized_relobj::do_layout): Don't report special sections.
7647 (Sized_relobj::do_for_all_local_got_entries): New function.
7648 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7649 symtab_off to all symbol table offsets.
7650 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7651 * object.h (class Got_offset_list): Move to top of file.
7652 (Object::Object): Allow case where input_file == NULL.
7653 (Object::~Object): Likewise.
7654 (Object::input_file): Assert that input_file != NULL.
7655 (Object::lock): Allow case where input_file == NULL.
7656 (Object::unlock): Likewise.
7657 (Object::is_locked): Likewise.
7658 (Object::token): Likewise.
7659 (Object::release): Likewise.
7660 (Object::is_incremental): New function.
7661 (Object::get_mtime): New function.
7662 (Object::for_all_local_got_entries): New function.
7663 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7664 (Object::set_is_in_system_directory): New function.
7665 (Object::is_in_system_directory): New function.
7666 (Object::do_is_incremental): New function.
7667 (Object::do_get_mtime): New function.
7668 (Object::do_for_all_local_got_entries): New function.
7669 (Object::is_in_system_directory_): New data member.
7670 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7671 (class Sized_relobj_base): New class.
7672 (class Sized_relobj): Derive from Sized_relobj_base.
7673 (class Sized_relobj::Symbols): Redeclare from base class.
7674 (class Sized_relobj::local_got_offset_list): Remove.
7675 (class Sized_relobj::Output_sections): Redeclare from base class.
7676 (class Sized_relobj::do_for_all_local_got_entries): New function.
7677 (class Sized_relobj::write_local_symbols): Add offset parameter.
7678 (class Sized_relobj::local_symbol_offset_): Update comment.
7679 (class Sized_relobj::local_dynsym_offset_): Update comment.
7680 * options.cc (Input_arguments::add_file): Remove const.
7681 * options.h (Input_file_argument::Input_file_argument):
7682 Initialize arg_serial_ (all constructors).
7683 (Input_file_argument::set_arg_serial): New function.
7684 (Input_file_argument::arg_serial): New function.
7685 (Input_file_argument::arg_serial_): New data member.
7686 (Input_arguments::Input_arguments): Initialize file_count_.
7687 (Input_arguments::add_file): Remove const.
7688 (Input_arguments::number_of_input_files): New function.
7689 (Input_arguments::file_count_): New data member.
7690 (Command_line::number_of_input_files): Call
7691 Input_arguments::number_of_input_files.
7692 * output.cc (Output_segment_headers::Output_segment_headers):
7693 Set current size.
7694 (Output_section::Input_section::current_data_size): New function.
7695 (Output_section::Output_section): Initialize new data members.
7696 (Output_section::add_input_section): Don't do merge sections for
7697 an incremental link; allocate space from free list for an
7698 incremental update.
7699 (Output_section::add_output_section_data): Allocate space from
7700 free list for an incremental update.
7701 (Output_section::update_data_size): New function.
7702 (Output_section::set_fixed_layout): New function.
7703 (Output_section::reserve): New function.
7704 (Output_segment::set_section_addresses): Remove const.
7705 (Output_segment::set_section_list_addresses): Remove const; allocate
7706 space from free list for an incremental update.
7707 (Output_segment::set_offset): Adjust size of RELRO segment for an
7708 incremental update.
7709 * output.h (Output_data::current_data_size): Move here from
7710 child classes.
7711 (Output_data::pre_finalize_data_size): New function.
7712 (Output_data::update_data_size): New function.
7713 (Output_section_headers::update_data_size): new function.
7714 (Output_section_data_build::current_data_size): Move to Output_data.
7715 (Output_data_strtab::update_data_size): New function.
7716 (Output_section::current_data_size): Move to Output_data.
7717 (Output_section::set_fixed_layout): New function.
7718 (Output_section::has_fixed_layout): New function.
7719 (Output_section::reserve): New function.
7720 (Output_section::update_data_size): New function.
7721 (Output_section::has_fixed_layout_): New data member.
7722 (Output_section::free_list_): New data member.
7723 (Output_segment::set_section_addresses): Remove const.
7724 (Output_segment::set_section_list_addresses): Remove const.
7725 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7726 New function.
7727 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7728 New function.
7729 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7730 parameter when calling Add_symbols constructor; store argument
7731 serial number for members of a lib group.
7732 (Add_symbols::locks): Allow case where token == NULL.
7733 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7734 (Read_member::~Read_member): New function.
7735 (Read_member::is_runnable): New function.
7736 (Read_member::locks): New function.
7737 (Read_member::run): New function.
7738 (Check_script::~Check_script): New function.
7739 (Check_script::is_runnable): New function.
7740 (Check_script::locks): New function.
7741 (Check_script::run): New function.
7742 (Check_library::~Check_library): New function.
7743 (Check_library::is_runnable): New function.
7744 (Check_library::locks): New function.
7745 (Check_library::run): New function.
7746 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7747 (Add_symbols::library_): New data member.
7748 (class Read_member): New class.
7749 (class Check_script): New class.
7750 (class Check_library): New class.
7751 * reloc.cc (Read_relocs::is_runnable): Allow case where
7752 token == NULL.
7753 (Read_relocs::locks): Likewise.
7754 (Scan_relocs::locks): Likewise.
7755 (Relocate_task::locks): Likewise.
7756 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7757 to clear counters.
7758 (Sized_relobj::incremental_relocs_scan): Fix comment.
7759 (Sized_relobj::do_relocate): Pass output file offset to
7760 write_local_symbols.
7761 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7762 from class declaration.
7763 * script.cc (read_input_script): Allocate Script_info; pass
7764 argument serial number to report_script.
7765 * script.h (class Script_info): Move to incremental.h.
7766 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7767 * symtab.h (Symbol_table::add_from_incrobj): New function.
7768 (Symbol_table::set_file_offset): New function.
7769
b961d0d7
CC
77702011-04-05 Cary Coutant <ccoutant@google.com>
7771
7772 * incremental-dump.cc (dump_incremental_inputs): Change signature
7773 to take a Sized_incremental_binary; change caller. Use readers
7774 in Sized_incremental_binary.
7775 * incremental.cc
7776 (Sized_incremental_binary::find_incremental_inputs_sections):
7777 Rename do_find_incremental_inputs_sections to this.
7778 (Sized_incremental_binary::setup_readers): New function.
7779 (Sized_incremental_binary::do_check_inputs): Check
7780 has_incremental_info_ flag; move setup code to setup_readers;
7781 use input readers.
7782 (Sized_incremental_binary::do_file_is_unchanged): New function.
7783 (Sized_incremental_binary::do_get_input_reader): New function.
7784 * incremental.h (class Incremental_binary): Move to end of file.
7785 (Incremental_binary::file_is_unchanged): New function.
7786 (Incremental_binary::do_file_is_unchanged): New function.
7787 (Incremental_binary::Input_reader): New class.
7788 (Incremental_binary::get_input_reader): New function.
7789 (class Sized_incremental_binary): Move to end of file.
7790 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7791 input section reader classes.
7792 (Sized_incremental_binary::has_incremental_info): New function.
7793 (Sized_incremental_binary::inputs_reader): New function.
7794 (Sized_incremental_binary::symtab_reader): New function.
7795 (Sized_incremental_binary::relocs_reader): New function.
7796 (Sized_incremental_binary::got_plt_reader): New function.
7797 (Sized_incremental_binary::do_file_is_unchanged): New function.
7798 (Sized_incremental_binary::Sized_input_reader): New class.
7799 (Sized_incremental_binary::get_input_reader): New function.
7800 (Sized_incremental_binary::find_incremental_inputs_sections):
7801 Rename do_find_incremental_inputs_sections to this.
7802 (Sized_incremental_binary::setup_readers): New function.
7803 (Sized_incremental_binary::has_incremental_info_): New data member.
7804 (Sized_incremental_binary::inputs_reader_): New data member.
7805 (Sized_incremental_binary::symtab_reader_): New data member.
7806 (Sized_incremental_binary::relocs_reader_): New data member.
7807 (Sized_incremental_binary::got_plt_reader_): New data member.
7808 (Sized_incremental_binary::current_input_file_): New data member.
7809
a869183f
PP
78102011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7811
7812 PR gold/12640
7813 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7814 violation.
7815
78162011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7817
7818 * archive.cc (Archive::include_member): Adjust call to report_object.
7819 (Add_archive_symbols::run): Add script_info to call to
7820 report_archive_begin.
7821 (Lib_group::include_member): Adjust call to report_object.
7822 (Add_lib_group_symbols::run): Adjust call to report_object.
7823 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7824 blocks. Add object count for script input files.
7825 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7826 script_info parameter; change all callers.
7827 (Incremental_inputs::report_object): Add script_info parameter;
7828 change all callers.
7829 (Incremental_inputs::report_script): Store backpointer to
7830 incremental info entry.
7831 (Output_section_incremental_inputs::set_final_data_size): Record
7832 additional information for scripts.
7833 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7834 * incremental.h (Incremental_script_entry::add_object): New function.
7835 (Incremental_script_entry::get_object_count): New function.
7836 (Incremental_script_entry::get_object): New function.
7837 (Incremental_script_entry::objects_): New data member; adjust
7838 constructor.
7839 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7840 (Incremental_inputs::report_object): Add script_info parameter.
7841 (Incremental_inputs_reader::get_object_count): New function.
7842 (Incremental_inputs_reader::get_object_offset): New function.
7843 * options.cc (Input_arguments::add_file): Return reference to
7844 new input argument.
7845 * options.h (Input_argument::set_script_info): New function.
7846 (Input_argument::script_info): New function.
7847 (Input_argument::script_info_): New data member; adjust all
7848 constructors.
7849 (Input_file_group::add_file): Return reference to new input argument.
7850 (Input_file_lib::add_file): Likewise.
7851 (Input_arguments::add_file): Likewise.
7852 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7853 * script.cc (Parser_closure::Parser_closure): Add script_info
7854 parameter; adjust all callers.
7855 (Parser_closure::script_info): New function.
7856 (Parser_closure::script_info_): New data member.
7857 (read_input_script): Report scripts earlier to incremental info.
7858 (script_add_file): Set script_info in Input_argument.
7859 (script_add_library): Likewise.
7860 * script.h (Script_options::Script_info): Rewrite class.
7861
a869183f 78622011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7863
7864 * archive.cc (Library_base::should_include_member): Move
7865 method here from class Archive.
7866 (Archive::Archive): Initialize base class.
7867 (Archive::should_include_member): Move to base class.
7868 (Archive::do_for_all_unused_symbols): New function.
7869 (Add_archive_symbols::run): Remove redundant access to
7870 incremental_inputs.
7871 (Lib_group::Lib_group): Initialize base class.
7872 (Lib_group::do_filename): New function.
7873 (Lib_group::include_member): Pass pointer to Lib_group to
7874 report_object.
7875 (Lib_group::do_for_all_unused_symbols): New function.
7876 (Add_lib_group_symbols::run): Report archive information for
7877 incremental links.
7878 * archive.h (class Library_base): New base class.
7879 (class Archive): Derive from Library_base.
7880 (Archive::filename): Move to base class.
7881 (Archive::set_incremental_info): Likewise.
7882 (Archive::incremental_info): Likewise.
7883 (Archive::Should_include): Likewise.
7884 (Archive::should_include_member): Likewise.
7885 (Archive::Armap_entry): Remove.
7886 (Archive::Unused_symbol_iterator): Remove.
7887 (Archive::unused_symbols_begin): Remove.
7888 (Archive::unused_symbols_end): Remove.
7889 (Archive::do_filename): New function.
7890 (Archive::do_get_mtime): New function.
7891 (Archive::do_for_all_unused_symbols): New function.
7892 (Archive::task_): Move to base class.
7893 (Archive::incremental_info_): Likewise.
7894 (class Lib_group): Derive from Library_base.
7895 (Lib_group::do_filename): New function.
7896 (Lib_group::do_get_mtime): New function.
7897 (Lib_group::do_for_all_unused_symbols): New function.
7898 (Lib_group::task_): Move to base class.
7899 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7900 function.
7901 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7902 function.
7903 * incremental.cc (Incremental_inputs::report_archive_begin):
7904 Use Library_base; call library's get_mtime; add incremental inputs
7905 entry before members.
7906 (class Unused_symbol_visitor): New class.
7907 (Incremental_inputs::report_archive_end): Use Library_base; use
7908 visitor class to record unused symbols; don't add incremental inputs
7909 entry after members.
7910 (Incremental_inputs::report_object): Use Library_base.
7911 * incremental.h
7912 (Incremental_archive_entry::Incremental_archive_entry): Remove
7913 unused Archive parameter.
7914 (Incremental_inputs::report_archive_begin): Use Library_base.
7915 (Incremental_inputs::report_archive_end): Likewise.
7916 (Incremental_inputs::report_object): Likewise.
7917 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7918 function.
7919 * object.h (Object::for_all_global_symbols): New function.
7920 (Object::do_for_all_global_symbols): New function.
7921 (Sized_relobj::do_for_all_global_symbols): New function.
7922 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7923 function.
7924 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7925 function.
7926
61ab3e40
ILT
79272011-03-27 Ian Lance Taylor <iant@google.com>
7928
7929 * archive.cc (Archive::interpret_header): Return -1 if something
7930 goes wrong. Change callers accordingly.
7931
30e1f9e6
CC
79322011-03-25 Cary Coutant <ccoutant@google.com>
7933
7934 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7935 * testsuite/Makefile.in: Regenerate.
7936
9370ce59 79372011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7938
7939 * plugin.cc (get_view): New.
7940 (Plugin::load): Pass get_view to the plugin.
7941 (Plugin_manager::get_view): New.
7942
9312bb0a
ILT
79432011-03-21 Ian Lance Taylor <iant@google.com>
7944
7945 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7946 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7947
7e12ba9e
ST
79482011-03-21 Sriraman Tallam <tmsriram@google.com>
7949
7950 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7951 Change == to -eq.
7952 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7953 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7954 Change == to -eq.
7955 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7956 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7957
fd7a005d
ILT
79582011-03-14 Ian Lance Taylor <iant@google.com>
7959
7960 * script-sections.cc (Sort_output_sections::script_compare):
7961 Rename from is_before, change return type.
7962 (Sort_output_sections::operator()): Adjust accordingly.
7963
ed16fd1b
ILT
79642011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7965
7966 PR gold/12572
7967 * testsuite/odr_violation2.cc: Add comment to make all error line
7968 numbers double digits.
7969 * testsuite/debug_msg.sh: Adjust expected errors.
7970
71ff8986
ILT
79712011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7972
7973 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7974 but mark earlier ones as non-canonical
7975 (offset_to_iterator): Update search target and example
7976 (do_addr2line): Return extra lines in a vector*
7977 (format_file_lineno): Extract from do_addr2line
7978 (one_addr2line): Add vector* out-param
7979 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7980 when a lineno entry appeared last for its instruction
7981 (Dwarf_line_info): Add vector* out-param
7982 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7983 * symtab.cc (Odr_violation_compare): Include the lineno in the
7984 comparison again.
7985 (linenos_from_loc): New. Combine the canonical line for an
7986 address with its other lines.
7987 (True_if_intersect): New. Helper functor to make
7988 std::set_intersection a query.
7989 (detect_odr_violations): Compare sets of lines instead of just
7990 one line for each function. This became less deterministic, but
7991 has fewer false positives.
7992 * symtab.h: Declarations.
7993 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
7994 mix an optimized and non-optimized object in the same binary
7995 (odr_violation2.so): Same.
7996 * testsuite/Makefile.in: Regenerate from Makefile.am.
7997 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
7998 * testsuite/debug_msg.sh: Update line numbers and add
7999 assertions.
8000 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8001 non-optimized context.
8002 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8003 isn't inlined, and use OdrDerived in an optimized context.
8004 * testsuite/odr_header1.h: Defines OdrDerived, where
8005 optimization will change the
8006 first-instruction-in-the-destructor's file and line number.
8007 * testsuite/odr_header2.h: Defines OdrBase.
8008
a19fefdc
ILT
80092011-03-09 Ian Lance Taylor <iant@google.com>
8010
8011 * fileread.cc (File_read::clear_views): Don't delete the whole
8012 file view.
8013
ecb351e9
ILT
80142011-03-08 Ian Lance Taylor <iant@google.com>
8015
8016 PR gold/12525
8017 * fileread.cc: #include <climits>.
8018 (GOLD_IOV_MAX): Define.
8019 (File_read::read_multiple): Limit number of entries by iov_max.
8020 * fileread.h (class File_read): Always set max_readv_entries to
8021 128.
8022
b821d13c
ILT
80232011-03-07 Ian Lance Taylor <iant@google.com>
8024
8025 PR gold/12525
8026 * options.h (class General_options): Add -dy and -dn.
8027
89243142
CC
80282011-03-02 Cary Coutant <ccoutant@google.com>
8029
8030 * testsuite/script_test_9.t: Add TLS segment.
8031
d0773f31
ILT
80322011-03-02 Simon Baldwin <simonb@google.com>
8033
8034 * configure.ac: Add check for gnu_indirect_function support in
8035 the toolchain building binutils.
8036 * configure: Rebuild.
8037
9370ce59 80382011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8039
8040 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8041 plugin only symbols.
8042 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8043 in plugin files as not needed in the symbol table.
8044
4cf7a849
ST
80452011-02-11 Sriraman Tallam <tmsriram@google.com>
8046
8047 * output.cc (Output_section::add_input_section): Delay fill
8048 generation for section ordering.
8049
b578bd7d
ILT
80502011-02-09 Ian Lance Taylor <iant@google.com>
8051
8052 PR gold/12316
8053 * object.h (class Sized_relobj): Remove clear_local_symbols.
8054 * reloc.cc (Sized_relobj::do_relocate): Don't call
8055 clear_local_symbols.
8056
9370ce59 80572011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8058
8059 * plugin.cc (is_visible_from_outside): Return true for symbols
8060 in the -u option.
8061
55382fb7
ILT
80622011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8063
8064 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8065 filename.
8066
4e271fff
ST
80672011-02-02 Sriraman Tallam <tmsriram@google.com>
8068
8069 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8070 to std::string.
4e271fff 8071 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8072 section_name to be std::string.
4e271fff
ST
8073 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8074
d433c3ac
ILT
80752011-01-25 Ian Lance Taylor <iant@google.com>
8076
8077 * script.cc (script_add_extern): Rewrite to use
8078 add_symbol_reference.
8079
880473a6
DK
80802011-01-25 Doug Kwan <dougkwan@google.com>
8081
d433c3ac 8082 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8083
f30f86fa
ILT
80842011-01-24 Ian Lance Taylor <iant@google.com>
8085
8086 * options.h (class General_options): Accept
8087 --no-detect-odr-violations.
8088
8e51a0b9
ILT
80892011-01-24 Ian Lance Taylor <iant@google.com>
8090
8091 * version.cc (version_string): Bump to 1.11.
8092
0f3b89d8
ILT
80932011-01-24 Ian Lance Taylor <iant@google.com>
8094
8095 * plugin.cc (class Plugin_rescan): Define new class.
8096 (Plugin_manager::claim_file): Set any_claimed_.
8097 (Plugin_manager::save_archive): New function.
8098 (Plugin_manager::save_input_group): New function.
8099 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8100 necessary.
8101 (Plugin_manager::new_undefined_symbol): New function.
8102 (Plugin_manager::rescan): New function.
8103 (Plugin_manager::rescannable_defines): New function.
8104 (Plugin_manager::add_input_file): Set any_added_.
8105 * plugin.h (class Plugin_manager): define new fields rescannable_,
8106 undefined_symbols_, any_claimed_, and any_added_. Declare
8107 Plugin_rescan as friend. Declare new functions.
8108 (Plugin_manager::Rescannable): Define type.
8109 (Plugin_manager::Rescannable_list): Define type.
8110 (Plugin_manager::Undefined_symbol_list): Define type.
8111 (Plugin_manager::Plugin_manager): Initialize new fields.
8112 * archive.cc (Archive::defines_symbol): New function.
8113 (Add_archive_symbols::run): Pass archive to plugins if any.
8114 * archive.h (class Archive): Declare defines_symbol.
8115 * readsyms.cc (Input_group::~Input_group): New function.
8116 (Finish_group::run): Pass input_group to plugins if any.
8117 * readsyms.h (class Input_group): Declare destructor.
8118 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8119 any.
8120
3bb951e5
ILT
81212011-01-10 Ian Lance Taylor <iant@google.com>
8122
8123 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8124 section as relro.
8125 (Layout::set_segment_offsets): Reset increase_relro before calling
8126 set_section_addresses a second time.
8127
0aa45fac
CC
81282011-01-04 Cary Coutant <ccoutant@google.com>
8129
8130 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8131 sections before NOBITS sections.
8132
0db46eb4
L
81332011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8134
8135 * version.cc (print_version): Update copyright to 2011.
8136
829c9745
CC
81372010-12-23 Cary Coutant <ccoutant@google.com>
8138
8139 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8140 of OS to this->add. Add OD parameter to second form of the function.
8141
7500420b
ILT
81422010-12-20 Ian Lance Taylor <iant@google.com>
8143
8144 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8145 second of two consecutive entries with same offset.
8146
f8e9a930
RW
81472010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8148
8149 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8150 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8151 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8152 to avoid unneeded links against $(LDADD).
8153 * testsuite/Makefile.in: Regenerate.
8154
2fbb4320
ILT
81552010-12-15 Ian Lance Taylor <iant@google.com>
8156
8157 PR gold/12324
8158 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8159 for R_X86_64_32 and R_X86_64_PC32.
8160 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8161 ver_matching_def_pic.o.
8162 (ver_matching_def_pic.o): New target.
8163
fedb228d
RW
81642010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8165
8166 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8167 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8168 Move definition before File_read::View member definitions.
8169 (File_read::View::~View): Initialize and hold lock before
8170 updating current_mapped_bytes.
8171
9b547ce6
RW
81722010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8173
8174 * dwarf_reader.cc: Remove outdated comment.
8175 * gold-threads.cc: Fix typo in error message.
8176 * archive.cc: Fix typos in comments.
8177 * archive.h: Likewise.
8178 * arm-reloc-property.cc: Likewise.
8179 * arm-reloc-property.h: Likewise.
8180 * arm-reloc.def: Likewise.
8181 * arm.cc: Likewise.
8182 * attributes.h: Likewise.
8183 * cref.cc: Likewise.
8184 * ehframe.cc: Likewise.
8185 * fileread.h: Likewise.
8186 * gold.h: Likewise.
8187 * i386.cc: Likewise.
8188 * icf.cc: Likewise.
8189 * incremental.h: Likewise.
8190 * int_encoding.cc: Likewise.
8191 * layout.h: Likewise.
8192 * main.cc: Likewise.
8193 * merge.h: Likewise.
8194 * object.cc: Likewise.
8195 * object.h: Likewise.
8196 * options.cc: Likewise.
8197 * readsyms.cc: Likewise.
8198 * reduced_debug_output.cc: Likewise.
8199 * reloc.cc: Likewise.
8200 * script-sections.cc: Likewise.
8201 * sparc.cc: Likewise.
8202 * symtab.h: Likewise.
8203 * target-reloc.h: Likewise.
8204 * target.cc: Likewise.
8205 * target.h: Likewise.
8206 * timer.cc: Likewise.
8207 * timer.h: Likewise.
8208 * x86_64.cc: Likewise.
8209
83e17bd5
CC
82102010-12-09 Cary Coutant <ccoutant@google.com>
8211
8212 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8213 stack.
8214 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8215 parameter; change all callers.
8216 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8217 * options.h (warn_execstack): New option.
8218
017257f8
DK
82192010-12-07 Doug Kwan <dougkwan@google.com>
8220
8221 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8222 like function call relocations.
8223
c20cbc06
ILT
82242010-12-07 Ian Lance Taylor <iant@google.com>
8225
8226 * archive.cc (Archive::get_elf_object_for_member): Permit
8227 punconfigured to be NULL.
8228 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8229 (Archive::include_member): Pass NULL to get_elf_object_for_member
8230 if we searched for the archive and this is the first included
8231 object.
8232
4dbfafcc
ILT
82332010-12-01 Ian Lance Taylor <iant@google.com>
8234
8235 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8236 track_relocs_type_ field.
8237 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8238 Set track_relocs_type_.
8239 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8240 contents when using RELA relocs.
8241 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8242 reloc_map_.
8243 * reloc.cc (Track_relocs::next_addend): New function.
8244 * reloc.h (class Track_relocs): Declare next_addend.
8245
e5e19edd
ILT
82462010-12-01 Ian Lance Taylor <iant@google.com>
8247
8248 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8249 virtual destructor.
8250
9a5ce24c
ILT
82512010-12-01 Ian Lance Taylor <iant@google.com>
8252
8253 * README: Update compilers known to work and fail.
8254
c7791212
NC
82552010-11-23 Matthias Klose <doko@ubuntu.com>
8256
8257 * configure.in: For --enable-gold, handle value `default' instead of
8258 `both*'. Always install ld as ld.bfd, install as ld if gold is
8259 not the default.
8260 * configure: Regenerate.
8261
0ad220c9
DK
82622010-11-18 Doug Kwan <dougkwan@google.com>
8263
8264 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8265 and right_alignment to be zero. Store result alignment only if it is
8266 greater than existing alignment.
8267
ab8056e0
CC
82682010-11-16 Cary Coutant <ccoutant@google.com>
8269
8270 PR gold/12220
8271 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8272 Check for ".zdebug_line".
8273
fd064a5b
CC
82742010-11-16 Doug Kwan <dougkwan@google.com>
8275 Cary Coutant <ccoutant@google.com>
8276
8277 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8278 by reference; adjust all callers.
8279 * output.cc (Output_segment::set_section_addresses): Adjust references
8280 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8281 list is empty.
8282 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8283 end at page boundary.
8284
6fc6ea19
CC
82852010-11-16 Cary Coutant <ccoutant@google.com>
8286
8287 PR gold/12220
8288 * layout.cc (Layout::choose_output_section): Transform names of
8289 compressed sections even when using a script with a SECTIONS clause.
8290 (Layout::output_section_name): Remove code to transform
8291 compressed debug section names.
8292 * output.cc (Output_section::add_input_section): Use uncompressed
8293 section size when tracking input sections.
8294
95a2c8d6
RS
82952010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8296
8297 * symtab.h (Symbol::NON_PIC_REF): Remove.
8298 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8299 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8300 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8301 (Symbol::use_plt_offset): Take a flags argument and pass it
8302 directly to needs_dynamic_reloc. Restrict check for undefined
8303 weak symbols to function calls.
8304 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8305 (Target_arm::Scan::global): Use it.
8306 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8307 (Target_arm::Relocate::relocate): Likewise.
8308 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8309 parameter with an r_type parameter. Use get_reference_flags
8310 to get the flags.
8311 (Target_arm::Relocate::relocate): Update accordingly.
8312 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8313 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8314 (Target_i386::Scan::global): Likewise.
8315 (Target_i386::Relocate::relocate): Likewise.
8316 (Target_i386::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_i386::Relocate::relocate): Update accordingly.
8320 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8321 (Target_powerpc::Scan::global): Use it.
8322 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8323 (Target_powerpc::Relocate::relocate): Likewise.
8324 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8325 (Target_sparc::Scan::global): Use it.
8326 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8327 (Target_sparc::Relocate::relocate): Likewise.
8328 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8329 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8330 (Target_x86_64::Scan::global): Likewise.
8331 (Target_x86_64::Relocate::relocate): Likewise.
8332
f625ae50
DK
83332010-11-08 Doug Kwan <dougkwan@google.com>
8334 Cary Coutant <ccoutant@google.com>
8335
8336 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8337 (Arm_exidx_merge_section::section_contents_): New data member.
8338 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8339 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8340 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8341 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8342 in parameters instead of calling Object::section_contents without
8343 locking.
8344 (Arm_output_section::group_section): New parameter TASK. Pass it
8345 to callees that need locking objects.
8346 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8347 to lock EXIDX input sections. Fix a formatting issue. Call
8348 Arm_exidx_merged_section::build_contents to create merged section
8349 contents.
8350 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8351 to lock object of stub table owner.
8352 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8353 TEXT_SIZE to initialize data member TEXT_SIZE_.
8354 (Arm_exidx_input_section::addralign): Fix typo in comment.
8355 (Arm_exidx_input_section::text_size): New method.
8356 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8357 that require locking objects. Lock objects before scanning for stubs
8358 and updating local symbols.
8359 (Arm_input_section<big_endian>::init): Copy contents of original
8360 input section.
2e702c99 8361 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8362 original input section instead of calling Object::section_contents
8363 without locking.
8364 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8365 size without calling Object::section_size().
8366 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8367 for size. Allocate a buffer for merged EXIDX entries.
8368 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8369 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8370 building code to Arm_exidx_merged_section::build_contetns. Write
8371 out contetns in buffer instead of building it on the fly.
8372 (Arm_relobj::make_exidx_input_section): Also pass text section size
8373 to Arm_exidx_input_section constructor.
8374 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8375 (Arm_dynobj::do_read_symbols): Fix memory leak.
8376 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8377 * target.h: (class Task): Add forward declaration.
8378 (Target::relax): Add new parameter TASK and pass it to
8379 Target::do_relax().
8380 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8381
5f9bcf58
CC
83822010-11-05 Cary Coutant <ccoutant@google.com>
8383
8384 PR gold/10708
8385 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8386 object when reading from the file.
8387 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8388 second layout pass.
8389 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8390 when reading section contents.
8391 (get_section_contents): Likewise.
8392 (icf::find_identical_sections): Likewise.
8393 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8394 object when reading from the file.
8395 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8396 the object when doing deferred section layout.
8397
e597fa08
NC
83982010-11-03 Nick Clifton <nickc@redhat.com>
8399
8400 PR gold/12001
8401 * script.h (class Symbol_assignment: name): New member. Returns
8402 the name of the symbol.
8403 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8404 Returns true if the given symbol name is on the list of
8405 assignments wating to be processed.
8406 * archive.cc (should_incldue_member): If the symbol is undefined,
8407 check to see if it is on the list of symbols pending assignment.
8408
3f9a3278
ILT
84092010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8410
8411 * script-sections.cc (Script_sections::find_memory_region): Check
8412 for a NULL output section pointer.
8413
d06fb4d1
DK
84142010-10-29 Doug Kwan <dougkwan@google.com>
8415
8416 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8417 Output_section::add_relaxed_input_section.
8418 * output.cc (Output_section::add_relaxed_input_section): Add new
8419 arguments LAYOUT and NAME. Set section order index.
8420 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8421 Copy section order index.
8422 * output.h (Output_section::add_relaxed_input_section): Add new
8423 arguments LAYOUT and NAME.
8424
90e24de5
ILT
84252010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8426
8427 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8428 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8429 * testsuite/Makefile.in: Regenerate.
8430
c9484ea5
DK
84312010-10-20 Doug Kwan <dougkwan@google.com>
8432
8433 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8434 without SHF_LINK_ORDER flags.
8435 * layout.cc (Layout::choose_output_section): Do not filter
8436 SHF_LINK_ORDER flag in a relocatable link.
8437
5bc2f5be
CC
84382010-10-17 Cary Coutant <ccoutant@google.com>
8439
8440 * output.h (Output_segment::set_section_addresses): Change function
8441 signature. Update all callers.
8442 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8443 sections.
8444 (Output_segment::set_section_addresses): Align after last TLS
8445 section. Add padding before last relro section instead of after.
8446
0c91cf04
DK
84472010-10-17 Doug Kwan <dougkwan@google.com>
8448
8449 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8450 GOT output section to be writable.
8451
8c21d9d3
CC
84522010-10-14 Cary Coutant <ccoutant@google.com>
8453
8454 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8455 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8456 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8457 mode.
8458 * incremental.cc (report_command_line): Ignore all forms of
8459 --incremental.
8460 * layout.cc (Layout::Layout): Check parameters for incremental link
8461 mode.
8462 * options.cc (General_options::parse_incremental): New function.
8463 (General_options::parse_no_incremental): New function.
8464 (General_options::parse_incremental_full): New function.
8465 (General_options::parse_incremental_update): New function.
8466 (General_options::incremental_mode_): New data member.
8467 (General_options::finalize): Check incremental_mode_.
8468 * options.h (General_options): Update help text for --incremental.
8469 Add --no-incremental, --incremental-full, --incremental-update.
8470 (General_options::Incremental_mode): New enum type.
8471 (General_options::incremental_mode): New function.
8472 (General_options::incremental_mode_): New data member.
8473 * parameters.cc (Parameters::incremental_mode_): New data member.
8474 (Parameters::set_options): Set incremental_mode_.
8475 (Parameters::set_incremental_full): New function.
8476 (Parameters::incremental): New function.
8477 (Parameters::incremental_update): New function.
8478 (set_parameters_incremental_full): New function.
8479 * parameters.h (Parameters::set_incremental_full): New function.
8480 (Parameters::incremental): New function.
8481 (Parameters::incremental_update): New function.
8482 (Parameters::incremental_mode_): New data member.
8483 (set_parameters_incremental_full): New function.
8484 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8485 incremental link mode.
8486 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8487 (Sized_relobj::do_relocate_sections): Likewise.
8488 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8489 option.
8490 * testsuite/Makefile.in: Regenerate.
8491 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8492
bb32aa18 84932010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8494
8495 * script-sections.h (class Script_sections): Make
8496 Sections_elements typedef public.
8497 * script-sections.cc (class Sort_output_sections): Add elements_
8498 field. Add constructor which sets it; change all callers.
8499 (Sort_output_sections::is_before): New function.
8500 (Sort_output_sections::operator()): Call is_before.
8501 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8502 conditional.
8503 * testsuite/script_test_10.sh: New test. Test script section
8504 order.
8505 * testsuite/script_test_10.t: Likewise.
8506 * testsuite/script_test_10.s: Likewise.
8507 * testsuite/Makefile.am: Wrap the cross linker tests and the
8508 common tests into NATIVE_OR_CROSS_LINKER.
8509 (check_SCRIPTS): Add script_test_10.sh.
8510 (check_DATA): Add script_test_10.stdout.
8511 (script_test_10.o, script_test_10): New targets.
8512 (script_test_10.stdout): New target.
8513 * configure, testsuite/Makefile.in: Regenerate.
8514
3cef7179
ILT
85152010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8516
8517 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8518 error for the deprecated relocations.
8519 (Target_arm::Scan::global): Likewise.
8520 (Target_arm::Relocate::relocate): Likewise.
8521
7411e9a8
RS
85222010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8523
8524 * fileread.cc (Input_file::find_file): Initialize *found_name
8525 and *namep when using the fallback search for case 4.
8526
6a9da32a
CC
85272010-10-11 Cary Coutant <ccoutant@google.com>
8528
8529 * options.h (class General_options): Redefine -z lazy as an alias for
8530 the negation of -z now.
8531
ac897c20
ILT
85322010-10-11 Ian Lance Taylor <iant@google.com>
8533
8534 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8535 binding.
8536
ea5cae92
NC
85372010-10-06 Nick Clifton <nickc@redhat.com>
8538
8539 * script-sections.cc(class Memory_region): Remove
8540 current_lma_offset_ field. Rename current_vma_offset_ to
8541 current_offset_. Add last_section_ field.
8542 (Memory_region::get_current_vma_address): Rename to
8543 get_current_address.
8544 (Memory_region::get_current_lma_address): Delete.
8545 (Memory_region::increment_vma_offset): Rename to
8546 increment_offset.
8547 (Memory_region::increment_lma_offset): Delete.
8548 (Memory_region::attributes_compatible): New method. Returns
8549 true if the provided section is compatible with the region.
8550 (Memory_region::get_last_section): New method. Returns the last
8551 section to use the region.
8552 (Memory_region::set_last_section): New method. Stores the last
8553 section to use the region.
8554 (Script_sections::block_in_region): New method. Returns true if
8555 a block of memory is contained within a region.
8556 (Script_sections::find_memory_region): New method. Locates a
8557 memory region to be used to set a VMA or LMA address.
8558 (Output_section_definition::set_section_addresses): Add code to
8559 check for addresses set by memory regions.
8560 (Output_segment::set_section_addresses): Remove memory region
8561 walking code.
8562 (Script_sections::create_segment): Add a warning if a header
8563 segment is created outside of any region.
8564 * script-sections.h (class Script_sections): Add prototypes for
8565 find_memory_region and block_in_region methods.
8566 * testsuite/memory_test.s: Use .long instead of .word.
8567 * testsuite/memory_test.t: Add some more output sections.
8568 * testsuite/memory_test.sh: Update expected output.
8569
a9bfd952
DK
85702010-10-02 Doug Kwan <dougkwan@google.com>
8571
8572 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8573 defintion to symtab.h
8574 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8575 declaration to defintion.
8576
bacff3ab
NC
85772010-10-01 Nick Clifton <nickc@redhat.com>
8578
8579 * expression.cc (eval): Replace dummy argument with NULL.
8580 (eval_maybe_dot): Check for a NULL result section pointer.
8581 (Symbol_expression::value): Likewise.
8582 (Dot_expression::value): Likewise.
8583 (BINARY_EXPRESSION): Likewise.
8584 (Max_expression::value): Likewise.
8585 (Min_expression::value): Likewise.
8586 (Absolute_expression::value): Likewise.
8587 (Addr_expression::value_from_output_section): Likewise.
8588 (Loaddddr_expression::value_from_output_section): Likewise.
8589 (Segment_start_expression::value): Likewise.
8590 * script-sections.cc
8591 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8592 argument with NULL.
8593 (Sections_elememt_dot_assignment::set_section_addresses):
8594 Likewise.
8595 (Output_data_expression::do_write_to_buffer): Likewise.
8596 (Output_section_definition::finalize_symbols): Likewise.
8597 (Output_section_definition::set_section_addresses): Likewise.
8598
f81bc8b5
DK
85992010-09-30 Doug Kwan <dougkwan@google.com>
8600
8601 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8602
c95e9f27
ST
86032010-09-28 Sriraman Tallam <tmsriram@google.com>
8604
8605 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8606 function.
c95e9f27
ST
8607 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8608 virtual function.
8609 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8610 virtual function.
8611 * icf.cc (get_section_contents): Inline merge sections only when
8612 target allows it.
8613
3cac54d2
RW
86142010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8615
8616 * configure: Regenerate.
8617
2904037a
ILT
86182010-09-17 Ian Lance Taylor <iant@google.com>
8619
8620 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8621 * testsuite/Makefile.am (memory_test.o): New target.
8622 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8623 memory_test.t.
8624 * testsuite/Makefile.in: Rebuild.
2904037a 8625
bca7fb63
DK
86262010-09-17 Doug Kwan <dougkwan@google.com>
8627
8628 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8629 defintion if relocation uses GOT entries of the symbol.
8630 * testsuite/icf_safe_test.sh: Fix test.
8631 * testsuite/icf_safe_so_test.sh: Fix test.
8632
4ef28648
CC
86332010-09-16 Cary Coutant <ccoutant@google.com>
8634
8635 * script_sections.cc (class Memory_region): Remove "NULL" from
8636 vector initializations.
8637
793990de
CC
86382010-09-15 Cary Coutant <ccoutant@google.com>
8639
8640 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8641 Resolve forwarding symbols.
8642
81e015e2
DK
86432010-09-15 Doug Kwan <dougkwan@google.com>
8644
8645 * gold/testsuite/script_test_3.t: Add ARM special sections.
8646 * gold/testsuite/script_test_4.t: Same.
8647 * gold/testsuite/script_test_5.t: Same.
8648 * gold/testsuite/script_test_6.t: Same.
8649 * gold/testsuite/script_test_7.t: Same.
8650 * gold/testsuite/script_test_7.t: Same.
8651 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8652
36171d64
CC
86532010-09-14 Cary Coutant <ccoutant@google.com>
8654
8655 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8656 (Target_x86_64::Relocate::relocate_tls): Replace check for
8657 saw_tls_block_reloc_ with test for executable section.
8658
d89051bd
CC
86592010-09-12 Cary Coutant <ccoutant@google.com>
8660
8661 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8662 position-independent executables to shared libraries need dynamic
8663 relocations.
8664 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8665 position-independent executables.
8666 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8667 * testsuite/Makefile.in: Regenerate.
8668
fca41f0f
NC
86692010-09-10 Nick Clifton <nickc@redhat.com>
8670
8671 PR gold/11997
8672 * testsuite/memory_test.t: Discard any sections that are not
8673 needed.
8674
6695e4b3
L
86752010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8676
8677 PR gold/11996
8678 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8679 "This::" to work around a bug in gcc 4.2.
8680
8681 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8682
0f72bf6f
RÁE
86832010-09-09 Rafael Espindola <espindola@google.com>
8684
8685 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8686 sections with different PF_X flags in the same segment.
8687 (Layout::find_first_load_seg): Search all segments to find the first
8688 one.
8689 * options.h (rosegment): New.
8690
86912010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8692
05a79166 8693 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8694
aa98ff75
DK
86952010-09-08 Doug Kwan <dougkwan@google.com>
8696
8697 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8698 (Arm_relobj::do_relocate_sections): Add new parameter for output
8699 file to match the parent.
8700 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8701 of local symbols instead of input values. Update code to track
8702 changes in gold::relocate_section.
8703 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8704 (Sized_relobj::compute_final_local_value_internal): New methods.
8705 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8706 body into private version of Sized_relobj::compute_final_local_value.
8707 Call the inline method.
8708 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8709 merged symbol value if there is one.
8710 (Symbol_value::has_output_value): New method defintiion.
8711 (Sized_relobj::Compute_final_local_value_status): New enum type.
8712 (Sized_relobj::compute_final_local_value): New methods.
8713 (Sized_relobj::compute_final_local_value_internal): New methods.
8714 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8715 and arm_cortex_a8.sh.
8716 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8717 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8718 New tests.
8719 * Makefile.in: Regenerate.
8720 * testsuite/arm_bl_out_of_range.s: Update test.
8721 * testsuite/thumb_bl_out_of_range.s: Ditto.
8722 * testsuite/thumb_blx_out_of_range.s: Ditto.
8723 * testsuite/arm_branch_out_of_range.sh: New file.
8724 * testsuite/arm_cortex_a8.sh: Ditto.
8725 * testsuite/arm_cortex_a8_b.s: Ditto.
8726 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8727 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8728 * testsuite/arm_cortex_a8_bl.s: Ditto.
8729 * testsuite/arm_cortex_a8_blx.s: Ditto.
8730 * testsuite/arm_cortex_a8_local.s: Ditto.
8731 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8732 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8733
05a79166
L
87342010-09-08 Rafael Espindola <espindola@google.com>
8735
8736 * Makefile.am (memory_test.stdout): Run readelf with -W.
8737 * Makefile.in: Regenerate.
8738 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8739 64 bit output.
8740
33dbc701
RÁE
87412010-09-08 Rafael Espindola <espindola@google.com>
8742
8743 * script-sections.cc (Script_sections::add_memory_region): Convert
8744 field precision to int.
8745 * script.cc (script_set_section_region, script_set_section_region):
8746 Convert field precision to int.
8747
731ca54a
RÁE
87482010-09-08 Rafael Espindola <espindola@google.com>
8749
8750 * arm.cc (do_finalize_sections): Create the __exidx_start and
8751 __exdix_end symbols even when the section is missing.
8752
7f8cd844
NC
87532010-09-08 Nick Clifton <nickc@redhat.com>
8754
8755 * README: Remove claim that MEMORY is not supported.
8756 * expression.cc (script_exp_function_origin)
8757 (script_exp_function_length): Move from here to ...
8758 * script.cc: ... here.
8759 (script_set_section_region, script_add_memory)
8760 (script_parse_memory_attr, script_include_directive): New
8761 functions.
8762 * script-sections.cc
8763 (class Memory_region): New class.
8764 (class Output_section_definition): Add set_memory_region,
8765 set_section_vma, set_section_lma and get_section_name methods.
8766 (class Script_Sections): Add add_memory_region,
8767 find_memory_region, find_memory_region_origin,
8768 find_memory_region_length and set_memory_region methods.
8769 Have set_section_addresses method walk the list of set memory
8770 regions.
8771 Extend the print methos to display memory regions.
8772 * script-sections.h: Add prototypes for new methods.
8773 Add enum for MEMORY region attributes.
8774 * yyscript.y: Add support for parsing MEMORY regions.
8775 * script-c.h: Add prototypes for new functions.
8776 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8777 * testsuite/Makefile.in: Regenerate.
8778 * testsuite/memory_test.sh: New script.
8779 * testsuite/memory_test.s: New assembler source file.
8780 * testsuite/memory_test.t: New linker script.
8781
a4649286
DK
87822010-08-27 Doug Kwan <dougkwan@google.com>
8783
8784 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8785 reference override an existing dynamic weak reference.
8786 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8787 * testsuite/Makefile.in: Regenerate.
8788 * testsuite/dyn_weak_ref.sh: New file.
8789 * testsuite/dyn_weak_ref_1.c: Ditto.
8790 * testsuite/dyn_weak_ref_2.c: Ditto.
8791
b56648ad
ILT
87922010-08-27 Ian Lance Taylor <iant@google.com>
8793
8794 * incremental.h (class Incremental_input_entry): Add virtual
8795 destructor.
8796
809313cb
ILT
87972010-08-27 Ian Lance Taylor <iant@google.com>
8798
8799 * testsuite/start_lib_test_3.c: Mark t3 as used.
8800
11e32464
NC
88012010-08-27 Nick Clifton <nickc@redhat.com>
8802
8803 * options.cc (version_script): Fix small typo in previous
8804 whitespace tidyup.
8805
ca09d69a
NC
88062010-08-25 Nick Clifton <nickc@redhat.com>
8807
8808 * archive.cc: Formatting fixes: Remove whitespace between
8809 typename and following asterisk. Remove whitespace between
8810 function name and opening parenthesis.
8811 * archive.h: Likewise.
8812 * arm.cc: Likewise.
8813 * attributes.cc: Likewise.
8814 * attributes.h: Likewise.
8815 * common.cc: Likewise.
8816 * copy-relocs.cc: Likewise.
8817 * dirsearch.h: Likewise.
8818 * dynobj.cc: Likewise.
8819 * ehframe.cc: Likewise.
8820 * ehframe.h: Likewise.
8821 * expression.cc: Likewise.
8822 * fileread.cc: Likewise.
8823 * fileread.h: Likewise.
8824 * gc.h: Likewise.
8825 * gold-threads.cc: Likewise.
8826 * gold.cc: Likewise.
8827 * i386.cc: Likewise.
8828 * icf.h: Likewise.
8829 * incremental-dump.cc: Likewise.
8830 * incremental.cc: Likewise.
8831 * layout.cc: Likewise.
8832 * layout.h: Likewise.
8833 * main.cc: Likewise.
8834 * merge.cc: Likewise.
8835 * merge.h: Likewise.
8836 * object.cc: Likewise.
8837 * object.h: Likewise.
8838 * options.cc: Likewise.
8839 * options.h: Likewise.
8840 * output.cc: Likewise.
8841 * output.h: Likewise.
8842 * plugin.cc: Likewise.
8843 * plugin.h: Likewise.
8844 * powerpc.cc: Likewise.
8845 * reloc.cc: Likewise.
8846 * script-c.h: Likewise.
8847 * script-sections.cc: Likewise.
8848 * script.cc: Likewise.
8849 * stringpool.cc: Likewise.
8850 * symtab.cc: Likewise.
8851 * symtab.h: Likewise.
8852 * target.cc: Likewise.
8853 * timer.cc: Likewise.
8854 * timer.h: Likewise.
8855 * version.cc: Likewise.
8856 * x86_64.cc: Likewise.
8857
b8fa8750
NC
88582010-08-24 Nick Clifton <nickc@redhat.com>
8859
8860 PR 11899
8861 * layout.cc (segment_precedes): Sort segments by their physical
8862 addresses, if they have been set.
8863
9919d93b
CC
88642010-08-23 Cary Coutant <ccoutant@google.com>
8865
8866 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8867 symbols data.
8868 (Lib_group::include_member): Unlock object after deleting its
8869 symbols data.
8870 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8871 the bug fixed here.
8872
97b4be1c
CC
88732010-08-19 Neil Vachharajani <nvachhar@google.com>
8874 Cary Coutant <ccoutant@google.com>
8875
8876 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8877 constructor, and set_blocker.
8878 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8879 readsyms_blocker_.
8880 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8881 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8882 * testsuite/Makefile.am (start_lib_test): New test case.
8883 * testsuite/Makefile.in: Regenerate.
8884 * testsuite/start_lib_test_main.c: New file.
8885 * testsuite/start_lib_test_1.c: New file.
8886 * testsuite/start_lib_test_2.c: New file.
8887 * testsuite/start_lib_test_3.c: New file.
8888
dd0b1884
ILT
88892010-08-19 Ian Lance Taylor <iant@google.com>
8890
8891 * Makefile.in: Rebuild with automake 1.11.1.
8892 * aclocal.m4: Likewise.
8893 * testsuite/Makefile.in: Likewise.
8894
7223e9ca
ILT
88952010-08-19 Ian Lance Taylor <iant@google.com>
8896
8897 PR 10893
8898 * i386.cc (class Output_data_plt_i386): Update declarations.
8899 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8900 local_ifuncs_ fields.
8901 (Target_i386::do_plt_section_for_global): New function.
8902 (Target_i386::do_plt_section_for_local): New function.
8903 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8904 parameter; change all callers. Initialize global_ifuncs_ and
8905 local_ifuncs_. If doing a static link define __rel_iplt_start and
8906 __rel_iplt_end.
8907 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8908 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8909 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8910 symbols.
8911 (Target_i386::make_plt_section): New function, broken out of
8912 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8913 (Target_i386::make_plt_entry): Call make_plt_section.
8914 (Target_i386::make_local_ifunc_plt_entry): New function.
8915 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8916 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8917 R_386_IRELATIVE to switch.
8918 (Target_i386::Scan::global): Likewise.
8919 (Target_i386::Relocate::relocate): Likewise.
8920 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8921 switch.
8922 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8923 (Target_x86_64::do_plt_section_for_global): New function.
8924 (Target_x86_64::do_plt_section_for_local): New function.
8925 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8926 parameter; change all callers. If doing a static link define
8927 __rela_iplt_start and __rela_iplt_end.
8928 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8929 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8930 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8931 to point to .plt.
8932 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8933 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8934 switch.
8935 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8936 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8937 R_X86_64_IRELATIVE to switch.
8938 (Target_x86_64::Scan::global): Likewise.
8939 (Target_x86_64::Relocate::relocate): Likewise.
8940 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8941 switch.
8942 * target.h (class Target): Add plt_section_for_global and
8943 plt_section_for_local functions. Add do_plt_section_for_global
8944 and do_plt_section_for_local virtual functions.
8945 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8946 clarifying comments.
8947 (Symbol::use_plt_offset): Handle IFUNC symbol.
8948 * object.cc (Sized_relobj::Sized_relobj): Initialize
8949 local_plt_offsets_.
8950 (Sized_relobj::local_has_plt_offset): New function.
8951 (Sized_relobj::local_plt_offset): New function.
8952 (Sized_relobj::set_local_plt_offset): New function.
8953 (Sized_relobj::do_count): Handle IFUNC symbol.
8954 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8955 a bit away from input_shndx_ field. Add set_is_func_symbol and
8956 is_ifunc_symbol functions.
8957 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8958 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8959 local_plt_offsets_ field.
8960 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8961 * output.h (class Output_section_data): Add non-const
8962 output_section function.
8963 (class Output_data_got): Update declarations.
8964 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8965 Add use_plt_offset parameter to global and local constructors.
8966 Change all callers. Change local_sym_index_ field to 31 bits.
8967 Change GSYM_CODE and CONSTANT_CODE accordingly.
8968 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8969 doing a static link don't set sh_link field.
8970 (Output_data_got::Got_entry::write): Use PLT offset if
8971 appropriate.
8972 (Output_data_got::add_global_plt): New function.
8973 (Output_data_got::add_local_plt): New function.
8974 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8975 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8976 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8977 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8978 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8979 IFUNC conditional.
8980 * testsuite/ifunc-sel.h: New file.
8981 * testsuite/ifuncmain1.c: New file.
8982 * testsuite/ifuncmain1vis.c: New file.
8983 * testsuite/ifuncmod1.c: New file.
8984 * testsuite/ifuncdep2.c: New file.
8985 * testsuite/ifuncmain2.c: New file.
8986 * testsuite/ifuncmain3.c: New file.
8987 * testsuite/ifuncmod3.c: New file.
8988 * testsuite/ifuncmain4.c: New file.
8989 * testsuite/ifuncmain5.c: New file.
8990 * testsuite/ifuncmod5.c: New file.
8991 * testsuite/ifuncmain6pie.c: New file.
8992 * testsuite/ifuncmod6.c: New file.
8993 * testsuite/ifuncmain7.c: New file.
8994 * configure, testsuite/Makefile.in: Rebuild.
8995
56f75c03
ILT
89962010-08-18 Ian Lance Taylor <iant@google.com>
8997
8998 * incremental.cc
8999 (Output_section_incremental_inputs::write_input_files): Add cast
9000 to avoid signed/unsigned comparison warning.
9001 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9002
55455f89
CC
90032010-08-12 Cary Coutant <ccoutant@google.com>
9004
9005 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9006
e2054bcb
ILT
90072010-08-13 Ian Lance Taylor <iant@google.com>
9008
9009 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9010
74f67560
DK
90112010-08-12 Cary Coutant <ccoutant@google.com>
9012 Doug Kwan <dougkwan@google.com>
9013
9014 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9015 defintion overrides non-weak undef, remember that the original undef
9016 is not weak.
9017 * symtab.cc (Symbol_table::sized_write_global): For undef without
9018 an original weak binding, set binding to global in output.
9019 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9020 * testsuite/Makefile.in: Regenerate.
9021 * testsuite/strong_ref_weak_def.sh: New file.
9022 * testsuite/strong_ref_weak_def_1.c: Ditto.
9023 * testsuite/strong_ref_weak_def_2.c: Ditto.
9024
d1238d12
CC
90252010-08-12 Cary Coutant <ccoutant@google.com>
9026
9027 * testsuite/incremental_test.sh: Rewrite.
9028 * testsuite/incremental_test_1.c: Rewrite.
9029 * testsuite/incremental_test_2.c: Rewrite.
9030
0e70b911
CC
90312010-08-12 Cary Coutant <ccoutant@google.com>
9032
9033 * arm.cc (Target_arm::got_size): Add const.
9034 (Target_arm::got_entry_count): New function.
9035 (Target_arm::plt_entry_count): New function.
9036 (Target_arm::first_plt_entry_offset): New function.
9037 (Target_arm::plt_entry_size): New function.
9038 (Output_data_plt_arm::entry_count): New function.
9039 (Output_data_plt_arm::first_plt_entry_offset): New function.
9040 (Output_data_plt_arm::get_plt_entry_size): New function.
9041 * i386.cc (Target_i386::got_size): Add const.
9042 (Target_i386::got_entry_count): New function.
9043 (Target_i386::plt_entry_count): New function.
9044 (Target_i386::first_plt_entry_offset): New function.
9045 (Target_i386::plt_entry_size): New function.
9046 (Output_data_plt_i386::entry_count): New function.
9047 (Output_data_plt_i386::first_plt_entry_offset): New function.
9048 (Output_data_plt_i386::get_plt_entry_size): New function.
9049 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9050 find_incremental_inputs_sections. Dump incremental_got_plt section.
9051 * incremental.cc: Include target.h.
9052 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9053 parameter. Adjust all callers. Find incremental_got_plt section.
9054 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9055 section.
9056 (Output_section_incremental_inputs::set_final_data_size): Calculate
9057 size of incremental_got_plt section.
9058 (Output_section_incremental_inputs::do_write): Write the
9059 incremental_got_plt section.
9060 (Got_plt_view_info): New struct.
9061 (Local_got_offset_visitor): New class.
9062 (Global_got_offset_visitor): New class.
9063 (Global_symbol_visitor_got_plt): New class.
9064 (Output_section_incremental_inputs::write_got_plt): New function.
9065 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9066 Add parameter. Adjust all callers.
9067 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9068 (Incremental_inputs::got_plt_section): New function.
9069 (Incremental_inputs::got_plt_section_): New data member.
9070 (Incremental_got_plt_reader): New class.
9071 * layout.cc (Layout::create_incremental_info_sections): Add the
9072 incremental_got_plt section.
9073 * object.h (Got_offset_list::get_list): New function.
9074 (Got offset_list::for_all_got_offsets): New function.
9075 (Sized_relobj::local_got_offset_list): New function.
9076 * powerpc.cc (Target_powerpc::got_size): Add const.
9077 (Target_powerpc::got_entry_count): New function.
9078 (Target_powerpc::plt_entry_count): New function.
9079 (Target_powerpc::first_plt_entry_offset): New function.
9080 (Target_powerpc::plt_entry_size): New function.
9081 (Output_data_plt_powerpc::entry_count): New function.
9082 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9083 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9084 * sparc.cc (Target_sparc::got_size): Add const.
9085 (Target_sparc::got_entry_count): New function.
9086 (Target_sparc::plt_entry_count): New function.
9087 (Target_sparc::first_plt_entry_offset): New function.
9088 (Target_sparc::plt_entry_size): New function.
9089 (Output_data_plt_sparc::entry_count): New function.
9090 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9091 (Output_data_plt_sparc::get_plt_entry_size): New function.
9092 * symtab.h (Symbol::got_offset_list): New function.
9093 (Symbol_table::for_all_symbols): New function.
9094 * target.h (Sized_target::got_entry_count): New function.
9095 (Sized_target::plt_entry_count): New function.
9096 (Sized_target::plt_entry_size): New function.
9097 * x86_64.cc (Target_x86_64::got_size): Add const.
9098 (Target_x86_64::got_entry_count): New function.
9099 (Target_x86_64::plt_entry_count): New function.
9100 (Target_x86_64::first_plt_entry_offset): New function.
9101 (Target_x86_64::plt_entry_size): New function.
9102 (Output_data_plt_x86_64::entry_count): New function.
9103 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9104 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9105
09ec0418
CC
91062010-08-12 Cary Coutant <ccoutant@google.com>
9107
9108 * archive.cc: Include incremental.h.
9109 (Archive::Archive): Initialize incremental_info_.
9110 (Archive::include_member): Record archive members in incremental info.
9111 (Add_archive_symbols::run): Record begin and end of an archive in
9112 incremental info.
9113 (Lib_group::include_member): Record objects in incremental info.
9114 * archive.h (Incremental_archive_entry): Forward declaration.
9115 (Archive::set_incremental_info): New member function.
9116 (Archive::incremental_info): New member function.
9117 (Archive::Unused_symbol_iterator): New class.
9118 (Archive::unused_symbols_begin): New member function.
9119 (Archive::unused_symbols_end): New member function.
9120 (Archive::incremental_info_): New data member.
9121 * incremental-dump.cc (find_input_containing_global): New function.
9122 (dump_incremental_inputs): Dump new incremental info sections.
9123 * incremental.cc: Include symtab.h.
9124 (Output_section_incremental_inputs): New class.
9125 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9126 new incremental info sections.
9127 (Sized_incremental_binary::do_check_inputs): Likewise.
9128 (Incremental_inputs::report_archive): Remove.
9129 (Incremental_inputs::report_archive_begin): New function.
9130 (Incremental_inputs::report_archive_end): New function.
9131 (Incremental_inputs::report_object): New function.
9132 (Incremental_inputs::finalize_inputs): Remove.
9133 (Incremental_inputs::report_input_section): New function.
9134 (Incremental_inputs::report_script): Rewrite.
9135 (Incremental_inputs::finalize): Do nothing but finalize string table.
9136 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9137 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9138 (Incremental_inputs::create_data_sections): New function.
9139 (Incremental_inputs::relocs_entsize): New function.
9140 (Output_section_incremental_inputs::set_final_data_size): New function.
9141 (Output_section_incremental_inputs::do_write): New function.
9142 (Output_section_incremental_inputs::write_header): New function.
9143 (Output_section_incremental_inputs::write_input_files): New function.
9144 (Output_section_incremental_inputs::write_info_blocks): New function.
9145 (Output_section_incremental_inputs::write_symtab): New function.
9146 * incremental.h (Incremental_script_entry): Forward declaration.
9147 (Incremental_object_entry): Forward declaration.
9148 (Incremental_archive_entry): Forward declaration.
9149 (Incremental_inputs): Forward declaration.
9150 (Incremental_inputs_header_data): Remove.
9151 (Incremental_inputs_header): Remove.
9152 (Incremental_inputs_header_write): Remove.
9153 (Incremental_inputs_entry_data): Remove.
9154 (Incremental_inputs_entry): Remove.
9155 (Incremental_inputs_entry_write): Remove.
9156 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9157 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9158 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9159 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9160 Likewise.
9161 (Incremental_input_entry): New class.
9162 (Incremental_script_entry): New class.
9163 (Incremental_object_entry): New class.
9164 (Incremental_archive_entry): New class.
9165 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9166 (Incremental_inputs::report_inputs): Remove.
9167 (Incremental_inputs::report_archive): Remove.
9168 (Incremental_inputs::report_archive_begin): New function.
9169 (Incremental_inputs::report_archive_end): New function.
9170 (Incremental_inputs::report_object): Change prototype.
9171 (Incremental_inputs::report_input_section): New function.
9172 (Incremental_inputs::report_script): Change prototype.
9173 (Incremental_inputs::get_reloc_count): New function.
9174 (Incremental_inputs::set_reloc_count): New function.
9175 (Incremental_inputs::create_data_sections): New function.
9176 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9177 (Incremental_inputs::inputs_section): New function.
9178 (Incremental_inputs::symtab_section): New function.
9179 (Incremental_inputs::relocs_section): New function.
9180 (Incremental_inputs::get_stringpool): Add const.
9181 (Incremental_inputs::command_line): Add const.
9182 (Incremental_inputs::inputs): Remove.
9183 (Incremental_inputs::command_line_key): New function.
9184 (Incremental_inputs::input_file_count): New function.
9185 (Incremental_inputs::input_files): New function.
9186 (Incremental_inputs::relocs_entsize): New function.
9187 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9188 (Incremental_inputs::finalize_inputs): Remove.
9189 (Incremental_inputs::Input_info): Remove.
9190 (Incremental_inputs::lock_): Remove.
9191 (Incremental_inputs::inputs_): Change type.
9192 (Incremental_inputs::inputs_map_): Remove.
9193 (Incremental_inputs::current_object_entry_): New data member.
9194 (Incremental_inputs::inputs_section_): New data member.
9195 (Incremental_inputs::symtab_section_): New data member.
9196 (Incremental_inputs::relocs_section_): New data member.
9197 (Incremental_inputs::reloc_count_): New data member.
9198 (Incremental_inputs_reader): New class.
9199 (Incremental_symtab_reader): New class.
9200 (Incremental_relocs_reader): New class.
9201 * layout.cc (Layout::finalize): Move finalization of incremental info
9202 and creation of incremental info sections to follow finalization of
9203 symbol table. Set offsets for postprocessing sections.
9204 (Layout::create_incremental_info_sections): Call
9205 Incremental_inputs::create_data_sections. Add incremental symtab
9206 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9207 sections to layout after input sections.
9208 * layout.h (struct Timespec): Forward declaration.
9209 (Layout::incremental_inputs): Add const.
9210 (Layout::create_incremental_info_sections): Add parameter.
9211 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9212 * object.cc: Include incremental.h.
9213 (Relobj::finalize_incremental_relocs): New function.
9214 (Sized_relobj::do_layout): Record input sections in incremental info.
9215 * object.h (Object::output_section): New function.
9216 (Object::output_section_offset): Moved from Relobj.
9217 (Object::get_incremental_reloc_base): New function.
9218 (Object::get_incremental_reloc_count): New function.
9219 (Object::do_output_section): New function.
9220 (Object::do_output_section_offset): Moved from Relobj.
9221 (Object::do_get_incremental_reloc_base): New function.
9222 (Object::do_get_incremental_reloc_count): New function.
9223 (Object::Object): Initialize new data members.
9224 (Relobj::output_section): Renamed do_output_section and moved to
9225 protected.
9226 (Relobj::output_section_offset): Moved to Object.
9227 (Relobj::do_get_incremental_reloc_base): New function.
9228 (Relobj::do_get_incremental_reloc_count): New function.
9229 (Relobj::allocate_incremental_reloc_counts): New function.
9230 (Relobj::count_incremental_reloc): New function.
9231 (Relobj::finalize_incremental_relocs): New function.
9232 (Relobj::next_incremental_reloc_index): New function.
9233 (Relobj::reloc_counts_): New data member.
9234 (Relobj::reloc_bases_): New data member.
9235 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9236 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9237 (Sized_relobj::incremental_relocs_scan): New function.
9238 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9239 (Sized_relobj::incremental_relocs_write): New function.
9240 (Sized_relobj::incremental_relocs_write_reltype): New function.
9241 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9242 incremental link.
9243 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9244 archives and object files elsewhere.
9245 (Add_symbols::run): Report object files here.
9246 (Finish_group::run): Report end of archive at end of group.
9247 * reloc.cc: Include layout.h, incremental.h.
9248 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9249 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9250 (Sized_relobj::incremental_relocs_scan): New function.
9251 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9252 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9253 (Sized_relobj::incremental_relocs_write): New function.
9254 (Sized_relobj::incremental_relocs_write_reltype): New function.
9255 * script.cc (read_input_script): Rewrite test for incremental link.
9256 Change call to Incremental_inputs::report_script.
9257 * symtab.h (Symbol_table::first_global_index): New function.
9258 (Symbol_table::output_count): New function.
9259
ce0d1972
DK
92602010-08-12 Doug Kwan <dougkwan@google.com>
9261
9262 * arm.cc (Target_arm::merge_object_attributes): Check command line
9263 options --no-wchar-size-warning and --no-enum-size-warning.
9264 * options.h (General_options): Add ld-compatible options
9265 --no-enum-size-warning and --no-wchar-size-warning.
9266
6e5710ce
ILT
92672010-08-04 Ian Lance Taylor <iant@google.com>
9268
9269 * x86_64.cc (Target_x86_64::Scan::local): Use
9270 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9271 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9272 (Target_x86_64::Scan::global): Likewise.
9273 (Target_x86_64::Relocate::relocate): Likewise.
9274 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9275 Likewise.
9276
fef830db
CC
92772010-08-03 Cary Coutant <ccoutant@google.com>
9278
9279 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9280 to reserve space in merged_strings vector. Keep total input size
9281 for stats.
9282 (Output_merge_string::do_print_merge_stats): Print total input size.
9283 * merge.h (Output_merge_string): Add input_size_ field.
9284 * stringpool.cc (Stringpool_template::string_length): Move
9285 implementations out of Stringpool_template class and place in
9286 stringpool.h.
9287 * stringpool.h (string_length): Move out of Stringpool_template.
9288
1e3811b0
ILT
92892010-08-03 Ian Lance Taylor <iant@google.com>
9290
9291 PR 11712
9292 * layout.cc (relaxation_loop_body): If address of load segment is
9293 set, adjust address to include headers if possible.
9294
7af0c620
ILT
92952010-08-03 Ian Lance Taylor <iant@google.com>
9296
9297 * version.cc (version_string): Bump to 1.10.
9298
22f0da72
ILT
92992010-08-03 Ian Lance Taylor <iant@google.com>
9300
9301 PR 11805
9302 * layout.h (enum Output_section_order): Define.
9303 (class Layout): Update declarations.
9304 * layout.cc (Layout::get_output_section): Add order parameter.
9305 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9306 is_first_non_relro parameters. Change all callers.
9307 (Layout::choose_output_section): Likewise.
9308 (Layout::add_output_section_data): Likewise.
9309 (Layout::make_output_section): Likewise. Set order.
9310 (Layout::default_section_order): New function.
9311 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9312 * output.cc (Output_section::Output_section): Initialize order_.
9313 Don't initialize deleted fields.
9314 (Output_segment::Output_segment): Don't initialize deleted
9315 fields.
9316 (Output_segment::add_output_section_to_load): New function
9317 replacing add_output_section. Change all callers to call this or
9318 add_output_section_to_nonload.
9319 (Output_segment::add_output_section_to_nonload): New function.
9320 (Output_segment::remove_output_section): Rewrite.
9321 (Output_segment::add_initial_output_data): Likewise.
9322 (Output_segment::has_any_data_sections): Likewise.
9323 (Output_segment::is_first_section_relro): Likewise.
9324 (Output_segment::maximum_alignment): Likewise.
9325 (Output_segment::has_dynamic_reloc): New function replacing
9326 dynamic_reloc_count. Change all callers.
9327 (Output_segment::has_dynamic_reloc_list): New function replacing
9328 dynamic_reloc_count_list. Change all callers.
9329 (Output_segment::set_section_addresses): Rewrite.
9330 (Output_segment::set_offset): Rewrite.
9331 (Output_segment::find_first_and_last_list): Remove.
9332 (Output_segment::set_tls_offsets): Rewrite.
9333 (Output_segment::first_section_load_address): Likewise.
9334 (Output_segment::output_section_count): Likewise.
9335 (Output_segment::section_with_lowest_load_address): Likewise.
9336 (Output_segment::write_section_headers): Likewise.
9337 (Output_segment::print_sections_to_map): Likewise.
9338 * output.h (class Output_data): Remove dynamic_reloc_count_
9339 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9340 (Output_data::add_dynamic_reloc): Rewrite.
9341 (Output_data::has_dynamic_reloc): New function.
9342 (Output_data::dynamic_reloc_count): Remove.
9343 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9344 is_last_relro_, is_first_non_relro_, is_interp_,
9345 is_dynamic_linker_section_ fields. Add order and set_order
9346 functions. Remove is_relro_local, set_is_relro_local,
9347 is_last_relro, set_is_last_relro, is_first_non_relro,
9348 set_is_first_non_relro functions, is_interp, set_is_interp,
9349 is_dynamic_linker_section, and set_is_dynamic_linker_section
9350 functions.
9351 (class Output_segment): Change Output_data_list from std::list to
9352 std:;vector. Add output_lists_ field. Remove output_data_ and
9353 output_bss_ fields. Update declarations.
9354
3ff2ccb0
ILT
93552010-08-02 Ian Lance Taylor <iant@google.com>
9356
9357 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9358 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9359 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9360
88a4108b
ILT
93612010-08-02 Ian Lance Taylor <iant@google.com>
9362
9363 PR 11855
9364 * script.cc (Script_options::Script_options): Initialize
9365 symbol_definitions_ and symbol_references_.
9366 (Script_options::add_symbol_assignment): Update
9367 symbol_definitions_ and symbol_references_.
9368 (Script_options::add_symbol_reference): New function.
9369 (script_symbol): New function.
9370 * script.h (class Script_options): Add symbol_definitions_ and
9371 symbol_references_ fields.
9372 (Script_options::referenced_const_iterator): New type.
9373 (Script_options::referenced_begin): New function.
9374 (Script_options::referenced_end): New function.
9375 (Script_options::is_referenced): New function.
9376 (Script_options::any_unreferenced): New function.
9377 * script-c.h (script_symbol): Declare.
9378 * yyscript.y (exp): Call script_symbol.
9379 * symtab.cc: Include "script.h".
9380 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9381 Change all callers. Check symbols referenced by scripts.
9382 (Symbol_table::add_undefined_symbols_from_command_line): Add
9383 layout parameter. Change all callers.
9384 (Symbol_table::do_add_undefined_symbols_from_command_line):
9385 Likewise. Break out loop body. Check symbols referenced by
9386 scripts.
9387 (Symbol_table::add_undefined_symbol_from_command_line): New
9388 function broken out of
9389 do_add_undefined_symbols_from_command_line.
9390 * symtab.h (class Symbol_table): Update declarations.
9391 * archive.cc: Include "layout.h".
9392 (Archive::should_include_member): Add layout parameter. Change
9393 all callers. Check for symbol mentioned in expression.
9394 * archive.h (class Archive): Update declaration.
9395 * object.cc (Sized_relobj::do_should_include_member): Add layout
9396 parameter.
9397 * object.h (Object::should_include_member): Add layout parameter.
9398 Change all callers.
9399 (Object::do_should_include_member): Add layout parameter.
9400 (class Sized_relobj): Update declaration.
9401 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9402 parameter.
9403 * dynobj.h (class Sized_dynobj): Update declaration.
9404 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9405 layout parameter.
9406 * plugin.h (class Sized_pluginobj): Update declaration.
9407
5f1ab67a
ILT
94082010-08-02 Ian Lance Taylor <iant@google.com>
9409
9410 PR 11866
9411 * output.cc (Output_segment::set_offset): Search for the first and
9412 last sections rather than assuming that the list is in order.
9413 (Output_segment::find_first_and_last_list): New function.
9414 * output.h (class Output_segment): Update declarations.
9415 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9416 (relro_strip_test_SOURCES): New variable.
9417 (relro_strip_test_DEPENDENCIES): New variable.
9418 (relro_strip_test_LDFLAGS): New variable.
9419 (relro_strip_test_LDADD): New variable.
9420 (relro_strip_test.so): New target.
9421
a8df5856
ILT
94222010-08-02 Ian Lance Taylor <iant@google.com>
9423
9424 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9425 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9426 (Target_i386::got_tlsdesc_section): New function.
9427 (Target_i386::got_section): Create space for GOT entries for
9428 TLSDESC relocations.
9429 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9430 R_386_TLS_GOTDESC.
9431 (Target_i386::Scan::global): Likewise.
9432 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9433 using TLSDESC GOT.
9434 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9435 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9436 (Target_x86_64::got_tlsdesc_section): New function.
9437 (Target_x86_64::got_section): Create space for GOT entries for
9438 TLSDESC relocations.
9439 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9440 R_386_TLS_GOTDESC.
9441 (Target_x86_64::Scan::global): Likewise.
9442 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9443 using TLSDESC GOT.
9444
0c10a0a6
ILT
94452010-08-02 Ian Lance Taylor <iant@google.com>
9446
9447 * testsuite/final_layout.sh: Use dc to convert from hex to
9448 decimal.
9449
41cbeecc
ST
94502010-07-29 Sriraman Tallam <tmsriram@google.com>
9451
9452 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9453 paramter to the call to gold::gc_process_relocs.
9454 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9455 paramter to the call to gold::gc_process_relocs.
9456 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9457 parameter to the call to gold::gc_process_relocs.
9458 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9459 template parameter to the call to gold::gc_process_relocs.
9460 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9461 paramter to the call to gold::gc_process_relocs.
9462 * gc.h (get_embedded_addend_size): New function.
9463 (gc_process_relocs): Save the size of the reloc for use by ICF.
9464 * icf.cc (get_section_contents): Get the addend from the text section
9465 for SHT_REL relocation sections.
9466 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9467 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9468 * int_encoding.h (read_from_pointer): New overloaded function.
9469 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9470 * testsuite/icf_sht_rel_addend_test.sh: New file.
9471 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9472 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9473
6ea55b82
RW
94742010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9475
9476 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9477 * Makefile.in: Regenerate.
9478 * testsuite/Makefile.in: Regenerate.
9479
9691462b
ILT
94802010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9481
9482 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9483 * gold/testsuite/debug_msg.cc: Likewise.
9484 * gold/testsuite/odr_violation1.cc
9485 * gold/testsuite/odr_violation2.cc
9486
76897331
CC
94872010-07-21 Cary Coutant <ccoutant@google.com>
9488
9489 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9490 string, and length fields.
9491 (Output_merge_string::Merged_strings_list): New type.
9492 (Output_merge_string::Merged_strings_lists): New typedef.
9493 (Output_merge_string): Replace merged_strings_ with
9494 merged_strings_lists_.
9495 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9496 Merged_strings_list per input object and section. Don't store pointer
9497 to the string. Don't store length with each merged string entry.
9498 (Output_merge_string::finalize_merged_data): Loop over list of merged
9499 strings lists. Recompute length of each merged string.
9500
78384e8f
CC
95012010-07-15 Cary Coutant <ccoutant@google.com>
9502
9503 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9504 here.
9505
783659f9
ILT
95062010-07-14 Ian Lance Taylor <iant@google.com>
9507
9508 * descriptors.cc (Descriptors::open): Report correct name in error
9509 message.
9510
131687b4
DK
95112010-07-13 Doug Kwan <dougkwan@google.com>
9512
9513 * arm.cc (Arm_input_section::Arm_input_section): For a
9514 SHT_ARM_EXIDX section, always keeps the input sections.
9515 (Arm_input_section::set_exidx_section_link): New method.
9516 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9517 has_errors_ to false.
9518 (Arm_exidx_input_section::has_errors,
9519 Arm_exidx_input_section::set_has_errors): New methods.
9520 (Arm_exidx_input_section::has_errors_): New data member.
9521 (Arm_relobj::get_exidx_shndx_list): New method.
9522 (Arm_output_section::append_text_sections_to_list): Do not skip
9523 section without SHF_EXECINSTR.
9524 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9525 errors.
2e702c99 9526 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9527 section header. Make error messages more verbose. Check for
9528 a non-executable section linked to an EXIDX section.
9529 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9530 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9531 check that there is no deferred EXIDX section if we exit early.
9532 Instead of not making an EXIDX section in case of an error, make one
9533 and set the has_errors flag of it.
9534 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9535 in a relocatable link.
9536 (Target_arm::do_relax): Look for the EXIDX output section instead of
9537 assuming that it is called .ARM.exidx.
2e702c99 9538 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9539 section list. Do not check for SHF_EXECINSTR section flags but
9540 skip any input section with errors.
9541 * output.cc (Output_section::Output_section): Initialize
9542 always_keeps_input_sections_ to false.
9543 (Output_section::add_input_section): Check for
9544 always_keeps_input_sections_.
9545 * output.h (Output_section::always_keeps_input_sections,
9546 Output_section::set_always_keeps_input_sections): New methods.
9547 (Output_section::always_keeps_input_sections): New data member.
9548
69517287
RÁE
95492010-07-13 Rafael Espindola <espindola@google.com>
9550
9551 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9552 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9553
82742395
ILT
95542010-07-13 Philip Herron <herron.philip@googlemail.com>
9555 Ian Lance Taylor <iant@google.com>
9556
9557 * output.h (Output_section_lookup_maps::add_merge_section):
9558 Correct check of whether value was inserted.
9559 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9560 (Output_section_lookup_maps::add_relaxed_input_section):
9561 Likewise.
9562 * arm.cc (Target_arm::got_section): Remove used local os.
9563 * i386.cc (Target_i386::got_section): Likewise.
9564 * x86_64.cc (Target_x86_64::got_section): Likewise.
9565 * sparc.cc (Target_sparc::got_section): Likewise.
9566 (Target_sparc::relocate): Remove unused local have_got_offset.
9567 * powerpc.cc (Target_powerpc::relocate): Likewise.
9568
f2d707b5
ILT
95692010-07-13 Ian Lance Taylor <iant@google.com>
9570
241531d6
ILT
9571 * compressed_output.cc (zlib_decompress): Fix signature in
9572 !HAVE_ZLIB_H case.
9573
f2d707b5
ILT
9574 * archive.cc (Archive::include_member): Unlock an external member
9575 of a thin archive. Don't bother to delete an object we know is
9576 NULL.
9577
a2e47362
CC
95782010-07-12 Cary Coutant <ccoutant@google.com>
9579
9580 * compressed_output.cc (zlib_decompress): New function.
9581 (get_uncompressed_size): New function.
9582 (decompress_input_section): New function.
9583 * compressed_output.h (get_uncompressed_size): New function.
9584 (decompress_input_section): New function.
9585 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9586 Handle compressed debug sections.
9587 * layout.cc (is_compressed_debug_section): New function.
9588 (Layout::output_section_name): Map compressed section names to
9589 canonical names.
9590 * layout.h (is_compressed_debug_section): New function.
9591 (is_debug_info_section): Recognize compressed debug sections.
9592 * merge.cc: Include compressed_output.h.
9593 (Output_merge_data::do_add_input_section): Handle compressed
9594 debug sections.
9595 (Output_merge_string::do_add_input_section): Handle compressed
9596 debug sections.
9597 * object.cc: Include compressed_output.h.
9598 (Sized_relobj::Sized_relobj): Initialize new data members.
9599 (build_compressed_section_map): New function.
9600 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9601 * object.h (Object::section_is_compressed): New method.
9602 (Object::do_section_is_compressed): New method.
9603 (Sized_relobj::Compressed_section_map): New type.
9604 (Sized_relobj::do_section_is_compressed): New method.
9605 (Sized_relobj::compressed_sections_): New data member.
9606 * output.cc (Output_section::add_input_section): Handle compressed
9607 debug sections.
9608 * reloc.cc: Include compressed_output.h.
9609 (Sized_relobj::write_sections): Handle compressed debug sections.
9610
ce279a62
CC
96112010-07-08 Cary Coutant <ccoutant@google.com>
9612
9613 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9614 weak when resolving to a dynamic def.
9615 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9616 for weak undef/dynamic def cases. Adjust callers.
9617 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9618 undef_binding_weak_.
9619 (Symbol_table::sized_write_globals): Adjust symbol binding.
9620 (Symbol_table::sized_write_symbol): Add binding parameter.
9621 * symtab.h (Symbol::set_undef_binding): New method.
9622 (Symbol::is_undef_binding_weak): New method.
9623 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9624 (Symbol_table::should_override): Add new parameter.
9625 (Symbol_table::sized_write_symbol): Add new parameter.
9626
9627 * testsuite/weak_undef_file1.cc: Add new test case.
9628 * testsuite/weak_undef_file2.cc: Fix header comment.
9629 * testsuite/weak_undef_test.cc: Add new test case.
9630
b2286c10
DK
96312010-06-29 Doug Kwan <dougkwan@google.com>
9632
9633 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9634 Initialize USE_SYMBOL_.
9635 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9636 definition.
9637 (Arm_reloc_property::uses_symbol_): New data member declaration.
9638 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9639 uses symbol value and symbol is undefined but not weakly undefined.
9640
4802450a
RÁE
96412010-06-28 Rafael Espindola <espindola@google.com>
9642
9643 * plugin.cc (Plugin::load): Use dlerror.
9644
e5ca47ba
ILT
96452010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9646
9647 * symtab.cc (detect_odr_violations): When reporting an ODR
9648 violation, report an object where the symbol is defined.
9649
8a75a161
DK
96502010-06-25 Doug Kwan <dougkwan@google.com>
9651
9652 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9653 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9654 definition.
9655 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9656 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9657 target hook to detect function points.
9658 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9659 * icf.h (Icf::check_section_for_function_pointers): Change type of
9660 parameter SECTION_NAME to const reference to std::string. Use
9661 target hook to determine if section may have unsafe pointers.
9662 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9663 method definition.
9664
42218b9f
RÁE
96652010-06-21 Rafael Espindola <espindola@google.com>
9666
9667 * fileread.cc (Input_file::find_fie): New
9668 (Input_file::open): Use Input_file::find_fie.
9669 * fileread.h (Input_file::find_fie): New
9670 * plugin.cc (set_extra_library_path): New.
9671 (Plugin::load): Add set_extra_library_path to the transfer vector.
9672 (Plugin_manager::set_extra_library_path): New.
9673 (Plugin_manager::add_input_file): Use the extra search path if set.
9674 (set_extra_library_path(): New.
9675 * plugin.h (Plugin_manager): Add set_extra_library_path and
9676 extra_search_path_.
9677
a0506cca
CC
96782010-06-19 Cary Coutant <ccoutant@google.com>
9679
9680 * layout.cc (gdb_sections): Add .debug_types.
9681 (lines_only_debug_sections): Likewise.
9682
6508b958
RÁE
96832010-06-18 Rafael Espindola <espindola@google.com>
9684
9685 * plugin.cc (add_input_file,add_input_library)
9686 (Plugin_manager::add_input_file): Make filename arguments const.
9687 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9688 const.
9689
3e235302
DK
96902010-06-16 Doug Kwan <dougkwan@google.com>
9691
9692 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9693 .ARM.attributes section if we have not merged any input
9694 attributes sections.
9695
106e8a6c
DK
96962010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9697
9698 * arm.cc: Allow combining objects with no EABI version
9699 information.
9700
91ff43fe
RÁE
97012010-06-15 Rafael Espindola <espindola@google.com>
9702
9703 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9704
68ed838c
ILT
97052010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9706
9707 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9708 (struct iovec): Correct !HAVE_READV definition.
9709
f3a2388f
CC
97102010-06-10 Cary Coutant <ccoutant@google.com>
9711
9712 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9713 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9714 reloc sections.
9715 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9716
9717 PR 11683
9718 * symtab.h (Symbol::is_placeholder): New member function.
9719 * target-reloc.h (relocate_section): Check for placeholder symbols.
9720
9721 * testsuite/Makefile.am (plugin_test_8): New test.
9722 (plugin_test_9): New test.
9723 * testsuite/Makefile.in: Regenerate.
9724
e1df38aa
NC
97252010-06-09 Nick Clifton <nickc@redhat.com>
9726
9727 * yyscript.y (input_list_element): Allow strings prefixed with
9728 the '-' character. Treat these as libraries.
9729 * script.cc (script_add_library): New function. Adds a library
9730 specified by "-l<name>" found in an input script.
9731 * script-c.h: Add prototype for script_add_library.
9732
25bbe950
DK
97332010-06-07 Doug Kwan <dougkwan@google.com>
9734
9735 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9736 Restrict stub-group size to be within long conditional branch
9737 range when working around cortex-A8 erratum.
9738
0f32ea4c
ILT
97392010-06-07 Damien Diederen <dd@crosstwine.com>
9740
9741 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9742 #ifdef typo.
9743
8fe2a369
ST
97442010-06-03 Sriraman Tallam <tmsriram@google.com>
9745
9746 PR gold/11658
9747 * output.cc
9748 (Output_section::Input_section_sort_entry::compare_section_ordering):
9749 Change to return non-zero correctly.
9750 (Output_section::Input_section_sort_section_order_index_compare
9751 ::operator()): Change to fix ambiguity in comparisons.
9752
6e9ba2ca
ST
97532010-06-01 Sriraman Tallam <tmsriram@google.com>
9754
9755 * gold.h (is_wildcard_string): New function.
9756 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9757 (Layout::layout_eh_frame): Ditto.
9758 (Layout::find_section_order_index): New method.
9759 (Layout::read_layout_from_file): New method.
9760 * layout.h (Layout::find_section_order_index): New method.
9761 (Layout::read_layout_from_file): New method.
9762 (Layout::input_section_position_): New private member.
9763 (Layout::input_section_glob_): New private member.
9764 * main.cc (main): Call read_layout_from_file here.
9765 * options.h (--section-ordering-file): New option.
9766 * output.cc (Output_section::input_section_order_specified_): New
9767 member.
9768 (Output_section::Output_section): Initialize new member.
9769 (Output_section::add_input_section): Add new parameter.
9770 Keep input sections when --section-ordering-file is used.
9771 (Output_section::set_final_data_size): Sort input sections when
9772 section ordering file is specified.
9773 (Output_section::Input_section_sort_entry): Add new parameter.
9774 Check sorting type.
9775 (Output_section::Input_section_sort_entry::compare_section_ordering):
9776 New method.
9777 (Output_section::Input_section_sort_compare::operator()): Change to
9778 consider section_order_index.
9779 (Output_section::Input_section_sort_init_fini_compare::operator()):
9780 Change to consider section_order_index.
9781 (Output_section::Input_section_sort_section_order_index_compare
9782 ::operator()): New method.
9783 (Output_section::sort_attached_input_sections): Change to sort
9784 according to section order when specified.
e1df38aa
NC
9785 (Output_section::add_input_section<32, true>): Add new parameter.
9786 (Output_section::add_input_section<64, true>): Add new parameter.
9787 (Output_section::add_input_section<32, false>): Add new parameter.
9788 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9789 * output.h (Output_section::add_input_section): Add new parameter.
9790 (Output_section::input_section_order_specified): New
9791 method.
9792 (Output_section::set_input_section_order_specified): New method.
9793 (Input_section::Input_section): Initialize section_order_index_.
9794 (Input_section::section_order_index): New method.
9795 (Input_section::set_section_order_index): New method.
9796 (Input_section::section_order_index_): New member.
9797 (Input_section::Input_section_sort_section_order_index_compare): New
9798 struct.
9799 (Output_section::input_section_order_specified_): New member.
9800 * script-sections.cc (is_wildcard_string): Delete and move modified
9801 method to gold.h.
9802 (Output_section_element_input::Output_section_element_input): Modify
9803 call to is_wildcard_string.
9804 (Output_section_element_input::Input_section_pattern
9805 ::Input_section_pattern): Ditto.
9806 (Output_section_element_input::Output_section_element_input): Ditto.
9807 * testsuite/Makefile.am (final_layout): New test case.
9808 * testsuite/Makefile.in: Regenerate.
9809 * testsuite/final_layout.cc: New file.
9810 * testsuite/final_layout.sh: New file.
9811
3537c84b
RÁE
98122010-06-01 Rafael Espindola <espindola@google.com>
9813
9814 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9815
105b6afd
RÁE
98162010-06-01 Rafael Espindola <espindola@google.com>
9817
9818 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9819 visibility of symbols.
9820
29e11421
DK
98212010-05-27 Doug Kwan <dougkwan@google.com>
9822
9823 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9824 from start of output section instead of address for a local symbol
9825 in a merged or relaxed section when doing a relocatable link.
9826
5e0f337e
RÁE
98272010-05-26 Rafael Espindola <espindola@google.com>
9828
703d02da 9829 PR 11604
5e0f337e
RÁE
9830 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9831 adding sections the garbage collector removed.
9832 * gold/testsuite/Makefile.am: Add test.
9833 * gold/testsuite/Makefile.in: Regenerate.
9834 * gold/testsuite/plugin_test_7.sh: New.
9835 * gold/testsuite/plugin_test_7_1.c: New.
9836 * gold/testsuite/plugin_test_7_2.c: New.
9837
f4187277
RÁE
98382010-05-26 Rafael Espindola <espindola@google.com>
9839
9840 * script-sections.cc (Output_section_definition::set_section_addresses):
9841 Check for --section-start.
9842
5c388529
DK
98432010-05-26 Doug Kwan <dougkwan@google.com>
9844
9845 * arm.cc (Arm_scan_relocatable_relocs): New class.
9846 (Target_arm::relocate_special_relocatable): New method.
9847 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9848 (Arm_relocate_functions::thumb_branch_common): Same.
9849 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9850 instead of Default_scan_relocatable_relocs.
9851 * target-reloc.h (relocate_for_relocatable): Let target handle
9852 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9853 * target.h (Sized_target::relocate_special_relocatable): New method.
9854
bca1c3ae
ILT
98552010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9856
9857 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9858
0439c796
DK
98592010-05-23 Doug Kwan <dougkwan@google.com>
9860
9861 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9862 instead of a cast.
9863 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9864 with a direct branch, not a conditional branch, to a stub.
9865 * merge.cc (Output_merge_base::record_input_section): New method
9866 defintion.
9867 (Output_merge_data::do_add_input_section): Record input section if
9868 keeps-input-sections flag is set.
9869 (Output_merge_string::do_add_input_section): Ditto.
9870 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9871 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9872 INPUT_SECTIONS_.
9873 (Output_merge_base::keeps_input_sections,
9874 Output_merge_base::set_keeps_input_sections,
9875 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9876 method definitions.
9877 (Output_merge_base::Input_sections): New type declaration.
9878 (Output_merge_base::input_sections_begin,
9879 Output_merge_base::input_sections_end,
9880 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9881 (Output_merge_base::bool keeps_input_sections_,
9882 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9883 Output_merge_base::input_sections_): New data members.
9884 (Output_merge_data::do_set_keeps_input_sections): New method
9885 defintion.
9886 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9887 * output.cc (Output_section::Input_section::relobj): Move method
9888 defintion from class declaration to here and handle merge sections.
9889 (Output_section::Input_section::shndx): Ditto.
9890 (Output_section::Output_section): Remove initializations of removed
9891 data members and initialize new data member LOOKUP_MAPS_.
9892 (Output_section::add_input_section): Set keeps-input-sections flag
9893 for a newly created merge output section as appropriate. Adjust code
9894 to use Output_section_lookup_maps class.
9895 (Output_section::add_relaxed_input_section): Adjst code for lookup
9896 maps code refactoring.
2e702c99 9897 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9898 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9899 class. If adding input section to a newly created merge output
9900 section fails, remove the new merge section.
9901 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9902 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9903 (Output_section::find_merge_section): Ditto.
0439c796 9904 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9905 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9906 Output_section_lookup_maps class.
9907 (Output_section::get_input_sections): Export merge sections. Adjust
9908 code to use Output_section_lookup_maps class.
9909 (Output_section:::add_script_input_section): Adjust code to use
9910 Output_section_lookup_maps class. Update lookup maps for merge
9911 sections also.
9912 (Output_section::discard_states): Use Output_section_lookup_maps.
9913 (Output_section::restore_states): Same.
9914 * output.h (Merge_section_properties): Move class defintion out of
9915 Output_section.
9916 (Output_section_lookup_maps): New class.
9917 (Output_section::Input_section::is_merge_section): New method
9918 defintion.
9919 (Output_section::Input_section::relobj): Move defintion out of class
9920 defintion. Declare method only.
9921 (Output_section::Input_section::shndx): Ditto.
9922 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9923 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9924 (Output_section::Merge_section_by_properties_map,
9925 Output_section::Output_section_data_by_input_section_map,
9926 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9927 Remove types.
2e702c99 9928 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9929 KEEPS_INPUT_SECTIONS.
9930 (Output_section::build_lookup_maps): New method declaration.
9931 (Output_section::merge_section_map_,
9932 Output_section::merge_section_by_properties_map_,
9933 Output_section::relaxed_input_section_map_,
9934 Output_section::is_relaxed_input_section_map_valid_): Remove data
9935 members.
9936 (Output_section::lookup_maps_): New data member.
9937
76295588
L
99382010-05-21 Doug Kwan <dougkwan@google.com>
9939
9940 PR gold/11619
9941 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9942 avoid a compilation error.
9943
d103a984
RÁE
99442010-05-19 Rafael Espindola <espindola@google.com>
9945
9946 * script-sections.cc (Output_section_definition::allocate_to_segment):
9947 Update the phdrs_list even when the output section is NULL.
9948 * testsuite/Makefile.am: Add test.
9949 * testsuite/Makefile.in: Regenerate.
9950 * testsuite/script_test_9.cc: New.
9951 * testsuite/script_test_9.sh: New.
9952 * testsuite/script_test_9.t: New.
9953
6625d24e
DK
99542010-05-19 Doug Kwan <dougkwan@google.com>
9955
9956 * arm.cc (Arm_input_section::original_size): New method.
9957 (Arm_input_section::do_addralign): Add a cast.
9958 (Arm_input_section::do_output_offset): Remove static cast.
9959 (Arm_input_section::original_addralign,
9960 Arm_input_section::original_size_): Change type to uint32_t.
9961 (Arm_input_section::init): Add safe casts for section alignment
9962 and size.
9963 (Arm_input_section::set_final_data_size): Do not set address and
9964 offset of stub table.
9965 (Arm_output_section::fix_exidx_coverage): Change use of of
9966 Output_section::Simple_input_section to that of
9967 Output_section::Input_section.
9968 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9969 except for the first pass.
9970 * output.cc (Output_section::get_input_sections): Change type of
9971 input_sections to std::list<Input_section>.
9972 (Output_section::add_script_input_section): Rename from
9973 Output_section::add_simple_input_section. Change type of SIS
9974 parameter from Simple_input_section to Input_section.
9975 * output.h (Output_section::Simple_input_section): Remove class.
9976 (Output_section::Input_section): Change class visibility to public.
9977 (Output_section::Input_section::addralign): Use stored alignments
9978 for special input sections if set.
9979 (Output_section::Input_section::set_addralign): New method.
9980 (Output_section::get_input_sections): Change parameter type from
9981 list of Simple_input_section to list of Input_section.
9982 (Output_section::add_script_input_section): Rename from
9983 Output_section::add_simple_input_section. Change first parameter's
9984 type from Simple_input_section to Input_section and remove the
9985 second and third parameters.
9986 * script-sections.cc (Input_section::Input_section_list): Change
9987 type to list of Output_section::Input_section/
9988 (Input_section_info::Input_section_info): Change parameter type of
9989 INPUT_SECTION to Output_section::Input_section.
9990 (Input_section_info::input_section): Change return type.
9991 (Input_section_info::input_section_): Change type to
9992 Output_section::Input_section.
9993 (Output_section_element_input::set_section_addresses): Adjust code
9994 to use Output_section::Input_section instead of
9995 Output_section::Simple_input_section. Adjust code for renaming
9996 of Output_section::add_simple_input_section.
9997 (Orphan_output_section::set_section_addresses): Ditto.
9998
e1e82ea4
RW
99992010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10000
10001 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10002 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10003
91e75c8a
RÁE
100042010-05-18 Rafael Espindola <espindola@google.com>
10005
10006 * options.cc (General_options::finalize): Handle -nostdlib.
10007 * options.h (nostdlib): New option.
10008 * script.cc (script_add_search_dir): Handle -nostdlib.
10009
da59ad79
DK
100102010-05-12 Doug Kwan <dougkwan@google.com>
10011
10012 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10013 attributes section only if there no attributes section after merging.
10014 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10015 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10016 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10017 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10018 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10019 and arm_attr_merge_7.stdout.
10020 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10021 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10022 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10023 arm_attr_merge_7b.o): New rules.
10024 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10025 arm_attr_merge_7
10026 * testsuite/Makefile.in: Regenerate.
10027 * testsuite/arm_attr_merge.sh: New file.
10028 * testsuite/arm_attr_merge_[67][ab].s: Same.
10029
3e01a7fd
NC
100302010-05-05 Nick Clifton <nickc@redhat.com>
10031
10032 * po/es.po: Updated Spanish translation.
10033
7ad2014a
L
100342010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10035
10036 * Makefile.am (install-exec-local): Properly install gold as
10037 default cross linker.
10038 * Makefile.in: Regenerated.
10039
4fda8867
NC
100402010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10041 Nick Clifton <nickc@redhat.com>
10042
10043 * configure.ac (install_as_default): Define and set to false
10044 unless --enable-gold or --enable-gold=both/gold has been
10045 specified.
10046 * configure: Regenerate.
10047
10048 * Makefile.am (install-exec-local): Install the executable as
10049 'ld.gold'. If install_as_default is true then also install it as
10050 'ld'.
10051 * Makefile.in: Regenerated.
10052
bd288ea2
ILT
100532010-04-24 Ian Lance Taylor <iant@google.com>
10054
10055 * layout.cc (Layout::layout_reloc): In relocatable link don't
10056 combine reloc sections for grouped sections.
10057
ef38fd8a
ST
100582010-04-23 Sriraman Tallam <tmsriram@google.com>
10059
10060 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10061 sections that are not ordinary to icf.
10062 * icf.cc (get_section_contents): Handle relocation pointing to section
10063 with no object or shndx information.
10064 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10065 * testsuite/Makefile.in: Regenerate.
10066 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10067 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10068
f6973bdc
ILT
100692010-04-22 Ian Lance Taylor <iant@google.com>
10070
10071 * expression.cc (Expression::Expression_eval_info): Add
10072 result_alignment_pointer field.
10073 (Expression::eval_with_dot): Add result_alignment_pointer
10074 parameter. Change all callers.
10075 (Expression::eval_maybe_dot): Likewise.
10076 (class Binary_expression): Add alignment_pointer parameter to
10077 left_value and right_value. Change all callers.
10078 (BINARY_EXPRESSION): Set result alignment.
10079 (class Trinary_expression): Add alignment_pointer parameter to
10080 arg2_value and arg3_value. Change all callers.
10081 (Trinary_cond::value): Set result alignment.
10082 (Max_expression::value, Min_expression::value): Likewise.
10083 (Align_expression::value): Likewise.
10084 * script-sections.cc (class Sections_element): Add dot_alignment
10085 parameter to set_section_addresses virtual function. Update
10086 instantiations.
10087 (class Output_section_element): Likewise.
10088 (Script_sections::create_segments): Add dot_alignment parameter.
10089 Change all callers.
10090 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10091 (Script_sections::set_phdrs_clause_addresses): Likewise.
10092 * script-sections.h: Update declarations.
10093 * script.h: Update declarations.
10094 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10095 min_p_align.
10096 * testsuite/script_test_3.t: Set large alignment.
10097 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10098 segment has expected alignment.
10099
9c9c98a5
NC
101002010-04-22 Nick Clifton <nickc@redhat.com>
10101
10102 * po/gold.pot: Updated by the Translation project.
10103 * po/vi.po: Updated Vietnamese translation.
10104
2253bfba
L
101052010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10106
10107 * testsuite/Makefile.am (check_PROGRAMS): Add
10108 icf_virtual_function_folding_test.
10109 * testsuite/Makefile.in: Regenerated.
10110
85fdf906
AH
101112010-04-15 Andrew Haley <aph@redhat.com>
10112
10113 * options.h (merge_exidx_entries): New option.
10114 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10115 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10116 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10117 (Target_arm::merge_exidx_entries): New function.
10118 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10119 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10120 to Arm_exidx_fixup constructor.
10121 Add new arg, merge_exidx_entries.
10122 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10123 Arm_output_section::fix_exidx_coverage.
10124
ce97fa81
ST
101252010-04-18 Sriraman Tallam <tmsriram@google.com>
10126
10127 * icf.cc (get_section_contents): Check for preemptible functions.
10128 Ignore addend when appropriate.
10129 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10130 section folded.
10131 (add_from_relobj): Check for section folded.
10132 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10133 * symtab.h (should_add_dynsym_entry): Add new parameter.
10134 * target-reloc.h (scan_relocs): Check for section folded.
10135 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10136 Check reloc types for function pointers in shared objects.
10137 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10138 case.
10139 (icf_preemptible_functions_test): New test case.
10140 (icf_string_merge_test): New test case.
10141 * testsuite.Makefile.in: Regenerate.
10142 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10143 bar_glob. Refactor code.
10144 * testsuite/icf_preemptible_functions_test.cc: New file.
10145 * testsuite/icf_preemptible_functions_test.sh: New file.
10146 * testsuite/icf_string_merge_test.cc: New file.
10147 * testsuite/icf_string_merge_test.sh: New file.
10148 * testsuite/icf_virtual_function_folding_test.cc: New file.
10149 * testsuite/icf_virtual_function_folding_test.sh: New file.
10150
04ceb17c
DK
101512010-04-14 Doug Kwan <dougkwan@google.com>
10152
10153 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10154 for local symbol recounting if we remove a section due to ICF.
10155 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10156 there are no regular objects in input.
10157
153e7da4
DK
101582010-04-13 Doug Kwan <dougkwan@google.com>
10159
10160 * arm.cc (Arm_input_section::set_final_data_size): Compute
10161 accurate final data size instead of using current data size.
10162
4dbd9faf
DK
101632010-04-09 Doug Kwan <dougkwan@google.com>
10164
10165 * layout.cc (Layout::choose_output_section): Handle script section
10166 types.
10167 (Layout::make_output_section_for_script): Add section type parameter.
10168 Handle script section types.
10169 * layout.h (Layout::make_output_section_for_script): Add section
10170 type parameter.
10171 * output.cc (Output_section::Output_section): Initialize data member
10172 is_noload_.
10173 (Output_section::do_reset_address_and_file_offset): Do not set address
10174 to 0 if section is a NOLOAD section.
10175 * output.h (Output_section::is_noload): New method.
10176 (Output_section::set_is_noload): Ditto.
10177 (Output_section::is_noload_): New data member.
10178 * script-c.h (Script_section_type): New enum type.
10179 (struct Parser_output_section_header): Add new file section_type.
10180 * script-sections.cc (Sections_element::output_section_name): Add
10181 parameter for returning script section type.
10182 (Output_section_definition::output_section_name): Ditto.
10183 (Output_section_definition::section_type)P; New method.
10184 (Output_section_definiton::script_section_type_name): Ditto.
10185 (Output_section_definition::script_section_type_): New data member.
10186 (Output_section_definition::Output_section_definition): Initialize
10187 data member Output_section_definition::script_section_type_.
10188 (Output_section_definition::create_sections): Pass script section type
10189 to Layout::make_output_section_for_script.
10190 (Output_section_definition::output_section_name): Return script
10191 section type to caller.
10192 (Output_section_definition::set_section_address): Do not advance
10193 dot value and load address if section type is NOLOAD. Set address
10194 of NOLOAD sections regardless of section flags.
10195 (Output_section_definition::print): Print section type if it is
10196 not SCRIPT_SECTION_TYPE_NONE.
10197 (Output_section_definition::section_type): New method.
10198 (Output_section_definition::script_section_type_name): Ditto.
10199 (Script_sections::output_section_name): Add new parameter
10200 PSECTION_TYPE for returning script section type. Pass it to
10201 section elements. Handle discard sections.
10202 (Sort_output_sections::operator()): Handle NOLOAD sections.
10203 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10204 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10205 returning script section type.
10206 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10207 INFO and NOLOAD.
10208 * yyscript.y (union): Add new field SECTION_TYPE.
10209 (COPY, DSECT, INFO, NOLOAD): New tokens.
10210 (opt_address_and_section_type): Change type to output_section_header.
10211 (section_type): New non-terminal
10212 (section_header): Handle section type.
2253bfba 10213 (opt_address_and_section_type): Return section type value.
4dbd9faf 10214
721ea635
L
102152010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10216
10217 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10218 * testsuite/plugin_common_test_2.c (foo): Likewise.
10219
6bf924b0
DK
102202010-04-08 Doug Kwan <dougkwan@google.com>
10221
10222 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10223 Output_merge_data.
10224 * output.cc (Output_section::add_merge_input_section): Simplify
10225 code and return status of Output_merge_base::add_input_section.
e1df38aa 10226 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10227 returns true.
10228
24af6f92
DK
102292010-04-07 Doug Kwan <dougkwan@google.com>
10230
10231 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10232 if section is marked as containing instructions but has no mapping
10233 symbols.
10234 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10235 correct section index.
10236 (Arm_relobj::find_linked_text_section): Ditto.
10237
00698fc5
CC
102382010-04-07 Cary Coutant <ccoutant@google.com>
10239
10240 * archive.cc (include_member): Destroy Read_symbols_data object before
10241 releasing file.
10242 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10243 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10244 (Read_symbols_data::~Read_symbols_data) New destructor.
10245 (Section_relocs::Section_relocs) New constructor.
10246 (Section_relocs::~Section_relocs) New destructor.
10247 (Read_relocs_data::Read_relocs_data) New constructor.
10248 (Read_relocs_data::~Read_relocs_data) New destructor.
10249 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10250 pointers to NULL after deleting.
10251
7296d933
DK
102522010-04-07 Doug Kwan <dougkwan@google.com>
10253
10254 * arm.cc: Replace "endianity" with "endianness" in comments.
10255 (Arm_exidx_cantunwind): Ditto.
10256 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10257 (Arm_relobj::merge_flags_and_attributes): New method.
10258 (Arm_relobj::merge_flags_and_attributes_): New data member.
10259 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10260 (Arm_relobj::scan_sections_for_stubs): Ditto.
10261 (Arm_relobj::do_read_symbols): Check to see if we really want to
10262 merge processor-specific flags and attributes. Exit early if
10263 an object is empty except for section names and the undefined symbol.
10264 (Target_arm::do_finalize_sections): Move check for ELF format to
10265 Arm_relobj::do_read_symbols. Merge processor specific flags and
10266 attributes from a regular object only when we have determined that
10267 it is aapropriate. Do not create an .ARM.attributes section in
10268 output if there is no regular input object.
10269 (Target_arm::merge_processor_specific_flags): Check
10270 --warn-mismatch before printing any error.
10271 (Target_arm::merge_object_attributes): Ditto.
10272 * gold.cc (queue_middle_tasks): Handle the case in which there is
10273 no regular object in input.
10274 * options.cc (General_options::parse_EB): New method.
10275 (General_options::parse_EL): Same.
10276 (General_options::General_options): Initialize endianness_.
10277 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10278 New options.
10279 (General_options::Endianness): New enum.
10280 (General_options::endianness): New method.
10281 (General_options::endianness_): New data member.
10282 * parameters.cc (Parameters::set_options): Check target endianness.
10283 (Parameters::set_target_once): Ditto.
10284 (Parameters::check_target_endianness): New method.
10285 (parameters_force_valid_target): If either -EL or -EB is specified,
10286 use it to define endianness of default target.
10287 * parameters.h (Parameters::check_target_endianness): New method
10288 declaration.
10289 * target.h (class Target): Change "endianity" to "endianness"
10290 in comments.
10291
efc8d4f2
RW
102922010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10293
10294 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10295 * configure: Regenerate.
10296 * Makefile.in: Regenerate.
10297 * testsuite/Makefile.in: Regenerate.
10298
be234d88
CC
102992010-04-06 Cary Coutant <ccoutant@google.com>
10300
10301 gcc PR lto/42757
10302 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10303 prevailing definitions of common symbols.
10304 * testsuite/plugin_test_6.sh: New test case.
10305 * testsuite/plugin_common_test_1.c: New test case.
10306 * testsuite/plugin_common_test_2.c: New test case.
10307 * testsuite/Makefile.am (plugin_test_6): New test case.
10308 * testsuite/Makefile.in: Regenerate.
10309
bd32c6bd
NC
103102010-04-06 Nick Clifton <nickc@redhat.com>
10311
10312 * po/vi.po: New Vietnamese translation.
10313
323c532f
DK
103142010-03-30 Doug Kwan <dougkwan@google.com>
10315
10316 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10317
4fcd97eb
DK
103182010-03-25 Doug Kwan <dougkwan@google.com>
10319
10320 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10321 to avoid a conversion warning on a 32-bit host.
10322
4ebf39db
ILT
103232010-03-24 Ian Lance Taylor <iant@google.com>
10324
10325 * testsuite/script_test_3.t: Add a TLS segment.
10326 * testsuite/Makefile.am (check_PROGRAMS): Add
10327 tls_phdrs_script_test.
10328 (tls_phdrs_script_test_SOURCES): Define.
10329 (tls_phdrs_script_test_DEPENDENCIES): Define.
10330 (tls_phdrs_script_test_LDFLAGS): Define.
10331 (tls_phdrs_script_test_LDADD): Define.
10332 * testsuite/Makefile.in: Rebuild.
10333
4a599bdd
CC
103342010-03-23 Cary Coutant <ccoutant@google.com>
10335
10336 * fileread.cc (find_or_make_view): Fix comment.
10337
6c93b22c
ILT
103382010-03-23 Ian Lance Taylor <iant@google.com>
10339
10340 * script-sections.cc (class Orphan_section_placement): Define
10341 PLACE_TLS and PLACE_TLS_BSS.
10342 (Orphan_section_placement::Orphan_section_placement): Initialize
10343 new places.
10344 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10345 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10346 (tls_script_test_SOURCES): Define.
10347 (tls_script_test_DEPENDENCIES): Define.
10348 (tls_script_test_LDFLAGS): Define.
10349 (tls_script_test_LDADD): Define.
10350 * testsuite/Makefile.in: Rebuild.
10351
a2c7281b
DK
103522010-03-22 Doug Kwan <dougkwan@google.com>
10353
10354 * arm.cc (Arm_relocate_functions::abs8,
10355 Arm_relocate_functions::abs16): Use correct check for overflow
10356 specified in the ARM ELF specs.
10357 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10358 target of a BLX instruction specially.
10359 (Reloc_stub::stub_type_for_reloc): Ditto.
10360 (Relocate::relocate): Use symbolic names instead of numeric relocation
10361 codes to report error.
10362 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10363 workaround.
10364 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10365 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10366 thumb2_blx_out_of_range.stdout
10367 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10368 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10369 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10370 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10371 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10372 thumb2_blx_in_range, thumb2_blx_in_range.o,
10373 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10374 thumb2_blx_out_of_range.o): New rules.
2e702c99 10375 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10376 thumb2_blx_in_range and thumb2_blx_out_of_range.
10377 * testsuite/Makefile.in: Regenerate.
10378 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10379 * testsuite/thumb_blx_in_range.s: New file.
10380 * testsuite/thumb_blx_out_of_range.s: New file.
10381
b0193076
RÁE
103822010-03-22 Rafael Espindola <espindola@google.com>
10383
10384 * archive.cc (Should_include): Move to archive.h.
10385 (should_include_member): Make it a member of Archive.
10386 (Lib_group): New.
10387 (Add_lib_group_symbols): New.
10388 * archive.h: Include options.h.
10389 (Archive_member): Moved from Archive.
10390 (Should_include): Moved from archive.cc.
10391 (Lib_group): New.
10392 (Add_lib_group_symbols): New.
10393 * dynobj.cc (do_should_include_member): New.
10394 * dynobj.h (do_should_include_member): New.
10395 * gold.cc (queue_initial_tasks): Update call to queue.
10396 * main.cc (main): Print lib group stats.
10397 * object.cc (do_should_include_member): New.
10398 * object.h: Include archive.h.
10399 (Object::should_include_member): New.
10400 (Object::do_should_include_member): New.
10401 (Sized_relobj::do_should_include_member): New.
10402 * options.cc (General_options::parse_start_lib): New.
10403 (General_options::parse_end_lib): New.
10404 (Input_arguments::add_file): Handle lib groups.
10405 (Input_arguments::start_group): Check we are not in a lib.
10406 (Input_arguments::start_lib): New.
10407 (Input_arguments::end_lib): New.
10408 * options.h (General_options): Add start_lib and end_lib.
10409 (Input_argument::lib_): New.
10410 (Input_argument::lib): New.
10411 (Input_argument::is_lib): New.
10412 (Input_file_lib): New.
10413 (Input_arguments::in_lib_): New.
10414 (Input_arguments::in_lib): New.
10415 (Input_arguments::start_lib): New.
10416 (Input_arguments::end_lib_): New.
10417 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10418 in unused members as preempted.
10419 (Sized_pluginobj::do_should_include_member): New.
10420 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10421 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10422 return the blocker.
10423 (Read_symbols::do_whole_lib_group): New.
10424 (Read_symbols::do_lib_group): New.
10425 (Read_symbols::do_read_symbols): Handle lib groups.
10426 (Read_symbols::get_name): Handle lib groups.
10427 * readsyms.h (Read_symbols): Add an archive member pointer.
10428 (Read_symbols::do_whole_lib_group): New.
10429 (Read_symbols::do_lib_group): New.
10430 (Read_symbols::member_): New.
10431 * script.cc (read_input_script): Update call to queue_soon.
10432
d099120c
DK
104332010-03-19 Doug Kwan <dougkwan@google.com>
10434
10435 * arm.cc (Stub_table::Stub_table): Initialize new data members
10436 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10437 (Stub_table::add_reloc_stub): Assign stub offset and update
10438 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10439 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10440 New data members.
2e702c99 10441 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10442 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10443 instead of going over all reloc stubs.
2e702c99 10444 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10445 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10446 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10447 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10448 Stringpool_template::offset_.
10449 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10450 Stringpool_template::offset_ to zero.
10451
1aa37384
DK
104522010-03-15 Doug Kwan <dougkwan@google.com>
10453
10454 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10455 offset_.
10456 (Stringpool_template::new_key_offset): New method.
10457 (Stringpool_template::add_string): Assign offsets when adding new
10458 strings.
10459 (Stringpool_template::set_string_offsets): Do not set string offsets
10460 when not optimizing.
10461 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10462 member size_.
2e702c99
RM
10463 (Chunked_vector::clear): Clear size_.
10464 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10465 (Chunked_vector::size): Return size_.
10466 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10467 (Chunked_vector::size_): New data member.
1aa37384
DK
10468 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10469 (Stringpool_template::new_key_offset): New method declaration.
10470 (Stringpool_template::offset_): New data member.
10471
b672b057
RÁE
104722010-03-15 Rafael Espindola <espindola@google.com>
10473
10474 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10475 Add_symbols' constructor.
10476 * readsyms.h (Add_symbols): Remove the input_group member.
10477
b6848d3c
ILT
104782010-03-10 Ian Lance Taylor <iant@google.com>
10479
10480 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10481 target to ask whether a reference to a symbol requires a stack
10482 split.
10483 * target.h (Target::is_call_to_non_split): New function.
10484 (Target::do_is_call_to_non_split): Declare virtual function.
10485 * target.cc: Include "symtab.h".
10486 (Target::do_is_call_to_non_split): New function.
10487 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10488
a2a5469e
CC
104892010-03-10 Cary Coutant <ccoutant@google.com>
10490
10491 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10492 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10493 (File_read::open[2]): Add whole_file_view_ to list of views.
10494 (File_read::make_view): Remove test of whole_file_view_.
10495 (File_read::find_or_make_view): Create whole_file_view_ if
10496 necessary.
10497 (File_read::clear_views): Replace bool parameter with enum;
10498 adjust all callers. Don't delete views with permanent data;
10499 do delete cached views and views from archives if
10500 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10501 if clearing the corresponding view.
10502 * fileread.h (File_read::Clear_views_mode): New enum.
10503 (File_read::View::is_permanent_view): New method.
10504 (File_read::clear_views): Replace bool parameter
10505 with enum; adjust all callers.
10506 * options.h (General_options): Change keep_files_mapped option;
10507 add map_whole_files.
10508 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10509 releasing the file.
10510 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10511 the file.
10512
8861f32b
DM
105132010-03-10 David S. Miller <davem@davemloft.net>
10514
10515 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10516
d62d0f5f
ST
105172010-03-09 Sriraman Tallam <tmsriram@google.com>
10518
10519 * icf.cc (get_section_contents): Add '@' marker after processing the
10520 merge reloc.
10521
9177756d
DK
105222010-03-08 Doug Kwan <dougkwan@google.com>
10523
10524 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10525 due to a conversion warning.
10526 (Arm_relobj::update_output_local_symbol_count): Check for local
10527 symbol with unset output index.
10528
9e9e071b
ILT
105292010-03-05 Ian Lance Taylor <iant@google.com>
10530
10531 * options.h (class General_options): Add --spare-dynamic-tags.
10532 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10533 --spare-dynamic-tags.
10534
a81ee015
ILT
105352010-03-05 Ian Lance Taylor <iant@google.com>
10536
10537 * incremental.cc: Include "libiberty.h".
10538
44ec90b9
RO
105392010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10540
10541 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10542 function, is_info_ member.
10543 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10544 (Versions::Versions): Update caller.
10545 (Versions::define_base_version): Likewise.
10546 (Versions::add_def): Likewise.
10547
0897ed3b
ST
105482010-03-03 Sriraman Tallam <tmsriram@google.com>
10549
10550 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10551 (Scan::possible_function_pointer_reloc): New function.
10552 (Scan::local_reloc_may_be_function_pointer): Change to call
10553 possible_function_pointer_reloc.
10554 (Scan::global_reloc_may_be_function_pointer): Ditto.
10555 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10556 relocations in ".data.rel.ro._ZTV" section.
10557 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10558 * testsuite/icf_safe_so_test.cc: Ditto.
10559 * testsuite/icf_safe_test.cc: Ditto.
10560 * testsuite/icf_safe_test.sh: Ditto.
10561
d3bbad62
ILT
105622010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10563 Ian Lance Taylor <iant@google.com>
10564
10565 * target-reloc.h (relocate_section): Check the symbol table index
10566 for -1U before setting the local symbol index.
10567 (scan_relocatable_relocs): If copying the relocation, record that
10568 the local symbol is required.
10569 * object.h (Symbol_value::is_output_symtab_index_set): New
10570 function.
10571 (Symbol_value::may_be_discarded_from_output_symtab): New
10572 function.
10573 (Symbol_value::has_output_symtab_entry): New function.
10574 (Symbol_value::needs_output_symtab_entry): Remove.
10575 (Symbol_value::output_symtab_index): Make sure the symbol index is
10576 set.
10577 (Symbol_value::set_output_symtab_index): Make sure the symbol
10578 index is not set. Make sure the new index is valid.
10579 (Symbol_value::set_must_have_output_symtab_entry): New function.
10580 (Symbol_value::has_output_dynsym_entry): New function.
10581 (Symbol_value::set_output_dynsym_index): Make sure the new index
10582 is valid.
10583 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10584 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10585 local symbol if permitted.
10586 (Sized_relobj::do_finalize_local_symbols): Call
10587 is_output_symtab_index_set rather than needs_output_symtab_entry.
10588 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10589 rather than needs_output_symtab_entry. Call
10590 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10591 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10592 is_output_symtab_index_set rather than needs_output_symtab_entry.
10593 * testsuite/discard_locals_relocatable_test.c: New file.
10594 * testsuite/discard_locals_test.sh: Test -r.
10595 * testsuite/Makefile.am (check_DATA): Add
10596 discard_locals_relocatable_test1.syms,
10597 discard_local_relocatable_test2.syms.
10598 (MOSTLYCLEANFILES): Likewise. Also add
10599 discard_locals_relocatable_test1.lout and
10600 discard_locals_relocatable_test2.out.
10601 (discard_locals_relocatable_test1.syms): New target.
10602 (discard_locals_relocatable_test.o): New target.
10603 (discard_locals_relocatable_test1.out): New target.
10604 (discard_locals_relocatable_test2.syms): New target.
10605 (discard_locals_relocatable_test2.out): New target.
10606 (various): Add missing ../ld-new dependencies.
10607 * testsuite/Makefile.in: Rebuild.
10608
7e8ccf26
NC
106092010-03-03 Nick Clifton <nickc@redhat.com>
10610
10611 * po/fi.po: New Finnish translation.
10612
2a0ff005
DK
106132010-03-01 Doug Kwan <dougkwan@google.com>
10614
10615 * layout.cc (Layout::Layout): Force section types of .init_array*,
10616 .preinit_array* and .fini_array* sections.
10617 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10618 Fix check of return value of std::string::find.().
10619 (Output_section::Input_section_sort_compare::operator()): Remove
10620 comment about .init_array.
10621 (Output_section::Input_section_sort_init_fini_compare::operator()):
10622 New method.
10623 (Output_section::sort_attached_input_sections): Handle .init_array
10624 and .fini_array specially.
10625 * output.h (Output_section::Inut_section_sort_compare): Update
10626 comment.
10627 (Output_section::Input_section_sort_init_fini_compare): New struct.
10628
c3e4ae29
DK
106292010-02-26 Doug Kwan <dougkwan@google.com>
10630
10631 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10632 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10633 * testsuite/debug_msg.sh: Avoid matching source line number for
10634 use of global variable undef_int.
10635
2fd9ae7a
DK
106362010-02-26 Doug Kwan <dougkwan@google.com>
10637
10638 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10639 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10640 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10641 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10642 * options.cc (General_options::General_options): Initialize member
10643 fix_v4bx_.
10644 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10645 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10646 and rm_no_fix_v4bx.stdout
10647 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10648 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10649 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10650 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10651 and arm_no_fix_v4bx.
10652 * Makefile.in: Regenerate.
10653 * testsuite/arm_fix_v4bx.s: New file.
10654 * testsuite/arm_fix_v4bx.sh: Ditto.
10655
67ec7d0b
DK
106562010-02-24 Doug Kwan <dougkwan@google.com>
10657
10658 * arm.cc (Target_arm::got_section): Make the .got section the first
10659 non RELRO section in the data segment.
10660 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10661 suffixes of section names.
10662
10165461
DK
106632010-02-24 Doug Kwan <dougkwan@google.com>
10664
10665 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10666 flags and attributes merging if an input file is a binary file.
10667 * fileread.cc (Input_file::open): Record format of original file.
10668 * fileread.h (Input_file::Format): New enum type.
2e702c99 10669 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10670 (Input_file::format): New method definition.
10671 (Input_file::format_):: New data member.
10672
4a54abbb
DK
106732010-02-24 Doug Kwan <dougkwan@google.com>
10674
10675 * arm.cc (Arm_output_data_got): New class.
10676 (ARM_TCB_SIZE): New constant
10677 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10678 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10679 If user uses a script with a SECTIONS clause, issue only a warning
10680 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10681 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10682 garbage collection.
10683 (Target_arm::got_mode_index_entry): Handle static linking.
10684 (Target_arm::Scan::local): Ditto.
10685 (Target_arm::Scan::global): Ditto.
10686 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10687 all incorrectly implemented relocations.
e1df38aa 10688 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10689 Arm_output_section::fix_exidx_coverage.
10690 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10691 from ".ARM.exidx." and ".ARM.extab.".
10692
ca419a6f
ILT
106932010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10694
10695 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10696 section if it does not already exist.
10697 * attributes.cc (Attributes_section_data::Attributes_section_data):
10698 Don't crash if size is zero.
10699
135b9c78
ILT
107002010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10701 Ian Lance Taylor <iant@google.com>
10702
10703 * gold.cc (queue_middle_tasks): If no input files were opened,
10704 exit.
10705 * workqueue.h (Task_function::Task_function): Assert that there is
10706 a blocker.
10707
bb0bfe4f
DK
107082010-02-22 Doug Kwan <dougkwan@google.com>
10709
10710 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10711 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10712 types to avoid warnings due to different uint64_t implementations
10713 on different hosts.
10714
2a2b6d42
DK
107152010-02-21 Doug Kwan <dougkwan@google.com>
10716
10717 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10718 handling of the maximum backward branch offset.
2e702c99 10719 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10720 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10721 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10722 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10723 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10724 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10725 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10726 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10727 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10728 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10729 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10730 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10731 thumb2_bl_out_of_range.o): New rules.
10732 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10733 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10734 thumb2_bl_out_of_range
10735 * testsuite/Makefile.in: Regenerate.
10736 * testsuite/arm_bl_in_range.s: New file.
10737 * testsuite/arm_bl_out_of_range.s: Ditto.
10738 * testsuite/arm_branch_in_range.sh: Ditto.
10739 * testsuite/arm_branch_range.t: Ditto.
10740 * testsuite/thumb2_branch_range.t: Ditto.
10741 * testsuite/thumb_bl_in_range.s: Ditto.
10742 * testsuite/thumb_bl_out_of_range.s: Ditto.
10743 * testsuite/thumb_branch_range.t: Ditto.
10744
b487ad64
ST
107452010-02-20 Sriraman Tallam <tmsriram@google.com>
10746
10747 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10748 Add reloc offset information.
10749 * icf.cc (get_section_contents): Change iterators to point to the new
10750 vectors. Add reloc offset information to the contents.
10751 * icf.h (Icf::Sections_reachable_info): New typedef.
10752 (Icf::Sections_reachable_list): New typedef.
10753 (Icf::Offset_info): New typedef.
10754 (Icf::Reloc_info): New struct typedef.
10755 (Icf::Reloc_info_list): New typedef.
10756 (Icf::symbol_reloc_list): Delete method.
10757 (Icf::addend_reloc_list): Delete method.
10758 (Icf::section_reloc_list): Delete method.
10759 (Icf::reloc_info_list): New method.
10760 (Icf::reloc_info_list_): New member.
10761
f96accdf
DK
107622010-02-19 Doug Kwan <dougkwan@google.com>
10763
10764 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10765 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10766 * arm.cc (Arm_relocation_functions): New forward declaration.
10767 (Target_arm::Target_arm): Initialize new data members
10768 got_mod_index_offset_ and tls_base_symbol_defined_.
10769 (Target_arm::Relocate::relocate_tls): New method.
10770 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10771 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10772 New methods.
2e702c99 10773 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10774 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10775 (Target_arm::got_mod_index_offset_,
10776 Target_arm::tls_base_symbol_defined_): New data members.
10777 (Target_arm::Scan::local, Target::Scan::global,
10778 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10779 relocations.
10780
c8761b9a
DK
107812010-02-18 Doug Kwan <dougkwan@google.com>
10782
10783 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10784 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10785 text section as a parameter becuase some broken tools may not set
10786 the link in section header.
10787 (Target_arm::has_got_section): New method.
10788 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10789 without any mapping symbol as data only. Remove warning.
10790 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10791 link in its section header, try to discover the link by inspecting the
10792 REL31 relocation at the beginning of the section.
10793 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10794 in error message.
10795 (Target_arm::Scan::global): Treat any reference to the symbol
10796 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10797
21bb3914
ST
107982010-02-12 Sriraman Tallam <tmsriram@google.com>
10799
10800 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10801 (Scan::global_reloc_may_be_function_pointer): New function.
10802 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10803 (Scan::global_reloc_may_be_function_pointer): New function.
10804 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10805 (Scan::global_reloc_may_be_function_pointer): New function.
10806 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10807 (Scan::global_reloc_may_be_function_pointer): New function.
10808 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10809 (Scan::global_reloc_may_be_function_pointer): New function.
10810 (Scan::possible_function_pointer_reloc): New function.
10811 (Target_x86_64::can_check_for_function_pointers): New function.
10812 * gc.h (gc_process_relocs): Scan relocation types to determine if
10813 function pointers were taken for targets that support it.
10814 * icf.cc (Icf::find_identical_sections): Include functions for
10815 folding in safe ICF whose pointer is not taken.
10816 * icf.h (Secn_fptr_taken_set): New typedef.
10817 (fptr_section_id_): New member.
10818 (section_has_function_pointers): New function.
10819 (set_section_has_function_pointers): New function.
10820 (check_section_for_function_pointers): New function.
10821 * options.h: Fix comment for safe ICF option.
10822 * target.h (can_check_for_function_pointers): New function.
10823 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10824 Modify icf_safe_test for X86-64.
10825 * testsuite/Makefile.in: Regenerate.
10826 * testsuite/icf_safe_so_test.cc: New file.
10827 * testsuite/icf_safe_so_test.sh: New file.
10828 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10829 (main): Change to take pointer to function kept_func_3.
10830 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10831 folding is done correctly for X86-64.
10832
0da6fa6c
DM
108332010-02-12 David S. Miller <davem@davemloft.net>
10834
10835 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10836 is_symbolless parameter.
10837 (Output_reloc<SHT_REL>::is_symbolless): New.
10838 (Output_reloc<SHT_REL>::is_symbolless_): New.
10839 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10840 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10841 (Output_reloc<SHT_RELA>::is_symbolless): New.
10842 (Output_data_reloc::add_global): Handle is_symbolless.
10843 (Output_data_reloc::add_global_relative): Likewise.
10844 (Output_data_reloc::add_local): Likewise.
10845 (Output_data_reloc::add_local_relative): Likewise.
10846 (Output_data_reloc::add_symbolless_global_addend): New.
10847 (Output_data_reloc::add_symbolless_local_addend): New.
10848 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10849 is_symbolless.
10850 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10851 instead of ->is_relative_
10852 (Output_reloc::write): Likewise.
10853 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10854 (Output_reloc::write_rel): Simplify.
10855
10856 * sparc.cc (Target_sparc::Scan::local): Use
10857 ->add_symbolless_local_addend as needed.
10858 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10859 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10860 based upon relocation offset.
10861
e4782e83
DK
108622010-02-11 Doug Kwan <dougkwan@google.com>
10863
10864 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10865 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10866 beginning of function.
10867 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10868 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10869 parameter is_32bit in calls to should_apply_static_reloc.
10870 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10871 (check_DATA): Add arm_abs_global.stdout.
10872 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10873 arm_abs_global.stdout): New rules.
10874 (MOSTLLYCLEANFILES): Add arm_abs_global
10875 * Makefile.in: Regenerate.
10876 * testsuite/arm_abs_global.s: New file.
10877 * testsuite/arm_abs_global.sh: Ditto.
10878 * testsuite/arm_abs_lib.s: Ditto.
10879
93ceb764
ILT
108802010-02-11 Ian Lance Taylor <iant@google.com>
10881
10882 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10883 Read_relocs task.
10884 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10885 Allocate_commons_task first.
10886 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10887 task, rather than symtab_lock_.
10888 (Gc_process_relocs::~Gc_process_relocs): New function.
10889 (Gc_process_relocs::is_runnable): Check this_blocker_.
10890 (Gc_process_relocs::locks): Use next_blocker_ rather than
10891 blocker_.
10892 (Scan_relocs::~Scan_relocs): New function.
10893 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10894 symtab_lock_.
10895 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10896 next_blocker_.
10897 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10898 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10899 constructor accordingly.
10900 (class Gc_process_relocs): Likewise.
10901 (class Scan_relocs): Likewise.
10902 * common.h (class Allocate_commons_task): Remove symtab_lock_
10903 field, and corresponding constructor parameter.
10904 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10905 symtab_lock_.
10906 (Allocate_commons_task::locks): Likewise.
10907
114dfbe1
ILT
109082010-02-11 Ian Lance Taylor <iant@google.com>
10909
10910 * gold-threads.h (class Once): Define.
10911 (class Initialize_lock): Rewrite as child of Once.
10912 * gold-threads.cc (class Once_initialize): Define.
10913 (once_pointer_control): New static variable.
10914 (once_pointer, once_arg): New static variables.
10915 (c_run_once): New static function.
10916 (Once::Once, Once::run_once, Once::internal_run): New functions.
10917 (class Initialize_lock_once): Remove.
10918 (initialize_lock_control): Remove.
10919 (initialize_lock_pointer): Remove.
10920 (initialize_lock_once): Remove.
10921 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10922 (Initialize_lock::initialize): Rewrite.
10923 (Initialize_lock::do_run_once): New function.
10924 * archive.cc (Archive::interpret_header): Only clear name if it is
10925 not already empty.
10926 * fileread.cc: Include "gold-threads.h"
10927 (file_counts_lock): New static variable.
10928 (file_counts_initialize_lock): Likewise.
10929 (File_read::release): Only increment counts when using --stats.
10930 Use a lock around the increment.
10931 * parameters.cc (class Set_parameters_target_once): Define.
10932 (set_parameters_target_once): New static variable.
10933 (Parameters::Parameters): Move here from parameters.h.
10934 (Parameters::set_target): Rewrite.
10935 (Parameters::set_target_once): New function.
10936 (Parameters::clear_target): Move here and rewrite.
10937 * parameters.h (class Parameters): Update declarations. Add
10938 set_parameters_target_once_ field.
10939 (Parameters::Parameters): Move to parameters.cc.
10940 (Parameters::clear_target): Likewise.
10941 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10942 task.
10943 (Start_group::~Start_group): New function.
10944 (Start_group::is_runnable): New function.
10945 (Start_group::locks, Start_group::run): New functions.
10946 (Finish_group::run): Change saw_undefined to size_t.
10947 * readsyms.h (class Start_group): Define.
10948 (class Finish_group): Change saw_undefined_ field to size_t.
10949 (Finish_group::Finish_group): Remove saw_undefined and
10950 this_blocker parameters. Change all callers.
10951 (Finish_group::set_saw_undefined): New function.
10952 (Finish_group::set_blocker): New function.
10953 * symtab.h (class Symbol_table): Change saw_undefined to return
10954 size_t. Change saw_undefined_ field to size_t.
10955 * target-select.cc (Set_target_once::do_run_once): New function.
10956 (Target_selector::Target_selector): Initialize set_target_once_
10957 field. Don't initialize lock_ and initialize_lock_ fields.
10958 (Target_selector::instantiate_target): Rewrite.
10959 (Target_selector::set_target): New function.
10960 * target-select.h (class Set_target_once): Define.
10961 (class Target_selector): Update declarations. Make
10962 Set_target_once a friend. Remove lock_ and initialize_lock_
10963 fields. Add set_target_once_ field.
10964
fa17a3f4
ILT
109652010-02-10 Ian Lance Taylor <iant@google.com>
10966
10967 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10968 queueing any tasks.
10969 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10970 (queue_middle_tasks): Add all blockers before queueing any tasks.
10971 (queue_final_tasks): Likewise.
10972 * token.h (Task_token::add_blockers): New function.
10973 * object.h (Input_objects::number_of_relobjs): New function.
10974
c7177d31
ILT
109752010-02-10 Ian Lance Taylor <iant@google.com>
10976
5de0e392
ILT
10977 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10978 shared, not if not position independent.
10979 * x86_64.cc (Relocate::relocate_tls): Likewise.
10980 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10981 (tls_pie_pic_test): New target.
10982 * testsuite/Makefile.in: Rebuild.
10983
c7177d31
ILT
10984 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
10985 (tls_test_main_pie.o, tls_test_pie.o): New targets.
10986 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
10987 * testsuite/Makefile.in: Rebuild.
10988
684b268a
DM
109892010-02-09 David S. Miller <davem@davemloft.net>
10990
10991 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
10992 R_SPARC_RELATIVE using ->add_local_relative().
10993 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
10994
612a8d3d
DM
10995 * output.h (Output_data_dynamic::add_section_size): New method
10996 that takes two Output_data objects.
10997 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
10998 entry param. Handle it in initializers.
10999 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11000 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11001 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11002 arg.
11003 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11004 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11005 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11006 for dynrel_includes_plt.
11007 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11008 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11009 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11010 before .rela.plt
11011 (Target_sparc::do_finalize_sections): Update to pass true for
11012 dynrel_includes_plt.
11013 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11014 output before .rela.plt
11015 (Target_powerpc::do_finalize_sections): Update to pass true for
11016 dynrel_includes_plt when 32-bit.
11017
cb1be87e
DK
110182010-02-08 Doug Kwan <dougkwan@google.com>
11019
11020 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11021 method.
11022 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11023 Arm_relobj::scan_section_for_cortex_a8_stubs,
11024 Arm_relobj::do_relocation_section): Instead of calling
11025 Output_section::output_address, use faster
11026 Arm_relobj::simple_input_section_output_address.
11027
705b5121
DM
110282010-02-08 David S. Miller <davem@davemloft.net>
11029
11030 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11031 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11032 relocation helper function.
11033
024c4466
DM
11034 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11035 just like R_SPARC_GOT{10,13,22}.
11036 (Target_sparc::Scan::local): Likewise.
11037 (Target_sparc::Relocate:relocate): Likewise.
11038
9109c078
ILT
110392010-02-06 Ian Lance Taylor <iant@google.com>
11040
11041 * configure.ac: Rewrite targetobjs duplicate removal code to use
11042 only shell constructs.
11043 * configure: Rebuild.
11044
cf846138
DK
110452010-02-05 Doug Kwan <dougkwan@google.com>
11046
11047 PR 11247
11048 * arm.cc (Arm_relobj::section_is_scannable): New method.
11049 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11050 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11051
6cfaf60b
DK
110522010-02-04 Doug Kwan <dougkwan@google.com>
11053
11054 PR 11247
11055 * arm-reloc-property.cc (cstdio): Include.
11056 * configure.ac (targetobjs): Remove duplicates.
11057 * configure: Regenerate.
11058 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11059 big and little endian version for a given address size.
11060
5c57f1be
DK
110612010-02-03 Doug Kwan <dougkwan@google.com>
11062
11063 * arm-reloc-property.cc
11064 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11065 definition.
11066 * arm-reloc-property.h
11067 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11068 New method definition.
11069 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11070 declaration.
11071 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11072 overflow to N.
11073 (GOT_PREL): Change implemented to Y.
11074 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11075 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11076 (Arm_relocate_functions::movw_abs_nc): Remove method.
11077 (Arm_relocate_functions::movt_abs): Ditto.
11078 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11079 (Arm_relocate_functions::thm_movt_abs): Ditto.
11080 (Arm_relocate_functions::movw_rel_nc): Ditto.
11081 (Arm_relocate_functions::movw_rel): Ditto.
11082 (Arm_relocate_functions::movt_rel): Ditto.
11083 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11084 (Arm_relocate_functions:thm_movw_rel): Ditto.
11085 (Arm_relocate_functions:thm_movt_rel): Ditto.
11086 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11087 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11088 New method definitions.
11089 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11090 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11091 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11092 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11093 (Target_arm::Relocate::relocate): Check for non-static or
11094 unimplemented relocation code and exit early. Change calls to
11095 Target_arm::reloc_uses_thumb_bit and
11096 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11097 instead. Refactor code to handle similar relocations to increase
11098 code sharing. Remove check for unsupported relocation code in switch
11099 statement.
11100 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11101 relocation property table to find out size. Change error message to
11102 print out the name of a relocation code instead of the numeric value.
11103 (Target_arm::scan_reloc_for_stub): Use relocation property table
11104 instead of calling Target_arm::reloc_uses_thumb_bit().
11105
218c5831
DK
111062010-02-02 Doug Kwan <dougkwan@google.com>
11107
11108 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11109 types of relaxed input section.
11110
0d31c79d
DK
111112010-02-02 Doug Kwan <dougkwan@google.com>
11112
11113 * Makefile.am (HFILES): Add arm-reloc-property.h.
11114 (DEFFILES): New.
2e702c99
RM
11115 (TARGETSOURCES): Add arm-reloc-property.cc
11116 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11117 (libgold_a_SOURCES): $(DEFFILES)
11118 * Makefile.in: Regenerate.
11119 * arm-reloc-property.cc: New file.
11120 * arm-reloc-property.h: New file.
11121 * arm-reloc.def: New file.
11122 * arm.cc: Update comments.
11123 (arm-reloc-property.h): New included header.
11124 (arm_reloc_property_table): New global variable.
11125 (Target_arm::do_select_as_default_target): New method definition.
11126 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11127 arm-reloc-property to targ_extra_obj.
11128 * parameters.cc (set_parameters_target): Call
11129 Target::select_as_default_target().
11130 * target.h (Target::select_as_default_target): New method definition.
11131 (Target::do_select_as_default_target): Same.
11132
546c7457
DK
111332010-02-01 Doug Kwan <dougkwan@google.com>
11134
11135 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11136 first_output_text_section_.
11137 (Arm_exidx_fixup::first_output_text_section): New method definition.
11138 (Arm_exidx_fixup::first_output_text_section_): New data member.
11139 (Arm_exidx_fixup::process_exidx_section): Record the first text
11140 output section seen.
11141 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11142 and entsize in output section header.
11143
11b861d5
DK
111442010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11145
11146 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11147 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11148 (Arm_relocate_functions::thm_alu11): New Method.
11149 (Arm_relocate_functions::thm_pc8): New Method.
11150 (Arm_relocate_functions::thm_pc12): New Method.
11151 (Target_arm::Scan::local): Handle the relocations.
11152 (Target_arm::Scan::global): Likewise.
11153 (Target_arm::Relocate::relocate): Likewise.
11154 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11155
c9a2c125
DK
111562010-01-29 Doug Kwan <dougkwan@google.com>
11157
11158 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11159 of relocation types as ld.
11160
1521477a
DK
111612010-01-29 Doug Kwan <dougkwan@google.com>
11162
11163 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11164 to public.
11165 (Arm_relocate_functions::thumb_branch_common): Ditto.
11166 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11167 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11168 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11169 Arm_relocate_functions::jump24): Remove.
11170 (Target_arm::Relocate::relocate): Adjust code to call
11171 Arm_relocation_functions::arm_branch_common and
11172 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11173 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11174
e7eca48c
DK
111752010-01-29 Doug Kwan <dougkwan@google.com>
11176
11177 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11178 output_local_symbol_count_needs_update_.
11179 (Arm_relobj::output_local_symbol_count_needs_update,
11180 Arm_relobj::set_output_local_symbol_count_needs_update,
11181 Arm_relobj::update_output_local_symbol_count): New methods.
11182 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11183 member.
11184 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11185 of pointed function as in a R_ARM_PREL31 relocation.
11186 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11187 for output local symbol count updating.
11188 (Target_arm::do_relax): Update output local symbol counts in objects
11189 if necessary.
11190 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11191
02961d7e
ILT
111922010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11193
11194 * arm.cc: Added support for the ARM relocations:
11195 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11196 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11197 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11198 movw_prel_nc).
11199 (Arm_relocate_functions::movw_rel): New method.
11200 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11201 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11202 thm_movw_prel_nc).
11203 (Arm_relocate_functions::thm_movw_rel): New method.
11204 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11205 thm_movt_prel).
11206 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11207 relocations.
11208 (Target_arm::Scan::global): Likewise.
11209 (Target_arm::Relocate::relocate): Likewise.
11210 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11211 Likewise.
11212
b10d2873
ILT
112132010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11214
11215 * arm.cc: Added support for ARM group relocations.
11216 (Target_arm::reloc_needs_sym_origin): New method.
11217 (Arm_relocate_functions::calc_grp_kn): New method.
11218 (Arm_relocate_functions::calc_grp_residual): New method.
11219 (Arm_relocate_functions::calc_grp_gn): New method.
11220 (Arm_relocate_functions::arm_grp_alu): New Method.
11221 (Arm_relocate_functions::arm_grp_ldr): New Method.
11222 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11223 (Arm_relocate_functions::arm_grp_ldc): New Method.
11224 (Target_arm::Scan::local): Handle the ARM group relocations.
11225 (Target_arm::Scan::global): Likewise.
11226 (Target_arm::Relocate::relocate): Likewise.
11227 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11228 Likewise.
11229
2b328d4e
DK
112302010-01-26 Doug Kwan <dougkwan@google.com>
11231
11232 * arm.cc (set): Include.
11233 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11234 pointer type.
2e702c99 11235 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11236 (Arm_output_section::append_text_sections_to_list): New method.
11237 (Arm_output_section::fix_exidx_coverage): Ditto.
11238 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11239 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11240 Relobj::set_section_offset() instead of
11241 Sized_relobj::invalidate_section_offset().
2e702c99 11242 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11243 parameter for section headers. Ignore relocation sections for
11244 unallocated sections and EXIDX sections.
11245 (Target_arm::fix_exidx_coverage): New method.
11246 (Target_arm::output_section_address_less_than): New type.
11247 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11248 linked text section instead of the EXIDX section.
11249 (Arm_output_section::create_stub_group): Add an assertion to check
11250 that this is not an EXIDX output section.
11251 (Arm_output_section::append_text_sections_to_list): New method.
11252 (Arm_output_section::fix_exidx_coverage): Ditto.
11253 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11254 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11255 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11256 first pass.
11257 (Target_arm::fix_exidx_coverage): New method.
11258 * object.h (Relobj::set_output_section): New method.
11259 (Sized_relobj::invalidate_section_offset): Remove method.
11260 (Sized_relobj::do_invalidate_section_offset): Remove method.
11261 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11262
c7f3c371
DK
112632010-01-25 Doug Kwan <dougkwan@google.com>
11264
11265 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11266 Fix warning due to signed and unsigned comparison on a 32-bit host.
11267
8923b24c
DK
112682010-01-22 Doug Kwan <dougkwan@google.com>
11269
11270 * arm.cc (Target_arm::do_relax): Record an output section for section
11271 offset adjustment it contains any stub table that has changed.
11272 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11273 offsets in an output section if necessary.
11274 * output.cc (Output_section::Output_section): Initialize
11275 section_offsets_need_adjustments_.
11276 (Output_section::add_input_section_for_script): Renamed to
11277 Output_section::add_simple_input_section.
11278 (Output_section::save_states): Add a comment.
11279 (Output_section::discard_states): New method defintion.
11280 (Output_section::adjust_section_offsets): Same.
11281 * output.h (Output_section::add_input_section_for_script): Renamed to
11282 Output_section::add_simple_input_section.
11283 (Output_section::discard_states): New method declaration.
11284 (Output_section::adjust_section_offsets): Same.
11285 (Output_section::section_offsets_need_adjustment,
11286 Output_section::set_section_offsets_need_adjustment): New method
11287 definitions.
11288 (Output_section::section_offsets_need_adjustment_): New data member.
11289 * script-sections.cc
11290 (Output_section_element_input::set_section_address): Adjust code for
11291 renaming of Output_section::add_input_section_for_script.
11292 (Orphan_output_section::set_section_address): Same.
11293
9b2fd367
DK
112942010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11295
11296 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11297 Fix_v4bx enum values .
11298 * gold/options.h (General_options): New option definitions.
11299 (General_options::fix_v4bx): New method.
11300 (General_options::Fix_v4bx): New enum.
11301 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11302 (General_options::parse_fix_v4bx_interworking): New method.
11303
80d0d023
DK
113042010-01-22 Doug Kwan <dougkwan@google.com>
11305
11306 * arm.cc (Arm_exidx_fixup): New class.
11307
af2cdeae
DK
113082010-01-21 Doug Kwan <dougkwan@google.com>
11309
11310 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11311 classes.
11312 (Arm_exidx_section_offset_map): New type.
11313
993d07c1
DK
113142010-01-21 Doug Kwan <dougkwan@google.com>
11315
11316 * arm.cc (Arm_exidx_input_section): New class.
11317 (Arm_relobj::exidx_input_section_by_link,
11318 Arm_relobj::exidx_input_section_by_shndx,
11319 Arm_relobj::make_exidx_input_section): New methods.
11320 (read_arm_attributes_section): Remove.
11321 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11322 information about them.
11323 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11324 to here.
11325
5ac169d4
DK
113262010-01-20 Doug Kwan <dougkwan@google.com>
11327
11328 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11329 Input_section_specifier to Section_id.
11330 (Target_arm::new_arm_input_section: Adjust code for change of key
11331 type.
11332 (Target_arm::find_arm_input_section): Ditto.
11333 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11334 (Section_id): Remove.
11335 (Garbage_collection::Section_id_hash): Remove.
11336 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11337 (Section_id): Remove.
11338 (Icf::Section_id_hash): Remove.
11339 * object.h (Section_id, Const_section_id, Section_id_hash,
11340 Const_section_id_hash): New type definitions.
11341 * output.cc (Output_section::add_relaxed_input_section): Change to
11342 use Const_section_id instead of Input_section_specifier as key type.
11343 (Output_section::add_merge_input_section): Ditto.
11344 (Output_section::build_relaxation_map): Change to use Section_id
11345 instead of Input_section_specifier as key type.
2e702c99 11346 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11347 Ditto.
11348 (Output_section::convert_input_sections_to_relaxed_sections): Change
11349 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11350 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11351 (Output_section::find_relaxed_input_section): Ditto.
11352 * output.h (Input_section_specifier): Remove class.
11353 (Output_section::Output_section_data_by_input_section_map): Change
11354 key type to Const_section_id.
11355 (Output_section::Output_relaxed_input_section_by_input_section_map):
11356 Ditto.
11357 (Output_section::Relaxation_map): Change key type to Section_id.
11358
a2162063
ILT
113592010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11360
11361 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11362 (class Arm_v4bx_stub): New class.
11363 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11364 (Stub_factory::make_arm_v4bx_stub): New method.
11365 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11366 (Stub_table::empty): Handle v4bx stubs.
11367 (Stub_table::add_arm_v4bx_stub): New method.
11368 (Stub_table::find_arm_v4bx_stub): New method.
11369 (Arm_relocate_functions::v4bx): New method.
11370 (Target_arm::fix_v4bx): New method.
11371 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11372 (Stub_table::relocate_stubs): Likewise.
11373 (Stub_table::do_write): Likewise.
11374 (Stub_table::update_data_size_and_addralign): Likewise.
11375 (Stub_table::finalize_stubs): Likewise.
11376 (Target_arm::Scan::local): Likewise.
11377 (Target_arm::Scan::global): Likewise.
11378 (Target_arm::do_finalize_sections): Likewise.
11379 (Target_arm::Relocate::relocate): Likewise.
11380 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11381 Likewise.
11382 (Target_arm::scan_reloc_for_stub): Likewise.
11383 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11384
5696ab0b
ILT
113852010-01-19 Ian Lance Taylor <iant@google.com>
11386
11387 * output.cc (Output_section_headers::do_sized_write): Write large
11388 segment count to sh_info field.
11389 (Output_file_header::do_sized_write): For large segment count,
11390 write PN_XNUM to e_phnum field.
11391
800d0f56
ILT
113922010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11393
11394 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11395 (Arm_relocate_functions::thm_jump8): New function.
11396 (Arm_relocate_functions::thm_jump11): New function.
11397 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11398 R_ARM_THM_JUMP11.
11399 (Target_arm::Scan::global): Likewise.
11400 (Target_arm::Relocate::relocate): Likewise.
11401 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11402 Likewise.
11403
41263c05
DK
114042010-01-14 Doug Kwan <dougkwan@google.com>
11405
11406 * arm.cc (map, utility): Include headers.
11407 (Target_arm::apply_cortex_a8_workaround): New method.
11408 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11409 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11410 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11411 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11412 the --[no-]fix-cortex-a8 command line options.
11413 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11414 (Target_arm::relocate_stub): Use addend in instruction template.
11415 * options.h (DEFINE_bool): Set the user-set flag.
11416 (General_options): Add --[no-]-fix-cortex options.
11417 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11418 : Update fast look-up map after conversion.
41263c05 11419
459e9b03
ST
114202010-01-14 Sriraman Tallam <tmsriram@google.com>
11421
11422 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11423 in the first pass of do_layout.
11424
b521dfe4
DK
114252010-01-13 Doug Kwan <dougkwan@google.com>
11426
11427 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11428 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11429 apparent compiler problem of not folding static constant integral
11430 data members of elfcpp::Elf_sizes<32>.
11431
44272192
DK
114322010-01-13 Doug Kwan <dougkwan@google.com>
11433
11434 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11435 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11436 Arm_relobj::scan_section_for_cortex_a8_erratum,
11437 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11438 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11439 sections to scan for relocation stubs into a new method
11440 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11441 relocation and Cortex-A8 stub scanning.
11442 (Target_arm::do_relax): Force stubs to be after stubbed sections
11443 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11444 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11445 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11446
44b71ece
ILT
114472010-01-12 Ian Lance Taylor <iant@google.com>
11448
11449 * target-reloc.h (visibility_error): New inline function.
11450 (relocate_section): Call visibility_error.
11451 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11452 (MOSTLYCLEANFILES): Likewise.
11453 (protected_4_pic.o, protected_3.err): New targets.
11454 * testsuite/protected_4.cc: New file.
11455
a120bc7f
DK
114562010-01-12 Doug Kwan <dougkwan@google.com>
11457
11458 * arm.cc (Cortex_a8_reloc): New class.
11459 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11460 and cortex_a8_relocs_info_.
11461 (Target_arm::fix_cortex_a8): New method definition.
11462 (Target_arm::Cortex_a8_relocs_info): New type.
11463 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11464 New data member declarations.
11465 (Target_arm::scan_reloc_for_stub): Record information about
11466 relocations for THUMB branches that might be exempted from the
11467 Cortex-A8 workaround.
11468 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11469 at the beginning of a relaxation pass.
11470
20138696
DK
114712010-01-12 Doug Kwan <dougkwan@google.com>
11472
11473 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11474 (Arm_relobj::Mapping_symbol_position,
11475 Arm_reloj::Mapping_symbol_position_less,
11476 Arm_relobj::Mapping_symbols_info): New types.
11477 (Target_arm::is_mapping_symbol_name): New method definition.
11478 (Arm_relobj::do_count_local_symbols): Save information about mapping
11479 symbols.
11480
089d69dc
DK
114812010-01-11 Doug Kwan <dougkwan@google.com>
11482
11483 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11484 Arm_relocate_functions::thumb32_branch_upper,
11485 Arm_relocate_functions::thumb32_branch_lower,
11486 Arm_relocate_functions::thumb32_cond_branch_offset,
11487 Arm_relocate_functions::thumb32_cond_branch_upper,
11488 Arm_relocate_functions::thumb32_cond_branch_lower,
11489 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11490 branch offset encoding.
11491 (Arm_relocate_functions::thumb_branch_common): Use new branch
11492 offset encoding methods to avoid code duplication.
11493 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11494 (Stub_addend_reader::operator()): Use new branch encoding method
11495 to avoid code duplication.
11496
99e5bff2
DK
114972010-01-11 Doug Kwan <dougkwan@google.com>
11498
11499 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11500 (Target_arm::do_finalize_sections): Define special EXIDX section
11501 symbols only if referenced.
11502 * gc.h (Garbage_collection::add_reference): New method.
11503 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11504 code duplication.
11505
98e090bd
ILT
115062010-01-11 Ian Lance Taylor <iant@google.com>
11507
d0a91bd8
ILT
11508 * script.cc (Version_script_info::build_expression_list_lookup):
11509 Change complaing about duplicate wildcard match from error to
11510 warning.
11511
98e090bd
ILT
11512 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11513 of 2009-12-30.
11514 (Version_script_info::Version_script_info): Initialize globs_,
11515 default_version_, default_is_global_, and exact_. Don't
11516 initialize globals_ or locals_.
11517 (Version_script_info::build_lookup_tables): Build local symbols
11518 first.
11519 (Version_script_info::unquote): New function.
11520 (Version_script_info::add_exact_match): New function.
11521 (Version_script_info::build_expression_list_lookup): Remove lookup
11522 parameter. Add is_global parameter. Change all callers. Handle
11523 wildcard pattern specially. Unquote pattern. Call
11524 add_exact_match.
11525 (Version_script_info::get_name_to_match): New function.
11526 (Version_script_info::get_symbol_version): New function.
11527 (Version_script_info::get_symbol_version_helper): Remove.
11528 (Version_script_info::check_unmatched_names): Call unquote.
11529 * script.h (class Version_script_info): Change get_symbol_version
11530 to be non-inline and add is_global parameter; change all callers.
11531 Rewrite symbol_is_local. Update declarations. Define struct
11532 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11533 Remove globals_ and locals_ members. Add exact_, globs_,
11534 default_version_, is_global_.
11535 (Version_script_info::Glob): Remove pattern, add expression and
11536 is_global. Update constructor. Change all callers.
11537 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11538 default version.
11539 (Versions::symbol_section_contents): If a symbol is undefined, or
11540 defined in a dynamic object, set the version index to
11541 VER_NDX_LOCAL.
11542 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11543 symbol_is_local.
11544 (Symbol_table::add_from_pluginobj): Likewise.
11545 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11546
d56962d3
DK
115472010-01-11 Doug Kwan <dougkwan@google.com>
11548
11549 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11550 (incremental_dump_LDADD): Add linking option for libintl.
11551 * Makefile.in: Regenerate.
11552
94e6ee91
L
115532010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11554
11555 PR gold/11144
11556 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11557 instead of -Ds.
11558 * testsuite/Makefile.in: Regenerated.
11559
e96c574b
DK
115602010-01-10 Doug Kwan <dougkwan@google.com>
11561
11562 * options.h (DEFINE_var): Use parentheses around argument varname__
11563 in macro body to avoid any unintended subsequent substitutions.
11564
7198066b
ILT
115652010-01-10 Ian Lance Taylor <iant@google.com>
11566
ba4d53bf
ILT
11567 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11568 candidates before doing symbol resolution.
11569
7198066b
ILT
11570 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11571 ODR candidates if only one is weak.
11572
a2beed37
ILT
115732010-01-08 Ian Lance Taylor <iant@google.com>
11574
11575 * script.cc (Version_script_info::build_expression_list_lookup):
11576 Don't warn about ambiguous version, just record the ambiguity.
11577 (Version_script_info::get_symbol_version_helper): Give error if
11578 version is ambiguous.
11579
2fb7225c
DK
115802010-01-08 Doug Kwan <dougkwan@google.com>
11581
11582 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11583 prev_data_size_ and prev_addralign_. Remove initializer for
11584 deleted data member has_been_changed_.
11585 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11586 to determine if the table is empty.
11587 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11588 Remove.
11589 (Stub_table::add_reloc_stub): Define method in class definition
11590 instead of just declaring it there.
11591 (Stub_table::add_cortex_a8_stub): New method definition.
11592 (Stub_table::update_data_size_and_addralign): Ditto.
11593 (Stub_table::finalize_stubs): Ditto.
11594 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11595 (Stub_table::do_addralign_): Return address alignment in the
11596 (Stub_table::do_reset_address_and_file_offset): Define method in
11597 class definition instead of declaring it there. Set current data
11598 size to be the data size of the previous pass.
11599 (Stub_table::set_final_data_size): Use current data size as the
11600 final data size.
11601 (Stub_table::relocate_stub): Change parameter type of stub from
11602 Reloc_stub pointer to Stub pointer.
11603 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11604 (Stub_table::Cortex_a8_stub_list): New typedef.
11605 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11606 Stub_table::prev_addralign_): New data member.
11607 (Arm_relobj::Arm_relobj): Initialize data member
11608 section_has_cortex_a8_workaround_.
11609 (Arm_relobj::section_has_cortex_a8_workaround,
11610 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11611 definitions.
11612 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11613 declarations.
11614 (Target_arm::relocate_stub): Change parameter type of stub from
11615 Reloc_stub pointer to Stub pointer.
11616 (Insn_template::size, Insn_template::alignment): Handle
11617 THUMB16_SPECIAL_TYPE.
11618 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11619 Stub_table::update_data_size_and_addralign,
11620 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11621 definitions.
11622 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11623 (Stub_table::do_write): Ditto.
11624 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11625
880cd20d
ILT
116262010-01-08 Ian Lance Taylor <iant@google.com>
11627
11628 PR 11108
11629 * symtab.h (class Symbol): Remove fields is_target_special_ and
11630 has_plt_offset_. Add field is_defined_in_discarded_section_.
11631 (Symbol::is_defined_in_discarded_section): New function.
11632 (Symbol::set_is_defined_in_discarded_section): New function.
11633 (Symbol::has_plt_offset): Rewrite.
11634 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11635 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11636 Don't initialize is_target_special_ or has_plt_offset_.
11637 Initialize is_defined_in_discarded_section_.
11638 (Symbol_table::add_from_relobj): If appropriate, set
11639 is_defined_in_discarded_section.
11640 * resolve.cc (Symbol::override_base_with_special): Don't test
11641 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11642 * target-reloc.h (relocate_section): Do special handling for
11643 symbols defined in discarded sections for global symbols as well
11644 as local symbols.
11645
2703e3eb
ILT
116462010-01-08 Ian Lance Taylor <iant@google.com>
11647
11648 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11649 the SHT_SYMTAB case.
11650
339d40a3
ILT
116512010-01-08 Ian Lance Taylor <iant@google.com>
11652
11653 * object.cc (Sized_relobj::do_layout): Don't get confused if
11654 layout_eh_frame returns NULL.
11655
abecea76
ILT
116562010-01-08 Ian Lance Taylor <iant@google.com>
11657
11658 PR 11084
11659 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11660 dynamic symbol table, use the normal symbol table.
11661 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11662 symbol table.
11663
6b7dd3f3
ILT
116642010-01-08 Ian Lance Taylor <iant@google.com>
11665
11666 PR 11072
11667 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11668 sections.
11669
36c50e63
L
116702010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11671
11672 * version.cc (print_version): Change to "Copyright 2010".
11673
e291e7b9
ILT
116742010-01-08 Ian Lance Taylor <iant@google.com>
11675
11676 PR 10287
11677 PR 11063
11678 * i386.cc (class Target_i386): Change return type of plt_section
11679 to be non-const.
11680 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11681 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11682 tls_desc_rel_ field.
11683 (Output_data_plt_i386::rel_tls_desc): New function.
11684 (Target_i386::rel_tls_desc_section): New function.
11685 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11686 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11687 R_386_TLS_DESC reloc in rel_tls_desc_section.
11688 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11689 Define struct Tlsdesc_info.
11690 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11691 (Target_x86_64::do_reloc_symbol_index): New function.
11692 (Target_x86_64::add_tlsdesc_info): New function.
11693 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11694 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11695 tlsdesc_rel_ field.
11696 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11697 all callers.
11698 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11699 (Target_x86_64::rela_tlsdesc_section): New function.
11700 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11701 handling.
11702 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11703 (Target_x86_64::do_reloc_addend): New function.
11704 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11705 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11706 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11707 (Output_reloc::type): New function.
11708 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11709 (Output_reloc::is_target_specific): New function.
11710 (Output_reloc::target_arg): New function.
11711 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11712 absolute relocs and target specific relocs.
11713 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11714 add_target_specific.
11715 (class Output_data_reloc) [SHT_RELA]: Likewise.
11716 * output.cc (Output_reloc::Output_reloc): Add four new versions
11717 for absolute relocs and target specific relocs.
11718 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11719 (Output_reloc::get_symbol_index): Likewise.
11720 (Output_reloc::local_section_offset): Check that local_sym_index_
11721 is not TARGET_CODE or 0.
11722 (Output_reloc::symbol_value): Likewise.
11723 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11724 reloc.
11725 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11726 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11727 functions.
11728 * layout.cc (add_target_dynamic_tags): Use output section for
11729 DT_PLTRELSZ and DT_JMPREL.
11730
3a44184e
ILT
117312010-01-07 Ian Lance Taylor <iant@google.com>
11732
11733 PR 11061
11734 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11735 function.
11736 (class Output_data_reloc_generic): Define.
11737 (class Output_data_reloc_base): Change base class to
11738 Output_data_reloc_generic. Change add() method to call
11739 bump_relative_reloc_count for a relative reloc. Remove
11740 sort_relocs_ field.
11741 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11742 to sort_relocs().
11743 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11744 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11745 appropriate.
11746 * layout.h (class Layout): Update declaration.
11747
ea715a34
ILT
117482010-01-07 Ian Lance Taylor <iant@google.com>
11749
11750 * output.h (class Output_data): Add const version of
11751 output_section and do_output_section.
11752 (class Output_section_data): Add const version of
11753 do_output_section.
11754 (class Output_section): Likewise.
11755 * layout.cc (Layout::add_target_dynamic_tags): New function.
11756 * layout.h (class Layout): Update declarations.
11757 * arm.cc (Target_arm::do_finalize_sections): Use
11758 add_target_dynamic_tags.
11759 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11760 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11761 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11762 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11763
659948a4
ILT
117642010-01-07 Ian Lance Taylor <iant@google.com>
11765
11766 PR 11042
11767 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11768 object as needed.
11769
9d3b86f6
ILT
117702010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11771 Ian Lance Taylor <iant@google.com>
11772
11773 PR 11019
11774 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11775 Xindex::read_symtab_xindex.
11776
bb0d3eb0
DK
117772010-01-07 Doug Kwan <dougkwan@google.com>
11778
11779 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11780 (Insn_template::thumb16_bcond_insn): New method declaration.
11781 (Insn_template): Fix spelling.
11782 (Stub::thumb16_special): New method declaration.
11783 (Stub::do_write): Define virtual method which was previously pure
11784 virtual.
11785 (Stub::do_thumb16_special): New method declaration.
11786 (Stub::do_fixed_endian_write): New template member.
11787 (Reloc_stub::do_write): Remove.
11788 (Reloc_stub::do_fixed_endian_write): Remove.
11789 (Cortex_a8_stub): New class definition.
11790 (Stub_factory::make_cortex_a8_stub): New method definition.
11791 (Stub_factory::Stub_factory): Add missing static storage class
11792 qualifier for elf32_arm_stub_a8_veneer_blx.
11793
ffeef7df
ILT
117942010-01-07 Ian Lance Taylor <iant@google.com>
11795
dc3f80fe
ILT
11796 PR 10980
11797 * options.h (class General_options): Add --warn-unresolved-symbols
11798 and --error-unresolved-symbols.
11799 * errors.cc (Errors::undefined_symbol): Implement
11800 --warn-unresolved-symbols.
11801
ffeef7df
ILT
11802 * options.h (class General_options): Add -z text and -z textoff.
11803 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11804
f1ec9ded
ST
118052010-01-06 Sriraman Tallam <tmsriram@google.com>
11806
11807 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11808 (Garbage_collection::cident_sections): New function.
11809 (Garbage_collection::add_cident_section): New function.
11810 (Garbage_collection::cident_sections_): New member.
11811 (gc_process_relocs): Add references to sections whose names are C
11812 identifiers.
11813 * gold.h (cident_section_start_prefix): New constant.
11814 (cident_section_stop_prefix): New constant.
11815 (is_cident): New function.
11816 * layout.cc (Layout::define_section_symbols): Replace string constants
11817 with the newly defined constants.
11818 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11819 C identifiers.
11820 * testsuite/Makefile.am: Add gc_orphan_section_test.
11821 * testsuite/Makefile.in: Regenerate.
11822 * testsuite/gc_orphan_section_test.cc: New file.
11823 * testsuite/gc_orphan_section_test.sh: New file.
11824
6eda8c29
ILT
118252010-01-06 Ian Lance Taylor <iant@google.com>
11826
b9674e17
ILT
11827 PR 10980
11828 * options.h (class General_options): Add --warn-shared-textrel.
11829 * layout.cc (Layout::finish_dynamic_section): Implement
11830 --warn-shared-textrel.
11831
6eda8c29
ILT
11832 PR 10980
11833 * options.h (class General_options): Add --warn-multiple-gp.
11834
32dcd44e
ILT
118352010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11836
11837 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11838 $(THREADSLIB) and $(LIBDL).
11839 * Makefile.in: Rebuild.
11840
a192ba05
ILT
118412010-01-06 Ian Lance Taylor <iant@google.com>
11842
11843 PR 10980
11844 * options.cc (General_options::parse_section_start): New function.
11845 (General_options::section_start): New function.
11846 (General_options::General_options): Initialize all members.
11847 * options.h: Include <map>
11848 (class General_options): Add --section-start. Add section_starts_
11849 member.
11850 * layout.cc (Layout::attach_allocated_section_to_segment): If
11851 --section-start was used, set the address of the segment. Remove
11852 local sort_sections.
11853 (Layout::relaxation_loop_body): If the address of the load segment
11854 has been set by --section-start, don't use it.
11855 * output.h (Output_segment::update_flags_for_output_section): New
11856 function.
11857 * output.cc (Output_segment::add_output_section): Call
11858 update_flags_for_output_section.
11859
dde3f402
ILT
118602010-01-05 Ian Lance Taylor <iant@google.com>
11861
62dfdd4d
ILT
11862 PR 10980
11863 * options.h (class General_options): Add --undefined-version.
11864 * script.cc (struct Version_expression): Add was_matched_by_symbol
11865 field.
11866 (Version_script_info::matched_symbol): New function.
11867 (Version_script_info::get_symbol_version_helper): Call
11868 matched_symbol.
11869 (Version_script_info::check_unmatched_names): New function.
11870 * script.h (class Version_script_info): Update declarations.
11871 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11872
9c4ae156
ILT
11873 * options.h (class General_options): Use DEFINE_bool_alias for
11874 allow_multiple_definition.
11875 * resolve.cc (Symbol_table::should_override): Don't test
11876 allow_multiple_definition.
11877
dde3f402
ILT
11878 PR 10980
11879 * options.h (class General_options): Add --cref.
11880 * main.cc (main): Print cref table if --cref. Don't close mapfile
11881 until after printing cref table.
11882 * cref.cc: Include "symtab.h".
11883 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11884 (Cref_table_compare::operator()): New function.
11885 (Cref_inputs::gather_cref): New function.
11886 (filecol): New static const.
11887 (Cref_inputs::print_cref): New function.
11888 (Cref::print_cref): New function.
11889 * cref.h: Include <cstdio>.
11890 (class Cref): Update declarations.
11891 * mapfile.h (Mapfile::file): New function.
11892 * object.h (class Object): Define Symbols. Declare virtual
11893 do_get_global_symbols.
11894 (Object::get_global_symbols): New function.
11895 * object.cc (Input_objects::add_object): Pass object to cref_ if
11896 --cref.
11897 (Input_objects::archive_start): Likewise.
11898 (Input_objects::archive_stop): Likewise.
11899 (Input_objects::print_cref): New function.
11900 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11901 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11902 --cref.
11903 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11904 function.
11905 * plugin.h (class Sized_pluginobj): Update declarations.
11906
8781f709
ILT
119072010-01-05 Ian Lance Taylor <iant@google.com>
11908
11909 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11910 to is_default_version. Rename insdef to insdefault.
11911 (Symbol_table::add_from_relobj): Rename def to is_default_version
11912 and local to is_forced_local.
11913 (Symbol_table::add_from_pluginobj): Likewise.
11914 (Symbol_table::add_from_dynobj): Likewise.
11915 (Symbol_table::define_special_symbol): Rename insdef to
11916 insdefault.
11917
fe35d28d
ILT
119182010-01-04 Ian Lance Taylor <iant@google.com>
11919
30bc8c46
ILT
11920 PR 10980
11921 * options.h (class General_options): Add
11922 --allow-multiple-definition and -z muldefs.
11923 * resolve.cc (Symbol_table::should_override): Don't warn about a
11924 multiple symbol definition if --allow-multiple-definition or -z
11925 muldefs.
11926
7eaea549
ILT
11927 PR 10980
11928 * options.h (class General_options): Add --add-needed and
11929 --copy-dt-needed-entries. Tweak --as-needed help entry.
11930 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11931 error if --copy-dt-needed-entries aka --add-needed is used and
11932 would cause a change in behaviour.
11933
fe35d28d
ILT
11934 PR 10980
11935 * options.h (class General_options): Add -G as a short version of
11936 --shared. Add no-op options -assert, -g, and -i.
11937
55a2bb35
ST
119382010-01-04 Sriraman Tallam <tmsriram@google.com>
11939
11940 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11941 check for .text or .gnu.linkonce.t sections.
11942 * icf.cc (Icf::find_identical_sections): Ditto.
11943 Change the detection for mangled function name within the section
11944 name.
11945 * icf.h (is_section_foldable_candidate): New function.
11946
719328e1
ILT
119472009-12-30 Ian Lance Taylor <iant@google.com>
11948
11949 PR 10980
11950 * options.h (class General_options): Permit two dashes with
11951 --retain-symbols-file.
11952
d7bb5745
ILT
119532009-12-30 Ian Lance Taylor <iant@google.com>
11954
403a15dd
ILT
11955 PR 10979
11956 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11957 don't put the file header and segment headers in the text
11958 segment.
11959
eda294df
ILT
11960 PR 10979
11961 * common.cc (Sort_commons::operator()): Stabilize sort when both
11962 entries are NULL.
11963 (Symbol_table::do_allocate_commons_list): When allocating common
11964 symbols, skip a symbol which is no longer common.
11965 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11966 an object before checking its type.
11967 * testsuite/common_test_2.c: New file.
11968 * testsuite/common_test_3.c: New file.
11969 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11970 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11971 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11972 (common_test_2_pic.o, common_test_2.so): New targets.
11973 (common_test_3_pic.o, common_test_3.so): New targets.
11974 * testsuite/Makefile.in: Rebuild.
11975
d7bb5745
ILT
11976 PR 10979
11977 * script.cc (read_input_script): If we see a new SECTIONS clause,
11978 and we have added an input section, give an error.
11979 * layout.h (class Layout): Add have_added_input_section function.
11980 Add have_added_input_section_ field.
11981 * layout.cc (Layout::Layout): Initialize
11982 have_added_input_section_.
11983 (Layout::layout): Set have_added_input_section_.
11984 (Layout::layout_eh_frame): Likewise.
11985
fc59c572
ILT
119862009-12-30 Ian Lance Taylor <iant@google.com>
11987
11988 PR 10931
11989 * options.h (class General_options): Add --sort-common option.
11990 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
11991 * common.cc (Sort_common): Add sort_order parameter to
11992 constructor. Add sort_order_ field.
11993 (Sort_commons::operator): Check sort_order_.
11994 (Symbol_table::allocate_commons): Determine the sort order.
11995 (Symbol_table::do_allocate_commons): Add sort_order parameter.
11996 Change all callers.
11997 (Symbol_table::do_allocate_commons_list): Likewise.
11998
1c74fab0
ILT
119992009-12-30 Ian Lance Taylor <iant@google.com>
12000
12001 PR 10916
12002 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12003 symbols from this object, don't change the visibility of an
12004 undefined symbol.
12005 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12006
6affe781
ILT
120072009-12-30 Ian Lance Taylor <iant@google.com>
12008
12009 PR 10861
12010 * script.h (class Version_script_info): Define Language enum.
12011 Update declarations. Define Glob, Exact, and Lookup types. Add
12012 new fields globals_, locals_, and is_finalized_.
12013 * script.cc: Various formatting fixes.
12014 (class Parser_closure): Change language_stack_ from a vector of
12015 std::string to one of Version_script_info::Language. Adjust all
12016 uses accordingly.
12017 (class Lazy_demangler): Remove.
12018 (struct Version_expression): Change language from std::string to
12019 Version_script_info::Language.
12020 (Version_script_info::Version_script_info): New function.
12021 (Version_script_info::~Version_script_info): Don't call clear.
12022 (Version_script_info::finalize): New function.
12023 (Version_script_info::build_lookup_tables): New function.
12024 (Version_script_info::build_expression_list_lookup): New
12025 function.
12026 (Version_script_info::get_symbol_version_helper): Rewrite to use
12027 lookup tables.
12028 (Version_script_info::print_expression_list): Adjust to use
12029 Version_script_info::Language.
12030 (script_push_lex_into_version_mode): Check that the version script
12031 has not been finalized.
12032 (version_script_push_lang): Change language string to
12033 Version_script_info::Language.
12034 * options.cc (Command_line::version_script): New function.
12035 * options.h (class General_options): Add finalize_dynamic_list
12036 function. Change version_script from declaration to definition.
12037 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12038 * testsuite/version_script.map: Remove duplicate def of foo.
12039 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12040 version_script.map.
12041 * testsuite/Makefile.in: Rebuild.
12042
818bf354
ILT
120432009-12-30 Ian Lance Taylor <iant@google.com>
12044
12045 PR 10843
12046 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12047 if the input symbol index is 0, make the output symbol index 0.
12048
ebcc8304
ILT
120492009-12-30 Ian Lance Taylor <iant@google.com>
12050
12051 PR 10670
12052 * options.h (class General_options): Add -x/--discard-all.
12053 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12054 --discard-all. If the local symbol needs a dynamic entry, check
12055 that before handling --discard-locals.
12056
176fe33f
ILT
120572009-12-30 Ian Lance Taylor <iant@google.com>
12058
bb321bb1
ILT
12059 PR 10450
12060 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12061 flags to PF_R.
12062 (Output_segment::add_output_section): Don't change the flags if
12063 the type is PT_TLS.
12064
176fe33f
ILT
12065 PR 10450
12066 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12067 GNU hash table if they need a dynamic value. Otherwise, don't add
12068 them if they are defined in a dynamic object or are forced local.
12069
e8cd95c7
ILT
120702009-12-29 Ian Lance Taylor <iant@google.com>
12071
1b81fb71
ILT
12072 PR 10450
12073 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12074 .gnu.hash table for a 32-bit target.
12075
8d6d383d
ILT
12076 PR 10450
12077 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12078 regular and a dynamic object only needs a dynamic symbol table
12079 entry if it is externally visible.
12080
e785ec03
ILT
12081 PR 10450
12082 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12083 constructor. Add global_offset_table_ field.
12084 (Target_i386::got_section): Set global_offset_table_.
12085 (Target_i386::do_finalize_sections): Set global_offset_table_
12086 size.
12087 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12088 in constructor. Add global_offset_table_ field.
12089 (Target_x86_64::got_section): Set global_offset_table_.
12090 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12091 size.
12092
1a2dff53
ILT
12093 * layout.cc (Layout::Layout): Initialize increase_relro_.
12094 (Layout::get_output_section): Add is_relro, is_last_relro, and
12095 is_first_non_relro parameters. Change all callers.
12096 (Layout::choose_output_section): Likewise.
12097 (Layout::add_output_section_data): Likewise.
12098 (Layout::make_output_section): Likewise.
12099 (Layout::set_segment_offsets): Clear increase_relro when using a
12100 linker script.
12101 * layout.h (class Layout): Add increase_relro method. Add
12102 increase_relro_ field. Update declarations.
12103 * output.cc (Output_section::Output_section): Initialize
12104 is_last_relro_ and is_first_non_relro_.
12105 (Output_segment::add_output_section): Group relro sections is
12106 do_sort is true. Handle is_last_relro and is_first_non_relro.
12107 (Output_segment::maximum_alignment): Remove relro handling.
12108 (Output_segment::set_section_addresses): Add increase_relro
12109 parameter. Change all callers. Add initial alignment to align
12110 relro sections on separate page. Remove old relro handling.
12111 (Output_segment::set_section_list_addresses): Remove in_relro
12112 parameter. Change all callers.
12113 (Output_segment::set_offset): Add increase parameter. Change all
12114 callers. Remove old relro handling.
12115 * output.h (class Output_section): Add new methods: is_last_relro,
12116 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12117 Add is_last_relro_ and is_first_non_relro_ fields.
12118 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12119 Create separate .got.plt section. Call increase_relro.
12120 * x86_64.cc (Target_x86_64::got_section): Likewise.
12121 * testsuite/relro_script_test.t: Add .got.plt.
12122
f0ba79e2
ILT
12123 PR 10450
12124 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12125 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12126 (Layout::finalize): Call set_dynamic_symbol_size.
12127 (Layout::set_dynamic_symbol_size): New function.
12128 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12129 set_dynamic_symbol_size.
12130
e8cd95c7
ILT
12131 PR 10450
12132 * output.h (class Output_section): Add is_entsize_zero_ field.
12133 * output.cc (Output_section::Output_section): Initialize
12134 is_entsize_zero_.
12135 (Output_section::set_entsize): If two different entsizes are
12136 requested, force it to zero.
12137 (Output_section::add_input_section): Set flags for .debug_str
12138 before updating section flags. Set entsize.
12139 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12140 and SHF_STRING if all input sections have those flags.
12141
3e1b9a8a
RÁE
121422009-12-29 Rafael Espindola <espindola@google.com>
12143
12144 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12145 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12146 reporting.
3e1b9a8a 12147
3dcad376
ST
121482009-12-29 Sriraman Tallam <tmsriram@google.com>
12149
12150 * options.cc (General_options::parse_version): Allow -v to exit
12151 without an error if there is nothing to link.
12152
084e2665
ILT
121532009-12-29 Ian Lance Taylor <iant@google.com>
12154
12155 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12156 using a version of gcc before 4.1.
12157 * configure: Rebuild.
12158
250acde3
CD
121592009-12-28 Chris Demetriou <cgd@google.com>
12160
12161 * attributes.cc (Output_attributes_section_data::do_write): Use
12162 std::vector::front rather than std::vector::data.
12163
99fff23b
ILT
121642009-12-28 Ian Lance Taylor <iant@google.com>
12165
12166 * symtab.h (class Symbol_table): Add enum Defined.
12167 * resolve.cc (Symbol_table::should_override): Add defined
12168 parameter. Change all callers. Test whether object is NULL
12169 before calling a method on it.
12170 (Symbol_table::report_resolve_problem): Add defined parameter.
12171 Change all callers.
12172 (Symbol_table::should_override_with_special): Likewise.
12173 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12174 parameter. Change all callers.
12175 (Symbol_table::do_define_in_output_data): Likewise.
12176 (Symbol_table::define_in_output_segment): Likewise.
12177 (Symbol_table::do_define_in_output_segment): Likewise.
12178 (Symbol_table::define_as_constant): Likewise.
12179 (Symbol_table::do_define_as_constant): Likewise.
12180 * script.h (class Symbol_assignment): Add is_defsym parameter to
12181 constructor; change all callers.
12182 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12183 parameter. Change all callers. Add is_defsym_ field.
12184 (class Parser_closure): Add parsing_defsym parameter to
12185 constructor; change all callers. Add parsing_defsym accessor
12186 function. Add parsing_defsym_ field.
12187
556bd683
ILT
121882009-12-28 Ian Lance Taylor <iant@google.com>
12189
12190 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12191 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12192
1782c879
ILT
121932009-12-23 Ian Lance Taylor <iant@google.com>
12194
12195 * i386.cc (Target_i386::do_calls_non_split): Recognize
12196 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12197 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12198 -fsplit-stack prologue when using %r11.
1782c879 12199
329ca2b1
ST
122002009-12-21 Sriraman Tallam <tmsriram@google.com>
12201
12202 * options.cc (General_options::parse_version): Make -v continue and do
12203 the link like GNU ld does.
12204
d675ff46
RÁE
122052009-12-17 Rafael Avila de Espindola <espindola@google.com>
12206
12207 * Makefile.am (CCFILES): Add timer.cc.
12208 (HFILES): Add timer.h.
12209 * configure.ac: Check for sysconf and times.
12210 * main.cc: include timer.h.
12211 (main): Use Timer instead of get_run_time.
12212 * timer.cc: New.
12213 * timer.h: New.
12214 * workqueue.cc: include timer.h.
12215 (Workqueue::find_and_run_task):
12216 Report user, sys and wall time.
12217 * Makefile.in: Regenerate.
12218 * config.in: Regenerate.
12219 * configure: Regenerate.
12220
d6344fb5
DK
122212009-12-16 Doug Kwan <dougkwan@google.com>
12222
12223 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12224 sections.
12225 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12226 relaxed input sections.
12227 * output.cc (Output_section::find_relaxed_input_section): Change
12228 return type to Output_relaxed_input_section pointer. Adjust code
12229 for new type of relaxed_input_section_map_.
12230 * output.h (Output_section::find_relaxed_input_section): Change
12231 return type to Output_relaxed_input_section pointer.
12232 (Output_section::Output_relaxed_input_section_by_input_section_map):
12233 New type.
12234 (Output_section::relaxed_input_section_map_): Change type to
12235 Output_section::Output_relaxed_input_section_by_input_section_map.
12236 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12237 input section.
12238
0e0d5469
ILT
122392009-12-15 Ian Lance Taylor <iant@google.com>
12240
12241 * layout.cc (Layout::create_shstrtab): Only write out after input
12242 sections if we are compressing debug sections.
12243
0649a889
ILT
122442009-12-15 Ian Lance Taylor <iant@google.com>
12245
12246 * archive.cc (Archive::add_symbols): Only look up a symbol without
12247 a version if there is, in fact, a version.
12248
2ea97941
ILT
122492009-12-14 Ian Lance Taylor <iant@google.com>
12250
12251 Revert -Wshadow changes, all changes from:
12252 2009-12-11 Doug Kwan <dougkwan@google.com>
12253 2009-12-11 Nick Clifton <nickc@redhat.com>
12254 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12255
b0eec2cc
DK
122562009-12-11 Doug Kwan <dougkwan@google.com>
12257
12258 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12259 due to -Wshadow.
12260 * attributes.cc (Object_attribute::size): Ditto.
12261 (Attributes_section_data::size): Ditto.
12262 (Attributes_section_data::Attributes_section_data): Ditto.
12263 (Output_attributes_section_data::do_write): Ditto.
12264 * attributes.h (Object_attribute::set_type): Ditto.
12265 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12266
91d6fa6a
NC
122672009-12-11 Nick Clifton <nickc@redhat.com>
12268
12269 * archive.cc: Fix shadowed variable warnings.
12270 * arm.cc: Likewise.
12271 * compressed_output.cc: Likewise.
12272 * compressed_output.h: Likewise.
12273 * configure: Likewise.
12274 * dwarf_reader.cc: Likewise.
12275 * dynobj.cc: Likewise.
12276 * dynobj.h: Likewise.
12277 * ehframe.cc: Likewise.
12278 * ehframe.h: Likewise.
12279 * errors.cc: Likewise.
12280 * expression.cc: Likewise.
12281 * fileread.cc: Likewise.
12282 * fileread.h: Likewise.
12283 * freebsd.h: Likewise.
12284 * i386.cc: Likewise.
12285 * icf.cc: Likewise.
12286 * incremental.h: Likewise.
12287 * layout.cc: Likewise.
12288 * layout.h: Likewise.
12289 * mapfile.cc: Likewise.
12290 * merge.cc: Likewise.
12291 * merge.h: Likewise.
12292 * object.cc: Likewise.
12293 * object.h: Likewise.
12294 * options.h: Likewise.
12295 * output.cc: Likewise.
12296 * output.h: Likewise.
12297 * parameters.cc: Likewise.
12298 * plugin.cc: Likewise.
12299 * powerpc.cc: Likewise.
12300 * reduced_debug_output.cc: Likewise.
12301 * reduced_debug_output.h: Likewise.
12302 * reloc.cc: Likewise.
12303 * reloc.h: Likewise.
12304 * resolve.cc: Likewise.
12305 * script-sections.cc: Likewise.
12306 * script.cc: Likewise.
12307 * script.h: Likewise.
12308 * sparc.cc: Likewise.
12309 * symtab.cc: Likewise.
12310 * symtab.h: Likewise.
12311 * target-select.cc: Likewise.
12312 * target-select.h: Likewise.
12313 * token.h: Likewise.
12314 * workqueue.cc: Likewise.
12315 * workqueue.h: Likewise.
12316 * x86_64.cc: Likewise.
12317
a0351a69
DK
123182009-12-10 Doug Kwan <dougkwan@google.com>
12319
12320 * arm.cc (attributes.h): New include.
12321 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12322 (Arm_relobj::~Arm_relobj): Delete object pointed by
12323 attributes_section_data_.
12324 (Arm_relobj::attributes_section_data): New method definition.
12325 (Arm_relobj::attributes_section_data_): New data member declaration.
12326 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12327 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12328 attributes_section_data_.
12329 (Arm_dynobj::attributes_section_data): New method definition.
12330 (Arm_dynobj::attributes_section_data_): New data member declaration.
12331 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12332 initialization value of may_use_blx_ to false.
2e702c99 12333 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12334 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12335 object attributes to compute results instead of hard-coding.
12336 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12337 Target_arm::get_secondary_compatible_arch,
12338 Target_arm::set_secondary_compatible_arch
12339 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12340 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12341 New method declarations.
12342 (Target_arm::get_aeabi_object_attribute): New method definition.
12343 (Target_arm::attributes_section_data_): New data member declaration.
12344 (read_arm_attributes_section): New template definition.
12345 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12346 (Arm_dynobj::do_read_symbols): Ditto.
12347 (Target_arm::do_finalize_sections): Merge attributes sections from
12348 input. Check for BLX use after attributes section merging.
12349 Fix __exidx_start and __exidx_end visibility. Create an
12350 .ARM.attributes section if necessary.
12351 (Target_arm::get_secondary_compatible_arch,
12352 Target_arm::set_secondary_compatible_arch,
12353 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12354 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12355 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12356 New method definitions.
12357
b59befec
ILT
123582009-12-09 Ian Lance Taylor <iant@google.com>
12359
12360 * plugin.cc (Plugin::load): Don't cast from void* to a function
12361 pointer.
12362
1276bc89
ILT
123632009-12-09 Ian Lance Taylor <iant@google.com>
12364
12365 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12366 information fields.
12367
2f2de248
L
123682009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12369
12370 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12371 Replace two_file_shared_1.so with two_file_shared_2.so.
12372 * testsuite/Makefile.in: Regenerated.
12373
4f787271
DK
123742009-12-08 Doug Kwan <dougkwan@google.com>
12375
12376 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12377 (HFILES): Add attributes.h and int_encoding.h.
12378 * Makefile.in: Regenerate.
12379 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12380 function definitions to int_encoding.cc
12381 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12382 prototypes to int_encoding.h
12383 * reduced_debug_output.cc (int_encoding.h): New include.
12384 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12385 function definitions to int_encoding.cc
12386 (insert_into_vector, read_from_pointer): Move template definitions to
12387 int_encoding.h
12388 * attributes.cc: New file.
12389 * attributes.h: New file.
12390 * int_encoding.cc: New file.
12391 * int_encoding.h: New file.
12392
20b52f1a
RÁE
123932009-12-07 Rafael Avila de Espindola <espindola@google.com>
12394
12395 PR gold/11055
12396 * incremental-dump.cc (dump_incremental_inputs): New.
12397 (main): Use dump_incremental_inputs.
12398
53d7974c
L
123992009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12400
12401 PR gold/10893
12402 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12403 checking elfcpp::STT_FUNC.
12404 (Target_i386::Relocate::relocate): Likewise.
12405 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12406
12407 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12408 symbols from shared libraries into normal FUNC symbols.
12409
12410 * symtab.h (Symbol): Add is_func and use it.
12411
05a352e6
DK
124122009-12-05 Doug Kwan <dougkwan@google.com>
12413
12414 * arm.cc (Target_arm::arm_info): Initialize new fields
12415 attributes_section and attributes_vendor.
12416 * i386.cc (Target_i386::i386_info): Same.
12417 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12418 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12419 fields attributes_section and attributes_vendor.
53d7974c 12420 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12421 * target.h (Target::attributes_section, Target::attributes_vendor,
12422 Target::is_attributes_section, Target::attribute_arg_type,
12423 Target::attributes_order): New method definitions.
12424 (Target::Target_info::attributes_section,
12425 Target::Target_info::attributes_vendor): New fields.
12426 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12427 virtual method definitions.
12428 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12429 attributes_section and attributes_vendor.
12430 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12431
f4e5969c
DK
124322009-12-05 Doug Kwan <dougkwan@google.com>
12433
12434 * arm.cc: Update comments about interworking and stub generation.
12435 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12436 considered as non-PIC.
12437 (Arm_relocate_functions::base_abs): Fix formatting.
12438 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12439 of function to use GOT entry address instead of offset.
12440 (Target_arm::Scan::global): Issue an error if a symbol would need a
12441 PLT does not get one because it is untyped. Remove code to create
12442 dynamic symbols for relative branches.
12443 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12444 takes unsigned integer instead of boolean.
12445
1abce4a6
L
124462009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12447
12448 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12449 (two_file_test_LDADD): Likewise.
12450 (common_test_1_LDADD): Likewise.
12451 (exception_test_LDADD) Likewise.
12452 (weak_test_LDADD): Likewise.
12453 (many_sections_test_LDADD): Likewise.
12454 (initpri1_LDADD): Likewise.
12455 (script_test_1_LDADD): Likewise.
12456 (script_test_2_LDADD): Likewise.
12457 (justsyms_LDADD): Likewise.
12458 (binary_test_LDADD): Likewise.
12459 (large_LDADD): Likewise.
12460 * testsuite/Makefile.in: Regenerated.
12461
adcf2816 124622009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12463
adcf2816
L
12464 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12465 (Symbol_table::override_with_special): Likewise.
12466 (Symbol_table::add_from_object): Likewise.
12467
28e67f5d
RÁE
124682009-12-04 Rafael Avila de Espindola <espindola@google.com>
12469
12470 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12471 Don't set the data_offset twice.
12472
ae10a101
RÁE
124732009-12-04 Rafael Avila de Espindola <espindola@google.com>
12474
12475 * testsuite/Makefile.in: Regenerate.
12476
f59f41f3
DK
124772009-12-03 Doug Kwan <dougkwan@google.com>
12478
12479 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12480 (Target_arm::do_finalize_sections): Add parameter for symbol table
12481 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12482 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12483 parameter for symbol table pointer.
12484 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12485 an additional parameter for a pointer to symbol table.
12486 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12487 parameter for a symbol table pointer.
12488 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12489 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12490 Ditto.
12491 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12492 parameter for a symbol table pointer.
12493
ca55d848
RÁE
124942009-12-03 Rafael Avila de Espindola <espindola@google.com>
12495
12496 * incremental.cc (Incremental_inputs_header)
12497 (Incremental_inputs_header_write, Incremental_inputs_entry)
12498 (Incremental_inputs_entry_write): Move ...
12499 * incremental.h (Incremental_inputs_header)
12500 (Incremental_inputs_header_write, Incremental_inputs_entry)
12501 (Incremental_inputs_entry_write): here.
12502
3aec4f9c
RÁE
125032009-12-02 Rafael Avila de Espindola <espindola@google.com>
12504
12505 * incremental.cc (make_sized_incremental_binary): Set the target.
12506 Error if it is incompatible.
12507 * output.h (Output_file): Add filename method.
12508
9c0ae74d
RÁE
125092009-12-02 Rafael Avila de Espindola <espindola@google.com>
12510
12511 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12512 from the get_* methods.
12513
a45500ae
RÁE
125142009-12-02 Rafael Avila de Espindola <espindola@google.com>
12515
12516 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12517 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12518 Write 0 for the data_offset of scripts.
12519
325e6408
RÁE
125202009-12-02 Rafael Avila de Espindola <espindola@google.com>
12521
12522 * testsuite/Makefile.am: Add the incremental_test.sh test.
12523 * testsuite/incremental_test.sh: New.
12524 * testsuite/incremental_test_1.c: New.
12525 * testsuite/incremental_test_2.c: New.
12526
954c3e2e
RÁE
125272009-12-01 Rafael Avila de Espindola <espindola@google.com>
12528
703d02da 12529 * incremental-dump.cc (main): Fix typos.
954c3e2e 12530
f8086623
RÁE
125312009-11-27 Rafael Avila de Espindola <espindola@google.com>
12532
12533 PR gold/11025
12534 * incremental-dump.cc (main): Use llu to print 64 bit values.
12535
3b0dd6ac
L
125362009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12537 H.J. Lu <hongjiu.lu@intel.com>
12538
12539 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12540 $(LIBDL).
12541 (incremental_dump_LDADD): Likewise.
12542 * Makefile.in: Regenerated.
12543
a6d1ef57 125442009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12545
a6d1ef57
DK
12546 Revert:
12547
12548 2009-11-25 Doug Kwan <dougkwan@google.com>
12549
12550 * arm.cc (Target_arm::Target_arm): Move method definition
12551 outside of class definition. Add code to handle
12552 --target1-rel, --target1-abs and --target2= options.
12553 (Target_arm::get_reloc_reloc_type): Change method to be
12554 non-static and const.
12555 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12556 New data member declaration.
12557 (Target_arm::Scan::local, Target_arm::Scan::global,
12558 Target_arm::Relocate::relocate,
12559 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12560 Adjust call to Target_arm::get_real_reloc_type.
12561 (Target_arm::get_real_reloc_type): Use command line options
12562 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12563 * options.h (--target1-rel, --target1-abs, --target2): New
12564 ARM-only options.
12565
50aeb7d4
DK
125662009-11-25 Doug Kwan <dougkwan@google.com>
12567
12568 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12569 class definition. Add code to handle --target1-rel, --target1-abs
12570 and --target2= options.
12571 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12572 and const.
12573 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12574 member declaration.
12575 (Target_arm::Scan::local, Target_arm::Scan::global,
12576 Target_arm::Relocate::relocate,
12577 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12578 call to Target_arm::get_real_reloc_type.
12579 (Target_arm::get_real_reloc_type): Use command line options to
12580 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12581 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12582 options.
12583
51938283
DK
125842009-11-25 Doug Kwan <dougkwan@google.com>
12585
12586 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12587 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12588 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12589 formatting.
12590 (Arm_relocate_functions::thm_call): Replace body with a call to
12591 Arm_relocate_functions::thumb_branch_common.
12592 (Arm_relocate_functions::thm_jump24,
12593 Arm_relocate_functions::thm_xpc22): New method definitions.
12594 (Arm_relocate_functions::thumb_branch_common): New method definition.
12595 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12596 operator.
12597 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12598 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12599
e2b8f3c4
RÁE
126002009-11-24 Rafael Avila de Espindola <espindola@google.com>
12601
12602 * Makefile.am: Build incremental-dump
12603 * Makefile.in: Regenerate.
12604 * incremental-dump.cc: New.
12605 * incremental.cc (Incremental_inputs_header_data,
12606 Incremental_inputs_entry_data): Move to incremental.h
12607 * incremental.h: (Incremental_inputs_header_data,
12608 Incremental_inputs_entry_data): Move from incremental.cc
12609
bcba9aec
RÁE
126102009-11-24 Rafael Avila de Espindola <espindola@google.com>
12611
12612 * incremental.cc (Incremental_inputs_header,
12613 Incremental_inputs_header_write, Incremental_inputs_entry,
12614 Incremental_inputs_entry_write): Add a typedef with the data type.
12615
7c3afe08
RÁE
126162009-11-24 Rafael Avila de Espindola <espindola@google.com>
12617
12618 * incremental.cc (Incremental_inputs_header,
12619 Incremental_inputs_header_write, Incremental_inputs_entry,
12620 Incremental_inputs_entry_write): Update comment about which
12621 type has the filed descriptions.
12622
d204b6e9
DK
126232009-11-15 Doug Kwan <dougkwan@google.com>
12624
12625 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12626 (Arm_relocate_functions::arm_branch_common): Change method defintion
12627 in class definition to a method declaration and update list of formal
12628 parameters.
12629 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12630 Arm_relocation_functions::jump24): Adjust call to
12631 Arm_relocate_functions::arm_branch_common. Update list of formal
12632 parameters.
12633 (Arm_relocate_functions::xpc25): New method definition.
12634 (Arm_relocate_functions::arm_branch_common): Move method defintion
12635 out from class definition. Use stubs for mode-switching and extending
12636 branch ranges.
12637 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12638 specially. Change code to enable use of stubs in ARM branches.
12639
43d12afe
DK
126402009-11-10 Doug Kwan <dougkwan@google.com>
12641
12642 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12643 in method declaration.
12644 (Target_arm::relocate_stub): New method declaration.
12645 (Target_arm::default_target): Change to return a pointer instead of
12646 a const reference.
12647 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12648 Target_arm::default_target.
12649 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12650 method definition.
12651 (Target_arm::relocate_section): Adjust view.
12652 (Target_arm::relocate_stub): New method definition.
12653
ac33a407
DK
126542009-11-10 Doug Kwan <dougkwan@google.com>
12655
12656 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12657 a format warning.
12658 * incremental.cc (open_incremental_binary): Initialized local
12659 variables to avoid warnings.
12660 * object.cc (make_elf_object): Ditto.
12661 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12662 a format warning.
e1df38aa 12663
88ee28e9
L
12664009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12665
12666 PR gold/10930
12667 * testsuite/plugin_test.c: Include "config.h".
12668
2daedcd6
DK
126692009-11-09 Doug Kwan <dougkwan@google.com>
12670
12671 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12672 (arm_symbol_value): Remove.
12673 (Arm_relocate_functions::arm_branch_common,
12674 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12675 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12676 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12677 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12678 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12679 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12680 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12681 Arm_relocate_functions::thm_mobw_abs_nc,
12682 Arm_relocate_functions::thm_mov_abs,
12683 Arm_relocate_functions::movw_prel_nc,
12684 Arm_relocate_functions::thm_movt_abs,
12685 Arm_relocate_functions::movt_prel,
12686 Arm_relocate_functions::thm_movw_prel_nc,
12687 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12688 (Target_arm::Relocate::relocate): Only decompose address into two
12689 parts if relocation type uses the thumb-bit and pass the actual
12690 bit instead of a flag indicating that the thumb-bit is used. Adjust
12691 calls to methods in Arm_relocate_functions for this change.
12692
1276bc89 126932009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12694
12695 PR 10925
12696 * reloc.cc: Instantiate
12697 Sized_relobj::initialize_input_to_output_maps and
12698 Sized_relobj:free_input_to_output_maps.
12699
e53ad1b5
ILT
127002009-11-06 Ian Lance Taylor <iant@google.com>
12701
12702 PR 10876
12703 * defstd.cc (in_segment): Set only_if_ref true for "end".
12704
eb44217c
DK
127052009-11-06 Doug Kwan <dougkwan@google.com>
12706
12707 * arm.cc (class Reloc_stub): Correct a comment.
12708 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12709 (Target_arm::scan_section_for_stubs): New method declaration.
12710 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12711 Change methods from private to protected.
12712 (Target_arm::do_may_relax): New method definition.
12713 (Target_arm::do_relax, Target_arm::group_sections,
12714 Target_arm::scan_reloc_for_stub,
12715 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12716 (Target_arm::arm_input_section_map_): New data member declaration.
12717 (Target_arm::scan_reloc_for_stub,
12718 Target_arm::scan_reloc_section_for_stubs,
12719 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12720 Target_arm::do_relax): New method definitions.
12721
5d329b7d
ILT
127222009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12723
12724 * configure.ac: Check for (struct stat)::st_mtim
12725 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12726 * config.in: Regenerate.
12727 * configure: Regenerate.
12728
96a0d71b
ILT
127292009-11-05 Ian Lance Taylor <iant@google.com>
12730
12731 PR 10910
12732 * output.cc (Output_segment::add_output_section): Add missing
12733 return statement.
12734
594c8e5e
ILT
127352009-11-04 Ian Lance Taylor <iant@google.com>
12736
12737 PR 10880
12738 * object.h (class Object): Add is_needed and set_is_needed
12739 methods. Add is_needed_ field. Make bool fields into bitfields.
12740 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12741 defined in a dynamic object and referenced by a regular object,
12742 set is_needed for the dynamic object.
12743 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12744 if the file is marked with as_needed and it is not needed.
12745
22b127cc
ILT
127462009-11-04 Ian Lance Taylor <iant@google.com>
12747
12748 PR 10887
12749 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12750 tags if data is discarded by linker script.
12751 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12752 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12753 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12754 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12755
f5c870d2
ILT
127562009-11-04 Ian Lance Taylor <iant@google.com>
12757
12758 * layout.cc (Layout::get_output_section): Add is_interp and
12759 is_dynamic_linker_section parameters. Change all callers.
12760 (Layout::choose_output_section): Likewise.
12761 (Layout::make_output_section): Likewise.
12762 (Layout::add_output_section_data): Add is_dynamic_linker_section
12763 parameter. Change all callers.
12764 * layout.h (class Layout): Update declarations.
12765 * output.h (class Output_section): Add is_interp, set_is_interp,
12766 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12767 Add is_interp_, is_dynamic_linker_section_ fields. Change
12768 generate_code_fills_at_write_ to a bitfield.
12769 * output.cc (Output_section::Output_sections): Initialize new
12770 fields.
12771 (Output_segment::add_output_section): Add do_sort parameter.
12772 Change all callers.
12773
1ae4d23b
ILT
127742009-11-03 Ian Lance Taylor <iant@google.com>
12775
12776 PR 10860
12777 * options.h (class General_options): Add --warn-common.
12778 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12779 merging two common symbols.
12780 (Symbol_table::should_override): Handle --warn-common when merging
12781 a common symbol with a defined symbol. Use report_resolve_problem
12782 for multiple definitions.
12783 (Symbol_table::report_resolve_problem): New function.
12784 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12785
55da9579
DK
127862009-11-03 Doug Kwan <dougkwan@google.com>
12787
12788 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12789 stub_factory_.
12790 (Target_arm::stub_factory): New method definition.
12791 (Target_arm::new_arm_input_section,
12792 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12793 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12794 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12795 New type definitions.
12796 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12797 member declarations.
12798 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12799 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12800 New method definitions.
12801
37a9ac43
ILT
128022009-11-03 Ian Lance Taylor <iant@google.com>
12803
12804 * options.h (class General_options): Add --warn_constructors.
12805
b3d6a3d4
ILT
128062009-11-03 Ian Lance Taylor <iant@google.com>
12807
12808 PR 10893
12809 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12810 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12811
934b01dd
ILT
128122009-11-03 Ian Lance Taylor <iant@google.com>
12813
12814 PR 10895
12815 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12816 --msgid-bugs-address.
12817 (install-pdf): New target.
12818 (install-data_yes): Look up one directory to find mkinstalldirs.
12819
03c1939b
L
128202009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12821
12822 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12823 tree.
12824
ebd95253
DK
128252009-10-30 Doug Kwan <dougkwan@google.com>
12826
12827 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12828
e9bbb538
DK
128292009-10-30 Doug Kwan <dougkwan@google.com>
12830
12831 * arm.cc (Stub_addend_reader): New struct template definition
12832 and partial specializations.
12833 (Stub_addend_reader::operator()): New method definition for a
12834 partially specialized template.
12835
d5b40221
DK
128362009-10-30 Doug Kwan <dougkwan@google.com>
12837
12838 * arm.cc (Arm_relobj::processor_specific_flags): New method
12839 definition.
12840 (Arm_relobj::do_read_symbols): New method declaration.
12841 (Arm_relobj::processor_specific_flags_): New data member declaration.
12842 (Arm_dynobj): New class definition.
12843 (Target_arm::do_finalize_sections): Add input_objects parameter.
12844 (Target_arm::do_adjust_elf_header): New method declaration.
12845 (Target_arm::are_eabi_versions_compatible,
12846 (Target_arm::merge_processor_specific_flags): New method declaration.
12847 (Target_arm::do_make_elf_object): New overloaded method definitions
12848 and declaration.
12849 (Arm_relobj::do_read_symbols): New method definition.
12850 (Arm_dynobj::do_read_symbols): Ditto.
12851 (Target_arm::do_finalize_sections): Add input_objects parameters.
12852 Merge processor-specific flags from all input objects.
12853 (Target_arm::are_eabi_versions_compatible,
12854 Target_arm::merge_processor_specific_flags,
12855 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12856 New method definitions.
12857 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12858 Input_objects pointer type parameter.
12859 * layout.cc (Layout::finalize): Pass input objects to target's.
12860 finalize_sections function.
12861 * output.cc (Output_file_header::do_sized_write): Set ELF file
12862 header's processor-specific flags.
12863 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12864 Input_objects pointer type parameter.
12865 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12866 * target.h (Input_objects): New forward class declaration.
12867 (Target::processor_specific_flags,
12868 Target::are_processor_specific_flags_sect): New method definitions.
12869 (Target::finalize_sections): Add input_objects parameter.
12870 (Target::Target): Initialize processor_specific_flags_ and
12871 are_processor_specific_flags_set_.
12872 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12873 parameter.
12874 (Target::set_processor_specific_flags): New method definition.
12875 (Target::processor_specific_flags_,
12876 Target::are_processor_specific_flags_set_): New data member
12877 declarations.
12878 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12879 Input_objects pointer type parameter.
12880
ebabffbd
DK
128812009-10-30 Doug Kwan <dougkwan@google.com>
12882
12883 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12884
ad0f2072
ILT
128852009-10-28 Ian Lance Taylor <iant@google.com>
12886
12887 * object.h (class Relobj): Drop options parameter from
12888 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12889 do_scan_relocs, do_relocate. Change all callers.
12890 (class Sized_relobj): Drop options parameters from
12891 do_gc_process_relocs, do_scan_relocs, do_relocate,
12892 do_relocate_sections, relocate_sections, emit_relocs_scan,
12893 emit_relocs_scan_reltype. Change all callers.
12894 (struct Relocate_info): Remove options field and all references to
12895 it.
12896 * reloc.h (class Read_relocs): Remove options constructor
12897 parameter and options_ field. Change all callers.
12898 (class Gc_process_relocs, class Scan_relocs): Likewise.
12899 (class Relocate_task): Likewise.
12900 * target-reloc.h (scan_relocs): Remove options parameter. Change
12901 all callers.
12902 (scan_relocatable_relocs): Likewise.
12903 * target.h (class Sized_target): Remove options parameter from
12904 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12905 all callers.
12906 * gc.h (gc_process_relocs): Remove options parameter. Change all
12907 callers.
12908 * arm.cc: Update functions to remove options parameters.
12909 * i386.cc: Likewise.
12910 * powerpc.cc: Likewise.
12911 * sparc.cc: Likewise.
12912 * x86_64.cc: Likewise.
12913 * testsuite/testfile.cc: Likewise.
12914
8ffa3667
DK
129152009-10-28 Doug Kwan <dougkwan@google.com>
12916
12917 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12918 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12919 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12920 New method definitions.
12921
40f36857
CC
129222009-10-28 Cary Coutant <ccoutant@google.com>
12923
12924 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12925 (Plugin::cleanup_done_): New member.
12926 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12927 (Plugin_manager::cleanup_done_): Remove.
12928 (Plugin_manager::add_input_file): Edit error message.
12929 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12930 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12931
2c849493
ILT
129322009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12933
12934 * fileread.cc: (File_read::View::~View): Use the new
12935 data_ownership_ filed.
12936 (File_read::~File_read): Dispose the new whole_file_view_.
12937 (File_read::open): Mmap the whole file if needed.
12938 (File_read::open): Use whole_file_view_ instead of contents_.
12939 (File_read::find_view): Use whole_file_view_ if applicable.
12940 (File_read::do_read): Use whole_file_view_ instead of contents_.
12941 (File_read::make_view): Use whole_file_view_ instead of contents_,
12942 update File_read::View::View call.
12943 (File_read::find_or_make_view): Update File_read::View::View
12944 call.
12945 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12946 remove contents_
12947 (File_read::View::Data_ownership): New enum.
12948 (File_read::View::View): Replace bool mapped_ with Data_ownership
12949 argument.
12950 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12951 (File_read::View::data_ownership_): New field.
12952 (File_read::contents_): Remove (replaced by whole_file_view_).
12953 (File_read::whole_file_view_): New field.
12954 * options.h (class General_options): Add --keep-files-mapped.
12955
24998053
CC
129562009-10-27 Cary Coutant <ccoutant@google.com>
12957
12958 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12959 * testsuite/Makefile.am (plugin_test_5): New test case.
12960 * testsuite/Makefile.in: Regenerate.
12961
72adc4fa
DK
129622009-10-25 Doug Kwan <dougkwan@google.com>
12963
12964 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12965 from private to protected to allow access by child class.
12966 (Sized_relobj::do_relocate_sections): New method declaration.
12967 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12968 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12969 Sized_relobj::relocate_sections. Instantiate template explicitly
12970 for different target sizes and endianity.
12971
07f508a2
DK
129722009-10-24 Doug Kwan <dougkwan@google.com>
12973
12974 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12975 (Arm_input_section::as_arm_input_section): New method.
12976 (Arm_output_section): New class definition.
12977 (Arm_output_section::create_stub_group,
12978 Arm_output_section::group_sections): New method definitions.
12979
10ad9fe5
DK
129802009-10-22 Doug Kwan <dougkwan@google.com>
12981
12982 * arm.cc (Arm_input_section): New class definition.
12983 (Arm_input_section::init, Arm_input_section:do_write,
12984 Arm_input_section::set_final_data_size,
12985 Arm_input_section::do_reset_address_and_file_offset): New method
12986 definitions.
12987
56ee5e00
DK
129882009-10-21 Doug Kwan <dougkwan@google.com>
12989
12990 * arm.cc (Stub_table, Arm_input_section): New forward class
12991 declarations.
12992 (Stub_table): New class defintion.
12993 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
12994 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
12995 New method definition.
12996
b569affa
DK
129972009-10-21 Doug Kwan <dougkwan@google.com>
12998
12999 * arm.cc: Update copyright comments.
13000 (Target_arm): New forward class template declaration.
13001 (Arm_address): New type.
13002 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13003 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13004 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13005 constants.
13006 (Insn_template): Same.
13007 (DEF_STUBS): New macro.
13008 (Stub_type): New enum type.
13009 (Stub_template): New class definition.
13010 (Stub): Same.
13011 (Reloc_stub): Same.
13012 (Stub_factory): Same.
13013 (Target_arm::Target_arm): Initialize may_use_blx_ and
13014 should_force_pic_veneer_.
13015 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13016 Target_arm::should_force_pic_veneer,
13017 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13018 Target_arm::using_thumb_only, Target_arm:;default_target): New
13019 method defintions.
13020 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13021 New data member declarations.
13022 (Insn_template::size, Insn_template::alignment): New method defintions.
13023 (Stub_template::Stub_template): New method definition.
13024 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13025 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13026 (Stub_factory::Stub_factory): New method definition.
13027 * gold.h (string_hash): New template.
13028 * output.h (Input_section_specifier::hash_value): Use
13029 gold::string_hash.
13030 (Input_section_specifier::string_hash): Remove.
13031 * stringpool.cc (Stringpool_template::string_hash): Use
13032 gold::string_hash.
13033
6c172549
DK
130342009-10-20 Doug Kwan <dougkwan@google.com>
13035
13036 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13037 symbols of relaxed input sections.
13038 * output.h (Output_section::find_relaxed_input_section): Make
13039 method public.
13040
c5617f2f
DK
130412009-10-16 Doug Kwan <dougkwan@google.com>
13042
13043 * dynobj.cc (Versions::Versions): Initialize version_script_.
13044 Only insert base version symbol definition for a shared object
13045 if version script defines any version versions.
13046 (Versions::define_base_version): New method definition.
13047 (Versions::add_def): Check that base version is not needed.
13048 (Versions::add_need): Define base version lazily.
13049 * dynobj.h (Versions::define_base_version): New method declaration.
13050 (Versions::needs_base_version_): New data member declaration.
13051 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13052 (check_DATA): Add no_version_test.stdout.
13053 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13054 New make rules.
13055 * testsuite/Makefile.in: Regenerate.
13056 * testsuite/no_version_test.c: New file.
13057 * testsuite/no_version_test.sh: Ditto.
13058
3c12dcdb
DK
130592009-10-16 Doug Kwan <dougkwan@google.com>
13060
13061 * expression.cc (class Segment_start_expression): New class definition.
13062 (Segment_start_expression::value): New method definition.
13063 (script_exp_function_segment_start): Return a new
13064 Segment_start_expression.
13065 * gold/script-c.h (script_saw_segment_start_expression): New function
13066 prototype.
13067 * script-sections.cc (Script_sections::Script_sections): Initialize
13068 SAW_SEGMENT_START_EXPRESSION_ to false.
13069 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13070 and -Tbbs options to specify section addresses if given in
13071 command line and no SEGMENT_START expression is seen in a script.
13072 * script-sections.h (Script_sections::saw_segment_start_expression,
13073 Script_sections::set_saw_segment_start_expression): New method
13074 definition.
13075 (Script_sections::saw_segment_start_expression_): New data member
13076 declaration.
13077 * script.cc (script_saw_segment_start_expression): New function.
13078 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13079 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13080 script_test_7.sh and script_test_8.sh.
13081 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13082 script_test_8.stdout.
13083 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13084 (script_test_6, script_test_6.stdout, script_test_7,
13085 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13086 * Makefile.in: Regenerate.
13087 * testsuite/script_test_6.sh: New file.
13088 * testsuite/script_test_6.t: Same.
13089 * testsuite/script_test_7.sh: Same.
13090 * testsuite/script_test_7.t: Same.
13091 * testsuite/script_test_8.sh: Same.
13092
64b1ae37
DK
130932009-10-16 Doug Kwan <dougkwan@google.com>
13094
13095 * output.cc (Output_segment::set_section_list_address): Cast
13096 expressions to unsigned long long type to avoid format warnings.
13097
661be1e2
ILT
130982009-10-15 Ian Lance Taylor <iant@google.com>
13099
12edd763 13100 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13101 dot assignment to script_sections_.
12edd763
ILT
13102 * script-sections.cc (Script_sections::add_dot_assignment):
13103 Initialize if necessary.
13104
68b6574b
ILT
13105 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13106 program headers with no load segment if there is a linker script.
13107
661be1e2
ILT
13108 * layout.cc (Layout::set_segment_offsets): Align the file offset
13109 to the segment aligment for -N or -n with no load segment.
13110 * output.cc (Output_segment::add_output_section): Don't crash if
13111 the first section is a TLS section.
13112 (Output_segment::set_section_list_addresses): Print an error
13113 message if the address moves backward in a linker script.
13114 * script-sections.cc
13115 (Output_section_element_input::set_section_addresses): Don't
13116 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13117 (Orphan_output_section::set_section_addresses): Likewise.
13118
f15f61a7
DK
131192009-10-15 Doug Kwan <dougkwan@google.com>
13120
13121 * layout.cc (Layout::finish_dynamic_section): Generate tags
13122 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13123 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13124 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13125
82bb573a
ILT
131262009-10-14 Ian Lance Taylor <iant@google.com>
13127
13128 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13129 fields.
13130 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13131 data_shdr fields of relinfo.
13132 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13133 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13134 R_386_TLS_LDO_32, adjust based on section flags.
13135 (Target_i386::Relocate::fix_up_ldo): Remove.
13136
374ad285
ILT
131372009-10-13 Ian Lance Taylor <iant@google.com>
13138
13139 Add support for -pie.
13140 * options.h (class General_options): Add -pie and
13141 --pic-executable.
13142 (General_options::output_is_position_independent): Test -pie.
13143 (General_options::output_is_executable): Return true if not shared
13144 and not relocatable.
13145 (General_options::output_is_pie): Remove.
13146 * options.cc (General_options::finalize): Reject incompatible uses
13147 of -pie.
13148 * gold.cc (queue_middle_tasks): A -pie link is not static.
13149 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13150 * symtab.cc (Symbol::final_value_is_known): Return false if
13151 output_is_position_independent.
13152 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13153 output_is_position_independent.
13154 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13155 output_is_position_independent.
13156 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13157 output_is_position_independent.
13158 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13159 two_file_pie_test.
13160 (basic_pie_test.o, basic_pie_test): New targets.
13161 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13162 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13163 (two_file_pie_test): New target.
13164 * testsuite/Makefile.in: Rebuild.
13165 * README: Remove note saying that -pie is not supported.
13166
c6585162
ILT
131672009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13168
13169 * options.h (class General_options): Add -init and -fini.
13170 * layout.cc (Layout::finish_dynamic_section): Emit
13171 given init and fini functions.
13172
032ce4e9
ST
131732009-10-13 Sriraman Tallam <tmsriram@google.com>
13174
13175 * gc.h (gc_process_relocs): Check if icf is enabled using new
13176 function.
13177 * gold.cc (queue_initial_tasks): Likewise.
13178 (queue_middle_tasks): Likewise.
13179 * object.cc (do_layout): Likewise.
13180 * symtab.cc (is_section_folded): Likewise.
13181 * main.cc (main): Likewise.
13182 * reloc.cc (Read_relocs::run): Likewise.
13183 (Sized_relobj::do_scan_relocs): Likewise.
13184 * icf.cc (is_function_ctor_or_dtor): New function.
13185 (Icf::find_identical_sections): Check if function is ctor or dtor when
13186 safe icf is chosen.
13187 * options.h (General_options::icf): Change option to be an enum.
13188 (Icf_status): New enum.
13189 (icf_enabled): New method.
13190 (icf_safe_folding): New method.
13191 (set_icf_status): New method.
13192 (icf_status_): New variable.
13193 * (options.cc) (General_options::finalize): Set icf_status_.
13194 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13195 icf_test and icf_keep_unique_test to use the --icf enum flag.
13196 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13197 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13198
f345227a
ST
131992009-10-12 Sriraman Tallam <tmsriram@google.com>
13200
13201 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13202 includes to gc.h and icf.h.
13203 * arm.cc: Include gc.h.
13204 * gold.cc: Likewise.
13205 * i386.cc: Likewise.
13206 * powerpc.cc: Likewise.
13207 * sparc.cc: Likewise.
13208 * x86_64.cc: Likewise.
13209 * gc.h: Include icf.h.
13210
1c7814ed
ILT
132112009-10-11 Ian Lance Taylor <iant@google.com>
13212
13213 * plugin.cc: Include "gold.h" before other header files.
13214
ae3b5189
CD
132152009-10-10 Chris Demetriou <cgd@google.com>
13216
13217 * options.h (Input_file_argument::Input_file_type): New enum.
13218 (Input_file_argument::is_lib_): Replace with...
13219 (Input_file_argument::type_): New member.
13220 (Input_file_argument::Input_file_argument): Take Input_file_type
13221 'type' rather than boolean 'is_lib' as second argument.
13222 (Input_file_argument::is_lib): Use type_.
13223 (Input_file_argument::is_searched_file): New function.
13224 (Input_file_argument::may_need_search): Handle is_searched_file.
13225 * options.cc (General_options::parse_library): Support -l:filename.
13226 (General_options::parse_just_symbols): Update for Input_file_argument
13227 changes.
13228 (Command_line::process): Likewise.
13229 * archive.cc (Archive::get_file_and_offset): Likewise.
13230 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13231 * script.cc (read_script_file, script_add_file): Likewise.
13232 * fileread.cc (Input_file::Input_file): Likewise.
13233 (Input_file::will_search_for): Handle is_searched_file.
13234 (Input_file::open): Likewise.
13235 * readsyms.cc (Read_symbols::get_name): Likewise.
13236 * testsuite/Makefile.am (searched_file_test): New test.
13237 * testsuite/Makefile.in: Regenerate.
13238 * testsuite/searched_file_test.cc: New file.
13239 * testsuite/searched_file_test_lib.cc: New file.
13240
f3048a1d
ILT
132412009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13242 Ian Lance Taylor <iant@google.com>
13243
13244 * descriptor.cc: Include <cstdio> and "binary-io.h".
13245 (Descriptors::open): Open the files in binary mode always.
13246 * script.cc (Lex::get_token): Treat \r as whitespace.
13247
d4780e57
ILT
132482009-10-09 Ian Lance Taylor <iant@google.com>
13249
13250 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13251
d9a893b8
ILT
132522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13253 Ian Lance Taylor <iant@google.com>
13254
13255 * configure.ac: Check for readv function also.
13256 * fileread.cc (readv): Define if not HAVE_READV.
13257 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13258 does not exist.
13259 * config.in: Regenerate.
13260 * configure: Regenerate.
13261
c0a62865
DK
132622009-10-09 Doug Kwan <dougkwan@google.com>
13263
13264 * layout.cc (Layout::make_output_section): Call target hook to make
13265 ordinary output section.
13266 (Layout::finalize): Adjust parameter list of call the
13267 Target::may_relax().
13268 * layout.h (class Layout::section_list): New method.
13269 * merge.h (Output_merge_base::entsize): Change visibility to public.
13270 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13271 New methods.
13272 (Output_merge_string::do_is_string): New method.
13273 * object.cc (Sized_relobj::do_setup): renamed from
13274 Sized_relobj::set_up.
13275 * object.h (Sized_relobj::adjust_shndx,
13276 Sized_relobj::initializ_input_to_output_maps,
13277 Sized_relobj::free_input_to_output_maps): Change visibilities to
13278 protected.
13279 (Sized_relobj::setup): Virtualize.
13280 (Sized_relobj::do_setup): New method declaration.
13281 (Sized_relobj::invalidate_section_offset,
13282 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13283 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13284 * options.cc (parse_int): New function.
13285 * options.h (parse_int): New declaration.
13286 (DEFINE_int): New macro.
13287 (stub_group_size): New option.
13288 * output.cc (Output_section::Output_section): Initialize memebers
13289 merge_section_map_, merge_section_by_properties_map_,
13290 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13291 (Output_section::add_input_section): Handled deferred code-fill
13292 generation and remove an old comment.
13293 (Output_section::add_relaxed_input_section): New method definition.
13294 (Output_section::add_merge_input_section): Use merge section by
13295 properties map to speed to search. Update merge section maps
13296 as appropriate.
13297 (Output_section::build_relaxation_map): New method definition.
13298 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13299 Same.
13300 (Output_section::relax_input_section): Renamed to
13301 Output_section::convert_input_sections_to_relaxed_sections and change
13302 interface to take a vector of pointers to relaxed sections.
13303 (Output_section::find_merge_section,
13304 Output_section::find_relaxed_input_section): New method definitions.
13305 (Output_section::is_input_address_mapped,
13306 Output_section::output_offset, Output_section::output_address):
13307 Use output section data maps to speed up searching.
13308 (Output_section::find_starting_output_address): Add comments.
13309 (Output_section::do_write,
13310 Output_section::write_to_postprocessing_buffer): Do code-fill
13311 generation as appropriate.
13312 (Output_section::get_input_sections): Invalidate relaxed input section
13313 map.
13314 (Output_section::restore_states): Adjust type of checkpoint .
13315 Invalidate relaxed input section map.
13316 * output.h (Output_merge_base): New class declaration.
13317 (Input_section_specifier): New class defintion.
13318 (class Output_relaxed_input_section) Change base class to
13319 Output_section_data_build.
13320 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13321 base class initializer.
13322 (Output_section::add_relaxed_input_section): New method declaration.
13323 (Output_section::Input_section): Change visibility to protected.
2e702c99 13324 (Output_section::Input_section::relobj,
c0a62865
DK
13325 Output_section::Input_section::shndx): Handle relaxed input sections.
13326 Output_section::input_sections) Change visibility to protected. Also
13327 define overload to return a non-const pointer.
13328 (Output_section::Merge_section_properties): New class defintion.
13329 (Output_section::Merge_section_by_properties_map,
13330 Output_section::Output_section_data_by_input_section_map,
13331 Output_section::Relaxation_map): New types.
13332 (Output_section::relax_input_section): Rename method to
13333 Output_section::convert_input_sections_to_relaxed_sections and change
13334 interface to take a vector of relaxed section pointers.
13335 (Output_section::find_merge_section,
13336 Output_section::find_relaxed_input_section,
13337 Output_section::build_relaxation_map,
13338 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13339 New method declarations.
13340 (Output_section::merge_section_map_
13341 Output_section::merge_section_by_properties_map_,
13342 Output_section::relaxed_input_section_map_,
13343 Output_section::is_relaxed_input_section_map_valid_,
13344 Output_section::generate_code_fills_at_write_): New data members.
13345 * script-sections.cc
13346 (Output_section_element_input::set_section_addresses): Call
13347 current_data_size and addralign methods of relaxed input sections.
13348 (Orphan_output_section::set_section_addresses): Call current_data_size
13349 and addralign methods of relaxed input sections.
13350 * symtab.cc (Symbol_table::compute_final_value): Extract template
13351 from the body of Symbol_table::sized_finalize_symbol.
13352 (Symbol_table::sized_finalized_symbol): Call
13353 Symbol_table::compute_final_value.
13354 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13355 (Symbol_table::compute_final_value): New templated method declaration.
13356 * target.cc (Target::do_make_output_section): New method defintion.
13357 * target.h (Target::make_output_section): New method declaration.
13358 (Target::relax): Add more parameters for input objects, symbol table
13359 and layout. Adjust call to do_relax.
13360 (Target::do_make_output_section): New method declaration.
13361 (Target::do_relax): Add parameters for input objects, symbol table
13362 and layout.
13363
d446d6c4
ILT
133642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13365
13366 * pread.c: Include stdio.h.
13367
bc06c745
ILT
133682009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13369
13370 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13371 defined.
13372
75aea3d0
ILT
133732009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13374
13375 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13376 Change read_shndx type to unsigned int.
13377 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13378 int.
13379 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13380 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13381 Change read_shndx type to unsigned int.
13382 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13383 int.
13384 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13385 * layout.cc (Layout::create_symtab_sections): Cast the result of
13386 local_symcount * symsize to off_t in the gold_assert.
13387
be8fcb75
ILT
133882009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13389
13390 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13391 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13392 R_ARM_BASE_ABS.
13393 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13394 (Arm_relocate_functions::thm_abs5): New function.
13395 (Arm_relocate_functions::abs12): New function.
13396 (Arm_relocate_functions::abs16): New function.
13397 (Arm_relocate_functions::base_abs): New function.
13398 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13399 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13400 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13401 R_ARM_BASE_ABS.
13402 (Scan::global): Likewise.
13403 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13404 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13405 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13406 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13407 R_ARM_BASE_ABS.
13408
c2a122b6
ILT
134092009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13410
13411 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13412 (Arm_relocate_functions::movt_prel): New function.
13413 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13414 (Arm_relocate_functions::thm_movt_prel): New function.
13415 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13416 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13417 (Scan::global, Relocate::relocate): Likewise.
13418 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13419
c4aa1e2d
ILT
134202009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13421
13422 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13423 Incremental_checker.
13424 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13425 unsigned int.
13426 (class Incremental_inputs_header): New class.
13427 (Incremental_inputs_header_writer): Edit comment.
13428 (Incremental_inputs_entry): New class.
13429 (Incremental_inputs_entry_writer): Edit comment.
13430 (Sized_incremental_binary::do_find_incremental_inputs_section):
13431 Add *strtab_shndx parameter, fill it.
13432 (Sized_incremental_binary::do_check_inputs): New method.
13433 (Incremental_checker::can_incrementally_link_output_file): Use
13434 Sized_incremental_binary::check_inputs.
13435 (Incremental_inputs::report_command_line): Save command line in
13436 command_line_.
13437 * incremental.h:
13438 (Incremental_binary::find_incremental_inputs_section): New
13439 method.
13440 (Incremental_binary::do_find_incremental_inputs_section): Add
13441 strtab_shndx parameter.
13442 (Incremental_binary::do_check_inputs): New pure virtual method.
13443 (Sized_incremental_binary::do_check_inputs): Declare.
13444 (Incremental_checker::Incremental_checker): Add incremental_inputs
13445 parameter, use it to initialize incremental_inputs_.
13446 (Incremental_checker::incremental_inputs_): New field.
13447 (Incremental_checker::command_line): New method.
13448 (Incremental_checker::inputs): New method.
13449 (Incremental_checker::command_line_): New field.
13450
c549a694
ILT
134512009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13452
13453 * incremental.cc: Include <cstdarg> and "target-select.h".
13454 (vexplain_no_incremental): New function.
13455 (explain_no_incremental): New function.
13456 (Incremental_binary::error): New method.
13457 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13458 method.
13459 (make_sized_incremental_binary): New function.
13460 (open_incremental_binary): New function.
13461 (can_incrementally_link_file): Add checks if output is ELF and has
13462 inputs section.
13463 * incremental.h: Include "elfcpp_file.h" and "output.h".
13464 (Incremental_binary): New class.
13465 (Sized_incremental_binary): New class.
13466 (open_incremental_binary): Declare.
13467 * object.cc (is_elf_object): Use
13468 elfcpp::Elf_recognizer::is_elf_file.
13469 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13470 * output.h (Output_file::filesize): New method.
13471
fd3c5f0b
ILT
134722009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13473
13474 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13475 New function.
13476 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13477 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13478 function.
13479 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13480 function.
13481 (Arm_relocate_functions::movw_abs_nc): New function.
13482 (Arm_relocate_functions::movt_abs): New function.
13483 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13484 (Arm_relocate_functions::thm_movt_abs): New function.
13485 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13486 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13487 (Scan::global): Likewise.
13488 (Relocate::relocate): Likewise.
13489 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13490
7f5309a5
ILT
134912009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13492
13493 * arm.cc (Arm_relocate_functions::got_prel) New function.
13494 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13495 (Relocate::relocate): Likewise.
13496 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13497
364c7fa5
ILT
134982009-10-06 Ian Lance Taylor <iant@google.com>
13499
13500 * options.h (class General_options): Define
13501 split_stack_adjust_size parameter.
13502 * object.h (class Object): Add uses_split_stack_ and
13503 has_no_split_stack_ fields. Add uses_split_stack and
13504 has_no_split_stack accessor functions. Declare
13505 handle_split_stack_section.
13506 (class Reloc_symbol_changes): Define.
13507 (class Sized_relobj): Define Function_offsets. Declare
13508 split_stack_adjust, split_stack_adjust_reltype, and
13509 find_functions.
13510 * object.cc (Object::handle_split_stack_section): New function.
13511 (Sized_relobj::do_layout): Call handle_split_stack_section.
13512 * dynobj.cc (Sized_dynobj::do_layout): Call
13513 handle_split_stack_section.
13514 * reloc.cc (Sized_relobj::relocate_sections): Call
13515 split_stack_adjust for executable sections in split_stack
13516 objects. Pass reloc_map to relocate_section.
13517 (Sized_relobj::split_stack_adjust): New function.
13518 (Sized_relobj::split_stack_adjust_reltype): New function.
13519 (Sized_relobj::find_functions): New function.
13520 * target-reloc.h: Include "object.h".
13521 (relocate_section): Add reloc_symbol_changes parameter. Change
13522 all callers.
13523 * target.h (class Target): Add calls_non_split method. Declare
13524 do_calls_non_split virtual method. Declare match_view and
13525 set_view_to_nop.
13526 * target.cc: Include "elfcpp.h".
13527 (Target::do_calls_non_split): New function.
13528 (Target::match_view): New function.
13529 (Target::set_view_to_nop): New function.
13530 * gold.cc (queue_middle_tasks): Give an error if mixing
13531 split-stack and non-split-stack objects with -r.
13532 * i386.cc (Target_i386::relocate_section): Add
13533 reloc_symbol_changes parameter.
13534 (Target_i386::do_calls_non_split): New function.
13535 * x86_64.cc (Target_x86_64::relocate_section): Add
13536 reloc_symbol_changes parameter.
13537 (Target_x86_64::do_calls_non_split): New function.
13538 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13539 parameter.
13540 * powerpc.cc (Target_powerpc::relocate_section): Add
13541 reloc_symbol_changes parameter.
13542 * sparc.cc (Target_sparc::relocate_section): Add
13543 reloc_symbol_changes parameter.
13544 * configure.ac: Call AM_CONDITIONAL for the default target.
13545 * configure: Rebuild.
13546 * testsuite/Makefile.am (TEST_AS): New variable.
13547 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13548 (check_DATA): Add split_i386 and split_x86_64 files.
13549 (SPLIT_DEFSYMS): Define.
13550 (split_i386_[1234n].o): New targets.
13551 (split_i386_[124]): New targets.
13552 (split_i386_[1234r].stdout): New targets.
13553 (split_x86_64_[1234n].o): New targets.
13554 (split_x86_64_[124]): New targets.
13555 (split_x86_64_[1234r].stdout): New targets.
13556 (MOSTLYCLEANFILES): Add new executables.
13557 * testsuite/split_i386.sh: New file.
13558 * testsuite/split_x86_64.sh: New file.
13559 * testsuite/split_i386_1.s: New file.
13560 * testsuite/split_i386_2.s: New file.
13561 * testsuite/split_i386_3.s: New file.
13562 * testsuite/split_i386_4.s: New file.
13563 * testsuite/split_i386_n.s: New file.
13564 * testsuite/split_x86_64_1.s: New file.
13565 * testsuite/split_x86_64_2.s: New file.
13566 * testsuite/split_x86_64_3.s: New file.
13567 * testsuite/split_x86_64_4.s: New file.
13568 * testsuite/split_x86_64_n.s: New file.
13569 * testsuite/testfile.cc (Target_test): Update relocation_section
13570 function.
13571 * testsuite/Makefile.in: Rebuild.
13572
e8a9fcda
ILT
135732009-10-06 Ian Lance Taylor <iant@google.com>
13574
13575 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13576 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13577 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13578 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13579 the address on ldo_addrs_.
13580 (Target_i386::Relocate::fix_up_ldo): New function.
13581
e99daf92
ILT
135822009-10-06 Rafael Espindola <espindola@google.com>
13583
13584 * plugin.cc (add_input_library): New.
13585 (Plugin::load): Add add_input_library to tv.
13586 (Plugin_manager::add_input_file): Add the is_lib argument.
13587 (add_input_file): Update call to Plugin_manager::add_input_file.
13588 (add_input_library): New.
13589 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13590
966d4097
DK
135912009-09-30 Doug Kwan <dougkwan@google.com>
13592
13593 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13594 symbol and call Symbol::may_need_copy_reloc to determine if
13595 a copy reloc is needed.
13596 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13597 nocopyreloc is given in command line.
13598 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13599 given in command line.
13600 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13601 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13602 of the removed Target_i386::may_need_copy_reloc.
13603 * options.h (copyreloc): New option with default value false.
13604 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13605 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13606 instead of the removed Target_powerpc::may_need_copy_reloc.
13607 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13608 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13609 instead of the removed Target_sparc::may_need_copy_reloc.
13610 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13611 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13612 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13613 instead of the removed Target_x86_64::may_need_copy_reloc.
13614
029ba973
ILT
136152009-09-30 Ian Lance Taylor <iant@google.com>
13616
13617 * object.h (class Object): Remove target_ field, and target,
13618 sized_target, and set_target methods.
13619 (Object::sized_target): Remove.
13620 (class Sized_relobj): Update declarations. Remove sized_target.
13621 * object.cc (Sized_relobj::setup): Remove target parameter.
13622 Change all callers.
13623 (Input_objects::add_object): Don't do anything with the target.
13624 (make_elf_sized_object): Add punconfigured parameter. Change all
13625 callers. Set or test parameter target.
13626 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13627 Change all callers.
13628 * parameters.cc (Parameters::set_target): Change parameter type to
13629 be non-const.
13630 (Parameters::default_target): Remove.
13631 (set_parameters_target): Change parameter type to be non-const.
13632 (parameters_force_valid_target): New function.
13633 (parameters_clear_target): New function.
13634 * parameters.h (class Parameters): Update declarations. Remove
13635 default_target method. Add sized_target and clear_target
13636 methods. Change target_ to be non-const.
13637 (set_parameters_target): Update declaration.
13638 (parameters_force_valid_target): Declare.
13639 (parameters_clear_target): Declare.
13640 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13641 as NULL if we aren't searching.
13642 (Add_symbols::run): Don't check for compatible target.
13643 * fileread.cc (Input_file::open_binary): Call
13644 parameters_force_valid_target.
13645 * gold.cc (queue_middle_tasks): Likewise.
13646 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13647 set_target on object.
13648 * dynobj.h (class Sized_dynobj): Update declarations.
13649 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13650 make_elf_object returns NULL.
13651 (Archive::include_member): Don't check whether object target is
13652 compatible.
13653 * output.cc (Output_section::add_input_section): Get target from
13654 parameters.
13655 (Output_section::relax_input_section): Likewise.
13656 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13657 parameters.
13658 (Sized_relobj::do_scan_relocs): Likewise.
13659 (Sized_relobj::relocate_sections): Likewise.
13660 * resolve.cc (Symbol_table::resolve): Likewise.
13661 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13662 parameter. Change all callers.
13663 (Symbol_table::add_from_object): Get target from parameters.
13664 (Symbol_table::add_from_relobj): Don't check object target.
13665 (Symbol_table::add_from_dynobj): Likewise.
13666 (Symbol_table::define_special_symbol): Get target from
13667 parameters.
13668 * symtab.h (class Symbol_table): Update declaration.
13669 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13670 parameter. Change all callers. Clear parameter target.
13671 (Binary_test): Test target here.
13672 * testsuite/object_unittest.cc (gold_testsuite): Remove
13673 target_test_pointer parameter. Change all callers.
13674 (Object_test): Test target here.
13675
a6a22b83
ILT
136762009-09-26 Ian Lance Taylor <iant@google.com>
13677
13678 * testsuite/initpri1.c: Don't try to use constructor priorities if
13679 compiling with gcc before 4.3.
13680
6a8f49fe
ILT
136812009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13682
13683 * testsuite/retain_symbols_file_test.sh (check_present): Change
13684 output file name to retain_symbols_file_test.stdout.
13685 (check_absent): Likewise.
13686
8c604651
CS
136872009-09-18 Craig Silverstein <csilvers@google.com>
13688
13689 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13690 * options.cc: Include <cerrno> and <fstream>.
13691 (General_options::finalize): Parse -retain-symbols-file tag.
13692 * options.h: New flag.
13693 (General_options): New method should_retain_symbol, new
13694 variable symbols_to_retain.
13695 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13696 should_retain_symbol map.
13697 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13698 * testsuite/Makefile.in: Regenerate.
13699 * testsuite/retain_symbols_file_test.sh: New file.
13700
ca58b19f
NC
137012009-09-18 Nick Clifton <nickc@redhat.com>
13702
13703 * po/es.po: Updated Spanish translation.
13704
20e6d0d6
DK
137052009-09-17 Doug Kwan <dougkwan@google.com>
13706
13707 * debug.h (DEBUG_RELAXATION): New constant.
13708 (DEBUG_ALL): Add DEBUG_RELAXATION.
13709 (debug_string_to_enum): Add relaxation debug option.
13710 * layout.cc
13711 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13712 Layout::Relaxation_debug_check::read_sections,
13713 Layout::Relaxation_debug_check::read_sections): New method definitions.
13714 (Layout::Layout): Initialize data members
13715 record_output_section_data_from_scrips_,
13716 script_output_section_data_list_ and relaxation_debug_check_.
13717 (Layout::save_segments, Layout::restore_segments,
13718 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13719 Layout::relaxation_loop_body): New method definitions.
13720 (Layout::finalize): Support relaxation. Move section layout code to
13721 Layout::relaxation_loop_body.
13722 (Layout::set_asection_address_from_script): Move code for orphan
13723 section placement out.
13724 (Layout::place_orphan_sections_in_script): New method definition.
13725 * layout.h (Output_segment_headers, Output_file_header):
13726 New forward class declarations.
13727 (Layout::~Layout): Define.
13728 (Layout::new_output_section_data_from_script): New method definition.
13729 (Layout::place_orphan_sections_in_script): New method declaration.
13730 (Layout::Segment_states): New type declaration.
13731 (Layout::save_segments, Layout::restore_segments,
13732 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13733 Layout::relaxation_loop_body): New method declarations.
13734 (Layout::Output_section_data_list): New type declaration.
13735 (Layout::Relaxation_debug_check): New class definition.
13736 (Layout::record_output_section_data_from_script_,
13737 Layout::script_output_section_data_list_, Layout::segment_states_,
13738 Layout::relaxation_debug_check_): New data members.
13739 * output.cc: (Output_section_headers::do_size): New method definition.
13740 (Output_section_headers::Output_section_headers): Move size
13741 computation to Output_section_headers::do_size.
13742 (Output_segment_headers::do_size): New method definition.
e1df38aa 13743 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13744 Output_file_header::do_size and call it.
13745 (Output_file_header::do_size): New method definition.
13746 (Output_data_group::Output_data_group): Adjust call to
13747 Output_section_data.
13748 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13749 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13750 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13751 RELAXED_INPUT_SECTION_CODE.
13752 (Output_section::Output_section): Initialize data member checkpoint_.
13753 (Output_section::~Output_section): Delete checkpoint object pointed
13754 by checkpoint_.
13755 (Output_section::add_input_section): Always add an Input_section if
13756 relaxing.
13757 (Output_section::add_merge_input_section): Add assert.
13758 (Output_section::relax_input_section): New method definition.
13759 (Output_section::set_final_data_size): Set load address to zero for
13760 an unallocated section.
13761 (Output_section::do_address_and_file_offset_have_reset_values):
13762 New method definition.
13763 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13764 Handle relaxed input section.
13765 (Output_section::sort_attached_input_sections): Checkpoint input
13766 section list lazily.
13767 (Output_section::get_input_sections): Change type of input_sections to
13768 list of Simple_input_section pointers. Checkpoint input section list
13769 lazily. Also handle relaxed input sections.
13770 (Output_section::add_input_section_for_script): Take a reference to
13771 a Simple_input_section object instead of Relobj pointer and section
13772 index as parameter. Handle relaxed input sections.
13773 (Output_section::save_states, Output_section::restore_states): New
13774 method definitions.
13775 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13776 (Output_data::is_data_size_fixed): New method definition.
13777 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13778 if it is fixed.
13779 (Output_data::address_and_file_offset_have_reset_values): New method
13780 definition.
13781 (Output_data::do_address_and_file_offset_have_reset_values): New method
13782 definition.
13783 (Output_data::set_data_size): Check that data size is not fixed.
13784 (Output_data::fix_data_size): New method definition.
13785 (Output_data::is_data_size_fixed_): New data member.
13786 (Output_section_headers::set_final_data_size): New method definition.
13787 (Output_section_headers::do_size): New method declaration.
13788 (Output_segment_headers::set_final_data_size): New method definition.
13789 (Output_segment_headers::do_size): New method declaration.
13790 (Output_file_header::set_final_data_size)::New method definition.
13791 (Output_file_header::do_size)::New method declaration.
13792 (Output_section_data::Output_section_data): Add new parameter
13793 is_data_size_fixed and use it to fix data size.
13794 (Output_data_const::Output_data_const): Adjust call to base class
13795 constructor and fix data size.
13796 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13797 base class constructor and fix data size.
13798 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13799 base class constructor and fix data size.
13800 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13801 class constructor and fix data size.
13802 (Output_data_group::set_final_data_size): New method definition.
13803 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13804 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13805 class constructor and fix data size.
13806 (Output_relaxed_input_section): New class definition.
13807 (Output_section::Simple_input_section): New class definition.
13808 (Output_section::get_input_sections): Adjust parameter list.
13809 (Output_section::add_input_section_for_script): Same.
13810 (Output_section::save_states, Output_section::restore_states,
13811 Output_section::do_address_and_file_offset_have_reset_values,
13812 (Output_section::Input_section::Input_section): Handle
13813 RELAXED_INPUT_SECTION_CODE. Add new overload for
13814 Output_relaxed_input_section.
13815 (Output_section::Input_section::is_input_section,
13816 Output_section::Input_section::set_output_section): Handle relaxed
13817 input section.
13818 (Output_section::Input_section::is_relaxed_input_section,
13819 Output_section::Input_section::output_section_data,
13820 Output_section::Input_section::relaxed_input_section): New method
13821 definitions.
13822 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13823 value.
13824 (Output_section::Input_section::u1_): Update comments.
13825 (Output_section::Input_section::u2_): Add new union member poris.
13826 (Output_section::Checkpoint_output_section): New classs definition.
13827 (Output_section::relax_input_section): New method declaration.
13828 (Output_section::checkpoint_): New data member.
13829 (Output_segment): Update comments.
13830 (Output_segment::Output_segment): Un-privatize copy constructor.
13831 (Output_segment::operator=): Un-privatize.
13832 * script-sections.cc (Output_section_element::Input_section_list):
13833 Change element type to Output_section::Simple_input_section.
13834 (Output_section_element_dot_assignment::set_section_addresses):
13835 Register output section data for relaxation clean up.
13836 (Output_data_exression::Output_data_expression): Adjust call to base
13837 constructor to fix data size.
13838 (Output_section_element_data::set_section_addresses): Register
13839 Output_data_expression object for relaxation clean up.
13840 (struct Input_section_info): Replace Relobj pointer and section index
13841 pair with Output_section::Simple_input_section and Convert struct to a
13842 class.
13843 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13844 Input_section_info data member to use accessors.
20e6d0d6
DK
13845 (Output_section_element_input::set_section_addresses): Use layout
13846 parameter. Adjust code to use Output_section::Simple_input_section
13847 and Input_secction_info classes. Register filler for relaxation
13848 clean up.
13849 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13850 and section index pair with Output_section::Simple_input_section
13851 class. Adjust code accordingly.
13852 (Phdrs_element::release_segment): New method definition.
13853 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13854 segment list.
13855 (Script_sections::release_segments): New method definition.
13856 * gold/script-sections.h (Script_sections::release_segments): New
13857 method declaration.
13858 * gold/target.h (Target::may_relax, Target::relax,
13859 Target::do_may_relax, Target::do_relax): New method definitions.
13860
5e445df6
ILT
138612009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13862
13863 * arm.cc (has_signed_unsigned_overflow): New function.
13864 (Arm_relocate_functions::abs8): New function.
13865 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13866 (Target_arm::Scan::global): Likewise.
13867 (Target_arm::relocate::relocate): Likewise.
13868 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13869 Likewise.
13870
8c604651 138712009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13872
13873 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13874 * testsuite/Makefile.in: Regenerate.
13875
1e9cc1c2
NC
138762009-09-11 Nick Clifton <nickc@redhat.com>
13877
13878 * po/gold.pot: Updated by the Translation project.
13879
6a89f575
CC
138802009-09-08 Cary Coutant <ccoutant@google.com>
13881
13882 * output.cc (Output_file::open): Add execute permission to empty file.
13883 * testsuite/Makefile.am (permission_test): New test.
13884 * testsuite/Makefile.in: Regenerate.
13885
fdcac5af
ILT
138862009-09-02 Ian Lance Taylor <iant@google.com>
13887
13888 * output.cc (Output_file::resize): Call map_no_anonymous rather
13889 than map.
13890
44453f85
ILT
138912009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13892
13893 * gold.cc: Include "incremental.h".
13894 (queue_initial_tasks): Call Incremental_checker methods.
13895 * incremental.cc: Include "output.h".
13896 (Incremental_checker::can_incrementally_link_output_file): New
13897 method.
13898 * incremental.h (Incremental_checker): New class.
13899
13900 * output.cc (Output_file::open_for_modification): New method.
13901 (Output_file::map_anonymous): Changed return type to bool. Record
13902 map in base_ field.
13903 (Output_file::map_no_anonymous): New method, broken out of map.
13904 (Output_file::map): Use map_no_anonymous and map_anonymous.
13905 * output.h (class Output_file): Update declarations.
13906
293c1386
CC
139072009-08-24 Cary Coutant <ccoutant@google.com>
13908
13909 * options.h (Command_line::Pre_options): New class.
13910 (Command_line::pre_options): New member.
13911 * options.cc (gold::options::ready_to_register): New variable.
13912 (One_option::register_option): Do nothing if not registering options.
13913 Assert if same short option registered twice.
13914 (General_options::General_options): Turn off option registration when
13915 done constructing.
13916 (Command_line::Pre_options::Pre_options): New constructor.
13917
f773f3d2
CC
139182009-08-24 Cary Coutant <ccoutant@google.com>
13919
06a73cfe
CC
13920 * options.h (General_options::no_keep_memory): Remove incorrect
13921 short option.
f773f3d2 13922
a15af8e2
RW
139232009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13924
13925 * Makefile.am (am__skiplex, am__skipyacc): New.
13926 * Makefile.in: Regenerate.
13927
c462b41b
RW
139282009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13929
14ec8efd
RW
13930 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13931 (INCLUDES): ... this.
13932 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13933 (AM_CPPFLAGS): Renamed from ...
13934 (INCLUDE): ... this.
13935 * Makefile.in, testsuite/Makefile.in: Regenerate.
13936
81ecdfbb
RW
13937 * Makefile.in: Regenerate.
13938 * aclocal.m4: Likewise.
13939 * config.in: Likewise.
13940 * configure: Likewise.
13941 * testsuite/Makefile.in: Likewise.
13942
c462b41b
RW
13943 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13944 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13945 * Makefile.in: Regenerate.
13946 * testsuite/Makefile.in: Regenerate.
13947
2da73f13
CC
139482009-08-19 Cary Coutant <ccoutant@google.com>
13949
13950 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13951 symbols in shared libraries overridden by hidden or internal symbols
13952 in the main program.
13953
2db70501
CD
139542009-08-19 Chris Demetriou <cgd@google.com>
13955
13956 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13957 checking source file names in error messages.
13958
f733487b
DK
139592009-08-18 Doug Kwan <dougkwan@google.com>
13960
13961 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13962 an elcpp::Ehdr as parameter. Adjust call to set_target.
13963 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13964 an elfcpp::Ehdr as parameter.
13965 * object.cc (Object::set_target): Remove the version that looks up
13966 a target and sets it.
13967 (Sized_relobj::setup): Take a Target object instead of
13968 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13969 (make_elf_sized_object): Find target and ask target to
13970 make an ELF object.
13971 * object.h: (Object::set_target): Remove the version that looks up
13972 a target and sets it.
13973 (Sized_relobj::setup): Take a Target object instead of
13974 an elfcpp:Ehdr as parameter.
13975 * target.cc: Include dynobj.h.
13976 (Target::do_make_elf_object_implementation): New.
2e702c99 13977 (Target::do_make_elf_object): New.
f733487b
DK
13978 * target.h (Target::make_elf_object): New template declaration.
13979 (Target::do_make_elf_object): New method declarations.
13980 (Target::do_make_elf_object_implementation): New template declaration.
13981
cc70f101
ILT
139822009-08-14 Ian Lance Taylor <iant@google.com>
13983
13984 * gold.h (FUNCTION_NAME): Define.
13985 (gold_unreachable): Use FUNCTION_NAME.
13986
ef5e0cb1
ST
139872009-08-12 Sriraman Tallam <tmsriram@google.com>
13988
13989 * icf.cc (Icf::find_identical_sections): Issue a warning when a
13990 symbol in the --keep-unique list is not found.
13991
48c187ce
ST
139922009-08-12 Sriraman Tallam <tmsriram@google.com>
13993
13994 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
13995 been maked as --keep-unique.
13996 (Icf::unfold_section): New function.
13997 * icf.h (Icf::unfold_section): New function.
13998 * options.h (General_options::keep_unique): New option.
13999 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14000 * testsuite/Makefile.in: Regenerate.
14001 * testsuite/icf_keep_unique_test.sh: New file.
14002 * testsuite/icf_keep_unique_test.cc: New file.
14003
645afe0c
CC
140042009-08-12 Cary Coutant <ccoutant@google.com>
14005
14006 PR 10471
14007 * resolve.cc (Symbol_table::resolve): Check for references from
14008 dynamic objects to hidden and internal symbols.
14009 * testsuite/Makefile.am (hidden_test.sh): New test.
14010 * testsuite/Makefile.in: Regenerate.
14011 * testsuite/hidden_test.sh: New script.
14012 * testsuite/hidden_test_1.c: New test source.
14013 * testsuite/hidden_test_main.c: New test source.
14014
11af873f
DK
140152009-08-11 Doug Kwan <dougkwan@google.com>
14016
14017 * arm.cc: Update comments.
14018 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14019 segment to locate the .ARM.exidx section if present.
14020
b9f7d72d
DK
140212009-08-09 Doug Kwan <dougkwan@google.com>
14022
14023 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14024 patch.
14025
ddd3c53c
ST
140262009-08-07 Sriraman Tallam <tmsriram@google.com>
14027 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14028 compiler warnings.
14029
27721062
ST
140302009-08-06 Sriraman Tallam <tmsriram@google.com>
14031
14032 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14033 valid tls_segment only for non-debug-section relocations.
14034 * testsuite/Makefile.am: Add gc_tls_test.
14035 * testsuite/Makefile.in: Regenerate.
14036 * testsuite/gc_tls_test.cc: New file.
14037 * testsuite/gc_tls_test.sh: New file.
14038
ef15dade 140392009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14040
ef15dade
ST
14041 * icf.cc: New file.
14042 * icf.h: New file.
14043 * Makefile.am (CCFILES): Add icf.cc.
14044 (HFILES): Add icf.h
14045 * Makefile.in: Regenerate.
14046 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14047 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14048 section, symbol and addend information for the relocs.
14049 * gold.cc (queue_middle_tasks): Call identical code folding.
14050 * gold.h: Add defines for multimap.
14051 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14052 to the call of finalize_local_symbols.
14053 * main.cc (main): Create object of class Icf.
14054 * object.cc (Sized_relobj::do_layout): Allow this function to be
14055 called twice during icf.
14056 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14057 to sections marked as identical by icf.
14058 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14059 when available.
14060 (Sized_relobj::do_section_entsize): New function.
14061 * object.h (Object::section_entsize): New function.
14062 (Object::do_section_entsize): New pure virtual function.
14063 (Relobj::finalize_local_symbols): Add new parameter.
14064 (Relobj::do_section_entsize): New function.
14065 * options.h (General_options::icf): New option.
14066 (General_options::icf_iterations): New option.
14067 (General_options::print_icf_sections): New option.
14068 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14069 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14070 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14071 icf.
14072 * symtab.cc (Symbol_table::is_section_folded): New function.
14073 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14074 to sections marked as identical by icf.
14075 * symtab.h (Symbol_table::set_icf): New function.
14076 (Symbol_table::icf): New function.
14077 (Symbol_table::is_section_folded): New function.
14078 (Symbol_table::icf_): New data member.
14079 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14080 * testsuite/Makefile.am: Add commands to build icf_test.
14081 * testsuite/Makefile.in: Regenerate.
14082 * testsuite/icf_test.sh: New file.
14083 * testsuite/icf_test.cc: New file.
14084
c3b65ac4
CD
140852009-07-24 Chris Demetriou <cgd@google.com>
14086
14087 * layout.cc (is_compressible_debug_section): Fix incorrect
14088 comment about compressed section names.
14089
1caf2c51
ILT
140902009-07-20 Ian Lance Taylor <ian@airs.com>
14091
14092 PR 10419
14093 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14094
1ef4d87f
ILT
140952009-07-16 Ian Lance Taylor <iant@google.com>
14096
14097 PR 10400
14098 * layout.h: #include <map>.
14099 (class Kept_section): Change from struct to class. Add accessors
14100 and setters. Add section size to Comdat_group mapping. Change
14101 Comdat_group to std::map. Add is_comdat_ field. Add
14102 linkonce_size field in union.
14103 (class Layout): Update declaration of find_or_add_kept_section.
14104 Don't declare find_kept_object.
14105 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14106 parameter. Add object, shndx, is_comdat, and is_group_name
14107 parameters. Change all callers. Adjust for new Kept_section.
14108 (Layout::find_kept_object): Remove.
14109 * object.cc (Sized_relobj::include_section_group): Update use of
14110 Kept_section. Rename secnum to shndx. Only record
14111 Kept_comdat_section if sections are the same size.
14112 (Sized_relobj::include_linkonce_section): Update use of
14113 Kept_section. Only record Kept_comdat_section if sections are the
14114 same size. Set size of linkonce section.
14115 (Sized_relobj::map_to_kept_section): Update call to
14116 get_kept_comdat_section.
14117 * object.h (class Sized_relobj): Rename fields in
14118 Kept_comdat_section to drop trailing underscores; change object
14119 field to Relobj*. Change Kept_comdat_section_table to store
14120 struct rather than pointer.
14121 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14122 Add kept_object and kept_shndx parameters. Change all callers.
14123 (Sized_relobj::get_kept_comdat_section): Change return type to
14124 bool. Add kept_object and kept_shndx parameters. Change all
14125 callers.
14126 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14127 Layout::find_or_add_kept_section.
14128
37c3b7b0
ILT
141292009-07-09 Ian Lance Taylor <iant@google.com>
14130
14131 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14132 Reserve space in the hash table.
14133
98fa85cb
ILT
141342009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14135
14136 * fileread.cc (File_read::get_mtime): New method.
14137 * fileread.h (Timespec): New structure.
14138 (File_read::get_mtime): New method.
14139 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14140 Renamed from timestamp_nsec.
14141 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14142 Elf_Xword.
e1df38aa 14143 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14144 timestamp_nsec.
e1df38aa 14145 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14146 (Incremental_inputs::report_obejct): Save mtime; style fix.
14147 (Incremental_inputs::report_script): Save mtime; style fix.
14148 (Incremental_inputs::finalize_inputs): Style fix.
14149 (Incremental_inputs::finalize): Style fix.
14150 (Incremental_inputs::create_input_section_data): Store inputs
14151 mtime.
14152 * incremental.h (Incremental_inputs::report_script): Add mtime
14153 argument.
14154 (Incremental_inputs::Input_info::Input_info): Intialize only one
14155 union member.
14156 (Incremental_inputs::Input_info::archive): Move to nameless
14157 union.
14158 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14159 (Incremental_inputs::Input_info::script): Move to nameless union.
14160 (Incremental_inputs::mtime): New field.
14161 * script.cc (read_input_script): Pass file mtime to
14162 Incremental_input.
14163 * script.h (Script_info::inputs): Style fix.
14164
c9d70757
ILT
141652009-07-01 Ian Lance Taylor <ian@airs.com>
14166
14167 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14168 instead of 32.
14169
9c547ec3
ILT
141702009-06-24 Ian Lance Taylor <iant@google.com>
14171
14172 PR 10156
14173 * layout.cc (Layout::choose_output_section): If we find an
14174 existing section, update the flags.
14175 (Layout::create_notes): New function, broken out of
14176 Layout::finalize.
14177 (Layout::finalize): Don't create note sections.
14178 (Layout::create_note): Don't crash if linker script discards
14179 section.
14180 (Layout::create_gold_note): Likewise.
14181 (Layout::create_build_id): Likewise. Don't set
14182 after_input_sections on the section.
14183 (Layout::create_executable_stack_info): Remove target parameter.
14184 Change caller.
14185 * layout.h (class Layout): Declare create_notes. Update
14186 declaration of create_executable_stack_info.
14187 * gold.cc (queue_middle_tasks): Call create_notes.
14188 * output.cc (Output_section::update_flags_for_input_section): Move
14189 here from output.h. If SHF_ALLOC flag is newly set, mark address
14190 invalid.
14191 * output.h (Output_data::mark_address_invalid): New function.
14192 (class Output_section): Only declare, not define,
14193 update_flags_for_input_section. Remove set_flags.
14194
55458500
ILT
141952009-06-24 Ian Lance Taylor <iant@google.com>
14196
14197 * script-sections.cc (Output_section_definition::
14198 set_section_addresses): Rename shadowing local load_address to
14199 laddr.
14200
1307d6cd
ILT
142012009-06-24 Ian Lance Taylor <iant@google.com>
14202
14203 PR 10244
14204 * reloc.cc (relocate_sections): Skip empty relocation sections.
14205
ec3f783e
ILT
142062009-06-23 Ian Lance Taylor <iant@google.com>
14207
14208 PR 10156
14209 * layout.cc (Layout::create_note): Use choose_output_section
14210 rather than make_output_section.
14211
459c9f1c
ILT
142122009-06-23 Ian Lance Taylor <iant@google.com>
14213
14214 PR 10237
14215 * options.cc (General_options::parse_V): Set printed_version_.
14216 (General_options::General_options): Initialize printed_version_.
14217 * options.h (class General_options): Add printed_version_ field.
14218 * gold.cc (queue_initial_tasks): If there are no input files,
14219 don't give a fatal error if we printed the version information.
14220 (queue_middle_tasks): If using -r with a shared object, give a
14221 fatal error rather than an ordinary error.
14222
1518dc8f
ILT
142232009-06-23 Ian Lance Taylor <iant@google.com>
14224
14225 PR 10219
14226 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14227 (Layout::make_output_section): Set have_stabstr_section_ if we see
14228 a .stab*str section.
14229 (Layout::finalize): Call link_stabs_sections.
14230 (Layout::link_stabs_sections): New file.
14231 * layout.h (class Layout): Add have_stabstr_section_ field.
14232 Declare link_stabs_sections.
14233
3d857b98
DK
142342009-06-23 Doug Kwan <dougkwan@google.com>
14235
14236 * Makefile.am (libgold_a_LIBADD): New.
14237 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14238 * Makefile.in: Regenerate.
3d857b98
DK
14239 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14240 * configure: Regenerate.
14241 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14242 * fileread.cc: Include sys/state.h
14243 * gold.h: Declare memmem and strndup if found missing.
14244 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14245
0639a6f6
ILT
142462009-06-23 Ian Lance Taylor <iant@google.com>
14247
14248 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14249 * configure: Rebuild.
14250
8d63875c
ILT
142512009-06-23 Ian Lance Taylor <iant@google.com>
14252
14253 PR 10147
14254 * object.cc (Object::section_contents): Don't try to get a view if
14255 the section has length zero.
14256 (Object::handle_gnu_warning_section): If the section is empty, use
14257 the name of the section as the warning.
14258
f7c8a183
ILT
142592009-06-23 Ian Lance Taylor <iant@google.com>
14260
14261 PR 10133
14262 * stringpool.h (class Stringpool_template): Add optimize_ field.
14263 (Stringpool_template::set_optimize): New function.
14264 * stringpool.cc (Stringpool_template::Stringpool_template):
14265 Initialize optimize_ field.
14266 (Stringpool_template::set_string_offsets): Test local optimize
14267 fild rather than parameter.
14268 * layout.cc (Layout::Layout): Call set_optimize on the section
14269 name stringpool.
14270
e6a307ba
ILT
142712009-06-22 Ian Lance Taylor <iant@google.com>
14272
14273 PR 10030
14274 * yyscript.y: Parse TARGET.
14275 * script.cc (script_set_target): New function.
14276 * script-c.h (script_set_target): Declare.
14277 * options.cc (General_options::string_to_object_format): Rename
14278 from string_to_object_format in anonymous namespace. Change
14279 callers.
14280 * options.h (class General_options): Declare
14281 string_to_object_format.
14282
3ee173de
ILT
142832009-06-22 Ian Lance Taylor <iant@google.com>
14284
14285 * script-sections.cc (Script_sections::create_segments): Don't put
14286 program headers in a PT_LOAD segment if -n or -N.
14287
142882009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14289
14290 PR 10141
14291 * options.h (class General_options): Add -z lazy and -z now. Sort
14292 -z options into alphabetical order.
14293 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14294
cd6739a1 142952009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14296
14297 * layout.cc (Layout::make_output_section): Call
14298 Target::new_output_section.
14299 (Layout::attach_allocated_section_to_segment): Put large section
14300 sections in a separate load segment with the large segment flag
14301 set.
14302 (Layout::segment_precedes): Sort large data segments after other
14303 load segments.
14304 (align_file_offset): New static function.
14305 (Layout::set_segment_offsets): Use align_file_offset.
14306 * output.h (class Output_section): Add is_small_section_ and
14307 is_large_section_ fields.
14308 (Output_section::is_small_section): New function.
14309 (Output_section::set_is_small_section): New function.
14310 (Output_section::is_large_section): New function.
14311 (Output_section::set_is_large_section): New function.
14312 (Output_section::is_large_data_section): New function.
14313 (class Output_segment): Add is_large_data_segment_ field.
14314 (Output_segment::is_large_data_segment): New function.
14315 (Output_segment::set_is_large_data_segment): New function.
14316 * output.cc (Output_section::Output_section): Initialize new
14317 fields.
14318 (Output_segment::Output_segment): Likewise.
14319 (Output_segment::add_output_section): Add assertion that large
14320 data sections always go in large data segments. Force small data
14321 sections to the end of the list of data sections. Force small BSS
14322 sections to the start of the list of BSS sections. For large BSS
14323 sections to the end of the list of BSS sections.
14324 * symtab.h (class Symbol): Declare is_common_shndx.
14325 (Symbol::is_defined): Check Symbol::is_common_shndx.
14326 (Symbol::is_common): Likewise.
14327 (class Symbol_table): Define enum Commons_section_type. Update
14328 declarations. Add small_commons_ and large_commons_ fields.
14329 * symtab.cc (Symbol::is_common_shndx): New function.
14330 (Symbol_table::Symbol_table): Initialize new fields.
14331 (Symbol_table::add_from_object): Put small and large common
14332 symbols in the right list.
14333 (Symbol_table::sized_finalized_symbol): Check
14334 Symbol::is_common_shndx.
14335 (Symbol_table::sized_write_globals): Likewise.
14336 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14337 common symbol lists. Don't call do_allocate_commons_list if the
14338 list is empty.
14339 (Symbol_table::do_allocate_commons_list): Remove is_tls
14340 parameter. Add comons_section_type parameter. Change all
14341 callers. Handle small and large common symbols.
14342 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14343 Symbol::is_common_shndx.
14344 * resolve.cc (symbol_to_bits): Likewise.
14345 * target.h (Target::small_common_shndx): New function.
14346 (Target::small_common_section_flags): New function.
14347 (Target::large_common_shndx): New function.
14348 (Target::large_common_section_flags): New function.
14349 (Target::new_output_section): New function.
14350 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14351 small_common_section_flags, and large_common_section_flags
14352 fields.
14353 (Target::do_new_output_section): New virtual function.
14354 * arm.cc (Target_arm::arm_info): Initialize new fields.
14355 * i386.cc (Target_i386::i386_info): Likewise.
14356 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14357 Likewise.
14358 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14359 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14360 (Target_x86_64::do_new_output_section): New function.
14361 * configure.ac: Define conditional MCMODEL_MEDIUM.
14362 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14363 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14364 (large_LDFLAGS): Define.
14365 * testsuite/large.c: New file.
14366 * testsuite/testfile.cc (Target_test::test_target_info):
14367 Initialize new fields.
14368 * configure, testsuite/Makefile.in: Rebuild.
14369
bb04269c
DK
143702009-06-05 Doug Kwan <dougkwan@google.com>
14371
14372 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14373 * Makefile.in: Regenerate.
bb04269c
DK
14374 * i386.cc (class Target_i386): Define new virtual method to
14375 override do_is_local_label_name in parent.
14376 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14377 local symbols if --discard-locals or -X is given.
14378 * options.h (class General_options): Declare new options
14379 '--discard-locals' and '-X' for discarding locals.
14380 * target.h (class Target): Define new methods is_local_label_name.
14381 Declare new virtual method do_is_local_label_name.
14382 * target.cc: New file.
14383 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14384 (check_SCRIPTS): Add discard_locals_test.sh.
14385 (check_DATA): Add discard_local_tests.syms.
14386 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14387 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14388 * testsuite/Makefile.in: Regenerate.
14389 * testsuite/discard_locals_test.c: New file.
14390 * testsuite/discard_locals_test.sh: Same.
14391
805bb01c
DK
143922009-06-05 Doug Kwan <dougkwan@google.com>
14393
14394 * object.cc (Sized_relobj::Sized_relobj): Initialize
14395 discarded_eh_frame_shndx_ to -1U.
14396 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14397 section.
14398 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14399 a discarded .eh_frame section.
14400 (Sized_relobj::do_finalize_local_symbols): Ditto.
14401 * object.h (class Sized_relobj): Declare new member
14402 discarded_eh_frame_shndx_.
14403 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14404 (local_labels_test.o, local_labels_test): New rules.
14405 * testsuite/Makefile.in: Regenerate.
14406
1dcd334d
DK
144072009-06-04 Doug Kwan <dougkwan@google.com>
14408
14409 * layout.cc (Layout::section_name_mapping): Add mapping for
14410 special ARM sections.
14411
96d49306
DK
144122009-06-03 Doug Kwan <dougkwan@google.com>
14413
14414 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14415 (utils::has_overflow): Same.
14416
dff16297
ILT
144172009-06-03 Ian Lance Taylor <iant@google.com>
14418
14419 * layout.cc (Layout::section_name_mapping): New array, replacing
14420 Layout::linkonce_mapping.
14421 (Layout::section_name_mapping_count): New variable, replacing
14422 Layout::linkonce_mapping_count.
14423 (Layout::linkonce_output_name): Remove.
14424 (Layout::output_section_name): Rewrite.
14425 * layout.h (class Layout): Rename Linkonce_mapping to
14426 Section_name_mapping, linkonce_mapping to section_name_mapping,
14427 linkonce_mapping_count to section_name_mapping_count. Don't
14428 declare linkonce_output_name.
14429
c121c671
DK
144302009-06-03 Doug Kwan <dougkwan@google.com>
14431
14432 * gold/arm.cc (namespace utils): New.
14433 (Target_arm::reloc_is_non_pic): Define new method.
14434 (class Arm_relocate_functions): New.
14435 (Target_arm::Relocate::relocate): Handle relocation types used by
14436 Android.
14437
07800fab
ILT
144382009-06-03 Ian Lance Taylor <iant@google.com>
14439
14440 * arm.cc (Target_arm::scan::global): Use || instead of |.
14441
c121c671
DK
144422009-06-02 Doug Kwan <dougkwan@google.com>
14443
14444 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14445 issued_non_pic_error_.
14446 (class Target_arm::Scan): Declare new method check_non_pic.
14447 Define new method symbol_needs_plt_entry.
14448 Declare new data member issued_non_pic_error_.
14449 (class Target_arm::Relocate): Declare new method
14450 should_apply_static_reloc.
14451 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14452 (Target_arm::Scan::check_non_pic): Define new method.
14453 (Target_arm::Scan::local): Handle a small subset of reloc types used
14454 by Android.
14455 (Target_arm::Scan::local): Same.
14456 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14457
b19b0c6d
ILT
144582009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14459
14460 * incremental.cc (Incremental_inputs::report_command_line): Filter
14461 out --incremental-* options.
14462
94cdfcff
DK
144632009-05-29 Doug Kwan <dougkwan@google.com>
14464
14465 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14466 template class.
14467 (class Target_arm): Update comment.
14468 (Target_arm::Target_arm): Initialize new data members GOT_,
14469 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14470 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14471 and Target_arm::rel_dyn_section.
14472 Declare new_enum Target_arm::Got_type.
14473 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14474 and DYNBSS_.
14475 Update commments for member do_dynsym_value.
14476 (Target_arm::got_size, Target_arm::plt_section,
14477 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14478 new methods inside class defintion.
14479 (Target_arm::got_section): Define new method.
14480 (Target_arm::rel_dyn_section): Same.
14481 (Output_data_plt_arm): New template class.
14482 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14483 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14484 (Output_data_plt_arm::add_entry): Same.
14485 (Output_data_plt_arm::first_plt_entry): Define new
14486 static data member for PLT instruction template.
14487 (Output_data_plt_arm::plt_entry): Same.
14488 (Output_data_plt_arm::do_write): Define new method.
14489 (Target_arm::make_plt_entry): Same.
14490 (Target_arm::do_finalize_sections): Same.
14491 (Target_arm::do_dynsym_value): Same.
14492
4a657b0d
DK
144932009-05-28 Doug Kwan <dougkwan@google.com>
14494
14495 * Makefile.am (TARGETSOURCES): Add arm.cc.
14496 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14497 * Makefile.in: Regenerate.
14498 * arm.cc: New file.
14499 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14500
e7ae8c36
DK
145012009-05-26 Doug Kwan <dougkwan@google.com>
14502
14503 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14504 (General_options::check_excluded_libs): Strip off directories in
14505 archive name before matching like GNU ld does.
14506 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14507 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14508 (exclude_libs_test_LDFLAGS): Add linker option
14509 -Wl,--exclude-libs,libexclude_libs_test_3
14510 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14511 an explicit archive without using -l.
14512 (alt/libexclude_libs_test_3.a): New make rule.
14513 * testsuite/Makefile.in: Regenerate.
14514 * testsuite/exclude_libs_test.c : Declare lib3_default().
14515 (main): Call it.
14516 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14517 * exclude_libs_test_3.c: New file.
14518
f12e7348
NC
145192009-05-26 Nick Clifton <nickc@redhat.com>
14520
14521 * po/id.po: New Indonesian translation.
14522 * po/gold.pot: Updated template file.
14523
4daadc0d
ST
145242009-05-22 Sriraman Tallam <tmsriram@google.com>
14525
e1df38aa 14526 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14527 gc_comdat_test files. Add -Wl,--gc-sections to build
14528 gc_comdat_test.
14529 * testsuite/Makefile.in: Regenerate.
14530 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14531
531813ad
ST
145322009-05-21 Sriraman Tallam <tmsriram@google.com>
14533
14534 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14535 kept comdat section was garbage collected.
14536 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14537 * testsuite/Makefile.in: Regenerate.
14538 * testsuite/gc_comdat_test.sh: New file.
14539 * testsuite/gc_comdat_test_1.cc: New file.
14540 * testsuite/gc_comdat_test_2.cc: New file.
14541
65514900
CC
145422009-05-19 Doug Kwan <dougkwan@google.com>
14543
14544 * archive.cc (Archive::Archive): Move constructor from archive.h
14545 to here. Initialize no_export_.
14546 (Archive::get_elf_object_for_member): Set no_export flag of object.
14547 * archive.h (Archive::Archive): Move constructor body to
14548 archive.cc.
14549 (Archive::no_export): New method.
14550 (Archive::no_export_): New field.
14551 * object.h (Object::Object): Initialize no_export_ to false.
14552 (Object::no_export, Object::set_no_export): New methods.
14553 (Object::no_export_): New field.
14554 * options.cc (General_options::parse_exclude_libs): New method.
14555 (General_options::check_excluded_libs) Same.
14556 * options.h (exclude_libs): New option.
14557 (General_options::check_excluded_libs): New method declaration.
14558 (General_options::excluded_libs_): New field.
14559 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14560 default or protected visibility if an object has no-export flag set.
14561 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14562 (check_SCRIPTS): Add exclude_libs_test.sh.
14563 (check_DATA): Add exclude_libs_test.syms.
14564 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14565 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14566 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14567 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14568 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14569 libexclude_libs_test_2.a): New rules.
14570 * testsuite/Makefile.in: Regenerate.
14571 * testsuite/exclude_libs_test.c: New file.
14572 * testsuite/exclude_libs_test.sh: Ditto.
14573 * testsuite/exclude_libs_test_1.c: Ditto.
14574 * testsuite/exclude_libs_test_2.c: Ditto.
14575
1b77ea50
ILT
145762009-05-15 Ian Lance Taylor <iant@google.com>
14577
14578 * configure.ac: Check for declarations for cases where libiberty.h
14579 checks HAVE_DECL_xxx.
14580 * configure, config.in: Rebuild.
14581
072fe7ce
ILT
145822009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14583
14584 * gold.h (Incremental_argument_list): Remove (invalid) forward
14585 declaration.
14586 * incremental.cc (Incremental_inputs::report_achive): New method.
14587 (Incremental_inputs::report_object): New method.
14588 (Incremental_inputs::report_script): New method.
14589 (Incremental_inputs::finalize_inputs): New method.
14590 (Incremental_inputs::finalize): Call finalize_inputs().
14591 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14592 Create inputs entries.
14593 * incremental.h (Incremental_input_type): New enum.
14594 (Incremental_inputs::Incremental_input): Initialize new fields.
14595 (Incremental_inputs::report_inputs): New method.
14596 (Incremental_inputs::report_achive): New method.
14597 (Incremental_inputs::report_object): New method.
14598 (Incremental_inputs::report_script): New method.
14599 (Incremental_inputs::finalize_inputs): New method.
14600 (Incremental_inputs::Input_info): New struct.
14601 (Incremental_inputs::Input_info_map): New typedef.
14602 (Incremental_inputs::lock_): New field.
14603 (Incremental_inputs::Inputs_): New field.
14604 (Incremental_inputs::Inputs_map): New field.
14605 * main.cc (main): Call Incremental_input::report_inputs.
14606 * options.h (Input_argument_list): Typedef moved from
14607 Input_arguments.
14608 (Input_file_group::Files): Remove, use ::Input_argument_list.
14609 (Input_file_group::Input_argument_list): Remove, use
14610 ::Input_argument_list.
14611 * plugin.cc (Plugin_manager::add_input_file): Add error in
14612 incremental build.
14613 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14614 functions.
14615 * script.cc (read_input_script): Call
14616 Incremental_input::report_script.
14617 * script.h (Script_info): New class.
14618
b0481b0b
ILT
146192009-04-27 Ian Lance Taylor <iant@google.com>
14620
14621 * x86_64.cc (do_adjust_output_section): Set entsize to
14622 plt_entry_size.
14623
b22a5a41 146242009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14625
14626 * output.cc (Output_file::close): After short writes, continue
14627 writing from the correct offset in the buffer being written.
14628
40fde488
CD
146292009-04-23 Chris Demetriou <cgd@google.com>
14630
14631 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14632 * configure: Regenerate.
14633 * config.in: Regenerate.
14634 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14635 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14636
3ce2c28e
ILT
146372009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14638
14639 * incremental.cc (Incremental_inputs_header_data): Renamed from
14640 Incremental_input_header_data.
14641 (Incremental_inputs_header_data::data_size): New field.
14642 (Incremental_inputs_header_data::put_input_file_count): Renamed
14643 from input_file_count.
14644 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14645 from command_line_offset.
14646 (Incremental_inputs_header_data::put_reserved): Renamed from
14647 put_reserved.
14648 (Incremental_inputs_entry_data): Renamed from
14649 Incremental_input_entry_data.
14650 (Incremental_inputs_entry_data::data_size): New field.
14651 (Incremental_inputs::report_command_line): New method.
14652 (Incremental_inputs::finalize): New method.
14653 (Incremental_inputs::create_incremental_inputs_data): New method.
14654 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14655 * incremental.h: New file.
14656 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14657 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14658 incremental builds.
703d02da 14659 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14660 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14661 (Layout::create_incremental_info_sections): New method.
14662 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14663 * main.cc (main): Notify Incremental_input of the command line.
14664
e55bde5e
ILT
146652009-04-01 Ian Lance Taylor <iant@google.com>
14666 Mikolaj Zalewski <mikolajz@google.com>
14667
14668 * gold.h (reserve_unordered_map): Define, three versions, one for
14669 each version of Unordered_map.
14670 * layout.cc (Layout::Layout): Remove options parameter. Add
14671 number_of_input_files parameter. Don't initialize options_.
14672 Initialize number_of_input_files_ and resized_signatures_. Move
14673 sections_are_attached_.
14674 (Layout::layout_group): Reserve space for group_signatures_.
14675 (Layout::find_or_add_kept_section): Change name parameter to be a
14676 reference. Resize signatures_ map when it gets large enough.
14677 (Layout::layout_eh_frame): Use parameters->options() instead of
14678 this->options_.
14679 (Layout::make_output_section): Likewise.
14680 (Layout::attach_allocated_section_to_segment): Likewise.
14681 (Layout::finalize, Layout::create_executable_stack): Likewise.
14682 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14683 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14684 * layout.h (class Layout): Update declarations. Remove options_
14685 field. Add number_of_input_files_ and resized_signatures_
14686 fields. Move sections_are_attached_ field.
14687 * main.cc (main): Pass number of input files to Layout
14688 constructor. Don't pass options.
14689
154b857c
ILT
146902009-03-30 Ian Lance Taylor <iant@google.com>
14691
14692 * ffsll.c (ffsll): Correct implementation.
14693
2f35ab9b
ILT
146942009-03-27 Ian Lance Taylor <iant@google.com>
14695
fd03461a
ILT
14696 * ffsll.c: New file.
14697 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14698 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14699 * ftruncate.c (ftruncate): Declare before definition.
14700 * mremap.c (mremap): Likewise.
14701 * pread.c (pread): Likewise.
14702 * configure, Makefile.in, config.in: Rebuild.
14703
2f35ab9b
ILT
14704 * mremap.c: New file.
14705 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14706 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14707 (mremap): Declare if HAVE_MREMAP is not defined.
14708 * configure, Makefile.in, config.in: Rebuild.
14709
33aea2fd
CC
147102009-03-27 Cary Coutant <ccoutant@google.com>
14711
14712 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14713 position independent.
14714 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14715 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14716
6d479619
CC
147172009-03-24 Cary Coutant <ccoutant@google.com>
14718
14719 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14720 an executable.
14721 (needs_dynamic_reloc): Likewise.
14722
afc06bb8
ILT
147232009-03-24 Ian Lance Taylor <iant@google.com>
14724
14725 * yyscript.y (file_cmd): Recognize EXTERN.
14726 (extern_name_list, extern_name_list_body): New nonterminals.
14727 * script.cc (script_add_extern): Define.
14728 * script-c.h (script_add_extern): Declare.
14729
f6060a4d
ILT
147302009-03-24 Rafael Avila de Espindola <espindola@google.com>
14731
14732 * object.cc (is_elf_object): Define.
14733 * object.h (is_elf_object): Declare.
14734 * archive.cc (Archive::get_elf_object_for_member): Call
14735 is_elf_object.
33aea2fd 14736 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14737
26736d8e
ILT
147382009-03-24 Elliott Hughes <enh@google.com>
14739
14740 * output.cc (Output_file::map_anonymous): Define.
14741 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14742 try an anonymous one. Report the size if the mmap fails.
14743 * output.h (class Output_file): Declare map_anonymous.
14744
22fd9730
ILT
147452009-03-24 Ian Lance Taylor <iant@google.com>
14746
14747 * target-select.cc (instantiate_target): Don't acquire the lock if
14748 the instantiated_target_ field has already been set.
14749
cb010894
ILT
147502009-03-23 Ian Lance Taylor <iant@google.com>
14751
7f055c20
ILT
14752 * gold-threads.h (class Initialize_lock): Define.
14753 * gold-threads.cc (class Initialize_lock_once): Define.
14754 (initialize_lock_control): New static variable.
14755 (initialize_lock_pointer): New static variable.
14756 (initialize_lock_once): New static function.
14757 (Initialize_lock::Initialize_lock): Define.
14758 (Initialize_lock::initialize): Define.
14759 * target-select.h: Include "gold-threads.h".
14760 (class Target_selector): Add lock_ and initialize_lock_ fields.
14761 Don't define instantiate_target, just declare it.
14762 * target-select.cc (Target_selector::Target_selector): Initialize
14763 new fields.
14764 (Target_selector::instantiate_target): Define.
14765 * descriptors.h: Include "gold-threads.h".
14766 (class Descriptors): Add initialize_lock_ field.
14767 * descriptors.cc (Descriptors::Descriptors): Initialize new
14768 field.
14769 (Descriptors::open): Use initialize_lock_ field
14770 * errors.h (class Errors): Add initialize_lock_ field.
14771 * errors.cc (Errors::Errors): Initialize new field.
14772 (Errors::initialize_lock): Use initialize_lock_ field.
14773 * powerpc.cc (class Target_selector_powerpc): Remove
14774 instantiated_target_ field. In do_recognize call
14775 instantiate_target rather than do_instantiate_target. In
14776 do_instantiate_target just allocate a new target.
14777 * sparc.cc (class Target_selector_sparc): Likewise.
14778
36959681
ILT
14779 * freebsd.h: New file.
14780 * i386.cc: Include "freebsd.h".
14781 (Target_i386): Derive from Target_freebsd rather than
14782 Sized_target.
14783 (Target_selector_i386): Derive from Target_selector_freebsd rather
14784 than Target_selector.
14785 * x86_64.cc: Include "freebsd.h".
14786 (Target_x86_64): Derive from Target_freebsd rather than
14787 Sized_target.
14788 (Target_selector_x86_64): Derive from Target_selector_freebsd
14789 rather than Target_selector.
14790 * target.h (class Target): Add adjust_elf_header and
14791 do_adjust_elf_header.
14792 * output.cc (Output_file_header:: do_sized_write): Call target
14793 adjust_elf_header routine.
14794 * configure.tgt: Set targ_osabi.
14795 * configure.ac: Define GOLD_DEFAULT_OSABI.
14796 * parameters.cc (Parameters::default_target): Pass
14797 GOLD_DEFAULT_OSABI to select_target.
14798 * target-select.h (class Target_selector): Make instantiate_target
14799 protected rather than private.
14800 * Makefile.am (HFILES): Add freebsd.h.
14801 * configure, Makefile.in, config.in: Rebuild.
14802
cb010894
ILT
14803 * merge.cc (do_add_input_section): Correct pend value. Change
14804 message about last entry not being null terminated from error to
14805 warning.
14806
0e879927
ILT
148072009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14808
14809 * incremental.cc: New file.
14810 * Makefile.am (CCFILES): Add incremental.cc.
14811 * Makefile.in: Rebuild.
14812
41105937
PP
148132009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14814
14815 * layout.cc (Layout::output_section_name): Preserve names
14816 of '.note.' sections.
e1df38aa 14817
60439920
ILT
148182009-03-19 Ian Lance Taylor <iant@google.com>
14819
14820 * descriptors.cc (Descriptors::open): Check that the options are
14821 valid before using them.
14822
0d371ad3
ILT
148232009-03-18 Ian Lance Taylor <iant@google.com>
14824
14825 * script-sections.h: Include <list>.
14826 (class Script_sections): Change Sections_elements from std::vector
14827 to std::list. Typedef public Elements_iterator. Add
14828 orphan_section_placement_, data_segment_align_start_, and
14829 saw_data_segment_align_ fields. Remove data_segment_align_index_
14830 field.
14831 * script-sections.cc (class Orphan_section_placement): New class.
14832 (class Sections_element): Add virtual functions is_relro and
14833 orphan_section_init. Remove virtual function place_orphan_here.
14834 (class Output_section_definition): Add is_relro and
14835 orphan_section_init. Remove place_orphan_here.
14836 (class Orphan_output_section): Likewise.
14837 (Script_sections::Script_sections): Update for field changes.
14838 (Script_sections::data_segment_align): Set saw_data_segment_align_
14839 and data_segment_align_start_, not data_segment_align_index.
14840 (Script_sections::data_segment_relro_end): Check
14841 saw_data_segment_align_. Use data_segment_align_start_ rather
14842 than data_segment_align_index_.
14843 (Script_sections::place_orphan): Rewrite to use
14844 Orphan_section_placement.
14845
9201d894
ILT
148462009-03-17 Ian Lance Taylor <iant@google.com>
14847
9c5b8369
ILT
14848 * archive.cc (Archive::add_symbols): Check for a version attached
14849 to the symbol name in the archive map.
14850 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14851 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14852 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14853 (ver_test_11.a): New target.
14854 * testsuite/Makefile.in: Rebuild.
14855
9201d894
ILT
14856 * configure.ac: Check for chsize and posix_fallocate. Replace
14857 ftruncate.
14858 * ftruncate.c: New file, from gnulib.
14859 * output.cc (posix_fallocate): Define dummy version if not
14860 HAVE_POSIX_FALLOCATE.
14861 (Output_file::map): Call posix_fallocate rather than lseek and
14862 write.
14863 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14864 * configure, Makefile.in, config.in: Rebuild.
14865
ef4ab7a8 148662009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14867
ef4ab7a8
PP
14868 * layout.h (Layout::create_note): Add section_name parameter.
14869 * layout.cc (Layout::create_note): Likewise.
14870 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14871
8c500701
ILT
148722009-03-17 Ian Lance Taylor <iant@google.com>
14873
e85b18e1
ILT
14874 * descriptors.cc: Include "options.h".
14875 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14876 (Descriptors::open): Always use O_CLOEXEC when opening a new
14877 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14878 then set FD_CLOEXEC.
14879
9efe6174
ILT
14880 * sparc.cc (class Target_sparc): Add has_got_section.
14881 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14882 make sure we have a GOT section.
14883
14884 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14885 (Target_sparc::Scan::local): Likewise.
14886 (Target_sparc::Scan::global): Likewise.
14887 (Target_sparc::Relocate::relocate): Likewise.
14888 (Target_sparc::Relocate::relocate_tls): Likewise.
14889
8c500701
ILT
14890 * symtab.cc (Symbol_table::define_default_version): New function,
14891 broken out of add_from_object.
14892 (Symbol_table::add_from_object): Call define_default_version.
14893 (Symbol_table::define_special_symbol): Add resolve_oldsym
14894 parameter. Change all callers. If the version for a symbol comes
14895 from a version script, resolve it with the symbol with the same
14896 name with no version. Also add the symbol without a version if
14897 appropriate.
14898 (do_define_in_output_data): If resolving with oldsym, don't delete
14899 sym.
14900 (do_define_in_output_segment): Likewise.
14901 (do_define_as_constant): Likewise.
14902 * symtab.h (class Symbol_table): Update declarations.
14903
f1ed28fb
ILT
149042009-03-13 Ian Lance Taylor <iant@google.com>
14905
15f8229b
ILT
14906 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14907 (Read_symbols::requeue): New function.
14908 (Read_symbols::do_read_symbols): If make_elf_object fails because
14909 the target type is not configured, and the file was searched for,
14910 issue a warning and retry with the next directory.
14911 (Add_symbols::run): If the file has an incompatible format, and
14912 it was searched for, requeue the Read_symbols task. On error,
14913 release the object.
14914 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14915 dirindex parameter to constructor. Change all callers. Declare
14916 incompatible_warning and requeue.
14917 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14918 input_argument_ and input_group_ fields. Add them to
14919 constructor. Change all callers.
14920 (class Read_script): Add dirindex_ field. Add it to constructor.
14921 Change all callers.
14922 * archive.cc (Archive::setup): Remove input_objects parameter.
14923 Change all callers.
14924 (Archive::get_file_and_offset): Likewise.
14925 (Archive::read_all_symbols): Likewise.
14926 (Archive::read_symbols): Likewise.
14927 (Archive::get_elf_object_for_member): Remove input_objects
14928 parameter. Add punconfigured parameter. Change all callers.
14929 (Archive::add_symbols): Change return type to bool. Check return
14930 value of include_member.
14931 (Archive::include_all_members): Likewise.
14932 (Archive::include_member): Change return type to bool. Return
14933 false if first included object has incompatible target. Set
14934 included_member_ field.
14935 (Add_archive_symbols::run): If add_symbols returns false, requeue
14936 Read_symbols task.
14937 * archive.h (class Archive): Add included_member_ field.
14938 Initialize it in constructor. Add input_file and searched_for
14939 methods. Update declarations.
14940 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14941 input_argument_ fields. Add them to constructor. Change all
14942 callers.
14943 * script.cc: Include "target-select.h".
14944 (class Parser_closure): Add skip_on_incompatible_target_ and
14945 found_incompatible_target_ fields. Add
14946 skip_on_incompatible_target parameter to constructor. Change all
14947 callers. Add methods skip_on_incompatible_target,
14948 clear_skip_on_incompatible_target, found_incompatible_target, and
14949 set_found_incompatible_target.
14950 (read_input_script): Add dirindex parameter. Change all callers.
14951 If parser finds an incompatible target, requeue Read_symbols
14952 task.
14953 (script_set_symbol): Clear skip_on_incompatible_target in
14954 closure.
14955 (script_add_assertion, script_parse_option): Likewise.
14956 (script_start_sections, script_add_phdr): Likewise.
14957 (script_check_output_format): New function.
14958 * script.h (read_input_script): Update declaration.
14959 * script-c.h (script_check_output_format): Declare.
14960 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14961 (ignore_cmd): Remove OUTPUT_FORMAT.
14962 * fileread.cc (Input_file::Input_file): Add explicit this.
14963 (Input_file::will_search_for): New function.
14964 (Input_file::open): Add pindex parameter. Change all callers.
14965 * fileread.h (class Input_file): Add input_file_argument method.
14966 Declare will_search_for. Update declarations.
14967 * object.cc (make_elf_object): Add punconfigured parameter.
14968 Change all callers.
14969 * object.h (class Object): Make input_file public. Add
14970 searched_for method.
14971 (make_elf_object): Update declaration.
14972 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14973 restart search.
14974 * dirsearch.h (class Dirsearch): Update declaration.
14975 * options.h (class General_options): Add --warn-search-mismatch.
14976 * parameters.cc (Parameters::is_compatible_target): New function.
14977 * parameters.h (class Parameters): Declare is_compatible_target.
14978 * workqueue.cc (Workqueue::add_blocker): New function.
14979 * workqueue.h (class Workqueue): Declare add_blocker.
14980
f1ed28fb
ILT
14981 * fileread.cc (Input_file::open): Remove options parameter.
14982 Change all callers.
14983 (Input_file::open_binary): Likewise.
14984 * script.cc (read_input_script): Likewise.
14985 * readsyms.h (class Read_symbols): Remove options_ field. Remove
14986 options parameter from constructor. Change all callers.
14987 (class Read_script): Likewise.
14988 * fileread.h (class Input_file): Update declarations.
14989 * script.h (read_input_script): Update declaration.
14990
34dd024a
NC
149912009-03-10 Nick Clifton <nickc@redhat.com>
14992
14993 * po/es.po: New Spanish translation.
14994
6d71b17c
CC
149952009-03-06 Cary Coutant <ccoutant@google.com>
14996
14997 * options.cc (parse_short_option): Keep dash_z from registering itself.
14998
031cdbed
ILT
149992009-03-03 Ian Lance Taylor <iant@google.com>
15000
15001 PR 9918
15002 * target-reloc.h (relocate_section): Pass output_section to
15003 relocate.
15004 * i386.cc (Target_i386::should_apply_static_reloc): Add
15005 output_section parameter. Change all callers.
15006 (Target_i386::Relocate::relocate): Add output_section parameter.
15007 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15008 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15009 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15010 * testsuite/two_file_shared.sh: New script.
15011 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15012 (check_DATA): Add two_file_shared.dbg.
15013 (two_file_shared.dbg): New target.
15014 * testsuite/Makefile.in: Rebuild.
15015
15d5fa16
ILT
150162009-03-01 Ian Lance Taylor <iant@google.com>
15017
15018 * configure.ac: Check for byteswap.h.
15019 * configure: Rebuild.
15020 * config.in: Rebuild.
15021
8a4c0b0d
ILT
150222009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15023
15024 * layout.cc (Layout::find_or_add_kept_section): New function.
15025 (Layout::add_comdat): Removed.
15026 * layout.h (struct Kept_section): Move out of class Layout.
15027 Remove trailing underscores from field names. Add group_sections
15028 field. Rename group_ field to is_group. Change all uses.
15029 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15030 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15031 comdat_groups_ field.
15032 (Sized_relobj::include_section_group): Use
15033 find_or_add_kept_section and Kept_section::group_sections.
15034 (Sized_relobj::include_linkonce_section): Likewise.
15035 * object.cc (class Sized_relobj): Don't define Comdat_group or
15036 Comdat_group_table. Remove find_comdat_group and
15037 add_comdat_group. Remove comdat_groups_ field.
15038 * plugin.cc (include_comdat_group): Use
15039 Layout::find_or_add_kept_section.
15040
b4ecf66b
ILT
150412009-02-28 Ian Lance Taylor <iant@google.com>
15042
14359ca0
ILT
15043 * README: --gc-sections and map files are now supported. Document
15044 some build requirements.
15045
b4ecf66b
ILT
15046 PR 6992
15047 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15048 relocatable link set the value of the section symbol to zero.
15049 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15050 relocatable link don't include the section address in the local
15051 symbol value.
15052
0602e05a
ILT
150532009-02-27 Ian Lance Taylor <iant@google.com>
15054
fd9d194f
ILT
15055 PR 6811
15056 * options.h (class Search_directory): Add is_system_directory.
15057 (class General_options): Declare is_in_system_directory.
15058 * options.cc (get_relative_sysroot): Make static.
15059 (get_default_sysroot): Make static.
15060 (General_optoins::is_in_system_directory): New function.
15061 * fileread.cc (Input_file::is_in_system_directory): New function.
15062 * fileread.h (class Input_file): Declare is_in_system_directory.
15063 * object.h (class Object): Add is_in_system_directory.
15064 (class Input_objects): Remove system_library_directory_ field.
15065 * object.cc (Input_objects::add_object): Don't set
15066 system_library_directory_.
15067 (input_objects::found_in_system_library_directory): Remove.
15068 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15069 parameter. Change all callers.
15070 (Symbol_table::sized_write_globals): Likewise.
15071 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15072 Call Object::is_in_system_directory.
15073 * symtab.h (class Symbol_table): Update declarations.
15074
61edd21f
ILT
15075 PR 5990
15076 * descriptors.h (Open_descriptor): Add is_on_stack field.
15077 * descriptors.cc (Descriptors::open): If the descriptor is on the
15078 top of the stack, remove it. Initialize is_on_stack field.
15079 (Descriptors::release): Only add pod to stack if it is not on the
15080 stack already.
15081 (Descriptors::close_some_descriptor): Clear stack_next and
15082 is_on_stack fields.
15083
e29e076a
ILT
15084 PR 7091
15085 * output.cc (Output_section::find_starting_output_address): Rename
15086 from starting_output_address; add PADDR parameter; change return
15087 type.
15088 * output.h (class Output_section): Declare
15089 find_starting_output_address instead of starting_output_address.
15090 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15091 section symbol for which we can't find a merge section.
15092
0602e05a
ILT
15093 PR 9836
15094 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15095 hidden or internal, force the symbol to be local.
15096 * resolve.cc (Symbol::override_visibility): Define.
15097 (Symbol::override_base): Use override_visibility.
15098 (Symbol_table::resolve): Likewise.
15099 (Symbol::override_base_with_special): Likewise.
15100 (Symbol_table::override_with_special): If the visibility is hidden
15101 or internal, force the symbol to be local.
15102 * symtab.h (class Symbol): Add set_visibility and
15103 override_visibility.
15104 * testsuite/ver_test_1.sh: New file.
15105 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15106 (check_DATA): Add ver_test_1.syms.
15107 (ver_test_1.syms): New target.
15108 * testsuite/Makefile.in: Rebuild.
15109
401a9a73
CC
151102009-02-25 Cary Coutant <ccoutant@google.com>
15111
15112 * layout.cc (Layout::choose_output_section): Don't rename sections
15113 when using a linker script that has a SECTIONS clause.
15114 * Makefile.in: Regenerate.
15115
15116 * testsuite/Makefile.am (script_test_5.sh): New test case.
15117 * testsuite/Makefile.in: Regenerate.
15118 * testsuite/script_test_5.cc: New file.
15119 * testsuite/script_test_5.sh: New file.
15120 * testsuite/script_test_5.t: New file.
15121
f488e4b0
CC
151222009-02-13 Rafael Avila de Espindola <espindola@google.com>
15123
15124 * archive.cc (Archive::include_member): Update calls to add_symbols.
15125 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15126 the Layout argument.
15127 * dynobj.h (do_add_symbols): Add the Layout argument.
15128 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15129 Layout argument.
15130 * object.h (Object::add_symbols): Add the Layout argument.
15131 (Object::do_add_symbols): Add the Layout argument.
15132 (Sized_relobj::do_add_symbols): Add the Layout argument.
15133 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15134 Unify the two versions.
15135 (Add_plugin_symbols): Remove.
15136 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15137 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15138 (Add_plugin_symbols): Remove.
15139 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15140 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15141 (Add_symbols::run): Make it work with Pulginobj.
15142
89dd1680
ILT
151432009-02-06 Ian Lance Taylor <iant@google.com>
15144
15145 * object.cc (Sized_relobj::do_layout): Make info message start
15146 with lower case letter.
15147
266d0a74
ILT
151482009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15149
602b464e
ILT
15150 * binary.cc: Fix file comment.
15151
266d0a74
ILT
15152 * options.h (enum Incremental_disposition): Define.
15153 (class General_options): Add new options: --incremental,
15154 --incremental_changed, --incremental_unchanged,
15155 --incremental_unknown. Add incremental_disposition_ and
15156 implicit_incremental_ fields.
15157 (General_options::incremental_disposition): New function.
15158 (class Position_dependent_options): Add incremental_disposition
15159 option.
15160 (Position_dependent_options::copy_from_options): Set incremental
15161 dispositions.
15162 * options.cc (General_options::parse_incremental_changed): New
15163 function.
2e702c99
RM
15164 (General_options::parse_incremental_unchanged): New function.
15165 (General_options::parse_incremental_unknown): New function.
15166 (General_options::General_options): Initialize new fields
266d0a74 15167 incremental_disposition_ and implicit_incremental_.
2e702c99 15168 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15169 without --incremental.
15170
f073bbf7
CD
151712009-02-06 Chris Demetriou <cgd@google.com>
15172
15173 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15174 pointer and to report location as the file name associated with
15175 the symbol.
15176 (gold_undefined_symbol_at_location): New function to replace the
15177 old gold_undefined_symbol functionality.
15178 * target-reloc.h (relocate_section): Update to use
15179 gold_undefined_symbol_at_location.
15180 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15181 Call gold_undefined_symbol function rather than gold_error.
15182 * errors.h (Errors::undefined_symbol): Take location as a
15183 string, rather than calculating it from a relocation.
15184 * errors.cc (Errors::fatal): Print "fatal error:" before the
15185 formatted message.
15186 (Errors::error, Errors::error_at_location): Print "error: "
15187 before the formatted message.
15188 (Errors::undefined_symbol): Take location as a string, rather
15189 than calculating it from a relocation.
15190 (gold_undefined_symbol_at_location): New function akin to
15191 old gold_undefined_symbol, calculates location from relocation.
15192 (gold_undefined_symbol): Change to take only a Symbol pointer
15193 and to report location as the file name associated with the symbol.
15194 * testsuite/debug_msg.sh: Update for changed error messages.
15195 * testsuite/undef_symbol.sh: Likewise.
15196
8e94a90c
ILT
151972009-02-04 Duncan Sands <baldrick@free.fr>
15198
15199 PR 9812
15200 * reduced_debug_output.h
15201 (Output_reduced_debug_abbrev_section::failed): Use format for
15202 gold_warning.
15203 (Output_reduced_debug_info_section::faild): Likewise.
15204
88a0e15b
ILT
152052009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15206
15207 * script.cc (Lazy_demangler): New class.
2e702c99 15208 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15209 symbol only once.
15210
5efc7cd2
CC
152112009-01-29 Cary Coutant <ccoutant@google.com>
15212
15213 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15214 to __tls_get_addr.
15215 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15216
e0ebcf42
ILT
152172009-01-28 Ian Lance Taylor <iant@google.com>
15218
5efc7cd2 15219 * version.cc (version_string): Bump to 1.9.
75fe7426 15220
e0ebcf42
ILT
15221 * gold.h: Include <cstring> and <stdint.h>.
15222 * version.cc: Include <cstdio>.
15223 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15224 warning.
15225 * reduced_debug_output.cc (insert_into_vector): Rename from
15226 Insert_into_vector; change all callers. Use Swap_unaligned to
15227 avoid aliasing issue; remove union since it is unnecessary.
15228
8e2813be 152292009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15230
15231 * Makefile.am (CCFILES): Add gc.cc.
15232 (HFILES): Add gc.h.
15233 * Makefile.in: Regenerate.
15234 * gold.cc (Gc_runner): New class.
15235 (queue_initial_tasks): Call garbage collection related tasks
15236 when corresponding options are invoked.
15237 (queue_middle_gc_tasks): New function.
15238 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15239 processed early before laying out sections during garbage collection.
15240 * gold.h (queue_middle_gc_tasks): New function.
15241 (is_prefix_of): Move from "layout.cc".
15242 * i386.cc (Target_i386::gc_process_relocs): New function.
15243 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15244 * main.cc (main): Create object of class "Garbage_collection".
15245 * object.cc (Relobj::copy_symbols_data): New function.
15246 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15247 (Sized_relobj::do_layout): Allow this function to be called twice
15248 during garbage collection and defer layout of section during the
6d03d481
ST
15249 first call.
15250 * object.h (Relobj::get_symbols_data): New function.
15251 (Relobj::is_section_name_included): New function.
15252 (Relobj::copy_symbols_data): New function.
15253 (Relobj::set_symbols_data): New function.
15254 (Relobj::get_relocs_data): New function.
15255 (Relobj::set_relocs_data): New function.
15256 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15257 (Relobj::gc_process_relocs): New function.
15258 (Relobj::do_gc_process_relocs): New pure virtual function.
15259 (Relobj::sd_): New data member.
15260 (Sized_relobj::is_output_section_offset_invalid): New function.
15261 (Sized_relobj::do_gc_process_relocs): New function.
15262 * options.h (General_options::gc_sections): Modify to not be a no-op.
15263 (General_options::print_gc_sections): New option.
15264 * plugin.cc (Plugin_finish::run): Remove function call to
15265 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15266 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15267 * reloc.cc (Read_relocs::run): Add task to process relocs and
15268 determine unreferenced sections when doing garbage collection.
15269 (Gc_process_relocs): New class.
15270 (Sized_relobj::do_gc_process_relocs): New function.
15271 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15272 sections that are garbage collected.
15273 * reloc.h (Gc_process_relocs): New class.
15274 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15275 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15276 symbols whose corresponding sections are garbage collected.
15277 (Symbol_table::Symbol_table): Add new parameter for the garbage
15278 collection object.
15279 (Symbol_table::gc_mark_undef_symbols): New function.
15280 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15281 (Symbol_table::gc_mark_dyn_syms): New function.
15282 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15283 as garbage.
15284 (Symbol_table::add_from_object): Likewise.
15285 (Symbol_table::add_from_relobj): When building shared objects, do not
15286 treat externally visible symbols as garbage.
15287 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15288 table information for static and relocatable links.
15289 * symtab.h (Symbol_table::set_gc): New function.
15290 (Symbol_table::gc): New function.
15291 (Symbol_table::gc_mark_undef_symbols): New function.
15292 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15293 (Symbol_table::gc_mark_dyn_syms): New function.
15294 (Symbol_table::gc_): New data member.
e1df38aa 15295 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15296 function.
15297 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15298 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15299
3b293544
CF
153002009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15301
15302 * options.h (General_options::gc_sections): Define as a no-op for now.
15303 (General_options::no_keep_memory): Ditto.
15304 (General_options::Bshareable): Define.
15305 * options.cc (General_options::finalize): Honor -Bshareable.
15306
83d22aa8
AS
153072009-01-20 Andreas Schwab <schwab@suse.de>
15308
15309 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15310 read the value in the contents, since we don't use it. Use the
15311 template endianness when writing.
15312 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15313
cd536b21
AS
153142009-01-19 Andreas Schwab <schwab@suse.de>
15315
15316 * configure.tgt (powerpc64-*): Fix targ_obj.
15317
99e9a495
ILT
153182009-01-15 Ian Lance Taylor <iant@google.com>
15319
15320 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15321 local symbols when stripping all symbols.
15322
bbbfea06
CC
153232009-01-14 Cary Coutant <ccoutant@google.com>
15324
99e9a495 15325 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15326
0f7c0701
CC
153272009-01-14 Cary Coutant <ccoutant@google.com>
15328
15329 * archive.cc (Archive::get_elf_object_for_member): Remove call
15330 to File_read::claim_for_plugin.
15331 * descriptors.cc (Descriptors::open): Remove reference to
15332 is_claimed.
15333 (Descriptors::claim_for_plugin): Remove.
15334 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15335 (Descriptors::is_claimed): Remove.
15336 (claim_descriptor_for_plugin): Remove.
15337 * fileread.cc (File_read::claim_for_plugin): Remove.
15338 * fileread.h (File_read::claim_for_plugin): Remove.
15339 (File_read::descriptor): Reopen descriptor if necessary.
15340 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15341 (Plugin_manager::all_symbols_read): Add task parameter. Change
15342 all callers.
15343 (Plugin_manager::get_input_file): New function.
15344 (Plugin_manager::release_input_file): New function.
15345 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15346 corresponding data member.
15347 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15348 and pass to base constructor. Change all callers.
15349 (get_input_file, release_input_file): New functions.
15350 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15351 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15352 (Plugin_manager::all_symbols_read): Add task parameter.
15353 (Plugin_manager::get_input_file): New function.
15354 (Plugin_manager::release_input_file): New function.
15355 (Plugin_manager::task_): New data member.
15356 (Pluginobj::Pluginobj): Add filesize parameter.
15357 (Pluginobj::filename): New function.
15358 (Pluginobj::descriptor): New function.
15359 (Pluginobj::filesize): New function.
15360 (Pluginobj::filesize_): New data member.
15361 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15362 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15363 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15364
15365 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15366 with archive libraries.
15367 * testsuite/Makefile.in: Regenerate.
15368 * testsuite/plugin_test.c (struct sym_info): New type.
15369 (get_input_file, release_input_file): New static variables.
15370 (onload): Capture new transfer vector entries.
15371 (claim_file_hook): Stop reading at end of file according to filesize.
15372 Factor out parsing of readelf output into separate function.
15373 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15374 APIs and get the source file name from the symbol table. Convert
15375 source file name to corresponding object file name. Print info
15376 message when adding new input files.
15377 (parse_readelf_line): New function.
15378 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15379 * testsuite/plugin_test_2.sh: Likewise.
15380 * testsuite/plugin_test_3.sh: Likewise.
15381 * testsuite/plugin_test_4.sh: New test case.
15382
62a6d109
ILT
153832009-01-07 Ian Lance Taylor <iant@google.com>
15384
15385 * version.cc (version_string): Bump to 1.8.
15386
483620e8
CC
153872008-12-23 Cary Coutant <ccoutant@google.com>
15388
15389 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15390 * plugin.cc (Plugin_manager::finish): Rename as
15391 layout_deferred_objects. Move cleanup to separate function.
15392 (Plugin_manager::cleanup): New function.
15393 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15394 separately.
15395 * plugin.h (Plugin_manager::finish): Rename as
15396 layout_deferred_objects.
15397 (Plugin_manager::cleanup): New function.
15398 (Plugin_manager::cleanup_done): New field.
15399
d66a9eb3
CC
154002008-12-23 Cary Coutant <ccoutant@google.com>
15401
15402 * plugin.cc (is_visible_from_outside): New function.
15403 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15404 so we don't return "IR only" status for exported symbols or -r links.
15405
15406 * testsuite/Makefile.am (plugin_test_3): New test case.
15407 * testsuite/Makefile.in: Regenerate.
15408 * testsuite/plugin_test_3.sh: New file.
15409
5995b570
CC
154102008-12-22 Cary Coutant <ccoutant@google.com>
15411
15412 * object.cc (Sized_relobj::layout_section): New function.
15413 (Sized_relobj::do_layout): Defer layout of input sections until after
15414 plugin has provided replacement files.
15415 (Sized_relobj::do_layout_deferred_sections): New function.
15416 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15417 (Relobj::layout_deferred_sections): New function.
15418 (Relobj::do_layout_deferred_sections): New function.
15419 (Sized_relobj::do_layout_deferred_sections): New function.
15420 (Sized_relobj::layout_section): New function.
15421 (Sized_relobj::Deferred_layout): New structure.
15422 (Sized_relobj::deferred_layout_): New field.
15423 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15424 Change all callers. Layout deferred sections.
15425 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15426 references.
15427 (Plugin_hook::run): Move code from do_plugin_hook inline.
15428 (Plugin_hook::do_plugin_hook): Remove.
15429 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15430 (Plugin_manager::finish): Renamed, was cleanup.
15431 (Plugin_manager::should_defer_layout): New function.
15432 (Plugin_manager::add_deferred_layout_object): New function.
15433 (Plugin_manager::Deferred_layout_list): New type.
15434 (Plugin_manager::deferred_layout_objects_): New field.
15435 (Plugin_hook::do_plugin_hook): Remove.
15436
ee769c88
ILT
154372008-12-17 Ian Lance Taylor <iant@google.com>
15438
15439 * options.h (class General_options): Add --no case for
15440 --export-dynamic.
15441
abc8dcba
CC
154422008-12-16 Cary Coutant <ccoutant@google.com>
15443
15444 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15445 vector.
15446 (Plugin_manager::claim_file): Create plugin object even if
15447 plugin did not call the add_symbols callback.
15448 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15449 asking for more symbols than were added.
15450 * testsuite/Makefile.am (plugin_test_1): Add test case with
15451 no global symbols.
15452 (empty.syms): New target.
15453 * testsuite/Makefile.in: Regenerate.
15454 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15455 message. Don't call add_symbols if no globals.
15456 (all_symbols_read_hook): Don't provide replacement for empty
15457 claimed file.
15458
b0074644
ILT
154592008-12-12 Ian Lance Taylor <iant@google.com>
15460
68943102
ILT
15461 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15462 r_type == 0 for a local symbol with r_sym == 0.
15463 (scan_relocatable_relocs): Pass r_sym to
15464 local_non_section_strategy.
15465 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15466 r_sym parameter.
15467
b0074644
ILT
15468 * configure.ac: Update test for TLS descriptors: they are
15469 supported as of glibc 2.9.
15470 * configure: Rebuild.
15471
c2508178
ILT
154722008-12-11 Ian Lance Taylor <iant@google.com>
15473
15474 PR 7091
15475 * target-reloc.h (Default_scan_relocatable_relocs): For each
15476 function, map r_type == 0 to RELOC_DISCARD.
15477
2756a258
CC
154782008-12-10 Cary Coutant <ccoutant@google.com>
15479
15480 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15481 object to override a kept COMDAT group from a plugin object.
15482
bb6f53d3
ILT
154832008-12-09 Ian Lance Taylor <iant@google.com>
15484
fbc558e1
ILT
15485 PR 7088
15486 * yyscript.y (file_cmd): Handle INPUT.
15487
bb6f53d3
ILT
15488 * testsuite/initpri1.c: Change all declarations to be full
15489 prototypes by adding void, to avoid compiler warnings.
15490
4674ecfc
CC
154912008-12-05 Rafael Avila de Espindola <espindola@google.com>
15492
15493 * options.cc (General_options::parse_plugin_opt): New.
15494 (General_options::add_plugin): The argument now is just the filename.
15495 (General_options::add_plugin_option): New.
15496 * options.h (plugin_opt): New.
15497 (add_plugin): Change argument name.
15498 (add_plugin_option): New.
15499 * plugin.cc (Plugin::load): Don't parse the plugin option.
15500 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15501 (Plugin::add_option): New.
15502 (Plugin::args_): Change type.
15503 (Plugin::filename_): New.
15504 (Plugin_manager::add_plugin_option): New.
15505 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15506 * testsuite/Makefile.in: Regenerate.
15507
fd06b4aa
CC
155082008-12-05 Cary Coutant <ccoutant@google.com>
15509
15510 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15511 Handle --strip-lto-sections option.
15512 * options.h (strip_lto_sections): New option.
15513
6c52134c
CC
155142008-12-01 Cary Coutant <ccoutant@google.com>
15515
15516 * plugin.cc (ld_plugin_message): Change format parameter to const.
15517 Fix mismatch between new[] and delete.
15518
a45248e0
CC
155192008-11-14 Cary Coutant <ccoutant@google.com>
15520
15521 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15522 instead of -1U.
15523
c82fbeee
CS
155242008-11-05 Craig Silverstein <csilvers@google.com>
15525
15526 * options.cc (General_options::parse_dynamic_list): New function.
15527 * options.h (General_options): New flags dynamic_list,
15528 dynamic_list_data, dynamic_list_cpp_new, and
15529 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15530 (General_options::in_dynamic_list): New function.
15531 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15532 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15533 (Lex::can_continue_name): Likewise.
15534 (yylex): Likewise.
15535 (read_script_file): New parameter script_options.
15536 (read_dynamic_list): New function.
15537 (Script_options::define_dynamic_list): New function.
15538 (dynamic_list_keyword_parsecodes): New variable.
15539 (dynamic_list_keywords): New variable.
15540 * script.h (Script_options::define_dynamic_list): New function
15541 prototype.
15542 (read_dynamic_list): New function prototype.
15543 * symtab.cc (strprefix): New macro.
15544 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15545 dynamic_list_data, dynamic_list_cpp_new, and
15546 dynamic_list_cpp_typeinfo.
15547 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15548 (dynamic_list_expr): New rule.
15549 (dynamic_list_nodes): Likewise.
15550 (dynamic_list_node): Likewise.
15551 * testsuite/Makefile.am (dynamic_list): New test.
15552 * testsuite/Makefile.in: Regenerated.
15553 * testsuite/dynamic_list.t: New file.
15554 * testsuite/dynamic_list.sh: New file.
15555
e0bb29a5
CS
155562008-11-05 Craig Silverstein <csilvers@google.com>
15557
15558 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15559 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15560 (t11_last): Likewise.
15561 * testsuite/ver_test_6.c (main): Likewise.
15562
4e1e25e0
CC
155632008-10-07 Cary Coutant <ccoutant@google.com>
15564
15565 * options.c (General_options::finalize): Add check for -static and
15566 -shared.
15567 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15568 is not empty.
15569
92f03fcb
CC
155702008-10-02 Cary Coutant <ccoutant@google.com>
15571
15572 * plugin.cc (make_sized_plugin_object): Fix conditional
15573 compilation to work when not all targets are enabled.
15574
fbd8a257
CC
155752008-09-29 Cary Coutant <ccoutant@google.com>
15576
15577 * archive.cc (Archive::get_file_and_offset): Use filename instead
15578 of name to get library path.
15579 (Archive::include_member): Unlock external member of a thin archive.
15580
15581 * testsuite/Makefile.am (TEST_AR): New variable.
15582 (thin_archive_test_1): New test.
15583 (thin_archive_test_2): New test.
81636b3f
CC
15584 * testsuite/Makefile.in: Regenerate.
15585 * testsuite/thin_archive_main.cc: New file.
15586 * testsuite/thin_archive_test_1.cc: New file.
15587 * testsuite/thin_archive_test_2.cc: New file.
15588 * testsuite/thin_archive_test_3.cc: New file.
15589 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15590
eff45813
CC
155912008-09-29 Cary Coutant <ccoutant@google.com>
15592
15593 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15594 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15595 instead of -1U.
15596 (Sized_relobj::do_finalize_local_symbols): Likewise.
15597 (Sized_relobj::map_to_kept_section): Likewise.
15598 * object.h (Sized_relobj::invalid_address): New constant.
15599 (Sized_relobj::do_output_section_offset): Check for invalid_address
15600 and return -1ULL.
15601 * output.cc (Output_reloc::local_section_offset): Use constant
15602 invalid_address instead of -1U.
15603 (Output_reloc::get_address): Likewise.
15604 (Output_section::output_address): Change -1U to -1ULL.
15605 * output.h (Output_reloc::invalid_address): New constant.
15606 * reloc.cc (Sized_relobj::write_sections): Use constant
15607 invalid_address instead of -1U.
15608 (Sized_relobj::relocate_sections): Likewise.
15609 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15610 values for merge sections.
15611 * target-reloc.h (relocate_for_relocatable): Use constant
15612 invalid_address instead of -1U.
15613
89fc3421
CC
156142008-09-19 Cary Coutant <ccoutant@google.com>
15615
15616 Add plugin functionality for link-time optimization (LTO).
15617 * configure.ac (plugins): Add --enable-plugins option.
15618 * configure: Regenerate.
15619 * config.in: Regenerate.
15620 * Makefile.am (LIBDL): New variable.
15621 (CCFILES): Add plugin.cc.
15622 (HFILES): Add plugin.h.
15623 (ldadd_var): Add LIBDL.
15624 * Makefile.in: Regenerate.
15625
15626 * archive.cc: Include "plugin.h".
15627 (Archive::setup): Don't preread archive symbols when using a plugin.
15628 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15629 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15630 files.
15631 (Archive::include_member): Add symbols from plugin objects.
15632 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15633 * descriptors.cc (Descriptors::open): Check for file descriptors
15634 abandoned by plugins.
15635 (Descriptors::claim_for_plugin): New function.
15636 * descriptors.h (Descriptors::claim_for_plugin): New function.
15637 (Open_descriptor::is_claimed): New field.
15638 (claim_descriptor_for_plugin): New function.
15639 * fileread.cc (File_read::claim_for_plugin): New function.
15640 * fileread.h (File_read::claim_for_plugin): New function.
15641 (File_read::descriptor): New function.
15642 * gold.cc: Include "plugin.h".
15643 (queue_initial_tasks): Add task to call plugin hooks for generating
15644 new object files.
15645 * main.cc: Include "plugin.h".
15646 (main): Load plugin libraries.
15647 * object.h (Pluginobj): Declare.
15648 (Object::pluginobj): New function.
15649 (Object::do_pluginobj): New function.
15650 (Object::set_target): New function.
15651 * options.cc: Include "plugin.h".
15652 (General_options::parse_plugin): New function.
15653 (General_options::General_options): Initialize plugins_ field.
15654 (General_options::add_plugin): New function.
15655 * options.h (Plugin_manager): Declare.
15656 (General_options): Add --plugin option.
15657 (General_options::has_plugins): New function.
15658 (General_options::plugins): New function.
15659 (General_options::add_plugin): New function.
15660 (General_options::plugins_): New field.
15661 * plugin.cc: New file.
15662 * plugin.h: New file.
15663 * readsyms.cc: Include "plugin.h".
15664 (Read_symbols::do_read_symbols): Check for archive before checking
15665 for ELF file. Call plugin hooks to claim files.
15666 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15667 from a real object file; force override when processing replacement
15668 files.
15669 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15670 (Symbol::init_base_object): Likewise.
15671 (Symbol::init_base_output_data): Likewise.
15672 (Symbol::init_base_output_segment): Likewise.
15673 (Symbol::init_base_constant): Likewise.
15674 (Symbol::init_base_undefined): Likewise.
15675 (Symbol::output_section): Assert that object is not a plugin.
15676 (Symbol_table::add_from_pluginobj): New function.
15677 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15678 undefined.
15679 (Symbol_table::sized_write_globals): Likewise.
15680 (Symbol_table::add_from_pluginobj): Instantiate template.
15681 * symtab.h (Sized_pluginobj): Declare.
15682 (Symbol::in_real_elf): New function.
15683 (Symbol::set_in_real_elf): New function.
15684 (Symbol::in_real_elf_): New field.
15685 (Symbol_table::add_from_pluginobj): New function.
15686
15687 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15688 (LIBDL): New variable.
15689 (LDADD): Add LIBDL.
15690 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15691 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15692 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15693 (MOSTLYCLEANFILES): Likewise.
15694 * testsuite/Makefile.in: Regenerate.
15695 * testsuite/plugin_test.c: New file.
15696 * testsuite/plugin_test_1.sh: New file.
15697 * testsuite/plugin_test_2.sh: New file.
15698
de31bda5
ILT
156992008-09-16 Ian Lance Taylor <iant@google.com>
15700
9c2d0ef9
ILT
15701 * target-reloc.h (relocate_section): Check whether a symbol is
15702 defined by the ABI before reporting an undefined symbol error.
15703 * target.h (Target::is_defined_by_abi): Make parameter const.
15704 (Target::do_is_defined_by_abi): Likewise.
15705 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15706 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15707 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15708 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15709 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15710 * testsuite/Makefile.in: Rebuild.
15711
de31bda5
ILT
15712 * fileread.cc (make_view): Add casts to avoid warning.
15713
9fa33bee
AO
157142008-09-16 Alexandre Oliva <aoliva@redhat.com>
15715
15716 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15717 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15718
183fd0e3
AO
157192008-09-16 Alexandre Oliva <aoliva@redhat.com>
15720
15721 * options.h (General_options::output_is_executable): New.
15722 (General_options::output_is_pie): New.
15723 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15724 for shared libraries.
15725 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15726
7be8330a
CD
157272008-09-11 Chris Demetriou <cgd@google.com>
15728
15729 * options.h (origin): New -z option.
15730 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15731 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15732 in DT_FLAGS_1.
15733
a9caad02
CC
157342008-09-05 Cary Coutant <ccoutant@google.com>
15735
15736 * fileread.cc (File_read::make_view): Add check for attempt to map
15737 beyond end of file.
15738
ae6dce4d
CC
157392008-09-05 Cary Coutant <ccoutant@google.com>
15740
15741 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15742 explicit instantiations.
15743
d7ab2a47
KVH
157442008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15745
15746 PR gold/6858
15747 * options.cc (General_options::finalize): Allow undefined symbols
15748 in shlibs if linking -shared.
15749
15750 PR gold/6859
15751 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15752 symbols as not needing a dynsym entry.
15753
1e52a9c1
CS
157542008-08-20 Craig Silverstein <csilvers@google.com>
15755
15756 * fileread.cc (File_read::open): Do not lock the file unless it
15757 was successfully opened.
15758
d85c80a3
CC
157592008-08-14 Cary Coutant <ccoutant@google.com>
15760
15761 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15762 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15763 * testsuite/tls_test.cc (struct int128): 128-bit struct
15764 for testing TLS relocs with non-zero addend.
15765 (v12): New TLS variable.
15766 (t12): New test.
15767 (t_last): Add check for v12.
15768 * testsuite/tls_test.h (t12): New function.
15769 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15770
2d924fd9
ILT
157712008-08-13 Ian Lance Taylor <iant@google.com>
15772
15773 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15774 set tls_segment_ or relro_segment_.
15775 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15776 when appropriate.
15777 * output.h (Output_section::clear_is_relro): New function.
15778 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15779 sections specially even when output_data_ is empty.
15780 (Output_segment::maximum_alignment): When first section is relro,
15781 only force alignment for PT_LOAD segments.
15782 * script.cc (script_data_segment_align): New function.
15783 (script_data_segment_relro_end): New function.
15784 * script-c.h (script_data_segment_align): Declare.
15785 (script_data_segment_relro_end): Declare.
15786 * script-sections.h (class Script_sections): Declare
15787 data_segment_align and data_segment_relro_end. Add fields
15788 segment_align_index_ and saw_relro_end_.
15789 * script-sections.cc (class Sections_element): Add set_is_relro
15790 virtual function. Add new bool* parameter to place_orphan_here.
15791 Add get_output_section virtual function.
15792 (class Output_section_definition): Add set_is_relro. Add new
15793 bool* parameter to place_orphan_here. Add get_output_section.
15794 Add is_relro_ field.
15795 (Output_section_definition::Output_section_definition): Initialize
15796 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15797 and is_relro_ fields.
15798 (Output_section_definition::place_orphan_here): Add is_relro
15799 parameter.
15800 (Output_section_definition::set_section_addresses): Set relro for
15801 output section.
15802 (Output_section_definition::alternate_constraint): Likewise.
15803 (class Orphan_output_section): Add new bool* parameter to
15804 place_orphan_here. Add get_output_section.
15805 (Orphan_output_section::place_orphan_here): Add is_relro
15806 parameter.
15807 (Script_sections::Script_sections): Initialize
15808 data_segment_align_index_ and saw_relro_end_.
15809 (Script_sections::data_segment_align): New function.
15810 (Script_sections::data_segment_relro_end): New function.
15811 (Script_sections::place_orphan): Set or clear is_relro.
15812 (Script_sections::set_section_addresses): Force alignment of first
15813 TLS section.
15814 * yyscript.y (exp): Call script_data_segment_align and
15815 script_data_segment_relro_end.
15816 * testsuite/relro_script_test.t: New file.
15817 * testsuite/relro_test.cc (using_script): Declare.
15818 (t1, t2): Test using_script.
15819 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15820 (relro_script_test_SOURCES): Define.
15821 (relro_script_test_DEPENDENCIES): Define.
15822 (relro_script_test_LDFLAGS): Define.
15823 (relro_script_test_LDADD): Define.
15824 (relro_script_test.so): New target.
15825 * testsuite/Makefile.in: Rebuild.
15826
f827c9a9
CC
158272008-08-06 Cary Coutant <ccoutant@google.com>
15828
15829 * archive.cc (Archive::total_archives, Archive::total_members)
15830 (Archive::total_members_loaded): New variables.
15831 (Archive::setup): Add parameter. Add option to preread
15832 archive symbols.
15833 (Archive::read_armap): Add counter.
15834 (Archive::get_file_and_offset): New function.
15835 (Archive::get_elf_object_for_member): New function.
15836 (Archive::read_all_symbols): New function.
15837 (Archive::read_symbols): New function.
15838 (Archive::add_symbols): Add counters.
15839 (Archive::include_all_members): Use armap to find members if it's
15840 already built.
15841 (Archive::include_member): Skip reading symbols if already read.
15842 Factored code into Archive::get_file_and_offset and
15843 Archive::get_elf_object_for_member. Changed call to
15844 Mapfile::report_include_archive_member.
15845 (Archive::print_stats): New function.
15846 * archive.h: Declare Object and Read_symbols_data classes.
15847 (Archive::Archive): Add initializers for new members.
15848 (Archive::setup): Add parameter.
15849 (Archive::print_stats): New function.
15850 (Archive::total_archives, Archive::total_members)
15851 (Archive::total_members_loaded): New variables.
15852 (Archive::get_file_and_offset): New function.
15853 (Archive::get_elf_object_for_member): New function.
15854 (Archive::read_all_symbols): New function.
15855 (Archive::read_symbols): New function.
15856 (Archive::Archive_member): New class.
15857 (Archive::members_): New member.
15858 (Archive::num_members_): New member.
15859 * main.cc: Include archive.h.
15860 (main): Call Archive::print_stats.
15861 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15862 archive parameter; member_name is now the fully-decorated name.
15863 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15864 * options.h: (General_options): Add --preread-archive-symbols option.
15865 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15866 Archive::setup.
15867
de4c45bd
ILT
158682008-08-04 Ian Lance Taylor <iant@google.com>
15869
15870 * symtab.h (Symbol::use_plt_offset): New function.
15871 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15872 * powerpc.cc (Relocate::relocate): Likewise.
15873 * sparc.cc (Relocate::relocate): Likewise.
15874 * x86_64.cc (Relocate::relocate): Likewise.
15875 * testsuite/weak_plt.sh: New test.
15876 * testsuite/weak_plt_main.cc: New test.
15877 * testsuite/weak_plt_shared.cc: New test.
15878 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15879 (check_PROGRAMS): Add weak_plt.
15880 (check_DATA): Add weak_plt_shared.so.
15881 (weak_plt_main_pic.o, weak_plt): New targets.
15882 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15883 * testsuite/Makefile.in: Rebuild.
15884
15885 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15886 gcctestdir/ld.
15887 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15888 * testsuite/Makefile.in: Rebuild.
15889
323ee3f4
AM
158902008-08-04 Alan Modra <amodra@bigpond.net.au>
15891
15892 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15893 * Makefile.in: Regenerate.
15894 * po/POTFILES.in: Regenerate.
15895
7c07ecec
ILT
158962008-07-29 Ian Lance Taylor <iant@google.com>
15897
15898 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15899 symbols before other symbols.
15900 * testsuite/script_test_2.cc (test_addr): Declare.
15901 (test_addr_alias): Declare.
15902 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15903 values.
7c07ecec
ILT
15904 * testsuite/script_test_2.t: Define test_addr_alias and
15905 test_addr.
15906
5778530e
ILT
159072008-07-24 Ian Lance Taylor <iant@google.com>
15908
2a00e4fb
ILT
15909 PR 5990
15910 * descriptors.cc: New file.
15911 * descriptors.h: New file.
15912 * gold-threads.h (class Hold_optional_lock): New class.
15913 * fileread.cc: Include "descriptors.h".
15914 (File_read::~File_read): Release descriptor rather than closing
15915 it.
15916 (File_read::open) [file]: Call open_descriptor rather than open.
15917 Set is_descriptor_opened_.
15918 (File_read::open) [memory]: Assert that descriptor is not open.
15919 (File_read::reopen_descriptor): New function.
15920 (File_read::release): Release descriptor.
15921 (File_read::do_read): Make non-const. Reopen descriptor.
15922 (File_read::read): Make non-const.
15923 (File_read::make_view): Reopen descriptor.
15924 (File_read::do_readv): Likewise.
15925 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15926 Update declarations.
15927 * layout.cc: Include "descriptors.h".
15928 (Layout::create_build_id): Use open_descriptor rather than open.
15929 * output.cc: Include "descriptors.h".
15930 (Output_file::open): Use open_descriptor rather than open.
15931 * archive.cc (Archive::const_iterator): Change Archive to be
15932 non-const.
15933 (Archive::begin, Archive::end): Make non-const.
15934 (Archive::count_members): Likewise.
15935 * archive.h (class Archive): Update declarations.
15936 * object.h (Object::read): Make non-const.
15937 * Makefile.am (CCFILES): Add descriptors.cc.
15938 (HFILES): Add descriptors.h.
15939 * Makefile.in: Rebuild.
15940
801647d1
ILT
15941 PR 6716
15942 * gold.h: Always include <clocale>. Add Solaris workarounds
15943 following code in binutils/sysdep.h.
15944
5edd166e
ILT
15945 PR 6048
15946 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15947 this->eh_frame_hdr_ is NULL before using it.
15948
c89ad728
ILT
15949 * dynobj.cc (Versions::Versions): Update comment.
15950
aa86f06b
ILT
15951 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15952 the base version name.
15953
5778530e
ILT
15954 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15955 array size plus one.
15956 (Stringpool_template::set_string_offsets): Subtract one from key
15957 before using it as an array index.
15958 (Stringpool_template::get_offset_with_length): Likewise.
15959 (Stringpool_template::write_to_buffer): Likewise.
15960 * stringpool.h (Stringpool_template::get_offset_from_key):
15961 Likewise.
15962
057ead22
ILT
159632008-07-23 Ian Lance Taylor <iant@google.com>
15964
7f649c59
ILT
15965 PR 6658
15966 * object.h (Merged_symbol_value::value): Do our best to handle a
15967 negative addend.
15968
057ead22
ILT
15969 PR 6647
15970 * script.cc (Version_script_info::get_versions): Don't add empty
15971 version tag to return value.
15972 (Version_script_info::get_symbol_version_helper): Change return
15973 type to bool. Add pversion parameter. Change all callers.
15974 (script_register_vers_node): Don't require a non-NULL tag.
15975 * script.h (class Version_script_info): Update declarations.
15976 (Version_script_info::get_symbol_version): Change return type to
15977 bool. Add version parameter. Change all callers.
15978 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15979 handling. Handle an empty version from a version script.
15980 (Symbol_table::define_special_symbol): Likewise.
15981 * testsuite/ver_test_10.script: New file.
15982 * testsuite/ver_test_10.sh: New file.
15983 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15984 (check_DATA): Add ver_test_10.syms.
15985 (ver_test_10.syms, ver_test_10.so): New target.
15986 * testsuite/Makefile.in: Rebuild.
15987
58e54ac2
CD
159882008-07-23 Simon Baldwin <simonb@google.com>
15989
15990 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
15991 to zero for undefined symbols from dynamic libraries.
15992
95d14cd3
ILT
159932008-07-23 Ian Lance Taylor <iant@google.com>
15994
15995 * symtab.cc (Symbol_table::resolve): Remove version parameter.
15996 Change all callers.
15997 * symtab.h (class Symbol_table): Update declaration.
15998 * testsuite/ver_test_9.cc: New file.
15999 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16000 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16001 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16002 (ver_test_9.so, ver_test_9.o): New targets.
16003 * testsuite/Makefile.in: Rebuild.
16004
92de84a6
ILT
160052008-07-22 Ian Lance Taylor <iant@google.com>
16006
34810851
ILT
16007 * options.h (class General_options): Define --check-sections.
16008 * layout.cc (Layout::set_segment_offsets): Handle
16009 --check-sections.
16010
af6156ef
ILT
16011 * options.h (class General_options): Define -n/--nmagic and
16012 -N/--omagic.
16013 * options.cc (General_options::finalize): For -n/--nmagic or
16014 -N/--omagic, set -static.
16015 * layout.cc (Layout::attach_allocated_section_to_segment): If
16016 -N/--omagic, don't put read-only and read-write sections in
16017 different segments.
16018 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16019 finding a read-only segment.
16020 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16021 don't set the minimum segment alignment to the common page size,
16022 and don't set the file offset to the address modulo the page size.
16023 * script-sections.cc (Script_sections::create_segments): If
16024 -n/--omagic, don't put read-only and read-write sections in
16025 different segments.
16026
92de84a6
ILT
16027 * cref.cc: New file.
16028 * cref.h: New file.
16029 * options.h (class General_options): Add --print-symbol-counts.
16030 * main.cc (main): Issue defined symbol report if requested.
16031 * archive.cc (Archive::interpret_header): Make into a const member
16032 function.
16033 (Archive::add_symbols): Call Input_objects::archive_start and
16034 archive_stop.
16035 (Archive::const_iterator): Define new class.
16036 (Archive::begin, Archive::end): New functions.
16037 (Archive::include_all_members): Rewrite to use iterator.
16038 (Archive::count_members): New function.
16039 * archive.h (class Archive): Update declarations.
16040 (Archive::filename): New function.
16041 * object.cc: Include "cref.h".
16042 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16043 (Sized_relobj::do_get_global_symbol_counts): New function.
16044 (Input_objects::add_object): Add object to cross-referencer.
16045 (Input_objects::archive_start): New function.
16046 (Input_objects::archive_stop): New function.
16047 (Input_objects::print_symbol_counts): New function.
16048 * object.h: Declare Cref and Archive.
16049 (Object::get_global_symbol_counts): New function.
16050 (Object::do_get_global_symbol_counts): New pure virtual function.
16051 (class Sized_relobj): Add defined_count_ field. Update
16052 declarations.
16053 (class Input_objects): Add cref_ field. Update constructor.
16054 Update declarations.
16055 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16056 defined_count_.
16057 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16058 symbol counts.
16059 (Sized_dynobj::do_get_global_symbol_counts): New function.
16060 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16061 defined_count_. Update declarations. Define Symbols typedef.
16062 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16063 parameter. Change all callers.
16064 (Symbol_table::add_from_dynobj): Add sympointers and defined
16065 parameters. Change all callers.
16066 * symtab.h (class Symbol_table): Update declarations.
16067 * Makefile.am (CCFILES): Add cref.cc.
16068 (HFILES): Add cref.h.
16069 * Makefile.in: Rebuild.
16070
3f7c5e1d
CD
160712008-07-22 Simon Baldwin <simonb@google.com>
16072
16073 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16074 to zero when writing undefined symbols.
16075
e0b64032
ILT
160762008-07-22 Ian Lance Taylor <iant@google.com>
16077
16078 * output.cc (Output_section::add_input_section): Don't try to
16079 merge empty merge sections.
16080
096b02cf
CS
160812008-07-21 Craig Silverstein <csilvers@google.com>
16082
16083 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16084 Include symbol version in error message.
cd536b21 16085
1d1f116d
CD
160862008-07-20 Chris Demetriou <cgd@google.com>
16087
cd536b21 16088 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16089 (RANDOM_SEED_CFLAGS): New substituted variable.
16090 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16091 * configure: Rebuild.
16092 * Makefile.in: Likewise.
16093 * testsuite/Makefile.in: Likewise.
16094
a18f591e
ILT
160952008-07-18 Ian Lance Taylor <iant@google.com>
16096
16097 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16098 where we see NAME/NULL and NAME/VERSION as separate symbols.
16099 * testsuite/ver_test_main.cc (main): Call t4.
16100 (t4, t4_2a): Define.
16101 * testsuite/ver_test_2.cc (t4_2): Define.
16102 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16103 * testsuite/ver_test_4.cc (t4_2a): Define.
16104 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16105 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16106
c6e3f6ed
ILT
161072008-07-17 Ian Lance Taylor <iant@google.com>
16108
16109 * dynobj.cc (Versions::add_def): If we give an error about a
16110 missing version, go ahead and create the version anyhow.
16111
ef9beddf
ILT
161122008-07-10 Ian Lance Taylor <iant@google.com>
16113
16114 Handle output sections with more than 0x7fffffff bytes.
16115 * object.h (class Relobj): Change map_to_output_ to
16116 output_sections_, and just keep a section pointer. Change all
16117 uses. Move comdat group support to Sized_relobj.
16118 (Relobj::is_section_specially_mapped): Remove.
16119 (Relobj::output_section): Remove poff parameter. Change all
16120 callers.
16121 (Relobj::output_section_offset): New function.
16122 (Relobj::set_section_offset): Rewrite.
16123 (Relobj::map_to_output): Remove.
16124 (Relobj::output_sections): New function.
16125 (Relobj::do_output_section_offset): New pure virtual function.
16126 (Relobj::do_set_section_offset): Likewise.
16127 (class Sized_relobj): Add section_offsets_ field. Add comdat
16128 group support from Relobj. Update declarations.
16129 (Sized_relobj::get_output_section_offset): New function.
16130 (Sized_relobj::do_output_section_offset): New function.
16131 (Sized_relobj::do_set_section_offset): New function.
16132 * object.cc (Relobj::output_section_address): Remove.
16133 (Sized_relobj::Sized_relobj): Initialize new fields.
16134 (Sized_relobj::include_section_group): Cast find_kept_object to
16135 Sized_relobj.
16136 (Sized_relobj::include_linkonce_section): Likewise.
16137 (Sized_relobj::do_layout): Use separate arrays for output section
16138 and output offset.
16139 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16140 output_sections.
16141 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16142 output_sections and section_offsets.
16143 (Sized_relobj::write_local_symbols): Likewise.
16144 (map_to_kept_section): Compute output address directly.
16145 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16146 output_sections and section_offsets.
16147 (Sized_relobj::write_sections): Likewise.
16148 (Sized_relobj::relocate_sections): Likewise.
16149 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16150 * output.h (class Output_reloc): Update declarations. Change
16151 u2_.relobj to Sized_relobj*.
16152 (class Output_data_reloc): Change add functions to use
16153 Sized_relobj*.
16154 * output.cc (Output_reloc::Output_reloc): Change relobj to
16155 Sized_relobj*.
16156 (Output_reloc::local_section_offset): Change return type to
16157 Elf_Addr. Use get_output_section_offset.
16158 (Output_reloc::get_address): Likewise.
16159 (Output_section::is_input_address_mapped): Don't call
16160 is_section_specially_mapped.
16161 (Output_section::output_offset): Likewise.
16162 (Output_section::output_address): Likewise.
16163 (Output_section::starting_output_address): Likewise.
16164 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16165 parameter to Sized_relobj*.
16166 (Copy_relocs::need_copy_reloc): Likewise.
16167 (Copy_relocs::save): Likewise.
16168 * copy-relocs.h (class Copy_relocs): Update declarations.
16169 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16170 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16171 * target-reloc.h (relocate_for_relocatable): Change
16172 offset_in_output_section type to Elf_Addr. Change code that uses
16173 it as well.
16174 * layout.cc (Layout::layout): Always set *off.
16175 * mapfile.cc (Mapfile::print_input_section): Use
16176 output_section_offset.
16177 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16178 Sized_relobj*.
16179 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16180 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16181 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16182
5cb66f97
ILT
161832008-07-03 Ian Lance Taylor <iant@google.com>
16184
16185 * layout.cc (Layout::include_section): Do not discard unrecognized
16186 SHT_STRTAB sections.
16187
afe47622
CS
161882008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16189
16190 * script.cc (Lex::can_continue_name): Make '?' allowable in
16191 version-script names.
16192 * testsuite/version_script.map: Change glob pattern to use '?'
16193
5adf9721
ILT
161942008-06-30 Manish Singh <yosh@gimp.org>
16195
16196 PR 6585
16197 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16198 Correct typo.
16199
e6fde208
ILT
162002008-06-30 Ian Lance Taylor <iant@google.com>
16201
16202 PR 6660
16203 PR 6682
16204 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16205 versions]: Don't try to read the value in the contents, since we
16206 don't use it. Use the template endianness when writing.
16207
3f2e6a2d
CC
162082008-06-25 Cary Coutant <ccoutant@google.com>
16209
16210 * fileread.cc (File_read::make_view): Assert on zero-length view.
16211 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16212 symbol table when there are no symbols to read.
16213
c43d3a48
CS
162142008-06-23 Craig Silverstein <csilvers@google.com>
16215
16216 * version.cc (version_string): Bump to 1.7
16217
5f494ea0
CS
162182008-06-18 Craig Silverstein <csilvers@google.com>
16219
16220 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16221 constant 0xFFFF to type Valtype.
16222 (Powerpc_relocate_functions::rel16_ha): Likewise.
16223
c42e122e
ILT
162242008-06-17 Ian Lance Taylor <iant@google.com>
16225
f34787f8
ILT
16226 * output.h (Output_section::Input_section): Initialize p2align_ to
16227 zero for Output_section_data constructors.
16228 (Output_section::Input_section::addralign): If not an input
16229 section, return the alignment of the Output_section_data.
16230 * testsuite/copy_test.cc: New file.
16231 * testsuite/copy_test_1.cc: New file.
16232 * testsuite/copy_test_2.cc: New file.
16233 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16234 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16235 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16236 (copy_test_1_pic.o, copy_test_1.so): New targets.
16237 (copy_test_2_pic.o, copy_test_2.so): New targets.
16238 * testsuite/Makefile.in: Rebuild.
16239
c42e122e
ILT
16240 * script-sections.cc (Script_sections::place_orphan): Initialize
16241 local variable exact.
16242
ce3ac18a
DE
162432008-06-13 David Edelsohn <edelsohn@gnu.org>
16244
16245 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16246
42cacb20
DE
162472008-06-12 David Edelsohn <edelsohn@gnu.org>
16248 David S. Miller <davem@davemloft.net>
16249
16250 * powerpc.cc: New file.
16251 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16252 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16253 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16254 * Makefile.in: Rebuild.
16255
7b308235
ILT
162562008-06-09 Ian Lance Taylor <iant@google.com>
16257
16258 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16259 <exception>.
16260 (throwing, orig_terminate): New static variables.
16261 (terminate_handler): New static function.
16262 (t2): Set terminate handler.
16263
f0b886e3
ILT
162642008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16265
16266 PR 6584
cd536b21 16267 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16268 alignment.
16269
3e90f135
CC
162702008-05-30 Cary Coutant <ccoutant@google.com>
16271
16272 * archive.cc (Archive::include_all_members) Correct to step
16273 over symbol table and extended name table in thin archives.
16274
e09ad04a
ILT
162752008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16276
16277 PR 6407
16278 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16279 calculation.
16280
62b01cb5
ILT
162812008-05-28 Caleb Howe <cshowe@google.com>
16282
16283 * reduced_debug_output.cc: New file.
16284 * reduced_debug_output.h: New file.
92de84a6 16285 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16286 * options.cc (General_options::finalize): Add strip_debug_non_line
16287 to the strip heirarchy.
16288 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16289 fields.
16290 * layout.cc: Include "reduced_debug_output.h".
16291 (Layout::Layout): Initialize new fields.
16292 (line_only_debug_sections): New static array.
16293 (is_lines_only_debug_sections): New static inline function.
16294 (Layout::include_section): Handle --strip-debug-non-line.
16295 (Layout::make_output_section): If --strip-debug-non-line, build
16296 new output sections for .debug_abbrev and .debug_info.
16297 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16298 gold. Warn about possible overflow.
16299 (read_signed_LEB_128): Likewise.
16300 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16301 (read_signed_LEB_128): Declare.
16302 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16303 (HFILES): Add reduced_debug_output.h.
16304 * Makefile.in: Rebuild.
16305
7d9e3d98
ILT
163062008-05-21 Ian Lance Taylor <iant@google.com>
16307
16308 * mapfile.cc: New file.
16309 * mapfile.h: New file.
16310 * options.h (class General_options): Add -M/--print-map and -Map.
16311 * options.cc (General_options::finalize): Make -M equivalent to
16312 -Map -.
16313 * main.cc: Include <cstdio> and "mapfile.h".
16314 (main): Open mapfile if requested.
16315 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16316 constructor. Change caller.
16317 (queue_initial_tasks): Add mapfile parameter. Change caller.
16318 (queue_middle_tasks): Likewise.
16319 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16320 declarations.
16321 * archive.cc: Include "mapfile.h".
16322 (Archive::add_symbols): Add mapfile parameter. Change all
16323 callers. Pass mapfile, symbol, and reason to include_member.
16324 (Archive::include_all_members): Add mapfile parameter. Change all
16325 callers.
16326 (Archive::include_member): Add mapfile, sym, and why parameters.
16327 Change all callers. Report inclusion to map file.
16328 * archive.h: Include "fileread.h".
16329 (class Archive): Update declarations.
16330 (Archive::file): New const method.
16331 (class Add_archive_symbols): Add mapfile_ field. Update
16332 constructor. Change all callers.
16333 * readsyms.h (class Read_symbols): Likewise.
16334 (class Finish_group): Likewise.
16335 (class Read_script): Likewise.
16336 * common.cc: Include "mapfile.h".
16337 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16338 all callers.
16339 (Symbol_table::do_allocate_commons): Likewise.
16340 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16341 symbol allocation to mapfile.
16342 * common.h (class Allocate_commons_task): Add mapfile_ field.
16343 Update constructor. Change all callers.
16344 * symtab.h (class Symbol_table): Update declarations.
16345 * layout.cc: Include "mapfile.h".
16346 (Layout_task_runner::run): Print information to mapfile.
16347 (Layout::create_gold_note): Change Output_data_fixed_space to
16348 Output_data_zero_fill.
16349 (Layout::create_build_id): Likewise.
16350 (Layout::print_to_mapfile): New function.
16351 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16352 constructor. Change caller.
16353 (class Layout): Declare print_to_mapfile.
16354 * output.cc (Output_section::Input_section::print_to_mapfile): New
16355 function.
16356 (Output_section::add_input_section): If producing a map, always
16357 add to input_sections_ list.
16358 (Output_section::do_print_to_mapfile): New function.
16359 (Output_segment::print_sections_to_mapfile): New function.
16360 (Output_segment::print_section_list_to_mapfile): New function.
16361 * output.h: Include "mapfile.h".
16362 (Output_data::print_to_mapfile): New function.
16363 (Output_data::do_print_to_mapfile): New virtual function.
16364 (Output_segment_headers::do_print_to_mapfile): New function.
16365 (Output_file_header::do_print_to_mapfile): New function.
16366 (Output_data_const::do_print_to_mapfile): New function.
16367 (class Output_data_const_buffer): Add map_name_ field. Update
16368 constructor. Change all callers. Add do_print_to_mapfile
16369 function.
16370 (class Output_data_fixed_space): Likewise.
16371 (class Output_data_space): Likewise.
16372 (class Output_data_zero_fill): New class.
16373 (Output_data_strtab::do_print_to_mapfile): New function.
16374 (Output_data_reloc_base::do_print_to_mapfile): New function.
16375 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16376 (Output_data_group::do_print_to_mapfile): New function.
16377 (Output_data_got::do_print_to_mapfile): New function.
16378 (Output_data_dynamic::do_print_to_mapfile): New function.
16379 (Output_symtab_xindex::do_print_to_mapfile): New function.
16380 (class Output_section): Declare do_print_to_mapflie. Declare
16381 print_to_mapfile in Input_section.
16382 (class Output_segment): Declare new functions.
16383 * object.h (Sized_relobj::symbol_count): New function.
16384 * script-sections.cc
16385 (Output_section_element_dot_assignment::set_section_addresses):
16386 Change Output_data_fixed_space to Output_data_zero_fill.
16387 (Output_data_expression::do_print_to_mapfile): New function.
16388 * script.cc (read_input_script): Add mapfile parameter. Change
16389 all callers.
16390 * script.h (read_input_script): Update declaration.
16391 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16392 (Eh_frame::do_print_to_mapfile): New function.
16393 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16394 (Output_merge_string::do_print_to_mapfile): New function.
16395 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16396 function.
16397 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16398 function.
16399 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16400 function.
16401 * Makefile.am (CCFILES): Add mapfile.cc.
16402 (HFILES): Add mapfile.h.
16403 * Makefile.in: Rebuild.
16404
9f1d377b
ILT
164052008-05-19 Ian Lance Taylor <iant@google.com>
16406
16407 * options.h (class General_options): Add -z relro.
16408 * layout.cc (Layout::Layout): Initialize relro_segment_.
16409 (Layout::add_output_section_data): Return the output section.
16410 (Layout::make_output_section): Rcognize relro sections and mark
16411 them appropriately.
16412 (Layout::attach_allocated_section_to_segment): Put relro sections
16413 in a PT_GNU_RELRO segment.
16414 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16415 section as relro.
16416 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16417 PT_TLS segments.
16418 (Layout::linkonce_mapping): Map d.rel.ro.local to
16419 .data.rel.ro.local.
16420 (Layout::output_section_name): Us .data.rel.ro.local for any
16421 section which begins with that.
16422 * layout.h (class Layout): Update add_output_section_data
16423 declaration. Add relro_segment_ field.
16424 * output.cc (Output_section::Output_section): Initialize is_relro_
16425 and is_relro_local_ fields.
16426 (Output_segment::add_output_section): Group relro sections.
16427 (Output_segment::is_first_section_relro): New function.
16428 (Output_segment::maximum_alignment): If there is a relro section,
16429 align the segment to the common page size.
16430 (Output_segment::set_section_addresses): Track whether we are
16431 looking at relro sections. If the last section is a relro
16432 section, align to the common page size.
16433 (Output_segment::set_section_list_addresses): Add in_relro
16434 parameter. Change all callers. Align to the page size when
16435 moving from relro to non-relro section.
16436 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16437 segment.
16438 * output.h (class Output_section): Add is_relro_ and
16439 is_relro_local_ fields.
16440 (Output_section::is_relro): New function.
16441 (Output_section::set_is_relro): New function.
16442 (Output_section::is_relro_local): New function.
16443 (Output_section::set_is_relro_local): New function.
16444 (class Output_segment): Update declarations.
16445 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16446 * sparc.cc (Target_sparc::got_section): Likewise.
16447 * x86_64.cc (Target_x86_64::got_section): Likewise.
16448 * testsuite/relro_test_main.cc: New file.
16449 * testsuite/relro_test.cc: New file.
16450 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16451 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16452 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16453 (relro_test.so, relro_test_pic.o): New targets.
16454 * testsuite/Makefile.in: Rebuild.
16455
a984ee1d
ILT
164562008-05-16 Ian Lance Taylor <iant@google.com>
16457
01676dcd
ILT
16458 * output.cc (Output_segment::add_output_section): Remove front
16459 parameter.
16460 * output.h (class Output_segment): Remove
16461 add_initial_output_section and overloaded add_output_section.
16462 Update declaration of remaining add_output_section.
16463 * layout.cc (Layout::create_interp): Call add_output_section
16464 rather than add_initial_output_section.
16465 (Layout::finish_dynamic_section): Likewise.
16466
497897f9
ILT
16467 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16468 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16469 know the dynamic type.
16470 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16471 field. Initialize it in constructor.
16472 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16473 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16474 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16475 reloc.
16476
a984ee1d
ILT
16477 * output.cc (Output_reloc::get_address): Change return type to
16478 Elf_Addr.
16479 * output.h (class Output_reloc): Update get_address declaration.
16480 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16481 for section addresses.
16482
55ba0940
ILT
164832008-05-09 Ian Lance Taylor <iant@google.com>
16484
16485 PR 6493
16486 * gold.cc (gold_nomem): Use return value of write.
16487
75517b77
ILT
164882008-05-08 Ian Lance Taylor <iant@google.com>
16489
16490 * symtab.c (Symbol::init_base_output_data): Add version
16491 parameter. Change all callers.
16492 (Symbol::init_base_output_segment): Likewise.
16493 (Symbol::init_base_constant): Likewise.
16494 (Symbol::init_base_undefined): Likewise.
16495 (Sized_symbol::init_output_data): Likewise.
16496 (Sized_symbol::init_output_segment): Likewise.
16497 (Sized_symbol::init_constant): Likewise.
16498 (Sized_symbol::init_undefined): Likewise.
16499 (Symbol_table::do_define_in_output_data): If the new symbol has a
16500 version, mark it as the default.
16501 (Symbol_table::do_define_in_output_segment): Likewise.
16502 (Symbol_table::do_define_as_constant): Likewise.
16503 * symtab.h (class Symbol): Update declarations.
16504 (class Sized_symbol): Likewise.
16505 * resolve.cc (Symbol::override_version): New function.
c42e122e 16506 (Symbol::override_base): Call override_version.
75517b77
ILT
16507 (Symbol::override_base_with_special): Likewise.
16508 * testsuite/ver_script_8.script: New file.
16509 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16510 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16511 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16512 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16513
f1f70eae
ILT
165142008-05-06 Ian Lance Taylor <iant@google.com>
16515
f3e9c5c5
ILT
16516 PR 6049
16517 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16518 functions.
16519 (class General_options): Remove existing --undefined, and add
16520 --no-undefined instead. Add new --undefined as synonym for -u.
16521 * archive.cc (Archive::add_symbols): Check whether symbol was
16522 named with -u.
16523 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16524 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16525 all uses. Add IS_UNDEFINED. Update declarations to split
16526 different versions of init_base. Declare init_base_undefined.
16527 (Symbol::is_defined): Handle IS_UNDEFINED.
16528 (Symbol::is_undefined): Likewise.
16529 (Symbol::is_weak_undefined): Call is_undefined.
16530 (Symbol::is_absolute): Handle IS_CONSTANT.
16531 (class Sized_symbol): Update declarations to split different
16532 versions of init. Declare init_undefined.
16533 (class Symbol_table): Declare new functions.
16534 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16535 Change all callers.
16536 (Symbol::init_base_output_data): Likewise.
16537 (Symbol::init_base_output_segment): Likewise.
16538 (Symbol::init_base_constant): Likewise.
16539 (Symbol::init_base_undefined): New function.
16540 (Sized_symbol::init_object): Rename from init. Change all
16541 callers.
16542 (Sized_symbol::init_output_data): Likewise.
16543 (Sized_symbol::init_output_segment): Likewise.
16544 (Sized_symbol::init_constant): Likewise.
16545 (Sized_symbol::init_undefined): New function.
16546 (Symbol_table::add_undefined_symbols_from_command_line): New
16547 function.
16548 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16549 function.
16550 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16551 (Symbol::output_section): Likewise.
16552 (Symbol::set_output_section): Likewise.
16553 (Symbol_table::sized_finalize_symbol): Likewise.
16554 (Symbol_table::sized_write_globals): Likewise.
16555 * resolve.cc (Symbol_table::should_override): Likewise.
16556 (Symbol::override_base_with_special): Likewise.
16557
8bdcdf2c
ILT
16558 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16559 symbol, change it to have default visibility.
16560 * testsuite/protected_1.cc: New file.
16561 * testsuite/protected_2.cc: New file.
16562 * testsuite/protected_3.cc: New file.
16563 * testsuite/protected_main_1.cc: New file.
16564 * testsuite/protected_main_2.cc: New file.
16565 * testsuite/protected_main_3.cc: New file.
16566 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16567 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16568 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16569 (protected_1.so): New target.
16570 (protected_1_pic.o, protected_2_pic.o): New targets.
16571 (protected_3_pic.o): New target.
16572 (check_PROGRAMS): Add protected_2.
16573 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16574 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16575 * testsuite/Makefile.in: Rebuild.
16576
2b706932
ILT
16577 * options.h (DEFINE_var): Add set_user_set_##varname__.
16578 (DEFINE_bool_alias): New macro.
16579 (class General_options): Define -Bstatic using DEFINE_bool_alias
16580 rather than DEFINE_special. Add --undefined as an alias for -z
16581 defs.
16582 * options.cc (General_options::parse_Bstatic): Remove.
16583
d82a5bcc
ILT
16584 * options.h (class General_options): Add --fatal-warnings.
16585 * main.cc (main): Implement --fatal-warnings.
16586 * errors.h (Errors::warning_count): New function.
16587
f1f70eae
ILT
16588 * options.h (class General_options): Add -Bsymbolic-functions.
16589 * symtab.h (Symbol::is_preemptible): Check for
16590 -Bsymbolic-functions.
16591
8825ac63
ILT
165922008-05-05 Ian Lance Taylor <iant@google.com>
16593
d98bc257
ILT
16594 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16595 as noVARNAME rather than no-VARNAME.
16596 (class General_options): Add option -z combreloc.
16597 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16598 get_address.
16599 (Output_reloc::sort_before) [SHT_REL]: New function.
16600 (Output_reloc::sort_before) [SHT_RELA]: New function.
16601 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16602 Sort_relocs_comparison.
16603 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16604 parameter. Change all callers.
16605 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16606 sort_relocs parameter. Change all callers.
16607 * output.cc (Output_reloc::get_address): New function, broken out
16608 of write_rel.
16609 (Output_reloc::write_rel): Call it.
16610 (Output_reloc::compare): New function.
16611 (Output_data_reloc_base::do_write): Optionally sort relocs.
16612
60b2b4e7
ILT
16613 * configure.ac: If targ_extra_obj is set, link it in.
16614 * configure.tgt: Initialize all variables.
16615 (x86_64*): Set targ_extra_obj and targ_extra_size.
16616 * configure: Rebuild.
16617
8825ac63
ILT
16618 * object.cc (Sized_relobj::include_section_group): Adjust section
16619 indexes read from group data. Build vector to pass to
16620 layout_group.
16621 * layout.cc (Layout::layout_group): Add flags and shndxes
16622 parameters. Remove contents parameter. Change caller. Update
16623 explicit instantiations.
16624 * layout.h (class Layout): Update layout_group declaration.
16625 * output.cc (Output_data_group::Output_data_group): Add flags and
16626 input_shndxes parameters. Remove contents parameter. Change
16627 caller.
16628 (Output_data_group::do_write): Change input_sections_ to
16629 input_shndxes_.
16630 * output.h (class Output_data_group): Update constructor
16631 declaration. Rename input_sections_ to input_shndxes_.
16632 * testsuite/many_sections_test.cc: Add template.
16633
e94cf127
CC
166342008-04-30 Cary Coutant <ccoutant@google.com>
16635
4418b2d5
CC
16636 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16637
e94cf127
CC
16638 * layout.cc (Layout::include_section): Refactored check for debug
16639 info section.
16640 (Layout::add_comdat): Add new parameters. Change type
16641 of signature parameter. Add object and shndx to signatures table.
16642 (Layout::find_kept_object): New function.
16643 * layout.h: Include <cstring>.
16644 (Layout::is_debug_info_section): New function.
16645 (Layout::add_comdat): Add new parameters.
16646 (Layout::find_kept_object): New function.
16647 (Layout::Kept_section): New struct.
16648 (Layout::Signatures): Change type of map range.
16649 * object.cc (Relobj::output_section_address): New function.
16650 (Sized_relobj::include_section_group): Add new parameters. Change
16651 calls to Layout::add_comdat. Change to build table of kept comdat
16652 groups and table mapping discarded sections to kept sections.
16653 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16654 (Sized_relobj::do_layout): Change calls to include_section_group and
16655 include_linkonce_section.
16656 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16657 value to zero when section is discarded.
16658 (Sized_relobj::map_to_kept_section): New function.
16659 * object.h (Relobj::output_section_address): New function.
16660 (Relobj::Comdat_group): New type.
16661 (Relobj::find_comdat_group): New function.
16662 (Relobj::Comdat_group_table): New type.
16663 (Relobj::Kept_comdat_section): New type.
16664 (Relobj::Kept_comdat_section_table): New type.
16665 (Relobj::add_comdat_group): New function.
16666 (Relobj::set_kept_comdat_section): New function.
16667 (Relobj::get_kept_comdat_section): New function.
16668 (Relobj::comdat_groups_): New field.
16669 (Relobj::kept_comdat_sections_): New field.
16670 (Symbol_value::input_value): Update comment.
16671 (Sized_relobj::map_to_kept_section) New function.
16672 (Sized_relobj::include_linkonce_section): Add new parameter.
16673 * target-reloc.h (Comdat_behavior): New type.
16674 (get_comdat_behavior): New function.
16675 (relocate_section): Add code to map a discarded section to the
16676 corresponding kept section when applying a relocation.
16677
e4e5049b
CS
166782008-04-30 Craig Silverstein <csilvers@google.com>
16679
16680 * dwarf_reader.cc (next_generation_count): New static var.
16681 (Addr2line_cache_entry): New struct.
16682 (addr2line_cache): New static var.
16683 (Dwarf_line_info::one_addr2line): Added caching.
16684 (Dwarf_line_info::clear_addr2line_cache): New function.
16685 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16686 cache-size parameter.
16687 (Dwarf_line_info::one_addr2line_cache): New function.
16688 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16689 new cache-size argument to one_addr2line(), and clear cache.
16690
d09e9154
CC
166912008-04-28 Cary Coutant <ccoutant@google.com>
16692
16693 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16694 R_386_PC8 relocations.
16695
7ef73768
ILT
166962008-04-23 Ian Lance Taylor <iant@google.com>
16697
55438702
ILT
16698 * object.cc (Sized_relobj::include_section_group): Check for
16699 invalid section group.
16700
c165fb93
ILT
16701 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16702 header size.
16703
7ef73768
ILT
16704 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16705 than read for file header.
16706 * archive.cc (Archive::include_member): Likewise.
16707
6194aaab
L
167082008-04-23 Paolo Bonzini <bonzini@gnu.org>
16709
16710 * aclocal.m4: Regenerate.
16711 * configure: Regenerate.
16712
d491d34e
ILT
167132008-04-19 Ian Lance Taylor <iant@google.com>
16714
5ea2bac6
ILT
16715 * version.cc (version_string): Bump to 1.6.
16716
7bc3e21a
ILT
16717 * testsuite/Makefile.am (many_sections_r_test): New target.
16718 (many_sections_r_test_SOURCES): Remove.
16719 (many_sections_r_test_DEPENDENCIES): Remove.
16720 (many_sections_r_test_LDFLAGS): Remove.
16721 (many_sections_r_test_LDADD): Remove.
16722
7fcd3aa9
ILT
16723 * object.cc (Sized_relobj::do_add_symbols): Always pass
16724 local_symbol_count_ to add_from_relobj.
16725
4c94d6ae
ILT
16726 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16727 every thousand variables.
16728 * testsuite/Makefile.in: Rebuild.
16729
d491d34e
ILT
16730 * object.cc (Xindex::initialize_symtab_xindex): New function.
16731 (Xindex::read_symtab_xindex): New function.
16732 (Xindex::sym_xindex_to_shndx): New function.
16733 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16734 available.
16735 (Sized_relobj::do_initialize_xindex): New function.
16736 (Sized_relobj::do_read_symbols): Adjust section links.
16737 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16738 parameter. Change all callers.
16739 (Sized_relobj::include_section_group): Adjust section links and
16740 symbol section indexes.
16741 (Sized_relobj::do_layout): Adjust section links.
16742 (Sized_relobj::do_count_local_symbols): Adjust section links and
16743 symbol section indexes.
16744 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16745 ordinary and special symbols.
16746 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16747 dynsym_xindex parameters. Change all callers. Adjust section
16748 links. Use SHN_XINDEX when needed.
16749 (Sized_relobj::get_symbol_location_info): Adjust section links.
16750 Don't get fooled by special symbols.
16751 * object.h (class Xindex): Define.
16752 (class Object): Add xindex_ parameter. Declare virtual functoin
16753 do_initialize_xindex.
16754 (Object::adjust_sym_shndx): New function.
16755 (Object::set_xindex): New protected function.
16756 (class Symbol_value): Add is_ordinary_shndx_ field.
16757 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16758 (Symbol_value::value): Assert ordinary section.
16759 (Symbol_value::initialize_input_to_output_map): Likewise.
16760 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16761 Change all callers.
16762 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16763 all callers.
16764 (class Sized_relobj): Update declarations.
16765 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16766 parameter. Change all callers.
16767 (Sized_relobj::adjust_shndx): New function.
16768 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16769 field.
16770 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16771 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16772 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16773 (Sized_dynobj::read_dynsym_section): Adjust section links.
16774 (Sized_dynobj::read_dynamic): Likewise.
16775 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16776 section links.
16777 (Sized_dynobj::do_initialize_xindex): New function.
16778 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16779 do_initialize_xindex.
16780 (Sized_dynobj::adjust_shndx): New function.
16781 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16782 dynsym_xindex_ fields.
16783 (Layout::finalize): Add a call to set_section_indexes before
16784 creating the symtab sections.
16785 (Layout::set_section_indexes): Don't do anything if the section
16786 already has a section index.
16787 (Layout::create_symtab_sections): Add shnum parameter. Change
16788 caller. Create .symtab_shndx section if needed.
16789 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16790 caller.
16791 (Layout::allocated_output_section_count): New function.
16792 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16793 needed.
16794 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16795 fields. Update declarations.
16796 (Layout::symtab_xindex): New function.
16797 (Layout::dynsym_xindex): New function.
16798 (class Write_symbols_task): Add layout_ field.
16799 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16800 Change caller.
16801 * output.cc (Output_section_headers::Output_section_headers): Add
16802 shstrtab_section parameter. Change all callers.
16803 (Output_section_headers::do_sized_write): Store overflow values
16804 for section count and section string table section index in
16805 section header zero.
16806 (Output_file_header::do_sized_write): Check for overflow of
16807 section count and section string table section index.
16808 (Output_symtab_xindex::do_write): New function.
16809 (Output_symtab_xindex::endian_do_write): New function.
16810 * output.h (class Output_section_headers): Add shstrtab_section_.
16811 Update declarations.
16812 (class Output_symtab_xindex): Define.
16813 (Output_section::has_out_shndx): New function.
16814 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16815 field.
16816 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16817 Change all callers.
16818 (Sized_symbol::init): Likewise.
16819 (Symbol::output_section): Check for ordinary symbol.
16820 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16821 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16822 callers.
16823 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16824 Change all callers. Simplify handling of symbols from sections
16825 not included in the link.
16826 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16827 distinction.
16828 (Weak_alias_sorter::operator()): Assert that symbols are
16829 ordinary.
16830 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16831 distinction.
16832 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16833 parameters. Change all callers.
16834 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16835 symbol distinction. Use SHN_XINDEX when needed.
16836 (Symbol_table::write_section_symbol): Add symtab_xindex
16837 parameter. Change all callers.
16838 (Symbol_table::sized_write_section_symbol): Likewise. Use
16839 SHN_XINDEX when needed.
16840 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16841 declarations.
16842 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16843 (Symbol::is_defined): Check is_ordinary.
16844 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16845 (Symbol::is_absolute, Symbol::is_common): Likewise.
16846 (class Sized_symbol): Update declarations.
16847 (class Symbol_table): Update declarations.
16848 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16849 parameters. Change all callers.
16850 (Sized_symbol::override): Likewise.
16851 (Symbol_table::override): Likewise.
16852 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16853 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16854 is_ordinary, and orig_st_shndx parameters. Change all callers.
16855 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16856 to be in an ordinary section.
16857 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16858 object and is_ordinary parameters. Change all callers.
16859 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16860 Change all callers. Don't add undefined or non-ordinary symbols
16861 to reloc_map_.
16862 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16863 Change all callers.
16864 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16865 declarations.
16866 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16867 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16868 (Sized_relobj::relocate_sections): Likewise.
16869 * target-reloc.h (scan_relocs): Adjust section symbol index.
16870 (scan_relocatable_relocs): Likewise.
16871 * i386.cc (Scan::local): Check for ordinary symbols.
16872 * sparc.cc (Scan::local): Likewise.
16873 * x86_64.cc (Scan::local): Likewise.
16874 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16875 to symbol_section_and_value.
16876 * testsuite/many_sections_test.cc: New file.
16877 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16878 (check_PROGRAMS): Add many_sections_test.
16879 (many_sections_test_SOURCES): Define.
16880 (many_sections_test_DEPENDENCIES): Define.
16881 (many_sections_test_LDFLAGS): Define.
16882 (BUILT_SOURCES): Add many_sections_define.h.
16883 (many_sections_define.h): New target.
16884 (BUILT_SOURCES): Add many_sections_check.h.
16885 (many_sections_check.h): New target.
16886 (check_PROGRAMS): Add many_sections_r_test.
16887 (many_sections_r_test_SOURCES): Define.
16888 (many_sections_r_test_DEPENDENCIES): Define.
16889 (many_sections_r_test_LDFLAGS): Define.
16890 (many_sections_r_test_LDADD): Define.
16891 (many_sections_r_test.o): New target.
16892 * testsuite/Makefile.in: Rebuild.
16893
c5818ff1
CC
168942008-04-17 Cary Coutant <ccoutant@google.com>
16895
16896 * errors.cc (Errors::info): New function.
16897 (gold_info): New function.
16898 * errors.h (Errors::info): New function.
16899 * gold.h (gold_info): New function.
16900 * object.cc (Input_objects::add_object): Print trace output.
16901 * options.cc (options::parse_set): New function.
16902 (General_options::parse_wrap): Deleted.
16903 (General_options::General_options): Deleted initializer.
16904 * options.h (options::String_set): New typedef.
16905 (options::parse_set): New function.
16906 (DEFINE_set): New macro.
16907 (General_options::wrap): Changed to use DEFINE_set. Changed
16908 callers of any_wrap_symbols and is_wrap_symbol.
16909 (General_options::trace, General_options::trace_symbol):
16910 New options.
16911 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16912 (General_options::wrap_symbols_): Deleted.
16913 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16914
b5be4a7c
DM
169152008-04-17 David S. Miller <davem@davemloft.net>
16916
16917 * options.cc (General_options::parse_V): New function.
16918 * options.h: Add entries for -V and -Qy.
16919
155a0dd7
ILT
169202008-04-17 Ian Lance Taylor <iant@google.com>
16921
16922 * common.cc (Symbol_table::allocate_commons): Remove options
16923 parameter. Change caller.
16924 (Symbol_table::do_allocate_commons): Remove options parameter.
16925 Change caller. Just call do_allocate_commons_list twice.
16926 (Symbol_table::do_allocate_commons_list): New function, broken out
16927 of do_allocate_commons.
16928 * common.h (class Allocate_commons_task): Remove options_ field.
16929 Update constructor.
16930 * symtab.cc (Symbol_table::Symbol_table): Initialize
16931 tls_commons_.
16932 (Symbol_table::add_from_object): Put TLS common symbols on
16933 tls_commons_ list.
16934 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16935 which are IN_OUTPUT_DATA.
16936 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16937 allocate_commons and do_allocate_commons declarations. Declare
16938 do_allocate_commons_list.
16939 * gold.cc (queue_middle_tasks): Update creation of
16940 Allocate_commons_task to not pass options.
16941 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16942 (TLS_TEST_C_FLAGS): New variable.
16943 (tls_test_c_pic.o): New target.
16944 (tls_test_shared.so): Link in tls_test_c_pic.o.
16945 (tls_test_c_pic_ie.o): New target.
16946 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16947 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16948 (tls_test_c.o): New target.
16949 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16950 (tls_pic_test_LDADD): Likewise.
16951 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16952 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16953 (tls_test_c_gnu2.o): New target.
16954 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16955 tls_test_c_gnu2.o.
16956 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16957 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16958 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16959 * testsuite/tls_test.cc: Include "config.h".
16960 (t_last): Call t11_last.
16961 * testsuite/tls_test.h (t11, t11_last): Declare.
16962 * testsuite/tls_test_c.c: New file.
16963 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16964 * configure.ac: Check for OpenMP support.
16965 * configure, config.in, Makefile.in: Rebuild.
16966 * testsuite/Makefile.in: Rebuild.
16967
edfbb029
CC
169682008-04-16 Cary Coutant <ccoutant@google.com>
16969
16970 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16971 (Target_i386::tls_base_symbol_defined_): New field.
16972 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16973 (Target_i386::Scan::global): Likewise.
16974 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16975 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16976 (Target_x86_64::tls_base_symbol_defined_): New field.
16977 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16978 (Target_x86_64::Scan::global): Likewise.
16979
f3c69fca
CC
169802008-04-16 Cary Coutant <ccoutant@google.com>
16981
16982 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16983 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16984 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
16985 building shared libraries.
16986 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
16987 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
16988 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
16989 * testsuite/Makefile.in: Rebuild.
16990 * testsuite/weak_undef.h: New file.
16991 * testsuite/weak_undef_file1.cc: Add extra test cases.
16992 * testsuite/weak_undef_file2.cc: Likewise.
16993 * testsuite/weak_undef_test.cc: Likewise.
16994
7c414435
DM
169952008-04-16 David S. Miller <davem@davemloft.net>
16996
32b769e1
DM
16997 * sparc.cc (Target_sparc::Scan): Change from struct to class.
16998 Add issued_non_pic_error_ field. Declare check_non_pic.
16999 (Target_sparc::Scan::check_non_pic): New function.
17000 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17001 (Target_sparc::Scan::global): Likewise.
17002
11936fb1
DM
17003 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17004 * configure: Rebuild.
17005
7c414435
DM
17006 * options.h (DEFINE_enable): New macro.
17007 (new_dtags): New enable option.
17008 (initfirst, interpose, loadfltr, nodefaultlib,
17009 nodelete, nodlopen, nodump): New -z options.
17010 * layout.cc (Layout:finish_dynamic_section): If new
17011 dtags enabled, emit DT_RUNPATH. Also, emit a
17012 DT_FLAGS_1 containing any specified -z flags.
17013
85c7bf8b
ILT
170142008-04-16 Ian Lance Taylor <iant@google.com>
17015
12c0daef
ILT
17016 * copy-relocs.cc: New file.
17017 * copy-relocs.h: New file.
17018 * reloc.cc: Remove Copy_relocs code.
17019 * reloc.h: Likewise.
17020 * reloc-types.h (struct Reloc_types) [both versions]: Add
17021 get_reloc_addend_noerror.
17022 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17023 variants of add_global which take an addend which must be zero.
17024 * i386.cc: Include "copy-relocs.h".
17025 (class Target_i386): Change type of copy_relocs_ to variable,
17026 update initializer.
17027 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17028 Change all callers.
17029 (Target_i386::do_finalize_sections): Change handling of
17030 copy_relocs_.
17031 * sparc.cc: Include "copy-relocs.h".
17032 (class Target_sparc): Change type of copy_relocs_ to variable,
17033 update initializer.
17034 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17035 Change all callers.
17036 (Target_sparc::do_finalize_sections): Change handling of
17037 copy_relocs_.
17038 * x86_64.cc: Include "copy-relocs.h".
17039 (class Target_x86_64): Change type of copy_relocs_ to variable,
17040 update initializer.
17041 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17042 class. Change all callers.
17043 (Target_x86_64::do_finalize_sections): Change handling of
17044 copy_relocs_.
17045 * Makefile.am (CCFILES): Add copy-relocs.cc.
17046 (HFILES): Add copy-relocs.h.
17047
4f4995b6
ILT
17048 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17049
85c7bf8b
ILT
17050 * testsuite/script_test_4.sh: Permit leading zeroes.
17051
4f2a9edd
ILT
170522008-04-15 Ian Lance Taylor <iant@google.com>
17053
e6188289
ILT
17054 * script-sections.cc (Script_sections::create_segments): Use
17055 header_size_adjustment even when there is enough room for the
17056 headers.
17057 * testsuite/script_test_4.sh: New file.
17058 * testsuite/script_test_4.t: New file.
17059 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17060 (check_DATA): Add script_test_4.stdout.
17061 (MOSTLYCLEANFILES): Likewise.
17062 (script_test_4): New target.
17063 (script_test_4.stdout): New target.
17064 * testsuite/Makefile.in: Rebuild.
17065
4f2a9edd
ILT
17066 * sparc.cc: Add definitions for Output_data_plt_sparc class
17067 constants.
17068
f5314dd5
DM
170692008-04-14 David S. Miller <davem@davemloft.net>
17070
17071 * sparc.cc: New file.
17072 * Makefile.am (TARGETSOURCES): Add sparc.cc
17073 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17074 * configure.tgt: Document targ_extra_size and
17075 targ_extra_big_endian. Add entries for sparc-* and
17076 sparc64-*.
17077 * configure.ac: Handle targ_extra_size and
17078 targ_extra_big_endian.
17079 * Makefile.in: Rebuild.
17080 * configure: Likewise.
17081 * po/POTFILES.in: Likewise.
17082 * po/gold.pot: Likewise.
17083
154e0e9a
ILT
170842008-04-14 Ian Lance Taylor <iant@google.com>
17085
17086 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17087 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17088 in the name/type/flags to section mapping. Don't call
17089 allocate_output_section.
17090 (Layout::choose_output_section): Change parameter from adjust_name
17091 to is_input_section. Don't permit input sections after sections
17092 are attached to segments. Don't call allocate_output_section.
17093 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17094 not write_enable_output_section.
17095 (Layout::make_output_section): Don't push to
17096 unattached_section_list_ nor call attach_to_segment. Call
17097 attach_section_to_segment if sections are attached.
17098 (Layout::attach_sections_to_segments): New function.
17099 (Layout::attach_section_to_segment): New function.
17100 (Layout::attach_allocated_section_to_segment): Rename from
17101 attach_to_segment. Remove flags parameter.
17102 (Layout::allocate_output_section): Remove function.
17103 (Layout::write_enable_output_section): Remove function.
17104 * layout.h (class Layout): Update for above changes. Add new
17105 field sections_are_attached_.
17106 * output.h (Output_section::update_flags_for_input_section): New
17107 function.
17108 * output.cc (Output_section::add_input_section): Call
17109 update_flags_for_input_section.
17110 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17111
009a67a2
CC
171122008-04-11 Cary Coutant <ccoutant@google.com>
17113
17114 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17115 thought unnecessary.
17116 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17117
759b1a24
ILT
171182008-04-11 Ian Lance Taylor <iant@google.com>
17119
17120 * output.h (class Output_section_data): Remove inline definition
17121 of set_addralign.
17122 * output.cc (Output_section_data::set_addralign): New function.
17123
c2b45e22
CC
171242008-04-11 Cary Coutant <ccoutant@google.com>
17125
17126 Add support for TLS descriptors for i386 and x86_64.
17127 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17128 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17129 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17130 GOT_TYPE_TLS_DESC.
17131 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17132 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17133 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17134 relocations.
17135 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17136 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17137 Fix problem with initial-exec relocations.
17138 (Target_i386::Relocate::relocate_tls): Likewise.
17139 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17140 relaxation.
17141 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17142 support for section-plus-offset dynamic table entries.
17143 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17144 (Output_data_dynamic::Dynamic_entry): Add support for
17145 section-plus-offset dynamic table entries.
17146 (Output_data_dynamic::Classification): Likewise.
17147 (Output_data_dynamic::classification_): Renamed offset_.
17148 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17149 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17150 (Target_x86_64::make_plt_section): New function.
17151 (Target_x86_64::reserve_tlsdesc_entries): New function.
17152 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17153 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17154 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17155 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17156 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17157 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17158 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17159 add extra PLT entry for TLS descriptors.
17160 (Output_data_plt_x86_64::got_): New field.
17161 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17162 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17163 fields.
17164 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17165 descriptors.
17166 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17167 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17168 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17169 R_386_TLS_DESC_CALL relocations.
17170 (Target_x86_64::Scan::global): Likewise.
17171 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17172 for TLS descriptors.
17173 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17174 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17175 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17176 GD-to-IE relaxation.
17177 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17178 and TLS_DESCRIPTORS.
17179 * Makefile.in: Rebuild.
17180 * configure: Rebuild.
17181 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17182 (tls_test_shared2.so): New target.
17183 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17184 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17185 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17186 (tls_shared_gd_to_ie_test_LDADD): New variable.
17187 (tls_shared_gnu2_gd_to_ie_test): New target.
17188 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17189 New targets.
17190 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17191 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17192 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17193 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17194 (tls_shared_gnu2_test): New target.
17195 (tls_test_gnu2_shared.so): New target.
17196 (tls_shared_gnu2_test_SOURCES): New variable.
17197 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17198 (tls_shared_gnu2_test_LDFLAGS): New variable.
17199 (tls_shared_gnu2_test_LDADD): New variable.
17200 * testsuite/Makefile.in: Rebuild.
17201 * testsuite/Makefile.
17202
83bfb6b7
ILT
172032008-04-11 Ian Lance Taylor <iant@google.com>
17204
17205 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17206 justsyms.t.
17207 * testsuite/Makefile.in: Rebuild.
17208
17209 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17210 long.
17211 * testsuite/script_test_2.cc (main): Adjust test.
17212
706e1f5e
ILT
172132008-04-11 David S. Miller <davem@davemloft.net>
17214 Ian Lance Taylor <iant@google.com>
17215
17216 * options.h (General_options): Add entries for '-Y' and
17217 '-relax'.
17218 * options.cc (General_options:finalize): If -Y was used, add those
17219 entries to the library path instead of the default "/lib" and
17220 "/usr/lib".
17221
7c98e6bb
DM
172222008-04-11 David S. Miller <davem@davemloft.net>
17223
17224 * testsuite/justsyms.t: Start at 0x100.
17225 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17226 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17227 long.
17228 * testsuite/script_test_2.cc: Adjust string and section length
17229 checks.
7c98e6bb 17230
99a37bfd
ILT
172312008-04-09 Ian Lance Taylor <iant@google.com>
17232
2cefc357
ILT
17233 PR gold/5996
17234 * script-sections.cc (Sections_element::allocate_to_segment): Add
17235 orphan parameter.
17236 (Output_section_definition::allocate_to_segment): Likewise.
17237 (Orphan_output_section::allocate_to_segment): Likewise.
17238 (Script_sections::attach_sections_using_phdrs_clause): Don't
17239 propagate non-PT_LOAD segments to orphan sections.
17240 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17241 readelf rather than objdump.
17242 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17243 .interp section and PT_INTERP segment are the same size.
17244 * testsuite/Makefile.in: Rebuild.
17245
99a37bfd
ILT
17246 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17247 aliases for symbols defined in the same object.
17248 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17249 (weak_alias_test_SOURCES): New variable.
17250 (weak_alias_test_DEPENDENCIES): New variable.
17251 (weak_alias_test_LDFLAGS): New variable.
17252 (weak_alias_test_LDADD): New variable.
17253 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17254 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17255 (weak_alias_test_3.o): New target.
17256 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17257 * testsuite/weak_alias_test_main.cc: New file.
17258 * testsuite/weak_alias_test_1.cc: New file.
17259 * testsuite/weak_alias_test_2.cc: New file.
17260 * testsuite/weak_alias_test_3.cc: New file.
17261
780e49c5
ILT
172622008-04-08 Ian Lance Taylor <iant@google.com>
17263
cdb0b8f5
ILT
17264 * options.h (class General_options): Add --noinhibit-exec option.
17265 * main.cc (main): Check --noinhibit-exec.
17266
0864d551
ILT
17267 * options.h (class General_options): Define --wrap as a special
17268 option. Add wrap_symbols_ field.
17269 (General_options::any_wrap_symbols): New function.
17270 (General_options::is_wrap_symbol): New function.
17271 * options.cc (General_options::parse_wrap): New function.
17272 (General_options::General_options): Initialize wrap_symbols_.
17273 * symtab.cc (Symbol_table::wrap_symbol): New function.
17274 (Symbol_table::add_from_object): Handle --wrap.
17275 * symtab.h (class Symbol_table): Declare wrap_symbol.
17276 * target.h (Target::wrap_char): New function.
17277 (Target::Target_info): Add wrap_char field.
17278 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17279 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17280 * testsuite/testfile.cc (Target_test::test_target_info):
17281 Likewise.
17282
789aa6de
ILT
17283 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17284 there is one.
17285
2c38906f
ILT
17286 * layout.h (class Layout): Add added_eh_frame_data_ field.
17287 * layout.cc (Layout::Layout): Initialize new field.
17288 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17289 output section until we find a section we merged successfully.
17290 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17291 that the size be non-zero.
17292
780e49c5
ILT
17293 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17294 qualifier.
17295
7fcd0256
ILT
172962008-04-08 Craig Silverstein <csilvers@google.com>
17297
17298 * configure.ac: Export new conditional variable HAVE_ZLIB.
17299 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17300 on HAVE_ZLIB.
17301 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17302 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17303
6835af53
ILT
173042008-04-07 Ian Lance Taylor <iant@google.com>
17305
e24f324c
ILT
17306 * version.cc (version_string): Set to "1.5".
17307
a036edd8
ILT
17308 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17309 Add issued_non_pic_error_ field. Declare check_non_pic.
17310 (Target_x86_64::Scan::check_non_pic): New function.
17311 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17312 (Target_x86_64::Scan::global): Likewise.
17313
624f8810
ILT
17314 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17315 addend parameter. Change caller. Handle merge sections.
17316 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17317 Address to Addend. Don't add in the result of
17318 local_section_offset, pass down the addend and use the returned
17319 value.
17320 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17321 Update declarations of local_section_offset and symbol_value.
17322 * testsuite/two_file_test_1.cc (t18): New function.
17323 * testsuite/two_file_test_2.cc (f18): New function.
17324 * testsuite/two_file_test_main.cc (main): Call t18.
17325 * testsuite/two_file_test.h (t18, f18): Declare.
17326
6835af53
ILT
17327 * configure.ac: Don't test for objdump, c++filt, or readelf.
17328 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17329 conditionals.
17330 (TEST_READELF): New variable.
17331 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17332 (check_PROGRAMS): Add two_file_strip_test.
17333 (two_file_strip_test): New target.
17334 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17335 (two_file_same_shared_strip_test_SOURCES): New variable.
17336 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17337 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17338 (two_file_same_shared_strip_test_LDADD): New variable.
17339 (two_file_shared_strip.so): New target.
17340 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17341 (ver_test_5.syms, ver_test_7.syms): Likewise.
17342 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17343 (strip_test_3.stdout): Use TEST_OBJDUMP.
17344 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17345
86925eef
CC
173462008-04-04 Cary Coutant <ccoutant@google.com>
17347
17348 * symtab.h (Symbol::is_weak_undefined): New function.
17349 (Symbol::is_strong_undefined): New function.
17350 (Symbol::is_absolute): New function.
17351 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17352 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17353 absolute symbols.
17354 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17355 (weak_undef_test): New target.
17356 * testsuite/Makefile.in: Rebuild.
17357 * testsuite/weak_undef_file1.cc: New file.
17358 * testsuite/weak_undef_file2.cc: New file.
17359 * testsuite/weak_undef_test.cc: New file.
17360
126f3ece
ILT
173612008-04-03 Craig Silverstein <csilvers@google.com>
17362
17363 * compressed_output.h (class Output_compressed_section): Use
17364 unsigned buffer.
17365 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17366 add zlib header.
17367 (zlib_compressed_suffix): Removed.
17368 (Output_compressed_section::set_final_data_size): Use unsigned
17369 buffers.
17370 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17371 Fix linker invocation.
17372 (flagstest_o_specialfile_and_compress_debug_sections):
17373 Likewise.
17374 * testsuite/Makefile.in: Regenerated.
17375
deae2a14
DM
173762008-04-02 David S. Miller <davem@davemloft.net>
17377
17378 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17379 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17380
70752818
ILT
173812008-04-02 Craig Silverstein <csilvers@google.com>
17382
17383 * TODO: New file.
17384
39d0cb0e
ILT
173852008-04-02 Ian Lance Taylor <iant@google.com>
17386
17387 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17388 parameters. Update for new key type to views_. Change all
17389 callers.
17390 (File_read::read): Adjust for byteshift in returned view.
17391 (File_read::add_view): New function, broken out of
17392 find_and_make_view.
17393 (File_read::make_view): New function, broken out of
17394 find_and_make_view.
17395 (File_read::find_or_make_view): Add offset and aligned
17396 parameters. Rewrite accordingly. Change all callers.
17397 (File_read::get_view): Add offset and aligned parameters. Adjust
17398 for byteshift in return value.
17399 (File_read::get_lasting_view): Likewise.
17400 * fileread.h (class File_read): Update declarations.
17401 (class File_read::View): Add byteshift_ field. Add byteshift to
17402 constructor. Add byteshift method.
17403 * archive.h (Archive::clear_uncached_views): New function.
17404 (Archive::get_view): Add aligned parameter. Change all callers.
17405 * object.h (Object::get_view): Add aligned parameter. Change all
17406 callers.
17407 (Object::get_lasting_view): Likewise.
17408
17409 * fileread.cc (File_read::release): Don't call clear_views if
17410 there are multiple objects.
17411 * fileread.h (File_read::clear_uncached_views): New function.
17412 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17413 on the archive.
17414
a1207466
CC
174152008-03-31 Cary Coutant <ccoutant@google.com>
17416
17417 Add thin archive support.
17418 * archive.cc (Archive::armagt): New const.
17419 (Archive::setup): Remove task parameter and calls to unlock.
17420 (Archive::unlock_nested_archives): New function.
17421 (Archive::read_header): Add nested_off parameter. Change
17422 all callers.
17423 (Archive::interpret_header): Likewise.
17424 (Archive::include_all_members): Change to handle thin
17425 archives.
17426 (Archive::include_member): Likewise.
17427 * archive.h (Archive::Archive): Add new parameters and
17428 initializers.
17429 (Archive::armagt): New const.
17430 (Archive::setup): Remove task parameter.
17431 (Archive::unlock_nested_archives): New function.
17432 (Archive::read_header): Add nested_off parameter.
17433 (Archive::interpret_header): Likewise.
17434 (Archive::Nested_archive_table): New typedef.
17435 (Archive::is_thin_archive_): New field.
17436 (Archive::nested_archives_): New field.
17437 (Archive::options_): New field.
17438 (Archive::dirpath_): New field.
17439 (Archive::task_): New field.
17440 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17441 for thin archives. Pass additional parameters to
17442 Archive::Archive. Unlock the archive file after calling
17443 Archive::setup.
cd536b21 17444
479f6503
ILT
174452008-03-29 Ian Lance Taylor <iant@google.com>
17446
686c8caf
ILT
17447 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17448 version symbol to be local.
17449 * testsuite/ver_test_4.sh: New file.
17450 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17451 (check_DATA): Add ver_test_4.syms.
17452 (ver_test_4.syms): New target.
17453 * testsuite/Makefile.in: Rebuild.
17454
ab794b6b
ILT
17455 * output.cc
17456 (Output_section::Input_section_sort_entry::has_priority): New
17457 function.
17458 (Output_section::Input_section_sort_entry::match_file_name): New
17459 function.
17460 (Output_section::Input_section_sort_entry::match_section_name):
17461 Remove.
17462 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17463 Remove.
17464 (Output_section::Input_section_sort_entry::match_section_file):
17465 Remove.
17466 (Output_section::Input_section_sort_compare::operator()): Rewrite
17467 using new Input_section_sort_entry functions. Sort crtbegin and
17468 crtend first. Sort sections with no priority before sections with
17469 a priority.
17470 * testsuite/initpri1.c (d3): Check j != 4.
17471 (cd5): New constructor/destructor function.
17472 (main): Check j != 2.
17473
479f6503
ILT
17474 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17475 new symbol when resolving, don't call set_is_default.
17476 * testsuite/ver_test_7.cc: New file.
17477 * testsuite/ver_test_7.sh: New file.
17478 * testsuite/Makefile.am (ver_test_7.so): New target.
17479 (ver_test_7.o): New target.
17480 (check_SCRIPTS): Add ver_test_7.sh.
17481 (check_DATA): Add ver_test_7.syms.
17482 (ver_test_7.syms): New target.
17483
2fd32231
ILT
174842008-03-28 Ian Lance Taylor <iant@google.com>
17485
17486 * layout.cc (Layout::layout): If we see an input section with a
17487 name that needs sorting, set the must_sort flag for the output
17488 section.
17489 (Layout::make_output_section): If the name of the output section
17490 indicates that it might require sorting, set the may_sort flag.
17491 * output.h (Output_section::may_sort_attached_input_sections): New
17492 function.
17493 (Output_section::set_may_sort_attached_input_sections): New
17494 function.
17495 (Output_section::must_sort_attached_input_sections): New
17496 function.
17497 (Output_section::set_must_sort_attached_input_sections): New
17498 function.
17499 (class Output_section): Declare Input_section_sort_entry. Define
17500 Input_section_sort_compare. Declare
17501 sort_attached_input_sections. Add new fields:
17502 may_sort_attached_input_sections_,
17503 must_sort_attached_input_sections_,
17504 attached_input_sections_are_sorted_.
17505 * output.cc (Output_section::Output_section): Initialize new
17506 fields.
17507 (Output_section::add_input_section): Add an entry to
17508 input_sections_ if may_sort or must_sort are true.
17509 (Output_section::set_final_data_size): Call
17510 sort_attached_input_sections if necessary.
17511 (Output_section::Input_section_sort_entry): Define new class.
17512 (Output_section::Input_section_sort_compare::operator()): New
17513 function.
17514 (Output_section::sort_attached_input_sections): New function.
17515 * configure.ac: Check whether the compiler supports constructor
17516 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17517 * testsuite/initpri1.c: New file.
17518 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17519 CONSTRUCTOR_PRIORITY.
17520 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17521 (initpri1_LDFLAGS): New variable.
17522 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17523
18e6b24e
ILT
175242008-03-27 Ian Lance Taylor <iant@google.com>
17525
49bdd526
ILT
17526 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17527 * testsuite/common_test_1.c: New file.
17528 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17529 (common_test_1_SOURCES): New variable.
17530 (common_test_1_DEPENDENCIES): New variable.
17531 (common_test_1_LDFLAGS): New variable.
17532
18e6b24e
ILT
17533 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17534 and commons_ correctly when NAME/VERSION does not override
17535 NAME/NULL.
17536 * testsuite/ver_test_6.c: New file.
17537 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17538 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17539 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17540
04bf7072
ILT
175412008-03-26 Ian Lance Taylor <iant@google.com>
17542
5871526f
ILT
17543 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17544 of an undefined symbol from a version script.
17545 * testsuite/Makefile.am (ver_test_5.so): New target.
17546 (ver_test_5.o): New target.
17547 (check_SCRIPTS): Add ver_test_5.sh.
17548 (check_DATA): Add ver_test_5.syms.
17549 (ver_test_5.syms): New target.
17550 * testsuite/ver_test_5.cc: New file.
17551 * testsuite/ver_test_5.script: New file.
17552 * testsuite/ver_test_5.sh: New file.
17553 * Makefile.in, testsuite/Makefile.in: Rebuild.
17554
04bf7072
ILT
17555 PR gold/5986
17556 Fix problems building gold with gcc 4.3.0.
17557 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17558 (gold_error_at_location, gold_warning_at_location): Use it.
17559 * configure.ac: Check whether we can compile and use a template
17560 function with a printf attribute.
17561 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17562 when jumping over bytes.
17563 * object.cc: Instantiate Object::read_section_data.
17564 * debug.h: Include <cstring>
17565 * dwarf_reader.cc: Include <algorithm>
17566 * main.cc: Include <cstring>.
17567 * options.cc: Include <cstring>.
17568 * output.cc: Include <cstring>.
17569 * script.cc: Include <cstring>.
17570 * script.h: Include <string>.
17571 * symtab.cc: Include <cstring> and <algorithm>.
17572 * target-select.cc: Include <cstring>.
17573 * version.cc: Include <string>.
17574 * testsuite/testmain.cc: Include <cstdlib>.
17575 * configure, config.in: Rebuild.
17576
874c5b28
ILT
175772008-03-25 Ian Lance Taylor <iant@google.com>
17578
819d6c3a
ILT
17579 * options.cc: Include "../bfd/bfdver.h".
17580 (options::help): Print bug reporting address.
17581
f4b2c6f5
ILT
17582 * version.cc (print_version): Adjust output for current value of
17583 BFD_VERSION_STRING.
17584
17585 * NEWS: New file.
17586
e96caa79
ILT
17587 * options.cc (options::help): Print list of supported targets.
17588 * target-select.h: Include <vector>.
17589 (class Target_selector): Make machine_, size_, and is_big_endian_
17590 fields const. Add bfd_name_ and instantiated_target_ fields.
17591 (Target_selector::Target_selector): Add bfd_name parameter.
17592 (Target_selector::recognize): Make non-virtual, call
17593 do_recognize.
17594 (Target_selector::recognize_by_name): Make non-virtual, call
17595 do_recognize_by_name.
17596 (Target_selector::supported_names): New function.
17597 (Target_selector::bfd_name): New function.
17598 (Target_selector::do_instantiate_target): New pure virtual
17599 function.
17600 (Target_selector::do_recognize): New virtual function.
17601 (Target_selector::do_recognize_by_name): New virtual function.
17602 (Target_selector::instantiate_target): New private function.
17603 (supported_target_names): Declare.
17604 * target-select.cc (Target_selector::Target_selector): Update for
17605 new parameter and fields.
17606 (select_target_by_name): Check that the name matches before
17607 calling recognize_by_name.
17608 (supported_target_names): New function.
17609 * i386.cc (class Target_selector_i386): Update Target_selector
17610 constructor call. Remove recognize and recognize_by_name. Add
17611 do_instantiate_target.
17612 * x86_64.cc (class Target_selector_x86_64): Likewise.
17613 * testsuite/testfile.cc (class Target_selector_test): Update for
17614 changes to Target_selector.
17615
874c5b28
ILT
17616 * README: Rewrite, with some notes on unsupported features.
17617
0a65a3a7
CC
176182008-03-24 Cary Coutant <ccoutant@google.com>
17619
17620 * i386.cc (Target_i386::Got_type): New enum declaration.
17621 (Target_i386::Scan::local): Updated callers of Output_data_got
17622 member functions.
17623 (Target_i386::Scan::global): Likewise.
17624 (Target_i386::Relocate::relocate): Likewise.
17625 (Target_i386::Relocate::relocate_tls): Likewise.
17626 * object.h (Got_offset_list): New class.
17627 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17628 (Sized_relobj::local_got_offset): Likewise.
17629 (Sized_relobj::set_local_got_offset): Likewise.
17630 (Sized_relobj::local_has_tls_got_offset): Removed.
17631 (Sized_relobj::local_tls_got_offset): Removed.
17632 (Sized_relobj::set_local_tls_got_offset): Removed.
17633 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17634 * output.cc (Output_data_got::add_global): Added got_type parameter.
17635 (Output_data_got::add_global_with_rel): Likewise.
17636 (Output_data_got::add_global_with_rela): Likewise.
17637 (Output_data_got::add_global_pair_with_rel): New function.
17638 (Output_data_got::add_global_pair_with_rela): New function.
17639 (Output_data_got::add_local): Added got_type parameter.
17640 (Output_data_got::add_local_with_rel): Likewise.
17641 (Output_data_got::add_local_with_rela): Likewise.
17642 (Output_data_got::add_local_pair_with_rel): New function.
17643 (Output_data_got::add_local_pair_with_rela): New function.
17644 (Output_data_got::add_global_tls): Removed.
17645 (Output_data_got::add_global_tls_with_rel): Removed.
17646 (Output_data_got::add_global_tls_with_rela): Removed.
17647 (Output_data_got::add_local_tls): Removed.
17648 (Output_data_got::add_local_tls_with_rel): Removed.
17649 (Output_data_got::add_local_tls_with_rela): Removed.
17650 * output.h (Output_data_got::add_global): Added got_type parameter.
17651 (Output_data_got::add_global_with_rel): Likewise.
17652 (Output_data_got::add_global_with_rela): Likewise.
17653 (Output_data_got::add_global_pair_with_rel): New function.
17654 (Output_data_got::add_global_pair_with_rela): New function.
17655 (Output_data_got::add_local): Added got_type parameter.
17656 (Output_data_got::add_local_with_rel): Likewise.
17657 (Output_data_got::add_local_with_rela): Likewise.
17658 (Output_data_got::add_local_pair_with_rel): New function.
17659 (Output_data_got::add_local_pair_with_rela): New function.
17660 (Output_data_got::add_global_tls): Removed.
17661 (Output_data_got::add_global_tls_with_rel): Removed.
17662 (Output_data_got::add_global_tls_with_rela): Removed.
17663 (Output_data_got::add_local_tls): Removed.
17664 (Output_data_got::add_local_tls_with_rel): Removed.
17665 (Output_data_got::add_local_tls_with_rela): Removed.
17666 * resolve.cc (Symbol::override_base_with_special): Removed
17667 reference to has_got_offset_ field.
17668 * symtab.cc (Symbol::init_fields): Replaced initialization
17669 of got_offset_ with got_offsets_. Removed initialization
17670 of has_got_offset_
53fcba31 17671 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17672 (Symbol::got_offset): Likewise.
17673 (Symbol::set_got_offset): Likewise.
17674 (Symbol::has_tls_got_offset): Removed.
17675 (Symbol::tls_got_offset): Removed.
17676 (Symbol::set_tls_got_offset): Removed.
17677 (Symbol::got_offset_): Removed.
17678 (Symbol::tls_mod_got_offset_): Removed.
17679 (Symbol::tls_pair_got_offset_): Removed.
17680 (Symbol::got_offsets_): New field.
17681 (Symbol::has_got_offset): Removed.
17682 (Symbol::has_tls_mod_got_offset): Removed.
17683 (Symbol::has_tls_pair_got_offset): Removed.
17684 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17685 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17686 member functions.
17687 (Target_x86_64::Scan::global): Likewise.
17688 (Target_x86_64::Relocate::relocate): Likewise.
17689 (Target_x86_64::Relocate::relocate_tls): Likewise.
17690
bd52eafb
BE
176912008-03-25 Ben Elliston <bje@au.ibm.com>
17692
17693 * yyscript.y: Fix spelling error in comment.
17694
8b105e34
ILT
176952008-03-24 Ian Lance Taylor <iant@google.com>
17696
8ed814a9
ILT
17697 * options.h (class General_options): Define build_id option.
17698 * layout.h (class Layout): Declare write_build_id, create_note,
17699 create_build_id. Add build_id_note_ member.
17700 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17701 "libiberty.h", "md5.h", "sha1.h".
17702 (Layout::Layout): Initialize eh_frame_data_,
17703 eh_frame_hdr_section_, and build_id_note_.
17704 (Layout::finalize): Call create_build_id.
17705 (Layout::create_note): New function, broken out of
17706 Layout::create_gold_note.
17707 (Layout::create_gold_note): Call create_note.
17708 (Layout::create_build_id): New function.
17709 (Layout::write_build_id): New function.
17710 (Close_task_runner::run): Call write_build_id.
17711
8b105e34
ILT
17712 * x86_64.cc: Correct license to GPLv3.
17713
086a1841
ILT
177142008-03-23 Ian Lance Taylor <iant@google.com>
17715
17716 * options.cc: Include "demangle.h".
17717 (parse_optional_string): New function.
17718 (parse_long_option): Handle takes_optional_argument.
17719 (parse_short_option): Update dash_z initializer. Handle
17720 takes_optional_argument.
17721 (General_options::General_options): Initialize do_demangle_.
17722 (General_options::finalize): Set do_demangle_. Handle demangling
17723 style.
17724 * options.h (parse_optional_string): Declare.
17725 (struct One_option): Add optional_arg field. Update constructor.
17726 Update call constructor calls. Add takes_optional_argument
17727 function.
17728 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17729 (DEFINE_optional_string): Define.
17730 (General_options::demangle): Change from DEFINE_bool to
17731 DEFINE_optional_string.
17732 (General_options::no_demangle): New function.
17733 (General_options::do_demangle): New function.
17734 (General_options::set_do_demangle): New function.
17735 (General_options::execstack_status_): Move definition to end of
17736 class definition.
17737 (General_options::static_): Likewise.
17738 (General_options::do_demangle_): New field.
17739 * object.cc (big_endian>::get_symbol_location_info): Call
17740 Options::do_demangle, not Options::demangle.
17741 * symtab.cc (demangle): Likewise.
17742
cbb93e63
ILT
177432008-03-22 Ian Lance Taylor <iant@google.com>
17744
17745 * gold.h: Include <cstddef> and <sys/types.h>
17746 * options.h: Include <cstring>.
17747
ec531623
ILT
177482008-03-21 Ian Lance Taylor <iant@google.com>
17749
17750 * Added source code to GNU binutils.
752937aa 17751\f
b90efa5b 17752Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17753
17754Copying and distribution of this file, with or without modification,
17755are permitted in any medium without royalty provided the copyright
17756notice and this notice are preserved.
17757
17758Local Variables:
17759mode: change-log
17760left-margin: 8
17761fill-column: 74
17762version-control: never
17763End:
This page took 1.12325 seconds and 4 git commands to generate.