Clear the ch_reserved field in 64-bit output
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
3d4fde69
CC
12015-09-07 Cary Coutant <ccoutant@gmail.com>
2
3 PR gold/18930
4 PR gold/18886
5 * resolve.cc (Symbol::override_base): Don't convert IFUNC symbols here.
6 * symtab.cc (Symbol_table::add_from_dynobj): Convert them here instead.
7
358de988
L
82015-09-02 H.J. Lu <hongjiu.lu@intel.com>
9
10 PR gold/18886
11 * resolve.cc (Symbol::override_base): Turn IFUNC symbols from
12 shared libraries into normal FUNC symbols.
13 * symtab.cc (Symbol_table::sized_write_symbol): Assert IFUNC
14 symbols aren't from shared libraries.
15
d49044c7
AM
162015-09-02 Alan Modra <amodra@gmail.com>
17
18 PR 18878
19 * powerpc.cc (Target_powerpc): Add savres_section_ and accessor.
20 (Target_powerpc::Branch_info::make_stub): Determine whether long
21 branch stub is for save/restore function.
22 (Branch_stub_ent): Add save_res_, and extra parm to constructor.
23 (Stub_table): Add need_save_res_.
24 (Stub_table:clear_stubs): Clear need_save_res_.
25 (Stub_table:set_address_and_size): Add save/restore section size.
26 (Stub_table::add_long_branch_entry): Add save_res param. Set
27 need_save_res_, but don't add space for save/restore stubs.
28 (Stub_table::find_long_branch_entry): Return offset to local copy
29 of save/restore func.
30 (Stub_table::do_write): Don't output save/restore stubs. Instead
31 copy the save/restore functions.
32 (Output_data_save_res:contents): New accessor.
33 (Target_powerpc::define_save_restore_funcs): Set savres_section_.
34
7c61d651
CC
352015-08-25 Cary Coutant <ccoutant@gmail.com>
36
37 PR gold/18847
38 * script-sections.cc (Memory_region::set_address): New method.
39 (Script_sections::find_memory_region): Add explicit_only parameter.
40 (Output_section_definition::set_section_addresses): Handle case where
41 script specifies both address and vma region.
42 * script-sections.h (Script_sections::find_memory_region): Add
43 explicit_only parameter.
44
4bfacfd3
CC
452015-08-25 Cary Coutant <ccoutant@gmail.com>
46
47 PR gold/18859
48 * object.cc (Input_objects::add_object): Store objects in a map,
49 indexed by soname; update as-needed flag when necessary.
50 * object.h (Object::clear_as_needed): New method.
51 (Input_objects::so_names_): Change from set to map.
52
1757d35c
CC
532015-08-25 Cary Coutant <ccoutant@gmail.com>
54
55 PR gold/14746
56 * expression.cc (Expression::Expression_eval_info): Add
57 is_valid_pointer field.
58 (Expression::eval_maybe_dot): Add is_valid_pointer parameter.
59 Adjust all callers.
60 (Addr_expression::value_from_output_section): Check whether address
61 is valid.
62 * script.cc (Symbol_assignment::set_if_absolute): Defer assignment
63 if evaluation failed due to address that is not yet valid.
64 * script.h: (Expression::eval_maybe_dot): Add is_valid_pointer
65 parameter.
66
3ac0a36c
CC
672015-08-25 Cary Coutant <ccoutant@gmail.com>
68
69 PR gold/18866
70 PR gold/18703
71 * symtab.cc (Symbol_table): Reorder conditions to avoid internal error.
72
9215b98b
AM
732015-08-20 Alan Modra <amodra@gmail.com>
74
75 PR gold/18846
76 * target-reloc.h (relocate_relocs <RELOC_ADJUST_FOR_SECTION_RELA>):
77 Subtract os->address() from addend.
78 * powerpc.cc (relocate_relocs): Likewise.
79
40fc1451
SD
802015-08-12 Simon Dardis <simon.dardis@imgtec.com>
81
82 * mips.cc (plt0_entry_o32, plt0_entry_n32, plt0_entry_n64,
83 lazy_stub_normal_1, lazy_stub_normal_1_n64,
84 lazy_stub_normal_2, lazy_stub_normal_2_n64, lazy_stub_big,
85 lazy_stub_big_n64, lazy_stub_micromips32_normal_1_n64,
86 lazy_stub_micromips32_normal_2_n64, lazy_stub_micromips32_big,
87 lazy_stub_micromips32_big_n64): Update to use 'or' for move instead
88 of 'addu/daddu'.
89
37a42ee9
L
902015-07-27 H.J. Lu <hongjiu.lu@intel.com>
91
92 * configure: Regenerated.
93
ab3b14b0
DK
942015-07-26 Doug Kwan <dougkwan@google.com>
95
96 * testsuite/arm_unaligned_reloc.{s,sh}: Make test less sensitive to
97 disassembler output format.
98
cdb06167
HS
992015-07-23 Ian Coolidge <icoolidge@google.com>
100 Plumb --pic-veneer option for gold.
101
102 * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub
103 generation.
104 * options.h (General_options): Add --pic-veneer option.
105
5b2af7dd
L
1062015-07-22 H.J. Lu <hongjiu.lu@intel.com>
107
108 PR gold/18663
109 * testsuite/Makefile.am (script_test_1_SOURCES): Set to
110 script_test_1a.cc script_test_1b.cc.
111 (script_test_11_r.o): Replace script_test_11.o with
112 script_test_11a.o script_test_11b.o.
113 (script_test_11.o): Removed.
114 (script_test_11a.o): New.
115 (script_test_11b.o): Likewise.
116 * testsuite/Makefile.in: Regenerated.
117 * testsuite/script_test_1.h: New file.
118 * testsuite/script_test_1b.cc: Likewise.
119 * testsuite/script_test_11.h: Likewise.
120 * testsuite/script_test_11b.c: Likewise.
121 * testsuite/script_test_1.cc: Renamed to ...
122 * testsuite/script_test_1a.cc: This.
123 Include "script_test_1.h".
124 (main): Call check_int and check_ptr.
125 * testsuite/script_test_11.c: Renamed to ...
126 * testsuite/script_test_11a.c: This.
127 Include "script_test_11.h".
128 (main): Call ptr_equal.
129
cd78ea77
L
1302015-07-22 H.J. Lu <hongjiu.lu@intel.com>
131
132 PR gold/18628
133 * testsuite/ifuncdep2.c (global): Change protected to hidden.
134 * testsuite/ifuncmod1.c (global): Likewise.
135 * testsuite/ifuncmod5.c (global): Likewise.
136
f945ba50
AM
1372015-07-22 Alan Modra <amodra@gmail.com>
138
139 * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
140
5417c94d
CC
1412015-07-21 Cary Coutant <ccoutant@gmail.com>
142
143 PR gold/18548
144 * symtab.cc (Symbol_table::do_define_in_output_data): Check for
145 forced local symbol even when oldsym != NULL.
146 (Symbol_table::do_define_in_output_segment): Likewise.
147 (Symbol_table::do_define_as_constant): Likewise.
148
cb5cf5e2
CC
1492015-07-21 Cary Coutant <ccoutant@gmail.com>
150
b8c6c5ef 151 PR gold/18698
cb5cf5e2
CC
152 * archive.cc (Library_base::should_include_member): Don't use entry
153 point for relocatable links, or if target is not yet valid.
154 * parameters.cc (Parameters::entry): Check target_valid().
155
0ef3814f
HS
1562015-07-20 Han Shen <shenhan@google.com>
157
158 Optimize erratum 843419 fix.
159
160 * aarch64.cc (AArch64_insn_utilities::is_adr): New method.
161 (AArch64_insn_utilities::aarch64_adr_encode_imm): New method.
162 (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method.
163 (E843419_stub): New sub-class of Erratum_stub.
164 (AArch64_relobj::try_fix_erratum_843419_optimized): New method.
165 (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix.
166 (AArch64_relobj::create_erratum_stub): Add 1 argument.
167 (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
168
2bca0377
HS
1692015-07-20 Han Shen <shenhan@google.com>
170
171 Fix arm elf header flags wrt hardfp bit.
172
173 * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
174
f54f5e31
L
1752015-07-20 H.J. Lu <hongjiu.lu@intel.com>
176
177 PR gold/18689
178 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit
179 from input group section for relocatable link.
180 * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh.
181 (check_DATA): Add pr18689.stdout.
182 (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o.
183 (pr18689.stdout): New rule.
184 (pr18689a.o): Likewise.
185 (pr18689b.o): Likewise.
186 (pr18689.o): Likewise.
187 * testsuite/pr18689.c: New file.
188 * testsuite/pr18689.sh: Likewise.
189 * testsuite/Makefile.in: Regenerated.
190
c20ceeb2
YW
1912015-07-20 Yiran Wang <yiran@google.com>
192 Cary Coutant <ccoutant@gmail.com>
193
194 PR gold/15574
195 * resolve.cc (Symbol_table): Remove warning about references
196 from shared objects to hidden symbols.
197 * testsuite/Makefile.am (hidden_test): Add hidden_test.syms.
198 * testsuite/Makefile.in: Regenerate.
199 * testsuite/hidden_test.sh: Check dynamic symbol table; update
200 expected error messages.
201
19a7fe52
L
2022015-07-14 H.J. Lu <hongjiu.lu@intel.com>
203
204 * compressed_output.cc (Output_compressed_section::set_final_data_size):
205 Make --compress-debug-sections=zlib the same as
206 --compress-debug-sections=zlib-gabi.
207 * testsuite/Makefile.am (flagstest_compress_debug_sections.check):
208 Expect ".debug_.*" with the SHF_COMPRESSED bit, instead of
209 ".zdebug_".
210 * testsuite/Makefile.in: Regenerated.
211
fb8b9dbc
L
2122015-07-12 H.J. Lu <hongjiu.lu@intel.com>
213
214 PR gold/18322
215 * compressed_output.cc (zlib_compress): Add argument for
216 compression header size. Set header size to compression header
217 size if it isn't 0. Don't write out the zlib header here.
218 (Output_compressed_section::set_final_data_size): Support
219 zlib-gnu and zlib-gabi compressions. Pass compression header
220 size to zlib_compress and write out compression header. Set
221 the SHF_COMPRESSED bit for zlib-gabi compression. Otherwise
222 clear the SHF_COMPRESSED bit
223 * options.h (compress_debug_sections): Add zlib-gnu and
224 zlib-gabi.
225 * output.h (Output_section::set_flags): New.
226 * testsuite/Makefile.am (check_PROGRAMS): Add
227 flagstest_compress_debug_sections_none,
228 flagstest_compress_debug_sections_gnu and
229 flagstest_compress_debug_sections_gabi.
230 (check_DATA): Add flagstest_compress_debug_sections_none.stdout.
231 flagstest_compress_debug_sections.stdout,
232 flagstest_compress_debug_sections.cmp,
233 flagstest_compress_debug_sections.check,
234 flagstest_compress_debug_sections_gnu.stdout,
235 flagstest_compress_debug_sections_gnu.cmp,
236 flagstest_compress_debug_sections_gnu.check,
237 flagstest_compress_debug_sections_gabi.stdout,
238 flagstest_compress_debug_sections_gabi.cmp and
239 flagstest_compress_debug_sections_gabi.check.
240 (flagstest_compress_debug_sections_none): New.
241 (flagstest_compress_debug_sections_none.stdout): Likewise.
242 (flagstest_compress_debug_sections.stdout): Likewise.
243 (flagstest_compress_debug_sections.check): Likewise.
244 (flagstest_compress_debug_sections.cmp): Likewise.
245 (flagstest_compress_debug_sections_gnu): Likewise.
246 (flagstest_compress_debug_sections_gnu.stdout): Likewise.
247 (flagstest_compress_debug_sections_gnu.check): Likewise.
248 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
249 (flagstest_compress_debug_sections_gabi): Likewise.
250 (flagstest_compress_debug_sections_gabi.stdout): Likewise.
251 (flagstest_compress_debug_sections_gnu.check): Likewise.
252 (flagstest_compress_debug_sections_gnu.cmp): Likewise.
253 * testsuite/Makefile.in: Regenerated.
254
48058663
L
2552015-07-12 H.J. Lu <hongjiu.lu@intel.com>
256
257 PR gold/18321
258 * compressed_output.h (decompress_input_section): Add arguments
259 for ELF class, big endian and sh_flags.
260 * compressed_output.cc (decompress_input_section): Likewise.
261 Support the SHF_COMPRESSED section.
262 * dynobj.h (Dynobj): Add elfsize and is_big_endian member
263 functions.
264 * plugin.h (Pluginobj): Likewise.
265 * layout.cc (Layout::get_output_section_flags): Also clear the
266 SHF_COMPRESSED bit.
267 * object.h (Compressed_section_info): Add flag to store sh_flags.
268 (Object): Add pure virtual elfsize and is_big_endian member
269 functions.
270 * object.cc (need_decompressed_section): Don't skip the ".zdebug"
271 prefix here.
272 (build_compressed_section_map): Check SHF_COMPRESSED for
273 uncompressed size. Store sh_flags in Compressed_section_info.
274 Pass size, big_endian and sh_flags to decompress_input_section.
275 Skip the ".debug"/".zdebug" prefix when passing section name to
276 need_decompressed_section.
277 (Sized_relobj_file<size, big_endian>::do_find_special_section):
278 Don't check ".zdebug_*" sections.
279 (Object::decompressed_section_contents): Pass ELF class, big
280 endian and sh_flags to decompress_input_section.
281 * reloc.cc (Sized_relobj_file<size, big_endian>::write_sections):
282 Likewise.
283 * testsuite/Makefile.am (check_DATA): Add
284 debug_msg_cdebug_gabi.err and gdb_index_test_2_gabi.stdout.
285 (MOSTLYCLEANFILES): Add debug_msg_cdebug_gabi.err and
286 gdb_index_test_2_gabi.stdout.
287 (debug_msg_cdebug_gabi.o): New.
288 (odr_violation1_cdebug_gabi.o): Likewise.
289 (odr_violation2_cdebug_gabi.o): Likewise.
290 (debug_msg_cdebug_gabi.err): Likewise.
291 (check_SCRIPTS): Add gdb_index_test_2_gabi.sh.
292 (gdb_index_test_cdebug_gabi.o): Likewise.
293 (gdb_index_test_2_gabi): Likewise.
294 (gdb_index_test_2_gabi.stdout): Likewise.
295 * testsuite/gdb_index_test_2_gabi.sh: New file.
296 * testsuite/Makefile.in: Regenerated.
297
73854cdd
HS
2982015-07-09 Han Shen <shenhan@google.com>
299
300 Use "gold_info" instead of "gold_warning" for erratum fix.
301
302 * aarch64.cc (Target_aarch64::scan_erratum_843419_span): Use
303 'gold_info'.
304 (Target_aarch64::scan_erratum_835769_span): USe 'gold_info'.
305
61163dfa
HS
3062015-07-09 Han Shen <shenhan@google.com>
307
308 Drop missing symbol warning for arm/aarch64.
309
310 * aarch64.cc (AArch64_relobj::scan_errata): Drop missing symbol warning.
311 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Drop missing
312 symbol warning.
313
b91deca9
HS
3142015-07-07 Han Shen <shenhan@google.com>
315
316 Make gold aarch64 accept long form of mapping symbols.
317
318 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Make legal
319 of mapping symbols.
320
15162bef
DK
3212015-06-29 Doug Kwan <dougkwan@google.com>
322
323 * testsuite/arm_bl_out_of_range.s: Align stub table so that it appears
324 at address expected by test.
325 * testsuite/arm_cortex_a8_b.s: Ditto.
326 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
327 * testsuite/arm_cortex_a8_bl.s: Ditto.
328 * testsuite/arm_cortex_a8_blx.s: Ditto.
329 * testsuite/arm_cortex_a8_local.s: Ditto.
330 * testsuite/arm_fix_v4bx.s: Ditto.
331 * testsuite/arm_unaligned_reloc.s: Ditto.
332 * testsuite/thumb_bl_out_of_range.s: Ditto.
333 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
334 * testsuite/thumb_blx_out_of_range.s: Ditto.
b91deca9 335
56b06706
HS
3362015-06-29 Han Shen <shenhan@google.com>
337
338 Patch for erratum 843419 internal error.
339
72f4393d
L
340 * aarch64.cc (Erratum_stub::Insn_utilities): New typedef.
341 (Erratum_stub::update_erratum_insn): New method.
342 (Stub_table::relocate_stubs): Modified to place relocated insn.
343 (AArch64_relobj::fix_errata): Modified gold_assert.
56b06706 344
2f0c79aa
HS
3452015-06-12 Han Shen <shenhan@google.com>
346
347 Fix erratum 835769.
348
72f4393d
L
349 * aarch64.cc (AArch64_insn_utilities::BYTES_PER_INSN): Move
350 defintion outside class definition.
351 (AArch64_insn_utilities::AARCH64_ZR): New static constant.
352 (AArch64_insn_utilities::aarch64_op31): New member.
353 (AArch64_insn_utilities::aarch64_ra): New member.
354 (AArch64_insn_utilities::aarch64_mac): New member.
355 (AArch64_insn_utilities::aarch64_mlxl): New member.
356 (ST_E_835769): New global enum member.
357 (Stub_table::relocate_stubs): Add 835769 handler.
358 (Stub_template_repertoire::Stub_template_repertoire): Install new
359 stub type.
360 (AArch64_relobj::scan_errata): This func is renamed from
361 scan_erratum_843419.
362 (AArch64_relobj::do_count_local_symbols): Add 835769 handler.
363 (AArch64_relobj::do_relocate_sections): Add 835769 handler.
364 (AArch64_relobj::scan_sections_for_stubs): Add 835769 handler.
365 (Target_aarch64::scan_erratum_835769_span): New method.
366 (Target_aarch64::create_erratum_stub): New method.
367 (Target_aarch64::is_erratum_835769_sequence): New method.
368 (Target_aarch64::scan_erratum_843419_sequence): Move part of the
369 code into create_erratum_stub.
370 * options.h (fix_cortex_a53_835769): New option.
2f0c79aa 371
5d7908e0
CC
3722015-06-11 Cary Coutant <ccoutant@gmail.com>
373
374 * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
375 outside class body.
376 (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
377
dd68f8fa
CC
3782015-06-11 Cary Coutant <ccoutant@gmail.com>
379
380 PR gold/17731
381 * layout.cc (corresponding_uncompressed_section_name): New function.
382 (Layout::choose_output_section): Call it.
383 * layout.h (corresponding_uncompressed_section_name): New function.
384 * script-sections.cc (Input_section_info::set_section_name): Check
385 for compressed debug section (.zdebug style).
386
a3a0c391
JY
3872015-06-11 Jing Yu <jingyu@google.com>
388
389 * testsuite/Makefile.am: Add -O0 for script_test_12 test.
390 * testsuite/Makefile.in: Regenerate.
391
970cdef2
DI
3922015-06-11 Davide Italiano <dccitaliano@gmail.com>
393
394 * gold.h (is_cident): Correct typo.
395
a48d0c12
HS
3962015-06-10 Han Shen <shenhan@google.com>
397 Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
398
399 Now fixing for 843419 is fully functional.
400
401 The first part of the erratum fix CL is here -
402 https://sourceware.org/ml/binutils/2015-04/msg00229.html
403
404 * aarch64.cc(global enum): New constants representing stub types.
405 (Stub_template): New POD struct.
406 (Stub_template_repertoire): New class.
407 (Stub_base): New class.
408 (Erratum_stub): New class.
409 (Reloc_stub): Refactored to be a subclass of Stub_base.
410 (Reloc_stub::Stub_type): Removed.
411 (Reloc_stub::offset): Moved to Stub_base.
412 (Reloc_stub::set_offset): Moved to Stub_base.
413 (Reloc_stub::destination_address): Moved to Stub_base.
414 (Reloc_stub::set_destination_address): Moved to Stub_base.
415 (Reloc_stub::reset_destination_address): Moved to Stub_base.
416 (Reloc_stub::stub_type): Renamed and moved to Stub_base.
417 (Reloc_stub::stub_size): Renamed and moved to Stub_base.
418 (Reloc_stub::stub_insns): Renamed and moved to Stub_base.
419 (Reloc_stub::write): Moved to Stub_base.
420 (Reloc_stub::invalid_offset): Moved to Stub_base.
421 (Reloc_stub::invalid_address): Moved to Stub_base.
422 (Reloc_stub::stub_type_): Renamed and moved to Stub_base.
423 (Reloc_stub::stub_insns_): Moved to Stub_base.
424 (Reloc_stub::offset_): Moved to Stub_base.
425 (Reloc_stub::destination_address_): Moved to Stub_base.
426 (Stub_table::The_aarch64_relobj): New typedef.
427 (Stub_table::The_erratum_stub): New typedef.
428 (Stub_table::The_erratum_stub_less): New typedef.
429 (Stub_table::The_erratum_stub_set): New typedef.
430 (Stub_table::The_erratum_stub_set_iter): New typedef.
431 (Stub_table::empty): Added emptiness testing for erratum stubs.
432 (Stub_table::add_erratum_stub): New method to add an erratum stub.
433 (Stub_table::find_erratum_stub): New method.
434 (Stub_table::find_erratum_stubs_for_input_section): New method.
435 (Stub_table::erratum_stub_address): New method.
436 (Stub_table::update_date_size_changed_p): Modified to handle erratum stubs.
437 (Stub_table::do_addralign): Modified to handle erratum stubs.
438 (Stub_table::erratum_stubs_): New member.
439 (Stub_table::erratum_stub_size_): New member.
440 (Stub_table::relocate_stubs): Modified to handle erratum stubs.
441 (Stub_table::do_write): Modified to handle erratum stubs.
442 (AArch64_relobj::The_erratum_stub): New typedef.
443 (AArch64_relobj::Erratum_stub_set_iter): New typedef.
444 (AArch64_relobj::fix_errata): New method.
445 (Target_aarch64::The_reloc_stub_type): Removed.
446 (Target_aarch64::The_erratum_stub): New typede.
447 (AArch64_relocate_functions::construct_b): New method.
448
1e1b2efc
NC
4492015-06-08 Nick Clifton <nickc@redhat.com>
450
451 * po/fr.po: New French Translation.
452
b8cf5075
CC
4532015-06-07 Cary Coutant <ccoutant@gmail.com>
454
455 PR gold/18288
456 * resolve.cc (symbol_to_bits): Remove type parameter; adjust all
457 callers. Don't use STT_COMMON to check for common symbols.
458 (Symbol_table::resolve): Warn if relocatable object has STT_COMMON
459 symbol that's not in a common section.
460 * symtab.h (Symbol::is_common): Don't use STT_COMMON to check for
461 common symbols.
462
bdd2d2b7
CC
4632015-06-04 Cary Coutant <ccoutant@gmail.com>
464
465 PR gold/18200
466 * Makefile.am (diststuff): Add target.
467 * Makefile.in: Regenerate.
468
cd3c333f
CC
4692015-06-04 Cary Coutant <ccoutant@gmail.com>
470
471 PR gold/17498
472 * object.cc (Sized_relobj_file::do_count_local_symbols): Discard
473 temporary locals in merge sections.
474 * options.cc (General_options::parse_discard_all): New method.
475 (General_options::parse_discard_locals): New method.
476 (General_options::parse_discard_none): New method.
477 (General_options::General_options): Initialize discard_locals_.
478 * options.h (--discard-all): Convert to special option.
479 (--discard-locals): Likewise.
480 (--discard-none): New option.
481 (General_options::discard_all): New method.
482 (General_options::discard_locals): New method.
483 (General_options::discard_sec_merge): New method.
484 (General_options::Discard_locals): New enum.
485 (General_options::discard_locals_): New data member.
486
8086551f
CC
4872015-06-03 Cary Coutant <cary@google.com>
488
489 * script-sections.cc (Script_sections::Script_sections): Initialize
490 segments_created_.
491 (Script_sections::create_note_and_tls_segments): Set flag when
492 segments are created.
493 (Script_sections::expected_segment_count): Count PT_INTERP.
494 (Script_sections::attach_sections_using_phdrs_clause): Set flag when
495 segments are created.
496 * script-sections.h (Script_sections::segments_created_): New data
497 member.
498
374082df
CC
4992015-06-03 Cary Coutant <ccoutant@gmail.com>
500
501 PR gold/15370
502 * script-sections.cc
503 (Output_section_element_input::set_section_addresses): When there
504 are several patterns with no sort spec, put all sections in the same
505 bin.
506 * testsuite/Makefile.am (script_test_12): New testcase.
507 (script_test_12i): New testcase.
508 * testsuite/Makefile.in: Regenerate.
509 * testsuite/script_test_12.t: New test linker script.
510 * testsuite/script_test_12i.t: New test linker script.
511 * testsuite/script_test_12a.c: New test source file.
512 * testsuite/script_test_12b.c: New test source file.
513
775ed62e
CC
5142015-06-02 Cary Coutant <ccoutant@gmail.com>
515
516 * nacl.h (Sniff_file): Switch parameters to get_view to get an
517 aligned view.
518
9c7fe3c5
CC
5192015-06-03 Cary Coutant <ccoutant@gmail.com>
520
72f4393d
L
521 PR gold/17819
522 * gold.cc (queue_final_tasks): When --build-id=tree, queue a
523 separate task to schedule the build id computation.
524 * layout.cc (Hash_task::Hash_task): Remove build_id_blocker,
525 add Output_file and offset.
526 (Hash_task::run): Get and release the input views.
527 (Hash_task::is_runnable): Always return NULL (always runnable).
528 (Layout::queue_build_id_tasks): Remove.
529 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
530 parameters; use them instead of class members.
531 (Build_id_task_runner::run): New function.
532 (Close_task_runner::run): Pass array_of_hashes and size_of_hashes
533 to write_build_id.
534 * layout.h (Layout::queue_build_id_tasks): Remove.
535 (Layout::write_build_id): Add array_of_hashes and size_of_hashes
536 parameters.
537 (Layout::array_of_hashes_): Remove.
538 (Layout::size_of_array_of_hashes_): Remove.
539 (Layout::input_view_): Remove.
540 (Build_id_task_runner): New class.
541 (Close_task_runner::Close_task_runner): Add array_of_hashes and
542 size_of_hashes parameters.
543 (Close_task_runner::array_of_hashes_): New data member.
544 (Close_task_runner::size_of_hashes_): New data member.
545 * testsuite/Makefile.am
546 (flagstest_compress_debug_sections_and_build_id_tree): New test.
547 * testsuite/Makefile.in: Regenerate.
9c7fe3c5 548
400f8944
RÁE
5492015-06-01 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
550
551 * merge.cc (get_input_merge_map): Update for data structure change.
552 (get_or_make_input_merge_map): Update for data structure change.
553 * merge.h (Object_merge_map): Use a std::vector<std::pair>> instead of
554 a std::map. Remove first_shnum_, first_map_, second_shnum_, second_map_.
555
bbec1a5d
AM
5562015-05-16 Alan Modra <amodra@gmail.com>
557
558 * reloc.cc (Sized_relobj_file::find_functions): Use function_location.
559 * powerpc.cc (Target_powerpc::do_calls_non_split): New function.
560 (addi_12_1, addis_2_12, addis_12_1, cmpld_7_12_0): New constants.
561 (lis_0): Rename from lis_0_0.
562
efc6fa12
CC
5632015-04-29 Cary Coutant <cary@google.com>
564 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
565
566 * gc.h (Garbage_collection::is_section_garbage): Change Object*
567 to Relobj*.
568 (Garbage_collection::add_reference): Likewise.
569 (Garbage_collection::gc_process_relocs): Likewise. Don't push
570 object/shndx pair onto *secvec for dynamic objects. Don't follow
571 relocations pointing to dynamic objects for GC.
572 * icf.cc (Icf::find_identical_sections): Change Object* to Relobj*.
573 (Icf::unfold_section): Likewise.
574 (Icf::is_section_folded): Likewise.
575 (Icf::get_folded_section): Likewise.
576 * icf.h: (Icf::get_folded_section): Likewise.
577 (Icf::unfold_section): Likewise.
578 (Icf::is_section_folded): Likewise.
579 (Icf::section_has_function_pointers): Likewise.
580 (Icf::set_section_has_function_pointers): Likewise.
581 * object.h (Section_id): Likewise.
582 (Const_section_id): Likewise.
583 * output.cc (Output_section::update_section_layout): Likewise.
584 * output.h: (Output_section_lookup_maps::find_relaxed_input_section):
585 Likewise.
586 * plugin.cc (update_section_order): Likewise.
587 (unique_segment_for_sections): Likewise.
588 * powerpc.cc (Powerpc_relobj::add_reference): Likewise.
589 (Target_powerpc::do_gc_add_reference): Likewise.
590 (Target_powerpc::gc_process_relocs): Likewise.
591 (Target_powerpc::do_gc_add_reference): Likewise.
592 * symtab.cc (Symbol_table::is_section_folded): Likewise.
593 (Symbol_table::gc_mark_symbol): Likewise.
594 * symtab.h: (Symbol_table::is_section_folded): Likewise.
595 * target.h: (Sized_target::gc_add_reference): Likewise.
596 (Sized_target::do_gc_add_reference): Likewise.
597
f9d3ecaa
NC
5982015-04-29 Nick Clifton <nickc@redhat.com>
599
600 * po/fi.po: Updated Finnish translation.
601
faa2211d
AM
6022015-04-28 Alan Modra <amodra@gmail.com>
603
604 * powerpc.cc (Target_powerpc::do_dynsym_value): Use Address rather
605 than unsigned int for find_global_entry result temp. Compare
606 against invalid_address.
607 (Target_powerpc::do_plt_address_for_global): Likewise.
608 (Target_powerpc::Relocate::relocate): Likewise. Don't assert
609 on plt call stub existence for debug info. Do assert for plt
610 and global entry stub existence if an alloc section.
611
6ec65f28
AM
6122015-04-28 Alan Modra <amodra@gmail.com>
613
614 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't assert
615 on missing global entry stub due to bogus debug info.
616
7a2a1c79
HS
6172015-04-27 Han Shen <shenhan@google.com>
618
619 * options.h (--fix-cortex-a53-843419): Rename option.
620 * aarch64.cc (AArch64_relobj::do_count_local_symbols): Use renamed
621 option.
622 (AArch64_relobj::scan_sections_for_stubs): Use renamed option.
623
cfbf0e3c
RÁE
6242015-04-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
625
626 PR gold/18327
627 * output.cc (Output_section::is_input_address_mapped): Assume a missing
628 entry is mapped.
629 * testsuite/Makefile.am: Add the eh_test test.
630 * testsuite/Makefile.in: Regenerate.
631 * testsuite/eh_test_a.cc: New test.
632 * testsuite/eh_test_b.cc: New test.
633
6ec65f28
AM
6342015-04-23 Sriraman Tallam <tmsriram@google.com>
635
a100d66f
ST
636 * options.h (--weak-unresolved-symbols): New option.
637 * symtab.cc (Symbol_table::sized_write_globals): Change symbol
638 binding to weak with new option.
639 * symtab.h (is_weak_undefined): Check for new option.
640 (is_strong_undefined): Check for new option.
641 * testsuite/Makefile.am (weak_unresolved_symbols_test): New test.
642 * testsuite/Makefile.in: Regenerate.
643 * testsuite/weak_unresolved_symbols_test.cc: New file.
644
4b889c30
IC
6452015-04-20 Ian Coolidge <icoolidge@google.com>
646
647 * symtab.cc (Symbol::should_add_dynsym_entry): Return true for
648 GNU_UNIQUE.
649
4277535c
RÁE
6502015-04-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
651
652 * gc.cc (Garbage_collection::do_transitive_closure): Use back and
653 push_back.
654 * gc.h (Garbage_collection): Use a std::vector instead of a std::queue.
655 * object.cc (Sized_relobj_file::do_layout): Use push_back.
656 * powerpc.cc (process_gc_mark): Use push_back.
657 (Target_powerpc::do_gc_mark_symbol): Use push_back.
658 * symtab.cc (Symbol_table::gc_mark_symbol): Use push_back.
659
7a2a1c79 6602015-04-16 Han Shen <shenhan@google.com>
5019d64a 661
6ec65f28
AM
662 * aarch64.cc (AArch64_insn_utilities): New utility class.
663 (AArch64_relobj::Mapping_symbol_position): New struct.
664 (AArch64_relobj::Mapping_symbol_info): New typedef.
665 (AArch64_relobj::do_count_local_symbols): New function overriding
666 parent's implementation.
667 (AArch64_relobj::mapping_symbol_info_): New member
668 (AArch64_relobj::scan_erratum_843419): New method.
669 (Target_aarch64::scan_erratum_843419_span): New method.
670 (Target_aarch64::is_erratum_843419_sequence): New method.
671 * options.h (fix_cortex_a53): New option.
5019d64a 672
a6a17750
CC
6732015-04-09 Cary Coutant <ccoutant@google.com>
674
675 * symtab.cc (Symbol::final_value_is_known): Check for TLS symbol
676 in a PIE link.
677 * testsuite/Makefile.am (tls_pie_test.sh): New test.
678 * testsuite/Makefile.in: Regenerate.
679 * testsuite/tls_pie_test.sh: New.
680
437ddf0c
CC
6812015-04-09 Cary Coutant <ccoutant@google.com>
682
683 * debug.h (DEBUG_LOCATION): New.
684 (DEBUG_ALL): Include DEBUG_LOCATION.
685 (debug_string_to_enum): Add DEBUG_LOCATION.
686 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
687 output to print correct context.
688 (Sized_dwarf_line_info::do_addr2line): Add debug output. Return
689 up to 4 more locations at the beginning of the function.
690 * symtab.cc (Symbol_table::detect_odr_violations): Get canonical
691 result before sorting list of line numbers.
692 * testsuite/debug_msg.sh: Allow range of line numbers for
693 canonical results on optimized code.
694
24491327
HS
6952015-04-07 HC Yen <hc.yen@mediatek.com>
696
697 Add AArch32 support for gold linker.
698 gold/
699 * arm.cc: Add V8 arch combine table.
700
7fa5525f
RÁE
7012015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
702
703 * aarch64.cc (do_reloc_addend): Fix signature to match the parent one.
704
5368dcf2
RÁE
7052015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
706
707 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a call
708 to find by using the return value of insert.
709
9dbb4b02
RÁE
7102015-04-06 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
711
712 * gc.cc (Garbage_collection::do_transitive_closure): Avoid a copy
713 constructor call.
714
1fa29f10
IT
7152015-04-06 Ilya Tocar <ilya.tocar@intel.com>
716
717 PR gold/17641
718 * x86_64.cc (Target_x86_64::can_convert_mov_to_lea): New.
719 (Target_x86_64::Scan::local): Don't create GOT entry, when we
720 can convert mov to lea.
721 (Target_x86_64::Scan::global): Ditto.
722 (Target_x86_64::Relocate::relocate): Convert mov foo@GOTPCREL(%rip),
723 %reg to lea foo(%rip), %reg if possible.
724 * testsuite/Makefile.am (x86_64_mov_to_lea): New test.
725 * testsuite/x86_64_mov_to_lea1.s: New.
726 * testsuite/x86_64_mov_to_lea2.s: Ditto.
727 * testsuite/x86_64_mov_to_lea3.s: Ditto.
728 * testsuite/x86_64_mov_to_lea4.s: Ditto.
729 * testsuite/x86_64_mov_to_lea.sh: Ditto.
730
39f3de7c
L
7312015-04-02 H.J. Lu <hongjiu.lu@intel.com>
732
733 * configure: Regenerated.
734
c4fc4724
IT
7352015-04-01 Ilya Tocar <ilya.tocar@intel.com>
736
737 PR gold/17640
738 * i386.cc (Target_i386::can_convert_mov_to_lea): New.
739 (Target_i386::Scan::local): Don't create GOT entry, when we
740 can convert GOT to GOTOFF.
741 (Target_i386::Scan::global): Ditto.
742 (Target_i386::Relocate::relocate): Convert mov foo@GOT(%reg), %reg to
743 lea foo@GOTOFF(%reg), %reg if possible.
744 * testsuite/Makefile.am (i386_mov_to_lea): New test.
745 * testsuite/i386_mov_to_lea1.s: New.
746 * testsuite/i386_mov_to_lea2.s: Ditto.
747 * testsuite/i386_mov_to_lea3.s: Ditto.
748 * testsuite/i386_mov_to_lea4.s: Ditto.
749 * testsuite/i386_mov_to_lea5.s: Ditto.
750 * testsuite/i386_mov_to_lea.sh: Ditto.
751
918357b9
L
7522015-04-01 H.J. Lu <hongjiu.lu@intel.com>
753
754 * Makefile.am (ZLIB): New.
755 (ZLIBINC): Likewise.
756 (AM_CFLAGS): Add $(ZLIBINC).
757 (AM_CXXFLAGS): Likewise.
758 (ldadd_varldadd_var): Add $(ZLIB).
759 (incremental_dump_LDADD): Likewise.
760 (dwp_LDADD): Likewise.
761 * compressed_output.cc: Don't check HAVE_ZLIB_H to include
762 <zlib.h>.
763 (zlib_compress): Don't check HAVE_ZLIB_H.
764 (zlib_decompress): Likewise.
765 * options.h (compress_debug_sections): Likewise.
766 * configure.ac (AM_CONDITIONAL): Removed.
767 * testsuite/Makefile.am (ZLIB): New.
768 (LDADD): Add $(ZLIB).
769 Don't check HAVE_ZLIB.
770 * Makefile.in: Regenerated.
771 * config.in: Likewise.
772 * configure: Likewise.
773 * testsuite/Makefile.in: Likewise.
774
6b0ad2eb
JY
7752015-03-30 Jing Yu <jingyu@google.com>
776
777 * aarch64-reloc.def: New TLSLD_ADD_DTPREL_HI12,
778 TLSLD_ADD_DTPREL_LO12_NC.
779 * aarch64.cc (Target_aarch64::define_tls_base_symbol): Always let
780 _TLS_MODULE_BASE_ point to the start of tls segment.
781 (Target_aarch64::optimize_tls_reloc): Add cases for
782 R_AARCH64_TLSLD_ADD_DTPREL_HI12 and
783 R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC.
784 (Target_aarch64::Scan::local): Likewise.
785 (Target_aarch64::Scan::global): Likewise.
786 (Target_aarch64::Relocate::relocate): Likewise.
787 (Target_aarch64::Relocate::relocate_tls): Likewise. And remove
788 subtracting tls segment size from symbol value for TLSLD_*_DTPREL
789 relocations.
790
0916f9e7
RÁE
7912015-03-27 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
792
793 * merge.cc (Object_merge_map::add_mapping): call
794 Object_merge_map::Input_merge_map::add_mapping.
795 (Object_merge_map::Input_merge_map::add_mapping): New.
796 (Output_merge_data::do_add_input_section): Call
797 get_or_make_input_merge_map before a loop.
798 (Output_merge_string<Char_type>::finalize_merged_data): Call
799 get_or_make_input_merge_map before a loop.
800 * merge.h (Object_merge_map): Make Input_merge_map public.
801 * object.cc (Relobj::add_merge_mapping): Use get_or_create_merge_map.
802 (Relobj::get_or_create_merge_map): New.
803 * object.h (Relobj::get_or_create_merge_map): New.
804
282c9750
AM
8052015-03-24 Alan Modra <amodra@gmail.com>
806
807 PR 18147
808 * powerpc.cc (Target_powerpc::Relocate::relocate): Don't report
809 relocation errors for branches to strong undefined symbols.
810
67f95b96
RÁE
8112015-03-23 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
812
813 * merge.cc (Object_merge_map::get_input_merge_map): Make it const.
814 (Object_merge_map::is_merge_section_for): Remove.
815 (Object_merge_map::find_merge_section): New.
816 * merge.h (Object_merge_map::is_merge_section_for): Remove.
817 (Object_merge_map::find_merge_section): New.
818 (Object_merge_map::get_input_merge_map): Add a const version.
819 * object.cc (Relobj::is_merge_section_for): Remove.
820 (Relobj::find_merge_section): New.
821 * object.h (Relobj::is_merge_section_for): Remove.
822 (Relobj::find_merge_section): New.
823 * output.cc
824 (Output_section::Input_section::is_merge_section_for): Remove.
825 (Output_section::add_merge_input_section): Don't call
826 add_merge_input_section.
827 (Output_section::find_merge_section): Return const. Use
828 object->find_merge_section.
829 (Output_section::build_lookup_maps): Don't build a map for
830 merge sections.
831 (Output_section::is_input_address_mapped): Return false if
832 section is not found.
833 (Output_section::find_starting_output_address): Use
834 find_merge_section instead of is_merge_section_for.
835 (Output_section::add_script_input_section): Don't build a map for
836 merge sections.
837 * output.h (Output_section_lookup_maps::merge_sections_by_id_): Remove.
838 (Output_section_lookup_maps::find_merge_section): Remove.
839 (Output_section_lookup_maps::add_merge_input_section) Remove.
840 (Output_section::find_merge_section): Return const.
841
152f7024
CC
8422015-03-22 Cary Coutant <cary@google.com>
843
844 PR gold/18106
845 * i386.cc (Target_i386::Relocate::tls_gd_to_ie): Fix support for
846 non-SIB form of lea, with nop after the call.
847
bccffdfd
CC
8482015-03-21 Cary Coutant <cary@google.com>
849
850 PR gold/14217
851 * output.cc (Output_segment::is_first_section_relro): Don't ignore
852 .tdata section.
853 (Output_segment::set_section_addresses): Don't align size of relro
854 segment for .tbss.
855
1c582fe7
CC
8562015-03-21 Cary Coutant <cary@google.com>
857
858 PR gold/18010
859 * stringpool.cc (Stringpool_template): Don't optimize if section
860 alignment is greater than sizeof(char).
861
410da591
CC
8622015-03-21 Cary Coutant <cary@google.com>
863
864 PR gold/18048
865 * script-c.h (script_include_directive): Add first_token parameter.
866 * script.cc (script_include_directive): Add first_token parameter, and
867 pass it to read_script_file.
868 * yyscript.y (PARSING_SECTIONS_BLOCK, PARSING_SECTION_CMDS)
869 (PARSING_MEMORY_DEF): New tokens.
870 (top): Add new productions for INCLUDE files.
871 (file_cmd): Replace file_or_sections_cmd with copy of its productions.
872 Pass PARSING_LINKER_SCRIPT to script_include_directive.
873 (section_block_cmd): Likewise; pass PARSING_SECTIONS_BLOCK.
874 (section_cmd): Pass PARSING_SECTION_CMDS.
875 (file_or_sections_cmd): Remove.
876 (memory_def): Pass PARSING_MEMORY_DEF.
877 * testsuite/Makefile.am (memory_test_2): New test.
878 * testsuite/Makefile.in: Regenerate.
879 * testsuite/memory_test_inc.t: New script file.
880 * testsuite/memory_test_inc_1.t.src: New script file.
881 * testsuite/memory_test_inc_2.t.src: New script file.
882 * testsuite/memory_test_inc_3.t.src: New script file.
883
0d5bbdb0
CC
8842015-03-21 Cary Coutant <cary@google.com>
885
886 * dwp.cc (Sized_relobj_dwo::do_section_contents): Delete.
887 (Sized_relobj_dwo::setup): Build compressed section map.
888 (Sized_relobj_dwo::do_decompressed_section_contents): Delete.
889 * dynobj.cc (Sized_dynobj::base_read_symbols): Build compressed
890 section map.
891 * object.cc (Sized_relobj_file::Sized_relobj_file): Remove
892 compressed_sections_ field.
893 (build_compressed_section_map): Take Object instead of
894 Sized_relobj_file parameter; add decompress_if_needed parameter.
895 (Sized_relobj_file::do_find_special_sections): Store compressed
896 section map in parent Object.
897 (Sized_relobj_file::do_decompressed_section_contents): Move
898 implementation to Object::decompressed_section_contents.
899 (Sized_relobj_file::do_discard_decompressed_sections): Move
900 implementation to Object::discard_decompressed_sections.
901 * object.h (build_compressed_section_map): Declare.
902 (Object::Object): Add compressed_sections_ field.
903 (Object::section_is_compressed): Move implementation here.
904 (Object::decompressed_section_contents): De-virtualize.
905 (Object::discard_decompressed_sections): De-virtualize.
906 (Object::do_section_is_compressed): Delete.
907 (Object::do_decompressed_section_contents): Delete.
908 (Object::set_compressed_sections): New method.
909 (Object::compressed_sections): New method.
910 (Object::compressed_sections_): New data member.
911 (Compressed_section_info, Compressed_section_map): Move to top of file.
912 (Sized_relobj_file::do_section_is_compressed): Delete.
913 (Sized_relobj_file::do_decompressed_section_contents): Delete.
914 (Sized_relobj_file::do_discard_decompressed_sections): Delete.
915 (Sized_relobj_file::compressed_sections_): Move to Object class.
916
bd9e0d46
CC
9172015-03-21 Cary Coutant <ccoutant@google.com>
918
919 PR gold/18152
920 * gold.cc (queue_middle_tasks): Finalize .eh_frame after laying out
921 deferred objects.
922
943c8b43
CC
9232015-03-11 Cary Coutant <ccoutant@google.com>
924
925 * options.cc (General_options::finalize): Don't allow -z relro
926 with incremental linking.
927 * testsuite/Makefile.am (incremental_test): Add -z norelro.
928 (incremental_test_2): Likewise.
929 (incremental_test_3): Likewise.
930 (incremental_test_4): Likewise.
931 (incremental_test_5): Likewise.
932 (incremental_test_6): Likewise.
933 (incremental_copy_test): Likewise.
934 (incremental_common_test_1): Likewise.
935 (incremental_comdat_test_1): Likewise.
936 * testsuite/Makefile.in: Regenerate.
937
e1663197
CC
9382015-03-09 Cary Coutant <ccoutant@google.com>
939
940 PR gold/14675
941 * ehframe.cc (Eh_frame::add_ehframe_input_section): Change return type;
942 return enum indicating whether .eh_frame section is empty, optimizable,
943 unrecognized, or an end marker. Adjust explicit instantiations.
944 * ehframe.h (Eh_frame::Eh_frame_section_disposition): New enum type.
945 (Eh_frame::add_ehframe_input_section): Change return type.
946 * gold.cc (queue_middle_tasks): Call Layout::finalize_eh_frame_section.
947 * layout.cc (Layout::layout_eh_frame): Don't add optimized sections
948 to the .eh_frame output section until we see the end marker.
949 (Layout::finalize_eh_frame_section): New.
950 * layout.h: (Layout::finalize_eh_frame_section): New.
951
beb8418f
L
9522015-03-05 H.J. Lu <hongjiu.lu@intel.com>
953
954 * output.cc (Relobj::initialize_input_to_output_map<size>):
955 Remove typename on elfcpp::Elf_types<size>::Elf_Addr.
956
48c73428
CC
9572015-03-04 Cary Coutant <ccoutant@google.com>
958
959 * parameters.cc (Parameters::set_target_once): Call
960 Target::select_as_default_target just once from here...
961 (set_parameters_target): ...instead of from here.
962
9632015-03-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
dbe40a88
RÁE
964
965 * ehframe.cc (Cie::set_output_offset): Pass in and use a
966 Output_section_data instead of a Merge_map.
967 (Eh_frame::Eh_frame): Don't initialize merge_map_.
968 (Eh_frame::read_cie): Use add_merge_mapping instead of
969 Merge_map::add_mapping.
970 (Eh_frame::read_fde): Ditto.
971 (Eh_frame::set_final_data_size): Use this instead of this->merge_map_.
972 (Eh_frame::do_output_offset): Use merge_output_offset istead of
973 merge_map_->get_output_offset.
974 (Eh_frame::do_is_merge_section_for): Delete.
975 * ehframe.h (Fde::add_mapping): Pass in and use a Output_section_data
976 instead of a Merge_map.
977 (Cie::set_output_offset): Pass in a Output_section_data instead of a
978 Merge_map.
979 (Eh_frame::do_is_merge_section_for): Delete.
980 (Eh_frame::merge_map_): Delete.
981 * merge.cc (Object_merge_map::get_or_make_input_merge_map): Pass in
982 and use a Output_section_data instead of a Merge_map.
983 (Object_merge_map::add_mapping): Ditto.
984 (Object_merge_map::get_output_offset): Remove the merge_map argument.
985 (Object_merge_map::is_merge_section_for): Pass in and use a
986 Output_section_data instead of a Merge_map.
987 (Merge_map): Delete.
988 (Output_merge_base::do_output_offset): Use merge_output_offset instead
989 of merge_map_.get_output_offset.
990 (Output_merge_base::do_is_merge_section_for): Delete.
991 (Output_merge_data::do_add_input_section): Use
992 object->add_merge_mapping instead of add_mapping.
993 (Output_merge_string<Char_type>::finalize_merged_data): Ditto.
994 * merge.h (Merge_map): Delete forward declaration.
995 (Object_merge_map::add_mapping): Pass in and use a Output_section_data
996 instead of a Merge_map.
997 (Object_merge_map::get_output_offset): Remove the merge_map argument.
998 (Object_merge_map::is_merge_section_for): Pass in and use a
999 Output_section_data instead of a Merge_map.
1000 (Input_merge_map::Object_merge_map::merge_map): Replace with
1001 output_data.
1002 (Object_merge_map::get_or_make_input_merge_map): Pass in and use a
1003 Output_section_data instead of a Merge_map.
1004 (Merge_map): Delete.
1005 (Output_merge_base::Output_merge_base): Don't initialize merge_map_.
1006 (Output_merge_base::do_is_merge_section_for): Delete.
1007 (Output_merge_base::add_mapping): Delete.
1008 (Output_merge_base::merge_map_): Delete.
1009 * object.cc (Relobj::initialize_input_to_output_map): New.
1010 (Relobj::initialize_input_to_output_map): New.
1011 (Relobj::merge_output_offset): New.
1012 (Relobj::is_merge_section_for): New.
1013 (Relobj::initialize_input_to_output_map): Instantiate for 32 and 64
1014 bits.
1015 * object.h (Relobj::merge_map): Delete.
1016 (initialize_input_to_output_map): New.
1017 (set_merge_map): Delete.
1018 (add_merge_mapping): New.
1019 (merge_output_offset): New.
1020 (is_merge_section_for): New.
1021 * output.cc (Output_section::Input_section::is_merge_section_for):
1022 Use object->is_merge_section_for.
1023 * output.h (Output_section_data::is_merge_section_for): Delete.
1024 (Output_section_data::do_is_merge_section_for): Delete.
1025 * reloc.cc (Merged_symbol_value<size>::initialize_input_to_output_map):
1026 Use object->initialize_input_to_output_map.
1027 (Merged_symbol_value<size>::value_from_output_section): Use
1028 object->merge_output_offset.
1029
48c73428 10302015-03-02 Peter Collingbourne <pcc@google.com>
72f4393d 1031 Cary Coutant <ccoutant@google.com>
2c7b626c
CC
1032
1033 * output.cc (Output_section::add_merge_input_section): Do not
1034 attempt to merge sections with an entsize of 0.
1035
48c73428 10362015-03-02 Khem Raj <raj.khem@gmail.com>
5b07cd84
CC
1037
1038 * attributes.h (class Output_attributes_section_data ): Add
1039 do_print_to_mapfile function.
1040
ec86f434
AM
10412015-02-24 Alan Modra <amodra@gmail.com>
1042
1043 PR 18010
1044 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always
1045 complain if value is not a multiple of four.
1046 (Target_powerpc::Relocate::relocate): Correct handling of
1047 R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
1048
be66981e
L
10492015-02-21 H.J. Lu <hongjiu.lu@intel.com>
1050
1051 * configure.ac (default_size): Set to 32 for x32.
1052 * configure: Regenerated.
1053
e3ee8ed4
AM
10542015-02-18 Alan Modra <amodra@gmail.com>
1055
1056 PR 17954
1057 * powerpc.cc (Global_symbol_visitor_opd::operator()): Set default
1058 visibility.
1059
3a935c6c
RÁE
10602015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1061
1062 * gc.h (Garbage_collection::add_reference): Don't use find.
1063
e0a1e121
RÁE
10642015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1065
1066 * object.cc (write_local_symbols): avoid std::vector copy.
1067
45a4fb1a
RÁE
10682015-02-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1069
1070 * merge.cc (get_output_offset): Use upper_bound instead of lower_bound.
1071
2d9afefe
MW
10722015-02-09 Mark Wielaard <mjw@redhat.com>
1073
1074 * gdb-index.cc (Gdb_index_info_reader::visit_top_die): Recognize
1075 DW_LANG_Fortran03 and DW_LANG_Fortran08.
1076
e9c1bdad
CC
10772015-02-16 Cary Coutant <ccoutant@google.com>
1078
1079 PR gold/13577
1080 PR gold/16992
1081 * layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
1082 DF_SYMBOLIC if --dynamic-list option is used.
1083 * options.cc (General_options::finalize): --dynamic-list is not
1084 mutually exclusive with -Bsymbolic.
1085 * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
1086 listed in --dynamic-list.
1087 * testsuite/Makefile.am (dynamic_list_lib2.so): Add
1088 -Bsymbolic-functions.
1089 * testsuite/Makefile.in: Regenerate.
1090
0ed4b0bf
CC
10912015-02-16 Cary Coutant <ccoutant@google.com>
1092
1093 PR gold/17971
1094 * incremental.cc: Remove redundant include of "output.h".
1095
1a920511
JY
10962015-02-12 Jing Yu <jingyu@google.com>
1097
1098 * aarch64-reloc.def (TLSLE_MOVW_TPREL_G2, TLSLE_MOVW_TPREL_G1,
1099 TLSLE_MOVW_TPREL_G1_NC, TLSLE_MOVW_TPREL_G0, TLSLE_MOVW_TPREL_G0_NC,):
1100 New relocation.
1101 * aarch64.cc (Target_aarch64::Scan::local): Add cases for new
1102 TLSLE_MOVW_* relocations.
1103 (Target_aarch64::Scan::global): Likewise.
1104 (Target_aarch64::Relocate::relocate): Likewise.
1105 (Target_aarch64::Relocate::relocate_tls): Add cases and handlings
1106 for new TLSLE_MOVW_* relocations.
1107
07f107f3
WN
11082015-02-11 Will Newton <will.newton@linaro.org>
1109
1110 PR gold/13321
1111 * arm.cc (Target_arm::make_plt_section): Create an ARM
1112 state mapping symbol at the start of the PLT.
1113
e051a5b5
L
11142015-02-09 H.J. Lu <hongjiu.lu@intel.com>
1115
1116 * testsuite/Makefile.am (two_file_shared_2_pic_1_test_DEPENDENCIES):
1117 Replace two_file_shared_2.so with two_file_shared_1.so.
1118 * testsuite/Makefile.in: Regenerated.
1119
dddcc5b9
AM
11202015-02-09 Alan Modra <amodra@gmail.com>
1121
1122 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add libweak_undef_2.a,
1123 plugin_test_thin.a and defsym_test.
1124 * testsuite/Makefile.in: Regenerate.
1125
b39b8b9d
RÁE
11262015-02-04 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1127
1128 * merge.cc (do_add_input_section): Combine loop epilogue into main loop
1129 body.
1130
b66d1c52
CC
11312015-02-04 Peter Collingbourne <pcc@google.com>
1132
1133 * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve
1134 forwarding symbols when computing symbol resolution info for plugins.
1135 * plugin.h (Plugin_manager::symtab): New method.
1136 (Pluginobj::get_symbol_resolution_info): Add symtab parameter.
1137
23081de0
CC
11382015-02-03 Cary Coutant <ccoutant@google.com>
1139 Peter Collingbourne <pcc@google.com>
1140
1141 PR gold/15660
1142 * archive.cc (Thin_archive_object_unlocker): New class.
1143 (Archive::include_member): Unlock external members of thin archives.
1144 * testsuite/Makefile.am (plugin_test_1): Rename .syms files.
1145 (plugin_test_2): Likewise.
1146 (plugin_test_3): Likewise.
1147 (plugin_test_4): Likewise.
1148 (plugin_test_5): Likewise.
1149 (plugin_test_6): Likewise.
1150 (plugin_test_7): Likewise.
1151 (plugin_test_8): Likewise.
1152 (plugin_test_9): Likewise.
1153 (plugin_test_10): Likewise.
1154 (plugin_test_11): New test case.
1155 * testsuite/Makefile.in: Regenerate.
1156 * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms
1157 file to decide whether to claim file.
1158 (all_symbols_read_hook): Likewise.
1159 * testsuite/plugin_test_1.sh: Adjust expected output.
1160 * testsuite/plugin_test_2.sh: Likewise.
1161 * testsuite/plugin_test_3.sh: Likewise.
1162 * testsuite/plugin_test_6.sh: Likewise.
1163 * testsuite/plugin_test_tls.sh: Likewise.
1164 * testsuite/plugin_test_11.sh: New testcase.
1165
11662015-02-03 Cary Coutant <ccoutant@google.com>
1167
1168 * descriptors.cc (Descriptors::open): Set artificially-low limit for
1169 file descriptors when debugging enabled. Add debug output.
1170 (Descriptors::release): Add debug output.
1171 (Descriptors::close_some_descriptor): Likewise.
1172 (Descriptors::close_all): Likewise.
1173 * fileread.cc (File_read::lock): Likewise.
1174 (File_read::unlock): Likewise.
1175
24dd5808
CC
11762015-02-02 Cary Coutant <ccoutant@google.com>
1177
1178 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for
1179 executable output file.
1180
fa89cc82
HS
11812015-01-22 Han Shen <shenhan@google.com>
1182
1183 * arm.cc (Target_arm::Target_arm): Add initialization for new members.
1184 (Target_arm::do_plt_address_for_global): New method.
1185 (Target_arm::do_plt_address_for_local): New method.
1186 (Target_arm::rel_irelative_section): New method.
1187 (Target_arm::make_data_plt): Add more parameters for plt ctor.
1188 (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
1189 (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
1190 (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
1191 (Target_arm::Scan::check_non_pic): Add ifunc support.
1192 (Target_arm::Scan::local): Add ifunc support.
1193 (Target_arm::Scan::global): Add ifunc support.
1194 (Target_arm::make_plt_section): New method.
1195 (Target_arm::make_plt_entry): Change to call to make_plt_section.
1196 (Target_arm::make_local_ifunc_plt_entry): New method.
1197 (Target_arm::got_irelative_): New member.
1198 (Target_arm::rel_irelative_): New member.
1199 (Target_arm::got_section): Add creation for got_irelative_.
1200 (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
1201 (Target_arm::Relocate::relocate): Properly set local ifunc address.
1202 (Target_arm::do_dynsym_value): Properly set global ifunc address.
1203 (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
1204 (Output_data_plt_arm::IRelative_data): New type.
1205 (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
1206 (Output_data_plt_arm::add_entry): Add more parameters.
1207 (Output_data_plt_arm::add_relocation): New method.
1208 (Output_data_plt_arm::add_local_ifunc_entry): New method.
1209 (Output_data_plt_arm::rel_irelative): New method.
1210 (Output_data_plt_arm::entry_count): Modified.
1211 (Output_data_plt_arm::address_for_global): New method.
1212 (Output_data_plt_arm::address_for_local): New method.
23081de0 1213gold/
fa89cc82
HS
1214 (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
1215 (Output_data_plt_arm::insert_irelative_data): New method.
1216 (Output_data_plt_arm::irelative_rel_): New member.
1217 (Output_data_plt_arm::got_): New member.
1218 (Output_data_plt_arm::got_irelative_): New member.
1219 (Output_data_plt_arm::irelative_count_): New member.
1220 (Output_data_plt_arm::IRelative_data_vec): New typedef.
1221 (Output_data_plt_arm::irelative_data_vec_): New member.
1222 (Output_data_plt_arm::do_write): Write out irelative entries.
1223 (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
1224 more parameters to ctor.
1225 (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
1226 more parameters to ctor.
1227 * output.h (Output_data_reloc::add_local_relative): New method.
1228 * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.
1229
0f81d3f0
AM
12302015-01-29 Alan Modra <amodra@gmail.com>
1231
1232 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct GOT_TLSLD
1233 and GOT_TLSGD to LE optimization.
1234
65d92137
CC
12352015-01-28 Cary Coutant <ccoutant@google.com>
1236
1237 * x86_64.cc (Target_x86_64::Scan::global): Allow IE-to-LE optimization
1238 for undef TLS symbols.
1239 (Target_x86_64::Relocate::relocate_tls): Likewise.
1240 (Target_x86_64::Relocate::tls_ie_to_le): Likewise.
1241
5485698a
CC
12422015-01-25 Cary Coutant <ccoutant@google.com>
1243
1244 * output.cc (Output_segment::set_section_addresses): Fix calculation
1245 of size of relro segment.
1246
b01a4b04
AM
12472015-01-22 Alan Modra <amodra@gmail.com>
1248
1249 * powerpc.cc (Target_powerpc::Scan::local <got relocs>): Correct
1250 condition for need of ifunc plt entry.
1251 (Target_powerpc::Scan::global <got relocs>): Likewise.
1252
3d0064a9
CC
12532015-01-14 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1254
1255 * mips.cc (reloc_high): Add r_sym.
1256 (Mips_relocate_functions::relhi16): Add r_sym parameter. Pass r_sym to
1257 reloc_high constructor.
1258 (Mips_relocate_functions::relgot16_local): Likewise.
1259 (Mips_relocate_functions::rello16): Add r_sym parameter. Use r_sym and
1260 r_type to decide whether LO16 matches HI16.
1261 (Target_mips::Relocate::relocate): Pass r_sym to calls to relhi16,
1262 rello16 and relgot16_local.
1263
a5cd8f05
CC
12642015-01-09 Cary Coutant <ccoutant@google.com>
1265
1266 * layout.cc (Layout::set_segment_offsets): Don't align start of segment
1267 unless alignment is larger than page size.
1268
4fc1b9d4
L
12692015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1270 Cary Coutant <ccoutant@google.com>
1271
1272 PR gold/17729
1273 * configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
1274 (DEFAULT_TARGET_X32): Set for x32.
1275 * x86_64.cc (cmp_insn_32): New.
1276 (lea_r10_insn_32): Likewise.
1277 (lea_r11_insn_32): Likewise.
1278 (cmp_insn_64): Likewise.
1279 (lea_r10_insn_64): Likewise.
1280 (lea_r11_insn_64): Likewise.
1281 (Target_x86_64<size>::do_calls_non_split): Handle x32.
1282 * testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
1283 (check_DATA): Add split_x32 files.
1284 (split_x32_[1234n].o): New targets.
1285 (split_x32_[124]): New targets.
1286 (split_x32_[1234r].stdout): New targets.
1287 * testsuite/split_x32.sh: New file.
1288 * testsuite/split_x32_1.s: Likewise.
1289 * testsuite/split_x32_2.s: Likewise.
1290 * testsuite/split_x32_3.s: Likewise.
1291 * testsuite/split_x32_4.s: Likewise.
1292 * testsuite/split_x32_n.s: Likewise.
1293 * configure: Regenerated.
1294 * testsuite/Makefile.in: Likewise.
1295
e749cab8
L
12962015-01-06 H.J. Lu <hongjiu.lu@intel.com>
1297
1298 PR gold/17809
1299 * x86_64.cc (Target_x86_64<size>::Relocate::tls_ie_to_le): Handle
1300 x32.
1301
af759df0
AM
13022015-01-02 Alan Modra <amodra@gmail.com>
1303
1304 * version.cc (print_version): Just print current year.
1305 * dwp.cc (print_version): Likewise.
1306
b90efa5b
AM
13072015-01-01 Alan Modra <amodra@gmail.com>
1308
1309 Update year range in copyright notice of all files.
1310
f12d1e8a
AM
13112014-12-25 Alan Modra <amodra@gmail.com>
1312
1313 * arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
1314 new enums.
1315 (Target_arm::merge_object_attributes, ): Likewise.
1316
5c294fee
TG
13172014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
1318
1319 * arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF header
1320 as hard float only when Tag_ABI_VFP_args is 1, using new enum value
1321 AEABI_VFP_args_vfp to check that.
1322 (Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
1323 value and replace hardcoded values by enum values.
1324
e30880c2
CC
13252014-12-22 Cary Coutant <ccoutant@google.com>
1326
1327 * powerpc.cc (Target_powerpc::relocate): Fix overflow check.
1328
bd040da1
L
13292014-12-20 H.J. Lu <hongjiu.lu@intel.com>
1330
1331 PR gold/14608
1332 * testsuite/debug_msg.cc (SometimesInlineFunction): Changed
1333 to "return i * i * 3;".
1334
e02a4046
CC
13352014-12-16 Cary Coutant <ccoutant@google.com>
1336
1337 * mapfile.cc (Mapfile::print_input_section): Print uncompressed sizes.
1338 (Mapfile::print_output_data): Use current_data_size() to avoid
1339 assert for sections requiring postprocessing; if address is not valid,
1340 print 0.
1341 (Mapfile::print_output_section): Use current_data_size(); print note
1342 that addresses and sizes are before compression.
1343
add6016b
L
13442014-12-14 H.J. Lu <hongjiu.lu@intel.com>
1345
1346 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1347 Cast current_group_size to unsigned long when reporting error.
1348
0bf32ea9
JY
13492014-12-10 Jing Yu <jingyu@google.com>
1350
1351 * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
1352 (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
1353 Update error message.
1354 (Target_aarch64::do_relax): Use absolute value of option
1355 stub_group_size. Replace local variable with class member
1356 stub_group_size_.
1357
cbcb23fa
AM
13582014-12-04 Alan Modra <amodra@gmail.com>
1359
1360 * powerpc.cc (Target_powerpc::Branch_info::make_stub): Ignore
1361 addend of PLTREL24 reloc when not generating a plt stub. Make
1362 max_branch_offset an "Address".
fbad6518 1363 (Stub_table::can_reach_stub): Make max_branch_offset an "Address".
cbcb23fa
AM
1364 (Target_powerpc::Relocate::relocate): Likewise.
1365
1611bc4a
AM
13662014-12-04 Alan Modra <amodra@gmail.com>
1367
1368 PR 17670
1369 * symtab.cc (Symbol::set_undefined): Remove assertion.
1370 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
1371 on symbols defined in discarded sections, instead return false.
1372 Rearrange params, update all callers.
1373 (Target_powerpc::Branch_info::make_stub): Don't make stubs for
1374 branches to syms in discarded sections.
1375 (Global_symbol_visitor_opd::operator()): Set discarded opd syms
1376 undefined and flag as discarded.
1377 (Target_powerpc::Relocate::relocate): Localize variable.
1378
4759c34e
L
13792014-12-03 H.J. Lu <hongjiu.lu@intel.com>
1380
1381 PR gold/17675
1382 * testsuite/Makefile.am (pie_copyrelocs_test_CXXFLAGS): New.
1383 * testsuite/Makefile.in: Regenerated.
1384
1f98a074
AM
13852014-12-03 Alan Modra <amodra@gmail.com>
1386
1387 PR 17566
1388 * powerpc.cc (Target_powerpc::Scan::local): Use add_local_section
1389 when adding dynamic relocations against section symbols.
1390
fb257835
DI
13912014-12-01 Dimitry Ivanov <dimitry@google.com>
1392
1393 * layout.cc (Layout::finish_dynamic_section): When '-z global'
1394 is specified set DF_1_GLOBAL in DT_FLAGS_1 flags.
1395 * options.h (General_options): New -z option (global).
1396
d8e60314
CC
13972014-12-01 Cary Coutant <ccoutant@google.com>
1398
1399 PR gold/17578
1400 * layout.cc (Layout::layout_gnu_stack): Don't warn when -z execstack
1401 is given.
1402 (Layout::create_executable_stack_info): Warn when -z noexecstack is
1403 given but some inputs require executable stack.
1404
982bbd97
CC
14052014-11-26 Cary Coutant <ccoutant@google.com>
1406
1407 * layout.cc (gdb_sections): Keep .debug_gdb_scripts and
1408 .debug_str_offsets; strip .debug_gnu_pubnames and
1409 .debug_gnu_pubtypes.
1410 (lines_only_debug_sections): Strip all four new sections.
1411
bb779192
HS
14122014-11-26 Jing Yu <jingyu@google.com>
1413
1414 * aarch64.cc (Relocate::tls_desc_gd_to_ie): Set ldr target
1415 register to be x0 when to relax TLSDESC_LD64_LO12.
1416
a3e60ddb
AM
14172014-11-26 Alan Modra <amodra@gmail.com>
1418
1419 * powerpc.cc (struct Stub_table_owner): New.
1420 (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an
1421 unsigned int vector. Update all references.
1422 (powerpc_relobj::set_stub_table): Take an unsigned int param
1423 rather than a Stub_table. Update callers.
1424 (Powerpc_relobj::clear_stub_table): New function.
1425 (Target_powerpc): Add relax_failed_, relax_fail_count_ and
1426 stub_group_size_ vars.
1427 (Target_powerpc::new_stub_table): Delete.
1428 (max_branch_delta): New function, extracted from..
1429 (Target_powerpc::Relocate::relocate): ..here..
1430 (Target_powerpc::Branch_info::make_stub): ..and here. Return
1431 status on whether stub created successfully.
1432 (Stub_control::Stub_control): Add "no_size_errors" param. Move
1433 default sizing to..
1434 (Target_powerpc::do_relax): ..here. Init stub_group_size_ and
1435 reduce on relax failure.
1436 (Target_powerpc::group_sections): Add "no_size_errors" param.
1437 Use stub_group_size_. Set up group info in a temp vector,
1438 before building Stub_table vector. Account for input sections
1439 possibly already converted to relaxed sections.
1440 (Stub_table::init): Delete. Merge into..
1441 (Stub_table::Stub_table): ..here.
1442 (Stub_table::can_reach_stub): New function.
1443 (Stub_table::add_plt_call_entry): Add "from" parameter and
1444 return true iff stub could be reached.
1445 (Stub_table::add_long_branch_entry): Similarly. Add "r_type"
1446 param too.
1447 (Stub_table::clear_stubs): Add "all" param.
1448
a20605cf
AM
14492014-11-26 Alan Modra <amodra@gmail.com>
1450
1451 * powerpc.cc (Stub_control::set_output_and_owner): New function.
1452 (Target_powerpc::group_sections): Use it.
1453
43b64deb
CC
14542014-11-25 Cary Coutant <ccoutant@google.com>
1455
1456 * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol.
1457 (Binary_to_elf::write_symbol): Add st_size parameter.
1458 * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
1459
c924eb67
CC
14602014-11-25 Cary Coutant <ccoutant@google.com>
1461
1462 PR gold/17639
1463 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_.
1464 (Sized_relobj_file::do_layout): Handle deferred sections properly
1465 during GC pass 1. Don't add reloc sections to deferred list twice.
1466 * object.h (Sized_relobj_file::is_deferred_layout): New function.
1467 (Sized_relobj_file::is_deferred_layout_): New data member.
1468
9d585188
L
14692014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1470
1471 PR gold/17619
1472 * x86_64.cc (Output_data_plt_x86_64_standard<size>::do_fill_plt_entry):
1473 Check PC-relative offset overflow in PLT entry.
1474
3ffaac20
AM
14752014-11-21 Alan Modra <amodra@gmail.com>
1476
1477 * powerpc.cc (Target_powerpc::Relocate::relocate): Correct test
1478 for undefined weaks.
1479
0cfb0717
AM
14802014-11-20 Alan Modra <amodra@gmail.com>
1481
1482 * powerpc.cc (Stub_control::Stub_control): Init stub14_group_size_
1483 from --stub-group-size parameter divided by 1024.
1484 (Powerpc_relocate_functions::rela, rela_ua): Add fieldsize
1485 template parameter. Update all uses.
1486 (Target_powerpc::Relocate::relocate): Rename has_plt_value to
1487 has_stub_value. Set for long branches. Don't report overflow for
1488 branch to undefined weak symbols. Print info message on
1489 overflowing branch to stub.
1490
f9dffbf0
AM
14912014-11-20 Alan Modra <amodra@gmail.com>
1492
1493 * powerpc.cc (Target_powerpc::do_relax): Add __go_go to thread_starters.
1494
e88ba8d5
L
14952014-11-13 H.J. Lu <hongjiu.lu@intel.com>
1496
1497 * x86_64.cc (Target_x86_64<size>::Scan::global): Don't make PLT
1498 entry for R_X86_64_GOTPLT64.
1499 (Target_x86_64<size>::Relocate::relocate): Update comments for
1500 R_X86_64_GOTPLT64.
1501
d37ffe25
ED
15022014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
1503
1504 * plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
1505 * plugin.h: add lock definition
1506
9726c3c1
HS
15072014-10-29 Han Shen <shenhan@google.com>
1508 Jing Yu <jingyu@google.com>
1509
1510 * aarch64-reloc.def: Add LD_PREL_LO12, ADR_PREL_LO21,
1511 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1512 TLSLD_MOVW_DTPREL_G0_NC. Change property of TLS relocations to
1513 Symbol::TLS_REF.
1514 * aarch64.cc (Target_aarch64::do_can_check_for_function_pointers): New
1515 method.
1516 (Target_aarch64::reloc_needs_plt_for_ifunc): New method.
1517 (Target_aarch64::tls_ld_to_le): New method.
1518 (Target_aarch64::aarch64_info): Enable can_icf_inline_merge_sections
1519 for 64bit targets.
1520 (Output_data_plt_aarch64::irelative_rel_): New data member.
1521 (Output_data_plt_aarch64::add_entry): Add irelative entries to plt.
1522 (Output_data_plt_aarch64::add_local_ifunc_entry): New method.
1523 (Output_data_plt_aarch64::add_relocation): New method.
1524 (Output_data_plt_aarch64::do_write): Add gold_assert on got_irelative
1525 offset. Add got_irelative size to got size.
1526 (AArch64_relocate_functions): Typedef AArch64_valtype. Replace long
1527 type string with the new typename.
1528 (AArch64_relocate_functions::update_adr): Replace parameter x with
1529 immed.
1530 (AArch64_relocate_functions::update_movnz): Correct wrong val mask.
1531 (AArch64_relocate_functions::reloc_common): New method.
1532 (AArch64_relocate_funcsions::rela_general): Extract common part out
1533 into reloc_common method.
1534 (AArch64_relocate_functions::rela_general): Likewise.
1535 (AArch64_relocate_functions::pcrela_general): Likewise.
1536 (AArch64_relocate_functions::adr): New method.
1537 (AArch64_relocate_functions::adrp): Calculate immed before calling
1538 update_adr.
1539 (AArch64_relocate_functions::adrp): Likewise.
1540 (AArch64_relocate_functions::movnz): Cast x to SignedW type when
1541 comparing x to 0. Calculate immed from ~x when x < 0.
1542 (Target_aarch64::optimize_tls_reloc): Add new cases for
1543 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1544 TLSLD_MOVW_DTPREL_G0_NC.
1545 (Target_aarch64::possible_function_pointer_reloc): Implement this
1546 method.
1547 (Target_aarch64::Scan::local_reloc_may_be_function_pointer): Update
1548 comment.
1549 (Target_aarch64::Scan::local): Add codes to handle STT_GNU_IFUNC
1550 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1551 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1552 (Target_aarch64::Scan::global): Add codes to handle STT_GNU_IFUNC
1553 symbol. Add cases for TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1554 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1555 (Target_aarch64::make_plt_entry): Call add_entry with two more
1556 parameters.
1557 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1558 (Target_aarch64::Relocate::relocate): Add cases for LD_PREL_LO19,
1559 ADR_PREL_LO21, TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC,
1560 TLSLD_MOVW_DTPREL_G1, TLSLD_MOVW_DTPREL_G0_NC.
1561 (Target_aarch64::Relocate::relocate_tls): Add cases for
1562 TLSLD_ADR_PAGE21, TLSLD_ADD_LO12_NC, TLSLD_MOVW_DTPREL_G1,
1563 TLSLD_MOVW_DTPREL_G0_NC.
1564 * testsuite/icf_safe_so_test.cc: Correct test comment.
1565 * testsuite/icf_safe_test.sh: Add AArch64 arch.
1566
80272b8c
AM
15672014-10-22 Alan Modra <amodra@gmail.com>
1568
1569 * powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
1570 thread_starter.
1571
998a69f4
AS
15722014-10-18 Andreas Schwab <schwab@linux-m68k.org>
1573
1574 * configure.tgt (targ_extra_obj) [aarch64*-*]: Define.
1575
aed56ec5
CC
15762014-10-17 Cary Coutant <ccoutant@google.com>
1577
1578 * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
1579 Add "typename" keyword.
1580
bb779192 15812014-10-15 Han Shen <shenhan@google.com>
72f4393d 1582 Jing Yu <jingyu@google.com>
83a01957
HS
1583
1584 Patch for gold aarch64 backend to support relaxation.
1585 * aarch64-reloc.def: Change format.
1586 * aarch64.cc (class Reloc_stub): New class.
1587 (class Stub_table): New class.
1588 (class AArch64_relobj): New class.
1589 (class AArch64_input_section): New class.
1590 (class AArch64_output_section): New class.
1591 (Target_aarch64::new_stub_table): New method.
1592 (Target_aarch64::new_aarch64_input_section): New method.
1593 (Target_aarch64::find_aarch64_input_section): New method.
1594 (Target_aarch64::scan_section_for_stubs): New method.
1595 (Target_aarch64::scan_reloc_section_for_stubs): New method.
1596 (Target_aarch64::relocate_stub): New method.
1597 (Target_aarch64::current_target): New method.
1598 (Target_aarch64::do_make_elf_object): New method.
1599 (Target_aarch64::do_may_relax): New method.
1600 (Target_aarch64::do_relax): New method.
1601 (Target_aarch64::group_sections): New method.
1602 (Target_aarch64::scan_reloc_for_stub): New method.
1603 (Target_aarch64::do_make_output_section): New method.
1604 (Target_aarch64::stub_tables_): New data member.
1605 (Target_aarch64::aarch64_input_section_map_): New data member.
1606 (AArch64_relocate_functions::maybe_apply_stub): New method.
1607
db4c9594
CC
16082014-09-30 Cary Coutant <ccoutant@google.com>
1609
1610 PR gold/17432
1611 * resolve.cc (Symbol_table::resolve): Fix local shadowing error.
1612
cd6da036
KC
16132014-09-30 Kito Cheng <kito@0xlab.org>
1614
1615 PR gold/13597
1616 * layout.cc (Layout::create_dynamic_symtab): Build gnu-style
1617 hash table before sysv-style hash table.
1618
5f772412
ST
16192014-09-29 Sriraman Tallam <tmsriram@google.com>
1620
1621 * options.h (--pic-executable): Add negative to alias to -no-pie.
1622
5efeedf6
CC
16232014-09-26 Cary Coutant <ccoutant@google.com>
1624
1625 PR gold/16773
1626 * object.cc (Sized_relobj_file): Compute value of section symbols
1627 for TLS sections the same as TLS symbols.
1628
1707f183
CC
16292014-09-25 Cary Coutant <ccoutant@google.com>
1630
1631 PR gold/17432
1632 * resolve.cc (Symbol_table::resolve): Override common placeholder
1633 symbols, but adjust sizes.
1634 * symtab.cc (Symbol_table::add_from_object): Don't add placeholder
1635 symbols to common lists.
1636
00cac886
AM
16372014-09-24 Alan Modra <amodra@gmail.com>
1638
1639 * po/POTFILES.in: Regenerate.
1640
635aa30e 16412014-09-23 Taiju Tsuiki <tzik@google.com>
72f4393d 1642 Cary Coutant <ccoutant@google.com>
635aa30e 1643
71b9b91b 1644 PR gold/14860
635aa30e
CC
1645 * gold.cc (queue_final_tasks): Add Write_sections_task as a blocker
1646 on input_sections_blocker.
1647 * layout.cc (Write_sections_task::locks): Unblock
1648 input_sections_blocker_.
1649 * layout.h (Write_sections_task::Write_sections_task): Add
1650 input_sections_blocker.
1651 * testsuite/Makefile.am (exception_x86_64_bnd_test): Add gcctestdir/ld
1652 to DEPENDENCIES.
1653 * testsuite/Makefile.in: Regenerate.
1654
c0c71592
RÁE
16552014-09-18 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1656
1657 * testsuite/Makefile.am (plugin_test_10): New test.
1658 * testsuite/Makefile.in: Regenerate
1659 * testsuite/plugin_common_test_2.c (c1): Align to 8.
1660 * testsuite/plugin_test_10.sh: New file.
1661
6168c2a1
RÁE
16622014-09-17 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
1663
1664 * plugin.cc (Sized_pluginobj::do_add_symbols): Ignore isym->size.
1665 * resolve.cc (Symbol_table::resolve): Don't override common symbols
1666 during the replacement phase.
1667
3a531937
JY
16682014-09-17 Han Shen <shenhan@google.com>
1669 Jing Yu <jingyu@google.com>
1670
1671 * aarch64-reloc.def: Add TLSGD_ADR_PAGE21, TLSGD_ADD_LO12_NC,
1672 TLSDESC_ADR_PAGE21, TLSDESC_LD64_LO12, TLSDESC_ADD_LO12, TLSDESC_CALL.
1673 * aarch64.cc (Target_aarch64): Add data members
1674 got_irelative_, got_tlsdesc_, rela_irelative_, got_mod_index_offset_,
1675 tlsdesc_reloc_info_, tls_base_symbol_defined_. Initialize them in
1676 constructor.
1677 (Target_aarch64::do_reloc_symbol_index): New method.
1678 (Target_aarch64::do_reloc_addend): New method.
1679 (Target_aarch64::add_tlsdesc_info): New method.
1680 (Target_aarch64::do_dynsym_value): New method.
1681 (Target_aarch64::do_make_data_plt): Add new parameters: got,
1682 got_irelative. Pass them to Output_data_plt_aarch64_standard.
1683 (Target_aarch64::make_data_plt): Add new parameters: got,
1684 got_irelative. Pass them to do_make_data_plt.
1685 (Target_aarch64::Relocate): Add skip_call_tls_get_addr_ variable.
1686 (Target_aarch64::Relocate:tls_gd_to_le): New method.
1687 (Target_aarch64::Relocate:tls_ie_to_le): New method.
1688 (Target_aarch64::Relocate:tls_desc_gd_to_le): New method.
1689 (Target_aarch64::Relocate:tls_desc_gd_to_ie): New method.
1690 (Target_aarch64::got_tlsdesc_section): New method.
1691 (Target_aarch64::make_local_ifunc_plt_entry): New method.
1692 (Target_aarch64::define_tls_base_symbol): New method.
1693 (Target_aarch64::reserve_tlsdesc_entries): New method.
1694 (Target_aarch64::got_mod_index_entry): New method.
1695 (Target_aarch64::rela_tlsdesc_section): New method.
1696 (Target_aarch64::rela_irelative_section): New method.
1697 (Target_aarch64::Tlsdesc_info): New struct.
1698 (Target_aarch64::got_section): Create .got.plt space for IRELATIVE
1699 relocations and tlsdesc relocations.
1700 (Target_aarch64::optimize_tls_reloc): Implement method.
1701 (Output_data_plt_aarch64): Add member variables: tlsdesc_rel_, got_,
1702 got_irelative_, irelative_count_, tlsdesc_got_offset_. Initialize them
1703 in constructor.
1704 (Output_data_plt_aarch64::reserve_tlsdesc_entry): New method.
1705 (Output_data_plt_aarch64::has_tlsdesc_entry): New method.
1706 (Output_data_plt_aarch64::get_tlsdesc_got_offset): New method.
1707 (Output_data_plt_aarch64::get_tlsdesc_plt_offset): New method.
1708 (Output_data_plt_aarch64::rela_tlsdesc): New method.
1709 (Output_data_plt_aarch64::rela_irelative): New method.
1710 (Output_data_plt_aarch64::entry_count): Count IRELATIVE relocations.
1711 (Output_data_plt_aarch64::first_plt_entry_offset): Add const attribute.
1712 (Output_data_plt_aarch64::get_plt_tlsdesc_entry_size): New method.
1713 (Output_data_plt_aarch64::fill_tlsdesc_entry): New method.
1714 (Output_data_plt_aarch64::do_get_plt_tlsdesc_entry_size): New method.
1715 (Output_data_plt_aarch64::do_fill_tlsdesc_entry): New method.
1716 (Output_data_plt_aarch64_standard): New member variables:
1717 plt_tlsdesc_entry_size, tlsdesc_plt_entry.
1718 (Output_data_plt_aarch64_standard::Output_data_plt_aarch64_standard):
1719 New parameter: got, got_irelative.
1720 (Output_data_plt_aarch64_standard::do_get_plt_entry_size): New method.
1721 (Output_data_plt_aarch64_standard::do_fill_tlsdesc_entry): New method.
1722 (Output_data_plt_aarch64::do_write): Replace got_address with
1723 gotplt_address. Add irelative_count_ to count. Write tlsdesc entry.
1724 (AArch64_relocate_functions::update_movnz): New method.
1725 (AArch64_relocate_functions): Correct format.
1726 (AArch64_relocate_functions::movnz): New method.
1727 (Target_aarch64::Scan::local): Correct format. Move r_sym, got to
1728 before the switch. Add new cases to switch.
00cac886 1729 Check ie_to_le relaxation on tlsie relocations. Add code handling
3a531937
JY
1730 tlsgd tlsdesc cases.
1731 (Target_aarch64::Scan::global): Move arp to front. Do copy_reloc when
1732 needed. Add new cases to switch. Insert dynamic RELATIVE relocation
1733 when needed. Add code handling tlsgd, tlsie, tlsdesc cases.
1734 Call reloc_name_in_error_message to print unsupported reloc.
1735 (Target_aarch64::make_plt_section): Pass got_ and got_irelative_ to
1736 make_data_plt.
1737 (Target_aarch64::do_finalize_sections): Emit relocs to save COPY
1738 relocs. Fill in some more dynamic tags.
1739 (Target_aarch64::Relocate::relocate): Handle tlsgd, tlsdesc relocs.
1740 Skip call tls_get_addr when tlsgd is relaxed.
1741 (Target_aarch64::Relocate::relocate_tls): Correct format. Add code
1742 handling tlsgd, tlsdesc relocs, and tls gd->le, ie->le, tlsdesc->le,
1743 tlsdesc->ie relaxation.
1744
62661c93
SS
17452014-09-03 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1746
1747 * mips.cc (Target_mips_nacl): New class.
1748 (Target_selector_mips_nacl): New class.
1749 (target_selector_mips32): Rename from target_selector_mips32be and use
1750 Target_selector_mips_nacl instead of Target_selector_mips.
1751 (target_selector_mips32el): Rename from target_selector_mips32 and use
1752 Target_selector_mips_nacl instead of Target_selector_mips.
1753 (target_selector_mips64): Rename from target_selector_mips64be and use
1754 Target_selector_mips_nacl instead of Target_selector_mips.
1755 (target_selector_mips64el): Rename from target_selector_mips64 and use
1756 Target_selector_mips_nacl instead of Target_selector_mips.
1757 (Target_mips::mips_info): Add const attribute.
1758
54674d38
CC
17592014-09-02 Cary Coutant <ccoutant@google.com>
1760
1761 * dwp.cc (Sized_relobj_dwo::do_section_name): Add const attribute.
1762 * dynobj.h (Sized_dynobj::do_section_name): Likewise.
1763 * incremental.cc (Sized_relobj_incr::do_section_name): Likewise.
1764 (Sized_incr_dynobj::do_section_name): Likewise.
1765 * incremental.h (Sized_relobj_incr::do_section_name): Likewise.
1766 (Sized_incr_dynobj::do_section_name): Likewise.
1767 * object.h (Object::section_name): Likewise.
1768 (Object::do_section_name): Likewise.
1769 (Sized_relobj_file::do_section_name): Likewise.
1770 * plugin.cc (Sized_pluginobj::do_section_name): Likewise.
1771 * plugin.h (Sized_pluginobj::do_section_name): Likewise.
1772
9860cbcf
CC
17732014-09-02 Cary Coutant <ccoutant@google.com>
1774
1775 PR gold/17005
1776 * ehframe.cc (Fde::write): Add output_offset parameter.
1777 (Cie::write): Likewise.
1778 (Eh_frame::set_final_data_size): Account for offset within output
1779 section.
1780 (Eh_frame::do_sized_write): Likewise.
1781 * ehframe.h (Fde::write): Add output_offset parameter.
1782 (Cie::write): Likewise.
1783 * output.cc (Output_section::Input_section_sort_entry): Remove
1784 section_has_name_; add output_section_name parameter. Use
1785 output section name for non-input sections.
1786 (Output_section::Input_section_sort_entry::section_has_name): Remove.
1787 (Output_section::Input_section_sort_entry::section_has_name_): Remove.
1788 (Output_section::Input_section_sort_compare): Remove logic for
1789 sections without names.
1790 (Output_section::Input_section_sort_init_fini_compare): Likewise.
1791 (Output_section::Input_section_sort_section_prefix_special_ordering_compare):
1792 Likewise.
1793 (Output_section::Input_section_sort_section_name_compare): Likewise.
1794
8e33481e
HS
17952014-08-29 Han Shen <shenhan@google.com>
1796 Jing Yu <jingyu@google.com>
1797
1798 * aarch64-reloc-property.cc
1799 (AArch64_reloc_property_table::reloc_name_in_error_message): Fix bug in
1800 reference reloc property in the table.
1801 * aarch64-reloc.def: Add TLSLE reloc types and fix some errors in
1802 3 other entries.
1803 * aarch64.cc: (Output_data_got_aarch64::add_static_reloc):
1804 2 new overloaded methods.
1805 (Output_data_got_aarch64::do_write): Add code to write out
1806 static relocs.
1807 (class Output_data_got_aarch64::Static_reloc): New class to wrap
1808 static relocs.
1809 (Output_data_got_aarch64::static_relocs): New vector to
1810 hold static relocs.
1811 (Target_aarch64::TCB_SIZE): New const static memeber.
1812 (Target_aarch64::tcb_size): New method.
1813 (Target_aarch64::Relocate::relocate): Add code handling new reloc types.
1814 (Target_aarch64::Relocate::relocate_tls): New method.
1815 (Target_aarch64::Scan::local): Add code handling new reloc types.
1816 (Target_aarch64::Scan::global): Add code handling new reloc types.
1817
81233653
ST
18182014-08-13 Sriraman Tallam <tmsriram@google.com>
1819
1820 * options.h (-no-pie): Add option.
1821
9363c7c3
JY
18222014-08-08 Jing Yu <jingyu@google.com>
1823 Han Shen <shenhan@google.com>
1824
1825 * Makefile.am (HFILES): Add aarch64-reloc-property.h.
1826 (DEFFILES): add aarch64-reloc.def.
1827 (TARGETSOURCES): Add aarch64-reloc-property.cc.
1828 (ALL_TARGETOBJS): Add aarch64-reloc-property.$(OBJEXT).
1829 * Makefile.in: Regenerate.
1830 * aarch64-reloc-property.cc: New file.
1831 * aarch64-reloc-property.h: New file.
1832 * aarch64-reloc.def: New file.
1833 * aarch64.cc: Include aarch64-reloc-property.h. Replace spaces
1834 with tab to make the format consistent.
1835 (Output_data_got_aarch64::symbol_table_): New method.
1836 (Target_aarch64::do_plt_address_for_global): New method.
1837 (Target_aarch64::do_plt_address_for_local): New method.
1838 (Target_aarch64::do_select_as_default_target): New method.
1839 (Target_aarch64::do_make_data_plt): New method.
1840 (Target_aarch64::make_data_plt): New method.
1841 (Output_data_plt_aarch64::has_irelative_section): New method.
1842 (Output_data_plt_aarch64::address_for_global): New method.
1843 (Output_data_plt_aarch64::address_for_local): New method.
1844 (Output_data_plt_aarch64::irelative_rel_): New parameter.
1845 (Output_data_plt_aarch64::add_entry): Implement contents.
1846 (Output_data_plt_aarch64::set_final_data_size): Fix typo.
1847 (Output_data_plt_aarch64::do_write): Remove useless got_base. Set
1848 the got_pov entry to plt0.
1849 (Output_data_plt_aarch64_standard::do_fill_first_plt_entry):
1850 Implement contents.
1851 (Output_data_plt_aarch64_standard::do_fill_plt_entry): Implement.
1852 (AArch64_howto): New struct.
1853 (aarch64_howto[]): New static const array.
1854 (AArch64_relocate_functions): New class.
1855 (Target_aarch64::Scan::get_reference_flags): Remove method.
1856 (Target_aarch64::Scan::local): Implement to support a few relocations.
1857 (Target_aarch64::Scan::global): Implement to support a few relocations.
1858 (Target_aarch64::make_plt_section): Implement contents.
1859 (Target_aarch64::make_plt_entry): Implement contents.
1860 (Target_aarch64::do_finalize_sections): Implement contents.
1861 (Target_aarch64::Relocate::relocate): Implement a few relocations.
1862 (Target_aarch64::relocate_section): Implement contents.
1863
ad9fe6c1
AM
18642014-08-06 Alan Modra <amodra@gmail.com>
1865
1866 * testsuite/defsym_test.sh: Allow ppc64le localentry annotation.
1867
7cd4e5b7
AM
18682014-08-06 Alan Modra <amodra@gmail.com>
1869
1870 PR 13227
1871 * symtab.cc (Symbol_table::add_from_relobj): Warn on __gnu_lto_slim.
1872
5ad9b0a7
ST
18732014-07-21 Sriraman Tallam <tmsriram@google.com>
1874
1875 * object.cc (Relobj::is_section_name_included): Add
7c16d96e 1876 ".rodata.nptl_version" to not garbage collect this section.
5ad9b0a7 1877
e051745c
CC
18782014-07-08 Cary Coutant <ccoutant@google.com>
1879
1880 * expression.cc (struct Expression::Expression_eval_info): Add
1881 new fields type_pointer, vis_pointer, and nonvis_pointer.
1882 (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
1883 nonvis_pointer parameters. Adjust all calls.
1884 (Symbol_expression::value): Update type, visibility, and nonvis bits
1885 in caller.
1886 * script.cc (Symbol_assignment::sized_finalize): Update type,
1887 visibility, and remaining st_other bits for new symbol.
1888 * script.h: (Expression::eval_maybe_dot): Add type_pointer,
1889 vis_pointer, and nonvis_pointer parameters.
1890 * symtab.h (Symbol::set_type): New method.
1891
1892 * testsuite/Makefile.am (defsym_test): New test.
1893 * testsuite/Makefile.in: Regenerate.
1894 * testsuite/defsym_test.c: New file.
1895 * testsuite/defsym_test.sh: New file.
1896
f35c4853
CC
18972014-07-08 Cary Coutant <ccoutant@google.com>
1898
1899 PR gold/15639
1900 * dynobj.h (Sized_dynobj::base_read_symbols): New method.
1901 * dynobj.cc (Sized_dynobj::do_read_symbols): Move body to...
1902 (Sized_dynobj::base_read_symbols): ...new method.
1903 * object.h (Sized_relobj_file::base_read_symbols): New method.
1904 * object.cc (Sized_relobj_file::do_read_symbols): Move body to...
1905 (Sized_relobj_file::base_read_symbols): ...new method.
1906 * arm.cc (Arm_relobj::do_read_symbols): Call base_read_symbols.
1907 * mips.cc: (Mips_relobj::do_read_symbols): Likewise.
1908 * powerpc.cc (Powerpc_dynobj::do_read_symbols): Likewise.
1909
2900af2d
AM
19102014-07-04 Alan Modra <amodra@gmail.com>
1911
1912 * po/POTFILES.in: Regenerate.
1913
053a4d68
JY
19142014-07-02 Jing Yu <jingyu@google.com>
1915
1916 * aarch64.cc: New file
1917 * Makefile.am (TARGETSOURCES): Add aarch64.cc
1918 (ALL_TARGETOBJS): Add aarch64.$(OBJEXT)
1919 * Makefile.in: Regenerate.
1920 * configure.tgt: Add entries for aarch64*.
1921 * configure.ac: Likewise.
1922 * configure: Likewise.
1923
7b549045
AM
19242014-06-27 Alan Modra <amodra@gmail.com>
1925
1926 * symtab.cc (Symbol::should_add_dynsym_entry): Don't make inline.
1927
cb818dbf
CC
19282014-06-24 Cary Coutant <ccoutant@google.com>
1929
1930 * dwp.cc (Dwo_file::read): Allow files with no .debug_types
1931 sections.
1932 (Dwo_file::sized_read_unit_index): Likewise.
1933
9810d34d
SS
19342014-06-23 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
1935
1936 * mips.cc: New file.
1937 * Makefile.am (TARGETSOURCES): Add mips.cc
1938 (ALL_TARGETOBJS): Add mips.$(OBJEXT)
1939 * configure.tgt: Add entries for mips*.
1940 * configure.ac: Likewise.
1941 * Makefile.in: Regenerate.
1942 * configure: Likewise.
1943
9baa787b
CC
19442014-06-09 Cary Coutant <ccoutant@google.com>
1945
1946 * dwarf_reader.cc (Dwarf_pubnames_table::read_header): Check that
1947 unit_length is within section bounds.
1948
8f89af0a
CC
19492014-06-09 Cary Coutant <ccoutant@google.com>
1950
1951 PR gold/16980
1952 * layout.cc (Layout::print_to_mapfile): Print unattached sections in
1953 map.
1954
a47622ac
AM
19552014-06-07 Alan Modra <amodra@gmail.com>
1956
1957 * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
1958
4320c691
CC
19592014-06-06 Cary Coutant <ccoutant@google.com>
1960
1961 * dwarf_reader.h (Dwarf_pubnames_table): Remove output_section_offset_.
1962 * dwarf_reader.cc (Dwarf_pubnames_table::read_section): Likewise.
1963 (Dwarf_pubnames_table::read_header): Likewise.
1964 * layout.cc (gdb_fast_lookup_sections): Add .debug_gnu_pubnames and
1965 .debug_gnu_pubtypes.
1966
270c9937
JB
19672014-06-05 Joel Brobecker <brobecker@adacore.com>
1968
1969 * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New.
1970 * Makefile.in, configure: Regenerate.
1971
397998fc
AM
19722014-06-03 Alan Modra <amodra@gmail.com>
1973
1974 * powerpc.cc (addis_12_2): Define.
1975 (Stub_table::do_write): Support fusion on ELFv2 stubs.
1976
61f5c66f
AM
19772014-06-03 Alan Modra <amodra@gmail.com>
1978
1979 * testsuite/plugin_test.c (parse_readelf_line): Skip non-visibility
1980 st_other output.
1981
f6971787
AM
19822014-06-02 Alan Modra <amodra@gmail.com>
1983
1984 * powerpc.cc (Target_powerpc::local_reloc_may_be_function_pointer):
1985 Only ignore relocs on ELFv1.
1986 (Target_powerpc::global_reloc_may_be_function_pointer): Likewise.
1987
f6fb8322
CC
19882014-05-30 Cary Coutant <ccoutant@google.com>
1989
1990 * testsuite/Makefile.am (ehdr_start_test_4): Fix typo in -B option.
1991 * testsuite/Makefile.in: Regenerate.
1992 * testsuite/ehdr_start_test_4.sh: Look for "U" instead of "w".
1993
c23dd342
L
19942014-05-27 H.J. Lu <hongjiu.lu@intel.com>
1995
1996 PR gold/16945
1997 * x86_64.cc (Target_x86_64::Relocate::relocate): Use signed int
1998 for got_offset. Properly get GOT address for R_X86_64_PLTOFF64.
1999
5fe7ffdc
AM
20002014-05-15 Alan Modra <amodra@gmail.com>
2001
2002 * powerpc.cc (do_plt_fde_location): Handle zero length .glink.
2003 Compare FDE contents with DW_CFA_nop rather than 0.
2004
a82bef93
ST
20052014-05-13 Sriraman Tallam <tmsriram@google.com>
2006
2007 * symtab.h (may_need_copy_reloc): Remove check for position independent
2008 code.
2009 * x86_64.cc (Target_x86_64<size>::Scan::global): Add check for no
2010 position independence before pc absolute may_need_copy_reloc call.
2011 Add check for executable output befor pc relative may_need_copy_reloc
2012 call.
2013 * i386.cc: Ditto.
2014 * arm.cc: Ditto.
2015 * sparc.cc: Ditto.
2016 * tilegx.cc: Ditto.
2017 * powerpc.cc: Add check for no position independence before
2018 may_need_copy_reloc calls.
2019 * testsuite/pie_copyrelocs_test.cc: New file.
2020 * testsuite/pie_copyrelocs_shared_test.cc: New file.
2021 * Makefile.am (pie_copyrelocs_test): New test.
5fe7ffdc 2022 * Makefile.in: Regenerate.
a82bef93 2023
53c66605
ML
20242014-05-08 Martin Liška <mliska@suse.cz>
2025
2026 * output.cc (Sized_relobj_file::do_layout): Fix typo in info message.
2027
57b2284c
CC
20282014-05-06 Cary Coutant <ccoutant@google.com>
2029
2030 PR gold/16900
2031 * i386.cc (Output_data_got_plt_i386): New class.
2032 (Output_data_plt_i386::Output_data_plt_i386): Change type of got_plt
2033 parameter. Change all callers.
2034 (Output_data_plt_i386::layout_): Remove.
2035 (Output_data_plt_i386::got_plt_): Change type.
2036 (Target_i386::got_plt_): Change type. Change all references.
2037 (Target_i386::got_section): Create instance of new class.
2038 (Output_data_got_plt_i386::do_write): New function.
2039 * x86_64.cc (Output_data_got_plt_x86_64): New class.
2040 (Output_data_plt_x86_64::Output_data_plt_x86_64): Change type of got_plt
2041 parameter. Change all callers.
2042 (Output_data_plt_x86_64::layout_): Remove.
2043 (Output_data_plt_x86_64::got_plt_): Change type.
2044 (Target_x86_64::got_plt_): Change type. Change all references.
2045 (Target_x86_64::got_section): Create instance of new class.
2046 (Output_data_got_plt_x86_64::do_write): New function.
2047 (Output_data_plt_x86_64::do_write): Don't write reserved words in GOT.
2048 (Target_x86_64<size>::init_got_plt_for_update): Create instance of new
2049 class.
2050
6b97515d 20512014-05-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2052
6b97515d
CC
2053 * gdb-index.cc (Gdb_index_info_reader): Don't complain about language
2054 if we have pubnames/pubtypes.
2055
d1bddd3c
CC
20562014-05-02 Cary Coutant <ccoutant@google.com>
2057
5fe7ffdc
AM
2058 * defstd.cc (in_segment): Define __ehdr_start here...
2059 * layout.cc (Layout::finalize): ...Instead of here. Set the
2060 output segment when known.
2061 * resolve.cc (Symbol::override_base_with_special): Remember
2062 the original binding.
2063 * symtab.cc (Symbol::set_output_segment): New function.
2064 (Symbol::set_undefined): New function.
2065 * symtab.h (Symbol::is_weak_undefined): Check original undef
2066 binding.
2067 (Symbol::is_strong_undefined): New function.
2068 (Symbol::set_output_segment): New function.
2069 (Symbol::set_undefined): New function.
2070 * target-reloc.h (is_strong_undefined): Remove.
2071 (issue_undefined_symbol_error): Call Symbol::is_weak_undefined.
2072 Check for hidden undefs.
2073 (relocate_section): Call Symbol::is_strong_undefined.
2074
2075 * testsuite/Makefile.am (ehdr_start_test_1)
2076 (ehdr_start_test_2, ehdr_start_test_3)
2077 (ehdr_start_test_4, ehdr_start_test_5): New test cases.
2078 * testsuite/Makefile.in: Regenerate.
2079 * testsuite/ehdr_start_def.cc: New source file.
2080 * testsuite/ehdr_start_test.cc: New source file.
2081 * testsuite/ehdr_start_test.t: New linker script.
2082 * testsuite/ehdr_start_test_4.sh: New shell script.
d1bddd3c 2083
7849f6d8
CC
20842014-04-23 Cary Coutant <ccoutant@google.com>
2085
bf2cc635 2086 PR gold/16870
7849f6d8
CC
2087 * x86_64.cc (Target_x86_64::Relocate::relocate): Add missing break.
2088
99fd8cff
CC
20892014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2090
2091 * layout.cc (Layout::include_section): Allow a target to decide
2092 whether to include a section.
2093 * target.h (Target::should_include_section): New function.
2094 (Target::do_should_include_section): New function.
2095
91f43acd
CC
20962014-04-15 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2097
2098 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Remove and
2099 inline into ...
2100 (Copy_relocs::emit): ... here.
2101 * copy-relocs.h (Copy_reloc_entry): Change from class to struct.
2102 (Copy_reloc_entry::make_copy_reloc): Change from private to protected.
2103 (Copy_reloc_entry::entries_): Change from private to protected.
2104
c4eb27e1
ST
21052014-04-02 Sriraman Tallam <tmsriram@google.com>
2106
2107 * icf.cc (get_section_contents): Replace copies of reloc
2108 vectors with const references.
2109
ae447ddd
CC
21102014-04-02 Cary Coutant <ccoutant@google.com>
2111
2112 * configure.ac (HAVE_PUBNAMES): Use C instead of C++.
2113 (HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
2114 * configure: Regenerate.
2115 * testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
2116 -fno-use-linker-plugin.
2117 (LINK1, CXXLINK1): Add it to the link command.
2118 * testsuite/Makefile.in: Regenerate.
2119
fa47fa92
AM
21202014-03-12 Alan Modra <amodra@gmail.com>
2121
2122 * Makefile.in: Regenerate.
2123
9b12c500
CC
21242014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2125
2126 * symtab.h (Symbol::set_nonvis): New function.
2127
beacaa96
CC
21282014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2129
2130 * symtab.cc (Sized_symbol<32>::init_output_data):
2131 Instantiate the template.
2132 (Sized_symbol<64>::init_output_data): Likewise.
2133
800d9823
CC
21342014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2135
2136 * symtab.cc (Symbol_table::sized_write_globals): Allow a target to
2137 adjust dynamic symbol value.
2138 * target.h (Target::adjust_dyn_symbol): New function.
2139 (Target::do_adjust_dyn_symbol): New function.
2140
918fc1f8 21412014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
5fe7ffdc 2142
918fc1f8
CC
2143 * output.cc (Output_data_dynamic::Dynamic_entry::write):
2144 Get the value of DYNAMIC_CUSTOM dynamic entry.
2145 * output.h (Output_data_dynamic::add_custom): New function.
2146 (Dynamic_entry::Dynamic_entry): New constructor for DYNAMIC_CUSTOM
2147 dynamic entry.
2148 (enum Dynamic_entry::Classification): Add DYNAMIC_CUSTOM.
2149 * target.h (Target::dynamic_tag_custom_value): New function.
2150 (Target::do_dynamic_tag_custom_value): New function.
2151
98ff9231
CC
21522014-03-10 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
2153
2154 * symtab.cc (Symbol_table::set_dynsym_indexes): Allow a target to set
2155 dynsym indexes.
2156 * target.h (Target::has_custom_set_dynsym_indexes): New function.
2157 (Target::do_has_custom_set_dynsym_indexes): New function.
2158 (Target::set_dynsym_indexes): New function.
2159 (Target::do_set_dynsym_indexes): New function.
2160
b80eed39
AM
21612014-03-07 Alan Modra <amodra@gmail.com>
2162
2163 * powerpc.cc (Powerpc_relocate_functions::Overflow_check): Add
2164 CHECK_UNSIGNED, CHECK_LOW_INSN, CHECK_HIGH_INSN.
2165 (Powerpc_relocate_functions::has_overflow_unsigned): New function.
2166 (Powerpc_relocate_functions::has_overflow_bitfield,
2167 overflowed): Use the above.
2168 (Target_powerpc::Relocate::relocate): Correct overflow checking
2169 for a number of relocations. Modify overflow test for 16-bit
2170 fields in instructions to signed/unsigned according to whether
2171 the field takes a signed or unsigned value.
2172
4b95cf5c
AM
21732014-03-05 Alan Modra <amodra@gmail.com>
2174
2175 Update copyright years.
2176
45965137
AM
21772014-03-05 Alan Modra <amodra@gmail.com>
2178
2179 * powerpc.cc (Target_powerpc::Scan::local, global): Support
2180 R_PPC64_ADDR64_LOCAL.
2181 (Target_powerpc::Relocate::relocate): Likewise.
2182
2c80b753
AM
21832014-03-03 Alan Modra <amodra@gmail.com>
2184
2185 * dwp.cc (print_version): Update copyright year to current.
2186
c1c69e83
AM
21872014-02-10 Alan Modra <amodra@gmail.com>
2188
2189 * po/gold.pot: Regenerate.
2190
dd0c4e70
CC
21912014-02-06 Cary Coutant <ccoutant@google.com>
2192
2193 Fix problem where -u is ignored when a weak undef is seen.
2194
2195 * archive.cc (Library_base::should_include_member): Reorder
2196 code to check for -u option if a weak undef has already been seen.
2197 * testsuite/Makefile.am (weak_undef_test_2): New test case.
2198 * testsuite/Makefile.in: Regenerate.
2199 * testsuite/weak_undef_file3.cc: New file.
2200 * testsuite/weak_undef_file4.cc: New file.
2201 * testsuite/weak_undef_test_2.cc: New file.
2202
1a221d3d
CC
22032014-02-05 Cary Coutant <ccoutant@google.com>
2204
2205 Fix issues with gold undefined symbol diagnostics.
2206
2207 PR binutils/15435
2208 * errors.cc (Errors::undefined_symbol): Move undef vtable symbol
2209 check to here.
2210 * target-reloc.h (is_strong_undefined): New function.
2211 (relocate_section): Move undef vtable symbol check from here.
2212 Check for is_strong_undefined.
2213
e889f0a4 22142014-02-05 Cary Coutant <ccoutant@google.com>
5fe7ffdc 2215
e889f0a4
CC
2216 Fix problems with the --dynamic-list option.
2217
2218 PR gold/13577
2219 * options.cc (General_options::parse_dynamic_list):
2220 Set have_dynamic_list_.
2221 (General_options::General_options): Initialize have_dynamic_list_.
2222 (General_options::finalize): Turn off -Bsymbolic and
2223 -Bsymbolic-functions if --dynamic-list provided.
2224 * options.h (General_options::have_dynamic_list): New function.
2225 (General_options::have_dynamic_list_): New data member.
2226 * symtab.h (Symbol::is_preemptible): Handle --dynamic-list
2227 correctly.
5fe7ffdc 2228
e889f0a4
CC
2229 PR gold/16530
2230 * symtab.cc (Symbol_table::add_from_relobj): If symbol is named
2231 in --dynamic-list, mark it.
5fe7ffdc 2232
e889f0a4
CC
2233 * testsuite/Makefile.am (gc_dynamic_list_test.sh): New test case.
2234 (dynamic_list_2): New test case.
2235 * testsuite/Makefile.in: Regenerate.
2236 * testsuite/dynamic_list_2.cc: New file.
2237 * testsuite/dynamic_list_2.t: New file.
2238 * testsuite/dynamic_list_lib1.cc: New file.
2239 * testsuite/dynamic_list_lib2.cc: New file.
2240 * testsuite/gc_dynamic_list_test.c: New file.
2241 * testsuite/gc_dynamic_list_test.sh: New file.
2242 * testsuite/gc_dynamic_list_test.t: New file.
2243
ec673e64
CC
22442014-01-28 Cary Coutant <ccoutant@google.com>
2245
2246 Add .gdb_index version 7 support.
2247
2248 * gold/dwarf_reader.cc: include <utility> (for make_pair).
2249 (Dwarf_abbrev_table::do_read_abbrevs): Check for compressed
2250 debug sections.
2251 (Dwarf_ranges_table::read_ranges_table): Likewise.
2252 (Dwarf_pubnames_table::read_section): Check for GNU-style
2253 sections, and for compressed debug sections.
2254 (Dwarf_pubnames_table::read_header): Compute end address of table.
2255 (Dwarf_pubnames_table::next_name): Return flag_byte. Check
2256 for end of list by offset, not by offset == 0.
2257 (Dwarf_info_reader::do_read_string_table): Check for compressed
2258 debug sections.
2259 * gold/dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2260 Initialize new data members.
2261 (Dwarf_pubnames_table::next_name): return flag_byte.
2262 (Dwarf_pubnames_table::end_of_table_): New data member.
2263 (Dwarf_pubnames_table::is_gnu_style_): New data member.
2264 * gold/gdb-index.cc (gdb_index_version): Update to version 7.
2265 (Gdb_index_info_reader::read_pubtable): Read flag_byte.
2266 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Don't
2267 read skeleton type unit DIEs.
2268 (Gdb_index::add_symbol): Add flag_byte; adjust all callers.
2269 (Gdb_index::do_write): Write flag_byte.
2270 * gold/gdb-index.h (Gdb_index::add_symbol): Add flags parameter.
2271 (Gdb_index::Cu_vector): Store flags along with cu indexes.
2272 * gold/testsuite/gdb_index_test_3.sh: Allow versions 4-7.
2273 * gold/testsuite/gdb_index_test_comm.sh: Likewise.
2274
221fd5d5
L
22752014-01-08 H.J. Lu <hongjiu.lu@intel.com>
2276
2277 * version.cc (print_version): Update copyright year to 2014.
2278
6c09fb0b
ILT
22792013-12-19 Dimitry Andric <dimitry@andric.com>
2280
2281 * stringpool.cc (Stringpool_template::reserve): Add
2282 HAVE_UNORDERED_MAP case.
2283 * stringpool.cc (Stringpool_template::print_stats): Likewise.
2284
8356f2d0
CC
22852013-12-18 Cary Coutant <ccoutant@google.com>
2286
2287 * configure.ac: Check for <unordered_set> and <unordered_map>.
2288 * config.in: Regenerate.
2289 * configure: Regenerate.
2290 * system.h: Use <unordered_set> and <unordered_map> if available.
2291
f2c7d7ee
RM
22922013-12-10 Roland McGrath <mcgrathr@google.com>
2293
2294 * Makefile.am (install-exec-local): Prefix $(INSTALL_PROGRAM) uses
2295 with $(INSTALL_PROGRAM_ENV).
2296 * Makefile.in: Regenerate.
2297
6632e8cc
CC
22982013-11-22 Cary Coutant <ccoutant@google.com>
2299
2300 * configure.ac: Add check for which library is needed for
2301 dlopen.
2302 * configure: Regenerate.
2303
0c075858
CC
23042013-11-22 Cary Coutant <ccoutant@google.com>
2305
2306 * testsuite/Makefile.am (exception_x86_64_bnd_test): Use in-tree
2307 assembler.
2308 * testsuite/Makefile.in: Regenerate.
2309
f49fe902
L
23102013-11-17 H.J. Lu <hongjiu.lu@intel.com>
2311
2312 * x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
2313 Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
2314 R_X86_64_PC32 and R_X86_64_PLT32, respectively.
2315 (Target_x86_64<size>::Scan::local): Likewise.
2316 (Target_x86_64<size>::Scan::global): Likewise.
2317 (Target_x86_64<size>::Relocate::relocate): Likewise.
2318 (Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
2319 Likewise.
2320 (Target_x86_64<size>::Scan::check_non_pic(): Handle
2321 R_X86_64_PC32_BND.
2322
2323 * testsuite/Makefile.am (check_PROGRAMS): Add
2324 exception_x86_64_bnd_test.
2325 (exception_x86_64_bnd_test_SOURCES): New macro.
2326 (exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
2327 (exception_x86_64_bnd_test_LDFLAGS): Likewise.
2328 (exception_x86_64_bnd_test_LDADD): Likewise.
2329 (exception_x86_64_bnd_1.o): New rule.
2330 (exception_x86_64_bnd_2.o): Likewise.
2331 * testsuite/Makefile.in: Regenerated.
2332
9055360d
AM
23332013-11-15 Alan Modra <amodra@gmail.com>
2334
2335 * powerpc.cc (Target_powerpc::glink_section): Provide non-const
2336 accessor.
2337 (Target_powerpc::Branch_info::make_stub): Make global entry stubs.
2338 Only call ppc64_local_entry_offset for 64-bit. Restrict
2339 symval_for_branch lookup to ELFv1.
2340 (Stub_table::add_plt_call_entry): Use unsigned int off.
2341 (Output_data_glink::Address, invalid_address): New.
2342 (Output_data_glink::add_eh_frame): Move out of line. Add
2343 support for ELFv2.
2344 (Output_data_glink::add_global_entry, find_global_entry,
2345 global_entry_address): New functions.
2346 (Output_data_glink::global_entry_stubs_, end_branch_table_,
2347 ge_size): New variables.
2348 (Output_data_glink::set_final_data_size): Add global entry
2349 stub sizing.
2350 (Output_data_glink::do_write): Write global entry stubs.
2351 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
2352 parameter. Return true for ELFv2. Adjust callers.
2353 (Target_powerpc::Scan::local, global): Restrict opd lookup to
2354 ELFv1. Similarly for ifunc and dynamic relocation processing
2355 specific to ELFv1. Recognize that symbols are defined on
2356 their plt entries for ELFv2.
2357 (Target_powerpc::symval_for_branch): Assert if called for
2358 ELFv2 or ppc32.
2359 (Target_powerpc::Relocate::relocate): Use global entry plt
2360 stub for symbol value if such exists on ELFv2.
2361 (Target_powerpc::Relocate::relocate): Don't call
2362 symval_for_branch when ELFv2. Do adjust for local entry
2363 offset when ELFv2.
2364 (Target_powerpc::do_dynsym_value): Set symbols to global entry
2365 plt stub for ELFv2.
2366 (Target_powerpc::do_plt_address_for_global): Similarly.
2367
cafdd569
CC
23682013-11-14 Cary Coutant <ccoutant@google.com>
2369
2370 Revert patch -- this did not fix the problem, and there is
2371 no race there.
2372
2373 2013-11-14 Cary Coutant <ccoutant@google.com>
2374
2375 PR gold/14860
2376 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2377 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2378 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2379 updating fde_offsets_.
2380 (Eh_frame_hdr::lock_): New data member.
2381
94e49e16
CC
23822013-11-14 Cary Coutant <ccoutant@google.com>
2383
2384 * dwp.cc (Dwo_file_entry): New type.
2385 (File_list): Use Dwo_file_entry.
2386 (Dwo_file::verify): New function.
2387 (Dwo_file::verify_dwo_list): New function.
2388 (Dwo_file::sized_verify_dwo_list): New function.
2389 (Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
2390 list.
2391 (Dwp_options): New enum type.
2392 (dwp_options): Add --verify-only.
2393 (usage): Likewise.
2394 (main): Likewise.
2395 * dwp.h (gold_info): Add declaration.
2396
7cdd7d57
CC
23972013-11-14 Cary Coutant <ccoutant@google.com>
2398
2399 PR gold/14860
2400 * ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
2401 (Ehframe_hdr::set_final_data_size): Allocate a Lock.
2402 * ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
2403 updating fde_offsets_.
2404 (Eh_frame_hdr::lock_): New data member.
2405
1d946cb3
CC
24062013-11-06 Cary Coutant <ccoutant@google.com>
2407
2408 PR gold/15758
2409 * object.cc (Sized_relobj_file::do_layout): Handle .eh_frame sections
2410 before reloc sections.
2411
4f65b40e
AM
24122013-11-04 Alan Modra <amodra@gmail.com>
2413
2414 * symtab.h (Symbol::Reference_flags): Add FUNC_DESC_ABI.
2415 (Symbol::needs_dynamic_reloc): Test new flag.
2416 * powerpc.cc (needs_dynamic_reloc, use_plt_offset): Delete.
2417 (Target_powerpc::Scan::get_reference_flags): Add target param.
2418 Return FUNC_DESC_ABI for 64-bit ELFv1.
2419 (Target_powerpc::Branch_info::make_stub): Adjust get_reference_flags
2420 call.
2421 (Target_powerpc::Scan::global): Use Symbol::needs_dynamic_reloc.
2422 (Target_powerpc::Relocate::relocate): Use Symbol::use_plt_offset.
2423
908794a9
CC
24242013-10-31 Cary Coutant <ccoutant@google.com>
2425
2426 Restore support for dwp v2 DWARF package file format.
2427
2428 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2429 tu_length parameter. Adjust all callers.
2430 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2431 * dwp.cc: Include dwarf.h.
2432 (Section_bounds): New struct type.
2433 (Unit_set): New struct type.
2434 (Dwo_file::Dwo_file): Initialize new data member.
2435 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2436 Combine and rename to...
2437 (Dwo_file::read_unit_index): ...this.
2438 (Dwo_file::sized_read_compunit_index)
2439 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2440 (Dwo_file::sized_read_unit_index): ...this.
2441 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2442 parameters; add section_id parameter.
2443 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2444 (Dwo_file::add_unit_set): ...this.
2445 (Dwo_file::shndx_map_): Remove.
2446 (Dwo_file::sect_offsets_): New data member.
2447 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2448 (Dwp_output_file::add_section): Rename to...
2449 (Dwp_output_file::add_contribution): ...this.
2450 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2451 (Dwp_output_file::add_tu_set): Likewise.
2452 (Dwp_output_file::Contribution): New type.
2453 (Dwp_output_file::Section::contributions): New data member.
2454 (Dwp_output_file::Cu_or_tu_set): Remove.
2455 (Dwp_output_file::Section::Section): New ctor.
2456 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2457 (Dwp_output_file::Dwp_index::Section_table): New type.
2458 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2459 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2460 parameter.
2461 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2462 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2463 (Dwp_output_file::Dwp_index::section_table): New member function.
2464 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2465 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2466 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2467 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2468 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2469 (Dwp_output_file::Dwp_index::section_table_): New data member.
2470 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2471 (Dwp_output_file::add_output_section): New member function.
2472 (Dwp_output_file::write_new_section): New member function.
2473 (Dwp_output_file::write_contributions): New member function.
2474 (Dwp_output_file::section_id_map_): New data member.
2475 (class Dwo_id_info_reader): Remove.
2476 (class Unit_reader): New class.
2477 (get_dwarf_section_name): New function.
2478 (Dwo_file::read_executable): Adjust initializations of class data.
2479 (Dwo_file::read): Add support for v2 package file format.
2480 (Dwo_file::read_unit_index): Likewise.
2481 (Dwo_file::sized_read_unit_index): Likewise.
2482 (Dwo_file::copy_section): Likewise.
2483 (Dwo_file::add_unit_set): Likewise.
2484 (Dwp_output_file::add_output_section): Likewise.
2485 (Dwp_output_file::add_contribution): Likewise.
2486 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2487 for empty slot.
2488 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2489 file format.
2490 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2491 slot.
2492 (Dwp_output_file::initialize): Remove unused function.
2493 (Dwp_output_file::finalize): Add support for v2 package file format.
2494 (Dwp_output_file::write_index): Likewise.
2495 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2496 function prototype.
2497
2500c017
CC
24982013-10-31 Cary Coutant <ccoutant@google.com>
2499
2500 * configure.ac: Fix check for -fmerge-constants.
2501 * configure.ac: Regenerate.
2502
dd0845d7
RM
25032013-10-30 Roland McGrath <mcgrathr@google.com>
2504
2505 * x86_64.cc (Output_data_plt_x86_64_nacl::first_plt_entry):
2506 Correct 9-byte nop sequence to match what the assembler generates.
2507
b4f7960d
AM
25082013-10-30 Alan Modra <amodra@gmail.com>
2509
2510 * powerpc.cc (Powerpc_relobj::abiversion, set_abiversion,
2511 ppc64_local_entry_offset, ppc64_local_entry_offset,
2512 do_read_symbols): New functions.
2513 (Powerpc_relobj::e_flags_, st_other_): New vars.
2514 (Powerpc_relobj::Powerpc_relobj): Call set_abiversion.
2515 (Powerpc_dynobj::abiversion, set_abiversion): New functions.
2516 (Powerpc_relobj::e_flags_): New var.
2517 (Target_powerpc::first_plt_entry_offset, plt_entry_size): Inline
2518 and adjust for ELFv2.
2519 (Target_powerpc::abiversion, set_abiversion, stk_toc): New functions.
2520 (Powerpc_relobj::do_find_special_sections): Check no .opd in ELFv2.
2521 (Powerpc_dynobj::do_find_special_sections): Likewise.
2522 (Target_powerpc::do_define_standard_symbols): Define ".TOC.".
2523 (Target_powerpc::Branch_info::make_stub): Adjust stub destination
2524 to ELFv2 local entry.
2525 (Target_powerpc::do_relax): No thread safe barriers needed for
2526 ELFv2.
2527 (Output_data_plt_powerpc::initial_plt_entry_size_,
2528 plt_entry_size): Delete. Replace all uses with
2529 first_plt_entry_offset() and plt_entry_size().
2530 (Output_data_plt_powerpc::Output_data_plt_powerpc): Remove
2531 reserved_size parm. Update callers.
2532 (Output_data_plt_powerpc::entry_count): Update.
2533 (Output_data_plt_powerpc::first_plt_entry_offset): Make private
2534 and use Target_powerpc::first_plt_entry_offset().
2535 (Output_data_plt_powerpc::get_plt_entry_size): Similarly and
2536 rename to plt_entry_size.
2537 (Output_data_plt_powerpc::add_ifunc_entry,
2538 add_local_ifunc_entry): Adjust reloc for ELFv2.
2539 (glink_eh_frame_fde_64): Rename to glink_eh_frame_fde_64v1.
2540 (glink_eh_frame_fde_64v2): New.
2541 (Stub_table::plt_call_size): Support ELFv2 sizing.
2542 (Output_data_glink::add_eh_frame): Use the new FDE.
2543 (Output_data_glink::set_final_data_size): Adjust for ELFv2 glink.
2544 (Stub_table::do_write): Write ELFv2 stubs and glink.
2545 (Target_powerpc::Relocate::relocate): Replaces nop after call
2546 with ld 2,24(1) and adjust local offset destination for ELFv2.
2547
f9c6b907
AM
25482013-10-30 Alan Modra <amodra@gmail.com>
2549
2550 * powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
2551 (Target_powerpc::Scan::global, local): Likewise.
2552 (Target_powerpc::Relocate::relocate): Likewise. Check for overflow
2553 on all ppc64 @h and @ha relocs.
2554
e84fe78f
AM
25552013-10-14 Alan Modra <amodra@gmail.com>
2556
2557 * output.h (Output_data_got::add_constant): Tidy.
2558 (Output_data_got::add_constant_pair): New function.
2559 * powerpc.cc (Output_data_got_powerpc): Override all Output_data_got
2560 methods used so as to first call reserve_ent().
2561
679e4abf
RM
25622013-10-11 Roland McGrath <mcgrathr@google.com>
2563
44dcb735
RM
2564 * powerpc.cc (Output_data_got_powerpc): Remove unused methods
2565 add_got_entry and add_got_entry_pair.
2566
13323c49
RM
2567 * configure.ac (TLS_GNU2_DIALECT): Use -Werror in test.
2568 (HAVE_PUBNAMES): Likewise.
2569 * configure: Regenerate.
2570
1496b446
RM
2571 * testsuite/Makefile.am: Replace '-T foo' with '-Wl,-T,foo' throughout.
2572 * testsuite/Makefile.in: Regenerate.
2573
cc84c10b
RM
2574 * target.h (Target::adjust_elf_header, Target::do_adjust_elf_header):
2575 Remove const from declaration.
2576 * target.cc (Sized_target::do_adjust_elf_header): Update definition.
2577 * sparc.cc (Target_sparc::do_adjust_elf_header): Likewise.
2578 * output.h (Output_file_header): Remove const from member target_
2579 and corresponding constructor argument.
2580 * output.cc (Output_file_header::Output_file_header): Update prototype.
2581 (Output_file_header::do_sized_write): Use this->target_ in place
2582 of parameters()->target().
2583
52f66a2c
RM
2584 * testsuite/undef_symbol.cc (Foo::get_a): New method.
2585
2b64b551
RM
2586 * configure.ac (MERGE_CONSTANTS_FLAG): New check.
2587 * configure: Regenerate.
2588 * Makefile.in: Regenerate.
2589 * testsuite/merge_string_literals_1.c: Renamed to have .cc suffix.
2590 * testsuite/merge_string_literals_2.c: Likewise.
2591 * testsuite/Makefile.am
2592 (merge_string_literals_1.o, merge_string_literals_2.o): Update deps.
2593 (AM_CFLAGS, AM_CXXFLAGS): Use $(MERGE_CONSTANTS_FLAG) in place of
2594 literal -fmerge-constants.
2595 * testsuite/Makefile.in: Regenerate.
2596
43819297
RM
2597 * i386.cc (Target_i386): Remove unused member dynbss_.
2598 * arm.cc (Target_arm): Likewise.
2599 * powerpc.cc (Target_powerpc): Likewise.
2600 * sparc.cc (Target_sparc): Likewise.
2601 * tilegx.cc (Target_tilegx): Likewise.
2602 * x86_64.cc (Target_x86_64): Likewise.
2603 * dwarf_reader.h (Dwarf_info_reader): Remove unused members
2604 type_signature_, type_offset_.
2605 * plugin.h (Plugin_hook): Remove unused member layout_.
2606 * readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
2607 mapfile_.
2608 (Read_member): Remove unused members input_objects_, symtab_,
2609 mapfile_, layout_.
2610 (Check_library): Remove unused member symtab_.
2611 * archive.h (Lib_group): Remove unused member lib_.
2612 * archive.cc (Lib_group::Lib_group): Update initializer.
2613 * incremental.h (Incremental_binary): Remove unused member target_.
2614 (Incremental_script_entry): Removed unused member script_.
2615 * layout.h (Write_symbols_task): Remove unused member input_objects_.
2616 * icf.h (Icf): Remove unused member num_tracked_relocs.
2617
39d9ead7
RM
2618 * gold-threads.h (Once): Conditionalize member was_run_lock_ on
2619 [ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
2620 its only use.
2621 * gold-threads.cc (Once::Once): Likewise conditionalize initializer.
2622
679e4abf
RM
2623 * archive.h: Use struct rather than class for forward declaration
2624 of Read_symbols_data.
2625
54de2ea6
CC
26262013-10-07 Cary Coutant <ccoutant@google.com>
2627
2628 PR gold/16010
2629 * testsuite/Makefile.am (icf_test): Fix dependencies.
2630 (icf_safe_test): Likewise.
2631 (icf_safe_so_test): Likewise.
2632 (large_symbol_alignment): Add empty _LDADD rule.
2633 * testsuite/Makefile.in: Regenerate.
2634
b14016f0
L
26352013-09-03 Pavel Chupin <pavel.v.chupin@intel.com>
2636
2637 PR gold/15927
2638 * x86_64.cc (Target_x86_64<size>::Scan::global): Use relative
2639 relocation for R_X86_64_32 on x32.
2640
eb426534
RM
26412013-08-27 Roland McGrath <mcgrathr@google.com>
2642
2643 * output.cc (Output_segment::set_section_addresses): Take new
2644 Target* argument. If target->isolate_execinstr() and the segment
2645 is executable and starts at a target->abi_pagesize() boundary,
2646 pad its end out to a target->abi_pagesize() boundary with code fill.
2647 * output.h (Output_segment::set_section_addresses): Update decl.
2648 * layout.h (Layout::check_output_data_for_reset_values): Take new
2649 argument RELAX_OUTPUTS.
2650 (Layout): New member relax_output_list_.
2651 (Layout::add_relax_output): New method.
2652 * layout.cc (Layout::Layout): Update constructor.
2653 (Layout::reset_relax_output): New method.
2654 (Layout::clean_up_after_relaxation): Call it.
2655 (Layout::prepare_for_relaxation): Update caller.
2656 (Layout::set_segment_offsets): Update callers of set_section_addresses.
2657 Call reset_relax_output before re-processing segments for
2658 isolate_execinstr case.
2659 (Layout::write_data): Handle relax_output_list_.
2660 (Layout::Relaxation_debug_check::check_output_data_for_reset_values):
2661 Take new argument RELAX_OUTPUTS. Assert it's an empty collection.
2662
9aff4b7a
NC
26632013-08-23 Yuri Chornoivan <yurchor@ukr.net>
2664
2665 PR binutils/15834
2666 * object.h: Fix typos.
2667
93f8221c
RM
26682013-08-16 Roland McGrath <mcgrathr@google.com>
2669
2670 * i386.cc (Target_i386_nacl::do_code_fill): New virtual function.
2671 * x86_64.cc (Target_x86_64_nacl::do_code_fill): New virtual function.
2672
e44c3715
CC
26732013-08-07 Cary Coutant <ccoutant@google.com>
2674
2675 Revert support for v2 DWP files:
2676
2677 2013-03-01 Cary Coutant <ccoutant@google.com>
2678
2679 Add dwp support for v2 DWARF package file format.
2680 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
2681 tu_length parameter. Adjust all callers.
2682 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
2683 * dwp.cc: Include dwarf.h.
2684 (Section_bounds): New struct type.
2685 (Unit_set): New struct type.
2686 (Dwo_file::Dwo_file): Initialize new data member.
2687 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
2688 Combine and rename to...
2689 (Dwo_file::read_unit_index): ...this.
2690 (Dwo_file::sized_read_compunit_index)
2691 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
2692 (Dwo_file::sized_read_unit_index): ...this.
2693 (Dwo_file::copy_section): Remove section_name, is_str_offsets
2694 parameters; add section_id parameter.
2695 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
2696 (Dwo_file::add_unit_set): ...this.
2697 (Dwo_file::shndx_map_): Remove.
2698 (Dwo_file::sect_offsets_): New data member.
2699 (Dwp_output_file::Dwp_output_file): Initialize new data members.
2700 (Dwp_output_file::add_section): Rename to...
2701 (Dwp_output_file::add_contribution): ...this.
2702 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
2703 (Dwp_output_file::add_tu_set): Likewise.
2704 (Dwp_output_file::Contribution): New type.
2705 (Dwp_output_file::Section::contributions): New data member.
2706 (Dwp_output_file::Cu_or_tu_set): Remove.
2707 (Dwp_output_file::Section::Section): New ctor.
2708 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
2709 (Dwp_output_file::Dwp_index::Section_table): New type.
2710 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
2711 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
2712 parameter.
2713 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
2714 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
2715 (Dwp_output_file::Dwp_index::section_table): New member function.
2716 (Dwp_output_file::Dwp_index::section_table_end): New member function.
2717 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
2718 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
2719 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
2720 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
2721 (Dwp_output_file::Dwp_index::section_table_): New data member.
2722 (Dwp_output_file::Dwp_index::section_mask_): New data member.
2723 (Dwp_output_file::add_output_section): New member function.
2724 (Dwp_output_file::write_new_section): New member function.
2725 (Dwp_output_file::write_contributions): New member function.
2726 (Dwp_output_file::section_id_map_): New data member.
2727 (class Dwo_id_info_reader): Remove.
2728 (class Unit_reader): New class.
2729 (get_dwarf_section_name): New function.
2730 (Dwo_file::read_executable): Adjust initializations of class data.
2731 (Dwo_file::read): Add support for v2 package file format.
2732 (Dwo_file::read_unit_index): Likewise.
2733 (Dwo_file::sized_read_unit_index): Likewise.
2734 (Dwo_file::copy_section): Likewise.
2735 (Dwo_file::add_unit_set): Likewise.
2736 (Dwp_output_file::add_output_section): Likewise.
2737 (Dwp_output_file::add_contribution): Likewise.
2738 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
2739 for empty slot.
2740 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
2741 file format.
2742 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
2743 slot.
2744 (Dwp_output_file::initialize): Remove unused function.
2745 (Dwp_output_file::finalize): Add support for v2 package file format.
2746 (Dwp_output_file::write_index): Likewise.
2747 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
2748 function prototype.
2749
c6905c28
CC
27502013-07-31 Cary Coutant <ccoutant@google.com>
2751
2752 * object.cc (Sized_relobj::do_output_section_address): New function.
2753 (Sized_relobj): Instantiate explicitly.
2754 * object.h (Object::output_section_address): New function.
2755 (Object::do_output_section_address): New function.
2756 (Sized_relobj::do_output_section_address): New function.
2757 * powerpc.cc (Target_powerpc::symval_for_branch): Use it.
2758
27592013-07-30 Cary Coutant <ccoutant@google.com>
5cdb4d98 2760 Sasa Stankovic <Sasa.Stankovic@imgtec.com>
a67858e0
CC
2761
2762 * parameters.cc (Parameters::entry): Return target-specific entry
2763 symbol name.
2764 * target.h (Target::entry_symbol_name): New function.
2765 (Target_info::entry_symbol_name): New data member.
2766
2767 * arm.cc (Target_arm::arm_info): Add entry_symbol_name.
2768 * i386.cc (Target_i386::i386_info): Likewise.
2769 (Target_i386_nacl::i386_nacl_info): Likewise.
2770 * sparc.cc (Target_sparc::sparc_info): Likewise.
2771 * tilegx.cc (Target_tilegx::tilegx_info): Likewise.
2772 * x86_64.cc: (Target_x86_64::x86_64_info) Likewise.
2773 (Target_x86_64_nacl::x86_64_nacl_info) Likewise.
2774 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
2775
234d4ab8
SA
27762013-07-22 Sterling Augustine <saugustine@google.com>
2777
2778 * dwarf_reader.cc (Dwarf_pubnames_table::read_section):
2779 Convert parameter shndx to local variable. Add parameters symtab
2780 and symtab_size. Scan over section names. Find relocation
2781 section corresponding to current section. Create and initialize
2782 reloc_mapper_ and reloc_type_.
2783 (Dwarf_pubnames_table::read_header): Add assertion. Change
2784 unit_length to off_t. Initialize member unit_length_. Fill in field
2785 cu_offset_.
2786 * dwarf_reader.h (Dwarf_pubnames_table::Dwarf_pubnames_table):
2787 Initialize new fields unit_length_ and cu_offset_.
2788 (Dwarf_pubnames_table::read_section): Update prototype.
2789 (Dwarf_pubnames_table::cu_offset): New member function.
2790 (Dwarf_pubnames_table::subsection_size): Likewise.
2791 (Dwarf_pubnames_table::cu_offset_, Dwarf_pubnames_table::unit_length):
2792 New fields.
2793 (Dwarf_info_reader::symtab, Dwarf_info_reader::symtab_size): Make
2794 member functions public.
2795 * gdb_index.cc (Gdb_index_info_reader::read_pubnames_and_pubtypes):
2796 Update comment. Rework logic. Move repeated parts to...
2797 (Gdb_index_info_reader::read_pubtable): ...here. New function.
2798 (Gdb_index::Gdb_index): Initialize new fields, pubnames_table_,
2799 pubtypes_table_, and stmt_list_offset.
2800 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2801 Gdb_index::find_pubtype_offset,
2802 Gdb_index::map_pubnames_and_types_to_dies): Define new functions.
2803 (Gdb_index::pubnames_read): Update prototype and rework logic.
2804 * gdb_index.h (Gdb_index_info_reader, Dwarf_pubnames_table):
2805 Forward declare.
2806 (Gdb_index::map_pubtable_to_dies, Gdb_index::find_pubname_offset,
2807 Gdb_index::find_pubtype_offset, Gdb_index::pubnames_table)
2808 Gdb_index::pubtypes_table, Gdb_index::map_pubnames_and_types_to_dies,
2809 Gdb_index::map_pubtable_to_dies):
2810 Declare functions.
2811 (Gdb_index::pubnames_read): Update declaration.
2812 (Gdb_index::Pubname_offset_map): New type.
2813 (Gdb_index::cu_pubname_map_, Gdb_index::cu_pubtype_map_,
2814 Gdb_index::pubnames_table_, Gdb_index::pubtypes_table_,
2815 Gdb_index::stmt_list_offset): Declare.
2816 (Gdb_index::pubnames_shndx_, Gdb_index::pubnames_offet_,
2817 Gdb_index::pubtypes_object_, Gdb_index::pubtypes_shndx_)
2818 Gdb_index::pubtypes_offset_): Remove.
2819
a3ed37d8
RM
28202013-07-19 Roland McGrath <mcgrathr@google.com>
2821
2822 * options.h (General_options): Add -Trodata-segment option.
2823 * parameters.cc (Parameters::check_rodata_segment): New function.
2824 (Parameters::set_target_once): Call it.
2825 * parameters.h (Parameters): Declare it (private member function).
2826 * layout.cc (load_seg_unusable_for_headers): New function, broken
2827 out of Layout::relaxation_loop_body. If TARGET->isolate_execinstr()
2828 then validate rodata segment rather than text segment.
2829 (relaxation_loop_body): Call that.
2830 (is_text_segment): New function. Don't admit a non-executable
2831 segment if TARGET->isolate_execinstr().
2832 (set_segment_offsets): Call it. Honor -Trodata-segment option.
2833
eb5b4ded
CC
28342013-07-15 Shawn Landden <shawnlandden@gmail.com>
2835
2836 PR gold/15070
2837 * fileread.h (File_read::get_view): Clarify comment about ALIGNED.
2838 * nacl.h (Sniff_file::View::View): Request aligned view.
2839
4d5effb9
CC
28402013-07-11 Cary Coutant <ccoutant@google.com>
2841
2842 * powerpc.cc (Target_powerpc::write_branch_lookup_table): Use
2843 correct BRLT entry size.
2844
ba8ca3e7
AM
28452013-07-03 Alan Modra <amodra@gmail.com>
2846
2847 * powerpc.cc (Target_powerpc::Relocate::relocate): Update self-call
2848 comment.
2849
267257d2
CC
28502013-07-01 Cary Coutant <ccoutant@google.com>
2851
2852 * dwarf_reader.cc (Dwarf_ranges_table::read_ranges_table): Save
2853 reloc_type_.
2854 (Dwarf_ranges_table::read_range_list): Call lookup_reloc.
2855 (Dwarf_ranges_table::lookup_reloc): New function.
2856 * dwarf_reader.h (Dwarf_ranges_table::Dwarf_ranges_table): Initialize
2857 reloc_type_.
2858 (Dwarf_ranges_table::lookup_reloc): New function.
2859 (Dwarf_ranges_table::reloc_type_): New data member.
2860
06f30c9d
CC
28612013-06-27 Jing Yu <jingyu@google.com>
2862
2863 PR gold/15662
2864 * powerpc.cc (Output_data_brlt_powerpc::reset_brlt_sizes): New
2865 function.
2866 (Output_data_brlt_powerpc::finalize_brlt_sizes): New function.
2867 (Target_powerpc::do_relax): Call the above.
2868
a2d7bf59
AM
28692013-06-27 Cary Coutant <ccoutant@google.com>
2870
2871 * powerpc.cc (Target_powerpc::symval_for_branch): Don't assert
2872 on garbage collected .opd section.
2873
28742013-06-27 Alan Modra <amodra@gmail.com>
2875
2876 * powerpc.cc (Target_powerpc::do_gc_add_reference): Test dst_shndx
2877 is non-zero.
2878 (Target_powerpc::do_gc_mark_symbols): Likewise for sym->shndx().
2879 (Target_powerpc::do_function_location): Likewise for loc->shndx.
2880
32364e50
CC
28812013-06-14 Cary Coutant <ccoutant@google.com>
2882
2883 * resolve.cc (Symbol::override_base): Don't override st_type
2884 from plugin placeholder symbols.
2885 (Symbol_table::resolve): Likewise.
2886 (Symbol_table::should_override): Don't complain about TLS mismatch
2887 if the TO symbol is a plugin placeholder.
2888 * testsuite/Makefile.am (plugin_test_tls): New test.
2889 * testsuite/Makefile.in: Regenerate.
2890 * testsuite/plugin_test_tls.sh: New test script.
2891 * testsuite/two_file_test_2_tls.cc: New test source.
2892 * testsuite/two_file_test_tls.cc: New test source.
2893
7fb47cc9
CC
28942013-06-05 Alexander Ivchenko <alexander.ivchenko@intel.com>
2895
2896 * layout.cc (Layout::set_segment_offsets): Taking care of the case when
2897 the maximum segment alignment is larger than the page size.
2898 * testsuite/Makefile.am (large_symbol_alignment): Test that Gold
2899 correctly aligns the symbols with large alignemnt.
2900 * testsuite/Makefile.in: Regenerate.
2901 * testsuite/large_symbol_alignment.cc: New file.
2902
6934001a
CC
29032013-05-30 Alexander Ivchenko <alexander.ivchenko@intel.com>
2904 Sriraman Tallam <tmsriram@google.com>
2905
2906 * options.h (sort_section): New option.
2907 * output.h (Input_section_sort_section_prefix_special_ordering_compare):
2908 Rename from Input_section_sort_section_name_special_ordering_compare.
2909 (Input_section_sort_section_name_compare): New struct.
2910 * output.cc (Output_section::Input_section_sort_section_name_compare::
2911 operator()): New function.
2912 (Output_section::sort_attached_input_sections): Use new sort function
2913 for .text if --sort-section=name is specified.
2914 * layout.cc (Layout::make_output_section):
2915 Add sorting by name when --sort-section=name is specified.
2916 * testsuite/Makefile.am (text_section_grouping): Test option
2917 --sort-section=name.
2918 * testsuite/Makefile.in: Regenerate.
2919 * testsuite/section_sorting_name.cc: New file.
2920 * testsuite/section_sorting_name.sh: New file.
2921
93acabad
CC
29222013-05-21 Cary Coutant <ccoutant@google.com>
2923
2924 * symtab.h (Symbol::is_cxx_vtable): New function.
2925 * target-reloc.h (relocate_section): Check for vtable symbol.
2926 * testsuite/Makefile.am (missing_key_func.sh): New test case.
2927 * testsuite/Makefile.in: Regenerate.
2928 * testsuite/missing_key_func.cc: New test source.
2929 * testsuite/missing_key_func.sh: New test script.
2930
60e8b3fc
CC
29312013-05-21 Cary Coutant <ccoutant@google.com>
2932
2b64b551
RM
2933 * object.cc (Sized_relobj_file::get_symbol_location_info): Set
2934 type of enclosing symbol.
2935 (Relocate_info::location): Check symbol type when describing symbol.
2936 * object.h (Symbol_location_info): Remove unused line_number;
2937 add enclosing_symbol_type.
2938 * testsuite/debug_msg.sh: Adjust expected output.
60e8b3fc 2939
9df9de2c
CC
29402013-05-13 Cary Coutant <ccoutant@google.com>
2941
2b64b551
RM
2942 * configure.ac: Export DEFAULT_TARGET.
2943 * configure: Regenerate.
2944 * Makefile.in: Regenerate.
2945 * testsuite/Makefile.am: Add .EXPORT_ALL_VARIABLES.
2946 * testsuite/Makefile.in: Regenerate.
2947 * testsuite/debug_msg.sh: Delete duplicate tests.
2948 Don't check undef_int error message match for powerpc where the
2949 source file and line number aren't available.
9df9de2c 2950
bbc5ae17
RM
29512013-05-10 Roland McGrath <mcgrathr@google.com>
2952
2953 * options.h (General_options): Add --rosegment-gap option.
2954 * options.cc (finalize): --rosegment-gap implies --rosegment.
2955 * layout.cc (set_segment_offsets): Let user option override
2956 target->rosegment_gap().
2957
0c6e6c39
RM
29582013-05-10 Roland McGrath <mcgrathr@google.com>
2959
2960 * options.h (General_options): Remove leading space from help
2961 messages for -nostdlib and --rosegment.
2962
cde7cb01
MR
29632013-05-03 Maciej W. Rozycki <macro@codesourcery.com>
2964
2965 PR ld/15365
2966 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN.
2967
f31ae5b8
AM
29682013-05-03 Alan Modra <amodra@gmail.com>
2969
2970 * merge.cc (Output_merge_string::do_add_input_section): Correct
2971 scan for number of strings. Rename vars to avoid shadowing.
2972 Include missing terminator in input_size_.
2973
d3a7cd45
L
29742013-05-01 H.J. Lu <hongjiu.lu@intel.com>
2975
2976 * merge.cc (Output_merge_string<Char_type>::do_add_input_section):
2977 Restore empty string handling.
2978
6ad3daba
CC
29792013-05-01 Cary Coutant <ccoutant@google.com>
2980
2981 * stringpool.cc (Stringpool_template::new_key_offset): Fix
2982 uninitialized warning.
2983
e31908b6
CC
29842013-04-29 Alexander Ivchenko <alexander.ivchenko@intel.com>
2985
2986 * output.cc (Output_section::add_merge_input_section): Allow
2987 to merge sections if the alignment is more than character size.
2988 * merge.h (Output_merge_string::Output_merge_string): Remove
2989 assert.
2990 * merge.cc (Output_merge_string<Char_type>::do_add_input_section): Count
2991 only not-null strings. Check the alignment of strings.
2992 * stringpool.h
2993 (Stringpool_template<Stringpool_char>::Stringpool_template): Add
2994 alignment as the argument.
2995 (Stringpool_template<Stringpool_char>::addralign_): New class member.
2996 * stringpool.cc (Stringpool_template<Stringpool_char>::new_key_offset):
2997 Align non-zero length strings according to the addralign_.
2998 (Stringpool_template<Stringpool_char>::set_string_offsets):
2999 Updating offsets according to the given alignment.
3000 * testsuite/Makefile.am (text_section_grouping): Test if string
3001 literals are getting merged.
3002 * testsuite/Makefile.in: Regenerate.
3003 * testsuite/merge_string_literals_1.c: New file.
3004 * testsuite/merge_string_literals_2.c: Ditto.
3005 * testsuite/merge_string_literals.sh: Ditto.
3006
0e804863
ILT
30072013-04-26 Ian Lance Taylor <iant@google.com>
3008
3009 * target-reloc.h (relocate_section): If the reloc offset is out of
3010 range, pass VIEW as NULL to relocate.relocate.
3011 * arm.cc (Target_arm:Relocate::relocate): Check for a NULL view.
3012 * i386.cc (Target_i386::Relocate::relocate): Likewise.
3013 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
3014 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
3015 * tilegx.cc (Target_tilegx::Relocate::relocate): Likewise.
3016 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
3017
e7c5ea40
CC
30182013-04-26 Geoff Pike <gpike@chromium.org>
3019
3020 * gold.cc (queue_final_tasks): invoke layout->queue_build_id_tasks().
3021 * layout.cc (Hash_task): New class.
3022 (Layout::queue_build_id_tasks): New function.
3023 (Layout::write_build_id): Handle single-thread portion of build ID
3024 computation. (In some cases, all of it is single-threaded.) Replace
3025 {sha1,md5}_process_bytes with {sha1,md5}_buffer to get the same
3026 functionality in fewer lines of code.
3027 * layout.h (Layout::queue_build_id_tasks): New function declaration.
3028 * options.h (General_options): make "--build-id" default to tree
3029 rather than sha1. Add two new options related to --build-id=tree:
3030 --build-id-chunk-size-for-treehash and
3031 --build-id-min-file-size-for-treehash.
3032 * Makefile.am: add testing of --build-id=tree and related new options
3033 (these tests will be invoked by "make check").
3034 * Makefile.in: Regenerate.
3035
49926cd0
AM
30362013-04-25 Alan Modra <amodra@gmail.com>
3037
3038 * configure.tgt: Add powerpcle and powerpc64le.
3039
a4034750
AM
30402013-04-22 Alan Modra <amodra@gmail.com>
3041
3042 PR gold/15355
3043 * layout.cc (Layout::segment_precedes): Allow more than one
3044 segment with the same type and flags.
3045
e79c84aa
CC
30462013-04-15 Cary Coutant <ccoutant@google.com>
3047
3048 * layout.cc (Layout::set_relocatable_section_offsets): Don't
3049 allocate space in file for BSS sections.
3050
2199fbe7
CC
30512013-04-15 Cary Coutant <ccoutant@google.com>
3052
3053 * script-sections.cc (Orphan_output_section): Reset address
3054 to zero after each orphaned section for relocatable links.
3055
502e8a84
CC
30562013-04-15 Cary Coutant <ccoutant@google.com>
3057
a4034750
AM
3058 * symtab.cc (Symbol_table::sized_write_globals): Subtract
3059 section starting address for relocatable link.
3060 * testsuite/Makefile.am (script_test_11): New test.
3061 * testsuite/Makefile.in: Regenerate.
3062 * testsuite/script_test_11.c: New source file.
3063 * testsuite/script_test_11.t: New linker script.
502e8a84 3064
0cfdc767
AM
30652013-04-13 Alan Modra <amodra@gmail.com>
3066
3067 * powerpc.cc (Stub_control::can_add_to_stub_group): Don't set
3068 owner when sections are not adjacent and exceed group size.
3069 (Target_powerpc::group_sections): Handle corner case.
3070 (Target_powerpc::Branch_info::make_stub): Handle case where
3071 stub table doesn't exist due to branches in non-exec sections.
3072 (Target_powerpc::Relocate::relocate): Likewise.
3073
6830ee24
AM
30742013-04-11 Alan Modra <amodra@gmail.com>
3075
3076 PR gold/15354
3077 * powerpc.cc (Target_powerpc::make_brlt_section): Name section
3078 .branch_lt to match bfd ld. Adjust comments throughout file.
3079
54a3d865
ILT
30802013-04-04 Ian Lance Taylor <iant@google.com>
3081
3082 GCC PR c++/56840
3083 * object.cc (do_layout_deferred_sections): Handle .eh_frame
3084 sections before checking whether they are included in the link.
3085
9993ba11
ST
30862013-03-29 Sriraman Tallam <tmsriram@google.com>
3087
3088 * archive.cc (Archive::get_elf_object_for_member): Create the elf
3089 object before calling the plugin claim_file handler. Pass the elf
3090 object of the archive to the plugin. Delete the elf object if the
3091 plugin claims the file.
3092
ebacd51e
AM
30932013-03-21 Alan Modra <amodra@gmail.com>
3094
3095 * layout.cc (Layout::set_segment_offsets): Accept writable .text
3096 segment when omagic.
3097
117be58f
AM
30982013-03-21 Alan Modra <amodra@gmail.com>
3099
3100 * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
3101 comparison warning.
3102 * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
3103 uninitialized" warning.
3104
32e2b61d
AM
31052013-03-20 Alan Modra <amodra@gmail.com>
3106
3107 * symtab.h (Symbol::clear_version): New function.
3108 * symtab.cc (Symbol_table::set_dynsym_indexes): Don't set object
3109 is_needed by weak references. Clear version for symbols defined
3110 in as-needed objects that are not needed.
3111
b3ccdeb5
AM
31122013-03-15 Alan Modra <amodra@gmail.com>
3113
3114 * powerpc.cc (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Make
3115 static and public. Add report_err param. Return false for data refs.
3116 (Target_powerpc::rela_dyn_section): New overloaded function.
3117 (Target_powerpc::plt_, iplt_): Elucidate.
3118 (Output_data_plt_powerpc::entry_count): Handle current_data_size()==0.
3119 (Output_data_plt_powerpc::do_write): Don't write .iplt.
3120 (Output_data_plt_powerpc::plt_entry_count): Don't add .iplt entries.
3121 (Target_powerpc::Scan::local, global): Adjust reloc_needs_plt_for_ifunc
3122 calls. Put ifunc dynamic relocs in irela_dyn_section. Only
3123 push_branch and make_plt_entry for ifunc syms when
3124 reloc_needs_plt_for_ifunc.
3125 (Target_powerpc::Relocate::relocate): Don't use plt entry value
3126 for ifunc unless reloc_needs_plt_for_ifunc.
3127
ad3d8a2f
AM
31282013-03-15 Alan Modra <amodra@gmail.com>
3129
3130 * gc.h (gc_process_relocs): Don't look through function descriptors.
3131 * icf.cc (get_section_contents): Do so here instead.
3132
4d9aa155
AM
31332013-03-13 Alan Modra <amodra@gmail.com>
3134
3135 * powerpc.cc (is_branch_reloc): Forward declare.
3136 (Target_powerpc::do_can_check_for_function_pointers): New predicate.
3137 (Target_powerpc::Scan::local_reloc_may_be_function_pointer): Return
3138 false for 64-bit, true for 32-bit non-branch relocs.
3139 (Target_powerpc::Scan::global_reloc_may_be_function_pointer): Likewise.
3140 * testsuite/Makefile.am (icf_test): Use linker map file instead of
3141 nm output.
3142 (icf_safe_test): Generate linker map file as well as nm output.
3143 (icf_safe_so_test): Likewise.
3144 * testsuite/Makefile.in: Regenerate.
3145 * testsuite/icf_test.sh: Parse linker map file to determine
3146 section folding.
3147 * testsuite/icf_safe_test.sh: Likewise. Expect folding for PowerPC.
3148 * testsuite/icf_safe_so_test.sh: Likewise.
3149 (X86_32_or_ARM_specific_safe_fold): Merge into..
3150 (arch_specific_safe_fold): ..this.
3151 (X86_64_specific_safe_fold): Delete unused function.
3152
57420c20
AM
31532013-03-12 Alan Modra <amodra@gmail.com>
3154
3155 * gc.h (gc_process_relocs): Look through function descriptors
3156 to determine shndx, symvalue and addend used by ICF. Tidy
3157 variable duplication.
3158
dc3714f3
AM
31592013-03-11 Alan Modra <amodra@gmail.com>
3160
3161 * gold.cc (queue_middle_tasks): Move detect_odr_violations..
3162 * layout.cc (Layout_task_runner::run): ..to here.
3163 * symtab.h (struct Symbol_location): Extract from..
3164 (class Symbol_table): ..here.
3165 * symtab.cc (Symbol_table::linenos_from_loc): Invoke function_location.
3166 * target.h (class Target): Add function_location and
3167 do_function_location functions.
3168 (class Sized_target): Add do_function_location.
3169 * object.h (class Sized_relobj_file): Move find_shdr..
3170 (class Object): ..to here.
3171 * object.cc: Likewise. Update to suit. Instantiate.
3172 (Sized_relobj_file::find_eh_frame): Update find_shdr call.
3173 * powerpc.cc (class Powerpc_dynobj): New.
3174 (Target_powerpc::do_function_location): New function.
3175 (Powerpc_relobj::do_find_special_sections): Update find_shdr call.
3176 (Powerpc_dynobj::do_read_symbols): New function.
3177 (Target_powerpc::do_make_elf_object): Make a Powerpc_dynobj.
3178
956b03bb
ILT
31792013-03-08 Ian Lance Taylor <iant@google.com>
3180
3181 * options.cc (General_options::string_to_object_format): Accept
3182 "default".
3183
4bead2d5
AM
31842013-03-08 Alan Modra <amodra@gmail.com>
3185
3186 * ehframe.h (Post_fdes) Make it a vector of Post_fde rather than
3187 pointer to Post_fde.
3188 (struct Post_fde): Move definition to here..
3189 * ehframe.cc (struct Post_fde): ..from here.
3190 (Cie::write): Don't alloc Post_fde.
3191 (Eh_frame::do_sized_write): Update. Don't free Post_fde.
3192
02e60bf7
AM
31932013-03-07 Alan Modra <amodra@gmail.com>
3194
3195 * testsuite/discard_locals_relocatable_test.c: Add a powerpc
3196 relocation referencing .LC0.
3197 * testsuite/discard_locals_test.sh: Remove FIXMEs.
3198
8343f03a
AM
31992013-03-07 Alan Modra <amodra@gmail.com>
3200
3201 * testsuite/ifunc-sel.h (ifunc_sel, ifunc_one): Mark
3202 always_inline. Add assembly for powerpc to avoid GOT.
3203
3366d57c
AM
32042013-03-07 Alan Modra <amodra@gmail.com>
3205
3206 * testsuite/script_test_10.sh: Don't test .bss section
3207 header number.
3208
6c77229c
AM
32092013-03-06 Alan Modra <amodra@gmail.com>
3210
3211 * powerpc.cc (class Powerpc_relobj): Move some member functions.
3212 (Target_powerpc::symval_for_branch): Add symtab param. Update
3213 all callers. Handle folded sections.
3214 (Target_powerpc::do_gc_add_reference): Don't cast dynamic object
3215 to Powerpc_relobj.
3216 (Global_symbol_visitor_opd::operator()): Likewise.
3217
a39e4af6
AM
32182013-03-04 Alan Modra <amodra@gmail.com>
3219
3220 * testsuite/Makefile.am (final_layout_script.lds): Add .sbss.
3221 * testsuite/Makefile.in: Regenerate.
3222
d5834edb
CC
32232013-03-01 Cary Coutant <ccoutant@google.com>
3224
3225 Add dwp support for v2 DWARF package file format.
3226 * dwarf_reader.cc (Dwarf_info_reader::visit_type_unit): Add
3227 tu_length parameter. Adjust all callers.
3228 * dwarf_reader.h (Dwarf_info_reader::visit_type_unit): Likewise.
3229 * dwp.cc: Include dwarf.h.
3230 (Section_bounds): New struct type.
3231 (Unit_set): New struct type.
3232 (Dwo_file::Dwo_file): Initialize new data member.
3233 (Dwo_file::read_compunit_index, Dwo_file::read_typeunit_index):
3234 Combine and rename to...
3235 (Dwo_file::read_unit_index): ...this.
3236 (Dwo_file::sized_read_compunit_index)
3237 (Dwo_file::sized_read_typeunit_index): Combine and rename to...
3238 (Dwo_file::sized_read_unit_index): ...this.
3239 (Dwo_file::copy_section): Remove section_name, is_str_offsets
3240 parameters; add section_id parameter.
3241 (Dwo_file::add_cu_set, Dwo_file::add_tu_set): Combine and rename to...
3242 (Dwo_file::add_unit_set): ...this.
3243 (Dwo_file::shndx_map_): Remove.
3244 (Dwo_file::sect_offsets_): New data member.
3245 (Dwp_output_file::Dwp_output_file): Initialize new data members.
3246 (Dwp_output_file::add_section): Rename to...
3247 (Dwp_output_file::add_contribution): ...this.
3248 (Dwp_output_file::add_cu_set): Combine parameters into a struct.
3249 (Dwp_output_file::add_tu_set): Likewise.
3250 (Dwp_output_file::Contribution): New type.
3251 (Dwp_output_file::Section::contributions): New data member.
3252 (Dwp_output_file::Cu_or_tu_set): Remove.
3253 (Dwp_output_file::Section::Section): New ctor.
3254 (Dwp_output_file::Dwp_index::Shndx_pool): Remove.
3255 (Dwp_output_file::Dwp_index::Section_table): New type.
3256 (Dwp_output_file::Dwp_index::Dwp_index): Initialize new data members.
3257 (Dwp_output_file::Dwp_index::enter_set): Change type of "set"
3258 parameter.
3259 (Dwp_output_file::Dwp_index::shndx_pool): Remove.
3260 (Dwp_output_file::Dwp_index::shndx_pool_end): Remove.
3261 (Dwp_output_file::Dwp_index::section_table): New member function.
3262 (Dwp_output_file::Dwp_index::section_table_end): New member function.
3263 (Dwp_output_file::Dwp_index::shndx_pool_size): Remove.
3264 (Dwp_output_file::Dwp_index::section_table_rows): New member function.
3265 (Dwp_output_file::Dwp_index::section_table_cols): New member function.
3266 (Dwp_output_file::Dwp_index::shndx_pool_): Remove.
3267 (Dwp_output_file::Dwp_index::section_table_): New data member.
3268 (Dwp_output_file::Dwp_index::section_mask_): New data member.
3269 (Dwp_output_file::add_output_section): New member function.
3270 (Dwp_output_file::write_new_section): New member function.
3271 (Dwp_output_file::write_contributions): New member function.
3272 (Dwp_output_file::section_id_map_): New data member.
3273 (class Dwo_id_info_reader): Remove.
3274 (class Unit_reader): New class.
3275 (get_dwarf_section_name): New function.
3276 (Dwo_file::read_executable): Adjust initializations of class data.
3277 (Dwo_file::read): Add support for v2 package file format.
3278 (Dwo_file::read_unit_index): Likewise.
3279 (Dwo_file::sized_read_unit_index): Likewise.
3280 (Dwo_file::copy_section): Likewise.
3281 (Dwo_file::add_unit_set): Likewise.
3282 (Dwp_output_file::add_output_section): Likewise.
3283 (Dwp_output_file::add_contribution): Likewise.
3284 (Dwp_output_file::Dwp_index::find_or_add): Use row index to check
3285 for empty slot.
3286 (Dwp_output_file::Dwp_index::enter_set): Add support for v2 package
3287 file format.
3288 (Dwp_output_file::Dwp_index::grow): Use row index to check for empty
3289 slot.
3290 (Dwp_output_file::initialize): Remove unused function.
3291 (Dwp_output_file::finalize): Add support for v2 package file format.
3292 (Dwp_output_file::write_index): Likewise.
3293 * gdb-index.cc (Gdb_index_info_reader::visit_type_unit): Adjust
3294 function prototype.
3295
a68a081d
CC
32962013-03-01 Cary Coutant <ccoutant@google.com>
3297
3298 * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
3299 function into class definition in header file.
3300 (Dwarf_info_reader::warn_corrupt_debug_section): New function.
3301 * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
3302 New function.
3303 (Dwarf_info_reader::check_buffer): Move here from .cc file.
3304
9d5781f8
AM
33052013-02-28 Alan Modra <amodra@gmail.com>
3306
3307 * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
3308 * target.cc (Target::do_plt_fde_location): New function.
3309 * ehframe.h (class FDE): Add post_map field to u_.from_linker,
3310 accessor function, and constructor param.
3311 (struct Post_fde, Post_fdes): Declare.
3312 (Cie::write): Add post_fdes param.
3313 * ehframe.cc (Fde::write): Use plt_fde_location.
3314 (struct Post_fde): Define.
3315 (Cie::write): Stash FDEs added post merge mapping.
3316 (Eh_frame::add_ehframe_for_plt): Assert no new CIEs after mapping.
3317 Adjust Fde constructor call. Bump final_data_size_ for post map FDEs.
3318 (Eh_frame::do_sized_write): Arrange to write post map FDES after
3319 other FDEs.
3320 * powerpc.cc (Target_powerpc::do_plt_fde_location): New function.
3321 (Target_powerpc::has_glink): New function.
3322 (Target_powerpc::do_relax): Add eh_frame info for stubs.
3323 (struct Eh_cie, eh_frame_cie, glink_eh_frame_fde_64,
3324 glink_eh_frame_fde_32, default_fde): New data.
3325 (Stub_table::eh_frame_added_): New var.
3326 (Stub_table::find_long_branch_entry, stub_address, stub_offset):
3327 Make const.
3328 (Stub_table::add_eh_frame): New function.
3329 (Output_data_glink::add_eh_frame): New function.
3330 (Target_powerpc::make_glink_section): Call add_eh_frame.
3331
214383dd
ILT
33322013-02-15 Ian Lance Taylor <iant@google.com>
3333
3334 * options.h (DEFINE_uint64_alias): Define.
3335 (class General_options): Add -Ttext-segment as an alias for
3336 -Ttext.
3337
91c2b899
AM
33382013-02-15 Alan Modra <amodra@gmail.com>
3339
3340 * powerpc.cc (Stub_table::plt_off): New function, extracted from..
3341 (Stub_table::do_write): ..here, two places.
3342 (Stub_table::plt_call_size): Use it here too.
3343
20e2a8aa
ILT
33442013-02-11 Ian Lance Taylor <iant@google.com>
3345
3346 * descriptors.cc (Descriptors::close_all): New function.
3347 * descriptors.h (class Descriptors): Declare close_all.
3348 (close_all_descriptors): New inline function.
3349 * plugin.cc: Include "descriptors.h".
3350 (Plugin_manager::cleanup): Call close_all_descriptors.
3351
8952bc69
AM
33522013-02-06 Alan Modra <amodra@gmail.com>
3353
3354 * README: Update coding style link.
3355
29bd8b6b
CC
33562013-01-28 Cary Coutant <ccoutant@google.com>
3357
a4034750
AM
3358 * dwp.cc (File_list): New typedef.
3359 (Dwo_name_info_reader): New class.
3360 (Dwo_id_info_reader::Dwo_id_info_reader): Remove unused parameters.
3361 (Dwo_id_info_reader::visit_top_die): Remove unused member function.
3362 (Dwo_file::~Dwo_file): Delete input_file_ after obj_.
3363 (Dwo_file::read_executable): New function.
3364 (Dwo_file::read): Move common setup code to ...
3365 (Dwo_file::make_object): ... here.
3366 (dwp_options): Add --exec/-e.
3367 (usage): Likewise.
3368 (main): Likewise.
29bd8b6b 3369
c6ac678d
ST
33702013-01-24 Sriraman Tallam <tmsriram@google.com>
3371
3372 * layout.cc (Layout::layout): Check for option text_reorder.
3373 (Layout::make_output_section): Ditto.
3374 * options.h (text_reorder): New option.
3375 * output.cc (Input_section_sort_compare): Remove special ordering
3376 of section names.
3377 (Output_section::
3378 Input_section_sort_section_name_special_ordering_compare::
3379 operator()): New function.
3380 (Output_section::sort_attached_input_sections): Use new sort function
3381 for .text.
3382 * output.h (Input_section_sort_section_name_special_ordering_compare):
3383 New struct.
3384 * testsuite/Makefile.am (text_section_grouping): Test option
3385 --no-text-reorder
3386 * testsuite/Makefile.in: Regenerate.
3387 * testsuite/text_section_grouping.sh: Check order of functions without
3388 default text reordering.
3389
50701cc1
MF
33902013-01-18 Mike Frysinger <vapier@gentoo.org>
3391
3392 * options.h (General_options): Change default to true for new_dtags.
3393
b1b00fcc
MF
33942013-01-18 Mike Frysinger <vapier@gentoo.org>
3395
3396 * layout.cc (Layout::finish_dynamic_section): Only add DT_RPATH
3397 when enable_new_dtags is false. Only add DT_RUNPATH when
3398 enable_new_dtags is true.
3399
ec5b8187
AM
34002013-01-17 Serge Pavlov <serge.v.pavlov@gmail.com>
3401
3402 * powerpc.cc (Stub_table::find_plt_call_entry): Make types
3403 used in declaration and definition consistent.
3404 (Target_powerpc::symval_for_branch): Ditto.
3405
a880d4c4
ST
34062013-01-16 Sriraman Tallam <tmsriram@google.com>
3407
3408 * testsuite/plugin_final_layout.cc: Fix comment.
3409
7c381248
ST
34102013-01-16 Sriraman Tallam <tmsriram@google.com>
3411
3412 * layout.cc (Layout::layout): Do not do default sorting for
3413 text sections when section ordering is specified.
3414 (make_output_section): Ditto.
3415 * testsuite/plugin_final_layout.cc: Name the function sections
3416 to catch reordering issues.
3417
e2458743
AM
34182013-01-15 Alan Modra <amodra@gmail.com>
3419
3420 * powerpc.cc (Target_powerpc::do_relax): Default shared libs to
3421 plt-thread-safe.
3422
431ed302
AM
34232013-01-15 Alan Modra <amodra@gmail.com>
3424
3425 * testsuite/Makefile.am (final_layout_script.lds): Handle .got section.
3426 * testsuite/Makefile.in: Regenerate.
3427
0ec6429b
AM
34282013-01-14 Alan Modra <amodra@gmail.com>
3429
3430 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add various output files.
3431 * testsuite/Makefile.in: Regenerate.
3432
0bf402d5
ILT
34332013-01-11 Pavel Chupin <pavel.v.chupin@intel.com>
3434
36af3926 3435 PR bfd/14430
0bf402d5
ILT
3436 Fix mingw gold build with plugins enabled
3437 * Makefile.am: Replace -ldl with @DLOPEN_LIBS@.
3438 * configure.ac: Export DLOPEN_LIBS and add headers check.
3439 * plugin.cc: Handle non-dlfcn case.
3440 * Makefile.in: Regenerate.
3441 * config.in: Regenerate.
3442 * configure: Regenerate.
3443 * testsuite/Makefile.in: Regenerate.
3444
9e9143bc
ST
34452013-01-09 Sriraman Tallam <tmsriram@google.com>
3446
3447 * output.h (sort_attached_input_sections): Change to be public.
3448 * script-sections.cc
3449 (Output_section_definition::set_section_addresses): Sort
3450 attached input sections according to section order before linker
3451 script assigns section addresses.
3452 (Orphan_output_section::set_section_addresses): Sort
3453 attached input sections according to section order before linker
3454 script assigns section addresses.
3455 * Makefile.am (final_layout.sh): Use a simple linker script to
3456 check if section ordering still works.
3457 * Makefile.in: Regenerate.
3458
679af368
ILT
34592013-01-09 Ben Cheng <bccheng@google.com>
3460
3461 * arm.cc (Target_arm::attributes_accept_div): New function.
3462 (Target_arm::attributes_forbid_div): New function.
3463 (Target_arm::merge_object_attributes): Merge the Tag_DIV_use
3464 attribute using the same new functions as what bfd/elf32_arm.c
3465 does.
3466
3136a00e
CC
34672013-01-07 Cary Coutant <ccoutant@google.com>
3468
3469 PR gold/14993
3470 * output.cc (Output_section::add_input_section): For incremental
3471 updates, don't track input sections that are allocated from patch
3472 space.
3473
f2a6224b
L
34742013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3475 Ian Lance Taylor <iant@google.com>
3476
3477 PR gold/14897
3478 * configure.ac (--enable-ld): Removed.
3479 (install_as_default): Set to yes only for --enable-gold=default
3480 or --disable-ld.
3481 * configure: Regenerated.
3482
4f46f626
L
34832013-01-07 H.J. Lu <hongjiu.lu@intel.com>
3484
3485 * options.h (General_options): Add -fuse-ld= for GCC linker
3486 option compatibility.
3487
26e4ef59
CC
34882013-01-04 Cary Coutant <ccoutant@google.com>
3489
3490 * configure.ac: Fix typo restoring CXXFLAGS.
3491 * configure: Regenerate.
3492
3d587466
CC
34932013-01-04 Cary Coutant <ccoutant@google.com>
3494
4f46f626
L
3495 * testsuite/Makefile.am (CXXLINK_S): New macro.
3496 (debug_msg_so.err, debug_msg_ndebug.err): Use CXXLINK_S.
3497 * testsuite/Makefile.in: Regenerate.
3d587466 3498
44db6695
L
34992013-01-02 H.J. Lu <hongjiu.lu@intel.com>
3500
3501 * version.cc (print_version): Update copyright year to 2013.
3502
edcac0c1
ILT
35032012-12-20 Ian Lance Taylor <iant@google.com>
3504
3505 * layout.cc (Layout::special_ordering_of_input_section): New
3506 function.
3507 (Layout::layout): If input section requires special ordering, must
3508 sort input sections.
3509 (Layout::make_output_section): May sort .text input sections.
3510 (Layout::is_section_name_prefix_grouped): Remove.
3511 * layout.h (class Layout): Declare
3512 special_ordering_of_input_section. Don't declare
3513 is_section_name_prefix_grouped.
3514 * output.cc (Output_section::add_input_section): Revert last
3515 change.
3516 (Output_section::Input_section_sort::match_file_name): Don't crash
3517 if called on output section data.
3518 (Output_section::Input_section_sort_compare): Sort based on
3519 special ordering.
3520 (Output_section::Input_section_sort_section_order_index_compare):
3521 Revert last patch.
3522 (Output_section::sort_attached_input_sections): Likewise.
3523
28f2a4ac
ST
35242012-12-18 Sriraman Tallam <tmsriram@google.com>
3525
edcac0c1 3526 * layout.cc (Layout::is_section_name_prefix_grouped): New function.
28f2a4ac
ST
3527 * layout.h (Layout::is_section_name_prefix_grouped): New function.
3528 * output.cc (Output_section::add_input_section): Check if section
3529 name contains special prefix. Keep input sections to sort such
3530 sections.
3531 (Output_section::Input_section_sort_section_order_index_compare
3532 ::operator()): Group sections according to prefixes.
edcac0c1
ILT
3533 (Output_section::sort_attached_input_sections): Add condition to
3534 Input_section_entry constructor call.
28f2a4ac
ST
3535 * testsuite/Makefile.am (text_section_grouping): New test.
3536 * testsuite/Makefile.in: Regenerate.
3537 * testsuite/text_section_grouping.cc: New file.
3538 * testsuite/text_section_grouping.sh: New file.
3539
5bf135a7
NC
35402012-12-17 Nick Clifton <nickc@redhat.com>
3541
3542 * Makefile.am: Add copyright notice.
3543 * NEWS: Likewise.
3544 * README: Likewise.
3545 * configure.ac: Likewise.
3546 * ftruncate.c: Likewise.
3547 * Makefile.in: Regenerate.
3548
59965708
CC
35492012-12-14 Cary Coutant <ccoutant@google.com>
3550
a4034750
AM
3551 * testsuite/Makefile.am (exception_separate_shared_12_test): Add
3552 --no-as-needed flag.
3553 (exception_separate_shared_12_test): Likewise.
3554 (incremental_copy_test): Likewise.
3555 * testsuite/Makefile.in: Regenerate.
59965708 3556
2a77e2ab
CC
35572012-12-14 Cary Coutant <ccoutant@google.com>
3558
3559 * dwp.cc (Dwp_output_file::add_cu_set): Check for duplicate CUs.
3560 (Dwp_output_file::Dwp_index::enter_set): Add assert.
3561
e3deeb9c
AM
35622012-12-12 Alan Modra <amodra@gmail.com>
3563
3564 * powerpc.cc (class Track_tls): New.
3565 (class Relocate, class Scan): Inherit Track_tls.
3566 (Target_powerpc::Scan::local, global): Track tls optimization
3567 and avoid creating plt entry for __tls_get_addr if all uses
3568 are optimized away.
3569 (Target_powerpc::Relocate::relocate): Update to use Track_tls.
3570
d8f5a274
AM
35712012-12-12 Alan Modra <amodra@gmail.com>
3572
3573 * options.h (General_options): Add --toc-sort/--no-toc-sort.
3574 Replace no_toc_optimize with toc_optimize.
3575 * output.h (Output_section::input_sections): Provide non-const variant.
3576 * powerpc.cc (Powerpc_relobj::has_small_toc_reloc_,
3577 set_has_small_toc_reloc, has_small_toc_reloc): New variable and
3578 accessors.
3579 (Target_powerpc::Scan::local, global): Call set_has_small_toc_reloc.
3580 (class Sort_toc_sections): New.
3581 (Target_powerpc::do_finalize_sections): Sort toc sections.
3582 (Target_powerpc::Relocate::relocate): Update toc_optimize test.
3583
4c8a1de1
RM
35842012-12-10 Roland McGrath <mcgrathr@google.com>
3585
3586 * testsuite/binary_unittest.cc (read_all): New function.
3587 (Sized_binary_test): Use it instead of ::read.
3588 * fileread.cc (do_read): Don't assume pread always reads the whole
3589 amount in a single call.
3590
edc27beb
AM
35912012-12-10 Alan Modra <amodra@gmail.com>
3592
3593 * powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
3594 Set EM_PPC64 or EM_PPC here.
3595 (Target_selector_powerpc::do_recognize): Delete.
3596
906b9150
AM
35972012-12-10 Alan Modra <amodra@gmail.com>
3598
3599 * powerpc.cc (Powerpc_relobj::Powerpc_relobj): Init has14_ and
3600 stub_table_.
3601 (Target_powerpc::Branch_info::make_stub): Don't omit addend.
3602
418c15ae
RM
36032012-12-07 Roland McGrath <mcgrathr@google.com>
3604
3605 * testsuite/binary_unittest.cc (Sized_binary_test):
3606 Use open_descriptor rather than ::open.
3607
decdd3bc
AM
36082012-12-07 Alan Modra <amodra@gmail.com>
3609
3610 * powerpc.cc (Stub_table::do_write): Delete redundant Address
3611 typedef and invalid_address constant.
3612 (Output_data_glink, Stub_table, Target_powerpc): Explicitly
3613 instantiate constants.
3614
db399005
ILT
36152012-12-06 Roland McGrath <mcgrathr@google.com>
3616
3617 * configure.ac (HAVE_ZLIB): Use AM_ZLIB instead of AC_SEARCH_LIBS.
3618 Use $ac_cv_header_zlib_h = yes as the condition in AM_CONDITIONAL.
3619 * aclocal.m4: Regenerate.
3620 * configure: Regenerate.
3621 * Makefile.in: Regenerate.
3622 * testsuite/Makefile.in: Regenerate.
3623
aba6bc71
AM
36242012-12-07 Alan Modra <amodra@gmail.com>
3625
3626 * options.h (General_options): Add no_toc_optimize.
3627 * powerpc.cc (ok_lo_toc_insn): New function.
3628 (Target_powerpc::Relocate::relocate): Optimize toc access sequences.
3629
9e69ed50
AM
36302012-12-06 Alan Modra <amodra@gmail.com>
3631
3632 * options.h (General_options): Add plt_align, plt_static_chain,
3633 plt_thread_safe. Update stub_group_size help text.
3634 * powerpc.cc (Target_powerpc::plt_thread_safe): New access function
3635 for new plt_thread_safe_ var.
3636 (use_plt_offset): Correct comments.
3637 (Target_powerpc::do_relax): Look for thread creation symbols to
3638 determine default plt_thread_safe value. Clear plt call stubs
3639 as well as branch stubs each iteration.
3640 (add_2_2_11, add_12_12_11, bnectr_p4, cmpldi_2_0, xor_11_11_11): New
3641 insn constants.
3642 (l, hi, ha, write_insn): Move earlier.
3643 (Stub_table): Delete prev_size, add last_plt_size and last_branch_size.
3644 (Stub_table::clear_stubs): Rename from clear_long_branch_stubs, clear
3645 plt stubs too.
3646 (Stub_table::update_size): Adjust.
3647 (Stub_table::prev_size, set_prev_size): Delete.
3648 (Stub_table::stub_align): Let --plt-align affect result.
3649 (Stub_table::plt_call_size): Calculate sizes for various stubs.
3650 (Stub_table::branch_stub_size): Use last_plt_size in address calc.
3651 (Stub_table::add_plt_call_stub): Pass iterator to plt_call_size.
3652 (Stub_table::do_write): Support more stub variants.
3653
f43ba157
AM
36542012-12-04 Alan Modra <amodra@gmail.com>
3655
3656 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Delete.
3657 (Target_powerpc::do_define_standard_symbols): New function.
3658
34171bc5
AM
36592012-12-03 Alan Modra <amodra@gmail.com>
3660
3661 * output.h: Formatting, whitespace.
3662
dc9589e9 36632012-12-03 Alan Modra <amodra@gmail.com>
ec661b9d
AM
3664
3665 * layout.h (Layout::get_executable_sections): Declare.
3666 * layout.cc (Layout::get_executable_sections): New function.
3667 * arm.cc (Target_arm::group_sections): Use it.
3668 (Arm_output_section::group_sections): Delete now redundant test.
3669 * output.cc (Output_reloc::Output_reloc): Add is_relative.
3670 param to handle relative relocs.
3671 * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise.
3672 (Output_data_reloc::add_absolute): Adjust.
3673 (Output_data_reloc::add_relative): New function.
3674 (Output_data::reset_data_size): New function.
3675 (Output_relaxed_input_section::set_relobj, set_shndx): New functions.
3676 (Output_section::set_addralign): New function.
3677 (Output_section::checkpoint_set_addralign): New function.
3678 (Output_section::clear_section_offsets_need_adjustment): New function.
3679 (Output_section::input_sections): Make public.
3680 * powerpc.cc (class Output_data_brlt_powerpc): New.
3681 (class Stub_table, class Stub_control): New.
3682 (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch,
3683 stub_table_, set_stub_table, stub_table): New vectors and accessor
3684 functions.
3685 (Target_powerpc::do_may_relax, do_relax, push_branch,
3686 new_stub_table, stub_tables, brlt_section, group_sections,
3687 add_branch_lookup_table, find_branch_lookup_table,
3688 write_branch_lookup_table, make_brlt_section): New functions.
3689 (Target_powerpc::struct Sort_sections, class Branch_info): New.
3690 (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_,
3691 branch_info_): New vars.
3692 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't
3693 make call stubs here.
3694 (Output_data_glink): Remove all call stub handling from this class.
3695 (Target_powerpc::Scan::local, global): Save interesting branch
3696 relocs and relocs for ifunc. Adjust calls to plt entry functions.
3697 (Target_powerpc::do_finalize_sections): Only make reg save/restore
3698 functions on final link.
3699 (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs.
3700 Handle long branch destinations too.
3701 (Target_powerpc::do_dynsym_value, do_plt_address_for_global,
3702 do_plt_address_for_local): Adjust lookup of plt call stubs.
3703
627b30b7
AM
37042012-11-30 Alan Modra <amodra@gmail.com>
3705
3706 * powerpc.c (Target_powerpc::Scan::global): Don't emit relative
3707 relocs against protected symbols when building 32-bit shared libs.
3708
40b469d7
AM
37092012-11-30 Alan Modra <amodra@gmail.com>
3710
3711 * powerpc.cc (Target_powerpc::make_plt_section): Add symtab
3712 param. Call got_section() to make .got. Update all callers
3713 and their callers and so on.
3714
bb66a627
AM
37152012-11-30 Alan Modra <amodra@gmail.com>
3716
3717 * powerpc.cc (Powerpc_relobj::do_scan_relocs): Make STB_LOCAL
3718 _GLOBAL_OFFSET_TABLE_ rather than STB_WEAK.
3719 (Output_data_got_powerpc::make_header): Update _GLOBAL_OFFSET_TABLE_
3720 value if it already exists.
3721
d2cf1c6c
L
37222012-11-19 H.J. Lu <hongjiu.lu@intel.com>
3723
3724 PR gold/14858
3725 * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
3726
edccdf7c
RM
37272012-11-14 Roland McGrath <mcgrathr@google.com>
3728
3729 * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
3730 than bfc instruction for data sandboxing.
3731
6febeb74
AM
37322012-11-08 Alan Modra <amodra@gmail.com>
3733
3734 * po/POTFILES.in: Regenerate.
3735
0a6f1bf2
AM
37362012-11-05 Alan Modra <amodra@gmail.com>
3737
3738 * configure.ac: Apply 2012-09-10 change to config.in here.
3739 * configure: Regenerate.
3740
26a4e9cb
AM
37412012-11-05 Alan Modra <amodra@gmail.com>
3742
3743 * powerpc.cc (Powerpc_relobj): Delete "Offset" typedef.
3744 (struct Opd_ent): Use "Address" rather than "Offset".
3745 (Output_data_got_powerpc::got_base_offset): Return Valtype.
3746 (Target_powerpc::got_section): Make public.
3747 (Target_powerpc::scan_relocs): Move code setting symbols..
3748 (Powerpc_relobj::do_scan_relocs): ..to here, new function.
3749 Create _SDA_BASE_ only when referenced.
3750
cc928013
RM
37512012-11-02 Roland McGrath <mcgrathr@google.com>
3752
3753 * i386.cc (Target_i386::relocate_relocs): Remove extraneous typename
3754 from last change.
3755
50ed5eb1
RM
37562012-11-01 Roland McGrath <mcgrathr@google.com>
3757
62fe925a
RM
3758 * target.h (Sized_target::relocate_relocs): Use Elf_Off
3759 for offset_in_output_section parameter.
3760 (Sized_target::relocate_special_relocatable): Likewise.
3761 * arm.cc (Target_arm::relocate_relocs): Likewise.
3762 (Target_arm::relocate_special_relocatable): Likewise.
3763 * i386.cc (Target_i386::relocate_relocs): Likewise.
3764 * powerpc.cc (Target_powerpc::relocate_relocs): Likewise.
3765 * sparc.cc (Target_sparc::relocate_relocs): Likewise.
3766 * target-reloc.h (relocate_relocs): Likewise.
3767 * testsuite/testfile.cc (Target_test): Likewise.
3768 * tilegx.cc (Target_tilegx::relocate_relocs): Likewise.
3769 * x86_64.cc (Target_x86_64::relocate_relocs): Likewise.
3770
3771 * system.h: Move inclusion of <clocale> to after <libintl.h> in
3772 [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section.
3773
3774 * descriptors.cc (set_close_on_exec): Add ATTRIBUTE_UNUSED to the
3775 parameter, which is unused in the [!F_SETFD] case.
3776
50ed5eb1
RM
3777 * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast
3778 SYMNDX to off_t before comparing it to this->data_size().
3779 * output.cc (Output_symtab_xindex::endian_do_write): Likewise.
3780 * incremental.cc (Output_section_incremental_inputs::do_write):
3781 Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE.
3782
2cadc0bf
RM
3783 * nacl.cc: Include "libiberty.h" for vasprintf declaration.
3784
3bfcb652
NC
37852012-10-30 Steve McIntyre <steve.mcintyre@linaro.org>
3786
3787 * gold.cc (Target_arm::do_adjust_elf_header): Add the
3788 hard-float/soft-float ABI flag as appropriate for ET_DYN/ET_EXEC
3789 in EABI_VER5.
3790
c1a8d56e
CC
37912012-10-29 Cary Coutant <ccoutant@google.com>
3792
3793 * dwp.cc (usage): Add file and exit status parameters;
3794 add --help and --version options.
3795 (print_version): New function.
3796 (main): Add --help and --version options.
3797
b2490a7b
L
37982012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3799
3800 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add
3801 final_layout_sequence.txt.
3802 * testsuite/Makefile.in: Regenerated.
3803
aa543512
L
38042012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3805
3806 * testsuite/Makefile.am (COMPILE1): New variable. Renamed from
3807 COMPILE generated by automake.
3808 (LINK1): Likewise.
3809 (CXXCOMPILE1): Likewise.
3810 (CXXLINK1): Likewise.
3811 (COMPILE): Strip out -Wp,-D_FORTIFY_SOURCE= from COMPILE1.
3812 (LINK): Likewise.
3813 (CXXCOMPILE): Likewise.
3814 (CXXLINK): Likewise.
3815 * testsuite/Makefile.in: Regenerated.
3816
d361fafb
L
38172012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3818
3819 * dwp.cc (Dwo_file::record_target_info): Issue a fatal error
3820 on bad fwrite return.
3821
598c7410
L
38222012-10-25 H.J. Lu <hongjiu.lu@intel.com>
3823
3824 * dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
3825 on val.
3826
35c813e2
CC
38272012-10-23 Cary Coutant <ccoutant@google.com>
3828
3829 * testsuite/Makefile.am (TEST_OBJCOPY): New macro.
3830 * testsuite/Makefile.in: Regenerate.
3831 * testsuite/dwp_test.h: New source file.
3832 * testsuite/dwp_test_1.cc: New source file.
3833 * testsuite/dwp_test_1.s: New source file.
3834 * testsuite/dwp_test_1.sh: New source file.
3835 * testsuite/dwp_test_1b.cc: New source file.
3836 * testsuite/dwp_test_1b.s: New source file.
3837 * testsuite/dwp_test_2.cc: New source file.
3838 * testsuite/dwp_test_2.s: New source file.
3839 * testsuite/dwp_test_2.sh: New source file.
3840 * testsuite/dwp_test_main.cc: New source file.
3841 * testsuite/dwp_test_main.s: New source file.
3842
77429909
CC
38432012-10-23 Cary Coutant <ccoutant@google.com>
3844
3845 * dwp.h: New header file.
3846 * dwp.cc: New source file.
3847 * gold.h: Move shared declarations to system.h.
3848 * system.h: New header file.
3849 * Makefile.am: Add dwp.
3850 * Makefile.in: Regenerate.
3851
ed5d6712
CC
38522012-10-23 Cary Coutant <ccoutant@google.com>
3853
3854 * dwarf_reader.cc (Dwarf_ranges_table::read_range_list): Call
3855 Dwarf_info_reader::read_from_pointer.
3856 (Dwarf_pubnames_table::read_header): Likewise.
3857 (Dwarf_pubnames_table::next_name): Likewise.
3858 (Dwarf_die::read_attributes): Likewise.
3859 (Dwarf_die::skip_attributes): Likewise.
3860 (Dwarf_info_reader::read_from_pointer): New function template.
3861 * dwarf_reader.h (Dwarf_ranges_table): Add dwinfo_.
3862 (Dwarf_pubnames_table): Likewise.
3863 (Dwarf_info_reader::read_from_pointer): New function template.
3864 * gdb-index.cc (Gdb_index_info_reader): Adjust call to
3865 Dwarf_pubnames_table ctor.
3866
8787852d
CC
38672012-10-23 Cary Coutant <ccoutant@google.com>
3868
3869 * dwarf_reader.cc (Dwarf_info_reader::do_parse): Use stored
3870 abbrev_shndx.
3871 * dwarf_reader.h (Dwarf_info_reader::Dwarf_info_reader): Initialize
3872 abbrev_shndx_.
3873 (Dwarf_info_reader::set_abbrev_shndx): New method.
3874 (Dwarf_info_reader::abbrev_shndx_): New data member.
3875
9fc236f3
CC
38762012-10-23 Cary Coutant <ccoutant@google.com>
3877
3878 * dwarf_reader.cc (make_elf_reloc_mapper): Check size and endianness
3879 from object, not parameters.
3880 (Dwarf_info_reader::parse): Likewise.
3881 * object.h (Relobj::elfsize, Relobj::is_big_endian): New methods.
3882 (Relobj::do_elfsize, Relobj::do_is_big_endian): New methods.
3883 (Sized_relobj::do_elfsize, Sized_relobj::do_is_big_endian): New
3884 methods.
3885
effe8365
CC
38862012-10-23 Cary Coutant <ccoutant@google.com>
3887
3888 * fileread.cc (Input_file::Input_file): New constructor.
3889 * fileread.h (class Input_file): Add new constructor.
3890
1698990d
AM
38912012-10-18 Alan Modra <amodra@gmail.com>
3892
3893 PR gold/14727
3894 * object.cc (Relobj::is_section_name_included): Also match
3895 .sdata personality section.
3896
168a4726
AM
38972012-10-18 Alan Modra <amodra@gmail.com>
3898
3899 * target-reloc.h (class Default_comdat_behavior): New, package up..
3900 (get_comdat_behaviour): ..this.
3901 (relocate_section): Add Relocate_comdat_behavior template arg,
3902 adjust code to suit.
3903 * arm.cc (Target_arm::relocate_section): Adjust to suit.
3904 (Target_arm::scan_reloc_section): Likewise.
3905 * i386.cc (Target_i386::relocate_section): Likewise.
3906 * sparc.cc (Target_sparc::relocate_section): Likewise.
3907 * tilegx.cc (Target_tilegx::relocate_section): Likewise.
3908 * x86_64.cc (Target_x86_64::relocate_section): Likewise.
3909 * powerpc.cc (class Relocate_comdat_behavior): New.
3910 (Target_powerpc::relocate_section): Don't zap opd relocs. Supply
3911 gold::relocate_section with new template arg.
3912
acc276d8
AM
39132012-10-18 Alan Modra <amodra@gmail.com>
3914
3915 * powerpc.cc (Target_powerpc::Scan::local, global): Always emit
3916 dynamic relocs for GOT_TPREL got entries, without symbol if
3917 resolving locally.
3918 (Target_powerpc::do_gc_add_reference): Don't add for dynamic objects.
3919 (Target_powerpc::scan_relocs): Define _GLOBAL_OFFSET_TABLE_ early.
3920 (Target_powerpc::Relocate:relocate): REL32 reloc may be unaligned.
3921
e10f9870
AM
39222012-10-17 Alan Modra <amodra@gmail.com>
3923
3924 PR gold/14726
3925 * gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
3926
ae034989
ST
39272012-10-16 Sriraman Tallam <tmsriram@google.com>
3928
3929 * layout.cc (Layout::include_section): Keep sections marked
3930 SHF_EXCLUDE when doing relocatable links.
3931
f3a0ed29
AM
39322012-10-16 Alan Modra <amodra@gmail.com>
3933
3934 * powerpc.cc (Target_powerpc::define_save_restore_funcs): New func.
3935 (Target_powerpc::do_finalize_sections): Call it.
3936 (Output_data_save_res): New class and supporting functions.
3937 (Target_powerpc::symval_for_branch): Only look up .opd entry for
3938 normal symbols defined in object files.
3939
c6de8ed4
AM
39402012-10-12 Alan Modra <amodra@gmail.com>
3941
3942 * powerpc.cc (Powerpc_relobj::add_gc_mark, process_gc_mark): New.
3943 (struct Opd_ent): Make "discard" a bit field. Add "gc_mark".
3944 (Target_powerpc::do_gc_mark_symbol): Delay marking function code
3945 section if scan_opd_relocs not yet called.
3946 (Target_powerpc::gc_process_relocs): Call process_gc_mark.
3947
03e25981
AM
39482012-10-12 Alan Modra <amodra@gmail.com>
3949
3950 * powerpc.cc (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3951 add_local_ifunc_entry): Revert last change.
3952 (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Likewise.
3953
c9824451
AM
39542012-10-05 Alan Modra <amodra@gmail.com>
3955
3956 * powerpc.cc (Target_powerpc::do_plt_address_for_local,
3957 do_plt_address_for_global): New functions.
3958 (Output_data_got_powerpc::do_write): Don't segfault when linking
3959 statically.
3960 (Output_data_plt_powerpc::add_entry, add_ifunc_entry,
3961 add_local_ifunc_entry): Return true on adding entry..
3962 (Target_powerpc::make_plt_entry): ..use to avoid unnecessary
3963 glink->add_entry call. Remove unused symtab param. Adjust calls.
3964 (Target_powerpc::make_local_ifunc_plt_entry): Likewise.
3965 (Target_powerpc::make_iplt_section): Remove symtab param. Don't
3966 set up symbols here.
3967 (Target_powerpc::do_finalize_sections): Instead set up __rela_iplt
3968 syms here. Do so even when no .iplt. Don't segfault when linking
3969 statically.
3970 (Output_data_glink::add_entry, find_entry): Rearrange params. Add
3971 new variants without reloc param.
3972 (Glink_sym_ent::Glink_sym_ent): Likewise.
3973 (Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Accept any
3974 reloc when refs will resolve to plt call stub.
3975 (Target_powerpc::Scan::local): Correct ifunc handling. Allow
3976 R_PPC_PLTREL24 to resolve locally.
3977 (Target_powerpc::Scan::global): Correct ifunc handling.
3978 (Target_powerpc::Relocate::relocate): Correct local sym glink
3979 lookup. Don't destroy "value" when we have a plt call stub,
3980 and when checking plt call validity.
3981 (Target_powerpc::do_dynsym_value): Simplify.
3982
19fec8c1
AM
39832012-10-05 Alan Modra <amodra@gmail.com>
3984
3985 * i386.cc (Output_data_plt_i386::address_for_global,
3986 address_for_local): Add plt offset to returned value. Adjust uses.
3987 * sparc.cc (Output_data_plt_sparc::address_for_global,
3988 address_for_local): Likewise.
3989 * tilegx.cc (Output_data_plt_tilegx::address_for_global,
3990 address_for_local): Likewise.
3991 * x86_64.cc (Output_data_plt_x86_64::address_for_global,
3992 address_for_local): Likewise.
3993 * target.h (Target::plt_address_for_global, plt_address_for_local):
3994 Update comment.
3995 * output.cc (Output_reloc::symbol_value): Don't add plt offset here.
3996 (Output_data_got::Got_entry::write): Nor here.
3997 * output.h: Comment fix.
3998
e867b647
WL
39992012-10-02 Jiong Wang <jiwang@tilera.com>
4000
4001 * tilegx.cc (Target_tilegx::do_finalize_sections): Adjust
4002 global_offset_table_ value for larget got.
4003 (Target_tilegx::Relocate::relocate): Handle adjusted got value.
4004
e5d5f5ed
AM
40052012-09-29 Alan Modra <amodra@gmail.com>
4006
4007 * powerpc.cc (Target_powerpc::iplt_): New output section.
4008 (Target_powerpc::iplt_section, make_iplt_section,
4009 reloc_needs_plt_for_ifunc, make_local_ifunc_plt_entry): New functions.
4010 (Target_powerpc::make_plt_entry): Handle ifunc syms.
4011 Target_powerpc::plt_entry_count): Count iplt entries too.
4012 (Output_data_plt_powerpc::Output_data_plt_powerpc): Don't create
4013 reloc section in constructor. New params.
4014 (Target_powerpc::make_plt_section): Create reloc section here instead.
4015 (Output_data_plt_powerpc::add_ifunc_entry, add_local_ifunc_entry): New
4016 functions.
4017 (Output_data_plt_powerpc::initial_plt_entry_size_, name_): New vars.
4018 (Output_data_glink::add_entry, find_entry): New functions to
4019 deal with local syms.
4020 (Glink_sym_ent): Add support for local syms.
4021 (Output_data_glink::do_write): Handle ifunc plt entries.
4022 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4023 (Target_powerpc::Scan::local, global): Handle ifunc syms.
4024 (Target_powerpc::Relocate::relocate): Likewise.
4025 (Target_powerpc::do_dynsym_value): Use glink stub, not plt entry.
4026
ec4dbad3
AM
40272012-09-25 Alan Modra <amodra@gmail.com>
4028
4029 * object.h (Sized_relobj_file::adjust_local_symbol,
4030 do_adjust_local_symbol): New functions.
4031 * object.cc (Sized_relobj_file::do_count_local_symbols): Use the above.
4032 * powerpc.cc (Powerpc_relobj::do_adjust_local_symbol): New function.
4033 (Powerpc_relobj::scan_opd_relocs): Warn on unexpected opd relocs
4034 and irregular opd entry spacing.
4035 (Powerpc_relobj::do_read_relocs): Add opd size checks.
4036 (Global_symbol_visitor_opd): New functor.
4037 (Target_powerpc::do_finalize_sections): Omit global symbols defined
4038 on deleted opd entries.
4039
5c0b3823
WL
40402012-09-15 Jiong Wang <jiwang@tilera.com>
4041
4042 * tilegx.cc: New file.
4043 * Makefile.am (TARGETSOURCES): Add tilegx.cc
4044 (ALL_TARGETOBJS): Add tilegx.$(OBJEXT)
4045 * configure.tgt: Add entries for tilegx*.
4046 * configure.ac: Likewise.
4047 * Makefile.in: Rebuild.
4048 * configure: Likewise.
4049 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Handle
4050 tilegx.
4051
bfdfa4cd
AM
40522012-09-13 Alan Modra <amodra@gmail.com>
4053
4054 * target-reloc.h (scan_relocs): Call scan.local for relocs
4055 against symbols in discarded sections. Pass is_discarded
4056 param.
4057 * arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
4058 Add is_discarded param.
4059 * powerpc (Target_powerpc::Scan::local): Likewise. Use
4060 is_discarded to flag opd entry as discarded. Don't emit dyn
4061 relocs on such entries.
4062 (Target_powerpc::Scan::global): Similarly detect and handle
4063 such opd entries.
4064 (Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
4065 opd_ent_. Update all uses.
4066 (Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
4067 (Target_powerpc::relocate_section): Zero out discarded opd
4068 entry relocs.
4069
d77a0555
ILT
40702012-09-12 Ian Lance Taylor <iant@google.com>
4071
4072 PR gold/14570
4073 * output.cc: Rename Output_data_got template parameter from size
4074 to got_size for all functions. Compile all variants of
4075 Output_data_got.
4076 (Output_data_got::Got_entry::write): Correct use of size for
4077 symbol value. Use local_is_tls rather than casting to
4078 Sized_relobj_file.
4079 * object.h (class Object): Add local_is_tls and do_local_is_tls.
4080 (class Sized_relobj_file): Add do_local_is_tls.
4081 * incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
4082
815a1205
AM
40832012-09-11 Alan Modra <amodra@gmail.com>
4084
4085 PR gold/14566
4086 * layout.cc (Layout::set_segment_offsets): When using
4087 common-page-size alignment, ensure we are on a new max-page-size
4088 page.
4089 * output.cc (Output_segment::set_section_addresses): Use
4090 abi_pagesize, not common_pagesize for relro boundary.
4091 (Output_segment::set_offset): Likewise.
4092
bd73a62d
AM
40932012-09-11 Alan Modra <amodra@gmail.com>
4094
4095 * output.h (Output_data_got::add_global_tls, add_local_tls,
4096 add_local_tls_pair): New functions.
4097 (Output_data_got::add_local_pair_with_rel): Remove second
4098 reloc param. Expand comment.
4099 (Output_data_got::Got_entry): Rename use_plt_offset_ to
4100 use_plt_or_tls_offset_, similarly for constructor param.
4101 (Output_data_got::Got_entry::write): Add got_index param.
4102 * output.cc (Output_data_got::add_global_tls, add_local_tls,
4103 add_local_tls_pair): New functions.
4104 (Output_data_got::Got_entry::write): Handle tls symbols
4105 with use_plt_or_tls_offset_ set specially.
4106 (Output_data_got::add_local_pair_with_rel): Only one reloc.
4107 (Output_data_got::do_write): Replace iterator with index, pass
4108 index to entry write function.
4109 * target.h (Target::tls_offset_for_local, tls_offset_for_global,
4110 do_tls_offset_for_local, do_tls_offset_for_global): New functions.
4111 * arm.cc (Target_arm::Scan::local): Update add_local_pair_with_rel
4112 call.
4113 * i386.cc (Target_i386::Scan::local): Likewise.
4114 * sparc.cc (Target_sparc::Scan::local): Likewise.
4115 * x86_64.cc (Target_x86_64::Scan::local): Likewise.
4116 * powerpc.cc (Target_powerpc::do_tls_offset_for_local,
4117 do_tls_offset_for_global): New functions.
4118 (Target_powerpc::Scan::local): Correct TLS relocations and got
4119 entry values.
4120 (Target_powerpc::Scan::global): Don't emit unnecessary
4121 dynamic relocations on TLS GOT entries.
4122
00716ab1
AM
41232012-09-10 Matthias Klose <doko@ubuntu.com>
4124
4125 * config.in: Disable sanity check for kfreebsd.
4126
c891b3f9
SA
41272012-09-10 Sterling Augustine <saugustine@google.com>
4128
4129 * gdb-index.cc (Gdb_index::pubnames_read): New parameter.
4130 (Gdb_index::pubtypes_read): New parameter.
4131 (Gdb_index_info_reader::read_pubnames_and_pubtypes): Add parameters
4132 to calls.
4133 * gdb-index.h (Gdb_index): New fields pubnames_object_ and
4134 pubtypes_object_.
4135
e81fea4d
AM
41362012-09-09 Alan Modra <amodra@gmail.com>
4137
4138 * target.h (Target::gc_mark_symbol, do_gc_mark_symbol): New functions.
4139 (Sized_target::gc_add_reference, do_gc_add_reference): New functions.
4140 * gc.h (gc_process_relocs): Call target gc_add_reference.
4141 * gold.cc (queue_middle_tasks): Use gc_mark_symbol on start sym.
4142 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Use gc_mark_symbol.
4143 (Symbol_table::gc_mark_symbol): Call target gc_mark_symbol. Remove
4144 unnecessary cast.
4145 * powerpc.cc (Powerpc_relobj::get_opd_ent): Rearrange parameters
4146 to cater for when we don't need code offset. Update use.
4147 (Powerpc_relobj::access_from_map_, opd_valid_): New vars.
4148 (Powerpc_relobj::access_from_map, add_reference, opd_valid,
4149 set_opd_valid): New functions.
4150 (Target_powerpc::do_gc_add_reference): New function.
4151 (Target_powerpc::gc_process_relocs): Call gc()->add_reference on
4152 stashed refs.
4153 (Target_powerpc::do_gc_mark_symbol): New function.
4154
d2d60eef
CC
41552012-09-06 Cary Coutant <ccoutant@google.com>
4156
4157 * dwarf_reader.cc (Dwarf_die::read_attributes): Add
4158 DW_FORM_GNU_addr_index and DW_FORM_GNU_str_index.
4159 (Dwarf_die::skip_attributes): Likewise.
4160 * object.cc (Read_symbols_data::~Read_symbols_data): Update comment.
4161 * testsuite/gdb_index_test.cc (inline_func_1): New function.
4162 (main): Call it.
4163 * testsuite/gdb_index_test_comm.sh: Check index for inline function.
4164
32ed4573
L
41652012-09-05 H.J. Lu <hongjiu.lu@intel.com>
4166
4167 * testsuite/script_test_3.t: Add .got.plt output section
4168 statement.
4169 * testsuite/script_test_4.t: Likewise.
4170
f4baf0d4
AM
41712012-09-05 Alan Modra <amodra@gmail.com>
4172
4173 * powerpc.cc (Powerpc_relocate_functions): Upcase enum values,
4174 update all uses and lose "enum" when using type.
4175
864a1b56
AM
41762012-09-05 Alan Modra <amodra@gmail.com>
4177
4178 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): False for powerpc.
4179 * configure: Regenerate.
4180 * testsuite/Makefile.am (final_layout.stdout): Pass --synthetic to nm.
4181 (plugin_final_layout.stdout): Likewise.
4182 (memory_test): Set page sizes to 0x1000.
4183 * testsuite/Makefile.in: Regenerate.
4184 * testsuite/discard_locals_test.sh: Add FIXME comment.
4185 * testsuite/justsyms_exec.c: Disable function test for powerpc64.
4186 * testsuite/pr14265.t: Add .got output section statement.
4187 * testsuite/script_test_2.t: Likewise.
4188 * testsuite/script_test_3.t: Likewise.
4189 * testsuite/script_test_4.t: Likewise.
4190 * testsuite/script_test_5.t: Likewise.
4191 * testsuite/script_test_6.t: Likewise.
4192 * testsuite/script_test_7.t: Likewise.
4193 * testsuite/script_test_9.t: Likewise.
4194
3ea0a085
AM
41952012-09-05 Alan Modra <amodra@gmail.com>
4196
4197 * powerpc.cc (Powerpc_relobj::get_opd_ent): Make const.
4198 (Powerpc_relocate_functions::Status): New typedef.
4199 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4200 (Target_powerpc::Scan::local): Handle REL64.
4201 (Target_powerpc::Scan::global): Likewise, and dynamic relocs
4202 for REL32 and REL64.
4203 (Target_powerpc::symval_for_branch): New function, extracted from..
4204 (Target_powerpc::Relocate::relocate): ..here. Correct plt call
4205 checks. Report overflow errors.
4206
7404fe1b
AM
42072012-09-05 Alan Modra <amodra@gmail.com>
4208
4209 * object.h (Sized_relobj_file::emit_relocs): Delete.
4210 (Sized_relobj_file::emit_relocs_reltype): Delete.
4211 * reloc.cc (Sized_relobj_file::do_relocate_sections): Call target
4212 relocate_relocs for --emit-relocs.
4213 (Sized_relobj_file::emit_relocs, emit_relocs_reltype): Delete.
4214 * output.h: Update comment.
4215 (Output_segment::first_section): New function.
4216 (Output_segment::first_section_load_address): Use first_section.
4217 * output.cc (Output_segment::first_section): New function extracted..
4218 (Output_segment::first_section_load_address): ..from here. Delete.
4219 * target-reloc.h (relocate_for_relocatable): Rename to relocate_relocs.
4220 * target.h (Sized_target::relocate_for_relocatable): Likewise.
4221 * arm.cc (Target_arm::relocate_for_relocatable): Likewise, and
4222 adjust call to target.h function.
4223 * i386.cc (Target_i386): Likewise.
4224 * sparc.cc (Target_sparc): Likewise.
4225 * x86_64.cc (Target_x86_64): Likewise.
4226 * powerpc.cc (Target_powerpc): Likewise.
4227 (Target_powerpc::Scan::local, global): Handle R_POWERPC_TLS. Ensure
4228 first tls section has section symbol for optimised local dynamic
4229 output relocs.
4230 (Target_powerpc::Relocate::relocate): Correct local dynamic value.
4231 (Target_powerpc::relocate_relocs): Adjust relocs emitted for
4232 optimised tls code.
4233 * testsuite/testfile.cc (Target_test::relocate_for_relocatable):
4234 Rename to relocate_relocs. Update error message.
4235
957564c9
AS
42362012-09-04 Andreas Schwab <schwab@linux-m68k.org>
4237
4238 * powerpc.cc (do_make_elf_object): Allow ET_EXEC files with
4239 --just-symbols.
4240
dd93cd0a
AM
42412012-08-31 Alan Modra <amodra@gmail.com>
4242
4243 * powerpc.cc (Powerpc_relobj): Add and use Address typedef.
4244 (Powerpc_relobj::toc_base_offset): New stub function.
4245 (Target_powerpc): Add tp_offset, dtp_offset. Rename
4246 got_mod_index_offset to tlsld_got_offset. Update all refs.
4247 (Target_powerpc::Relocate::enum skip_tls): New.
4248 (Target_powerpc::call_tls_get_addr_): New var.
4249 (Target_powerpc::is_branch_reloc): Move to file scope.
4250 (Target_powerpc::relocate_tls, optimize_tls_reloc): Delete.
4251 (Target_powerpc::optimize_tls_gd, optimize_tls_ld, optimize_tls_ie):
4252 New functions.
4253 (Target_powerpc::enum Got_type): Delete old values, add new ones.
4254 (powerpc_info): Correct common_pagesize for ppc64.
4255 (at_tls_transform, needs_dynamic_reloc, use_plt_offset): New functions.
4256 (Powerpc_relocate_functions): Add overflow check enums and functions.
4257 Add non-shift version of rela, rela_ua. Delete all rel public
4258 functions. Delete addr16_lo. Add addr64, addr64_u, addr32,
4259 addr32_u, addr24, addr16_u, addr16_hi2, addr16_ha2, addr16_hi3,
4260 addr16_ha3, addr14 functions.
4261 (Output_data_got_powerpc::add_constant_pair): New function.
4262 (Output_data_got_powerpc::got_base_offset): Likewise.
4263 (Output_data_got_powerpc::do_write): Correct 64-bit got header.
4264 (instruction constants): Sort, add some more.
4265 (Output_data_glink::do_write): Add and use Address typedef. Use
4266 object->toc_base_offset() stub for 64-bit.
4267 (Target_powerpc::tlsld_got_offset): Use add_constant_pair.
4268 (Target_powerpc::Scan::get_reference_flags): Handle more relocs.
4269 (Target_powerpc::Scan::local, global): Emit relative dynamic reloc
4270 for R_PPC64_TOC. Handle more relocs. Generate got entries for TLS.
4271 Always treat .opd relocs as against locally defined symbol.
4272 Correct condition for RELATIVE relocs.
4273 (Target_powerpc::do_finalize_sections): Test for NULL sections.
4274 (Target_powerpc::Relocate::relocate): Use plt call stub as value
4275 for 32-bit syms with a plt entry. Correct ppc64 toc base
4276 calculations. Handle TLS relocs, and more. Add overflow
4277 checking and adjust for Powerpc_relocate_functions changes.
4278 (Target_powerpc::relocate_for_relocatable): Handle zero r_sym.
4279 Reinstate --emit-relocs code with FIXME.
4280
a1373b60
AM
42812012-08-30 Alan Modra <amodra@gmail.com>
4282
4283 * layout.cc (Layout::set_segment_offsets): Set p_align to
4284 abi_pagesize, not common_pagesize.
4285 (Layout::relaxation_loop_body): Similarly use abi_pagesize
4286 to determine whether file header can go in segment.
4287
703d02da
AM
42882012-08-30 Alan Modra <amodra@gmail.com>
4289
4290 * output.h (Output_reloc::Output_reloc <output section>): Add
4291 is_relative param. Adjust calls.
4292 (Output_reloc::add_output_section_relative): New functions.
4293 * output.cc (Output_reloc::Output_reloc <output section>): Handle
4294 is_relative.
4295 (Output_reloc::symbol_value): Handle SECTION_CODE.
4296
16164a6b
ST
42972012-08-24 Sriraman Tallam <tmsriram@google.com>
4298
4299 * gold.cc (queue_middle_tasks): Call layout again when unique
4300 segments for sections is desired.
4301 * layout.cc (Layout::Layout): Initialize new members.
4302 (Layout::get_output_section_flags): New function.
4303 (Layout::choose_output_section): Call get_output_section_flags.
4304 (Layout::layout): Make output section for mapping to a unique segment.
4305 (Layout::insert_section_segment_map): New function.
4306 (Layout::attach_allocated_section_to_segment): Make unique segment for
703d02da 4307 output sections marked so.
16164a6b
ST
4308 (Layout::segment_precedes): Check for unique segments when sorting.
4309 * layout.h (Layout::Unique_segment_info): New struct.
4310 (Layout::Section_segment_map): New typedef.
4311 (Layout::insert_section_segment_map): New function.
4312 (Layout::get_output_section_flags): New function.
4313 (Layout::is_unique_segment_for_sections_specified): New function.
4314 (Layout::set_unique_segment_for_sections_specified): New function.
4315 (Layout::unique_segment_for_sections_specified_): New member.
4316 (Layout::section_segment_map_): New member.
4317 * object.cc (Sized_relobj_file<size, big_endian>::do_layout):
4318 Rename is_gc_pass_one to is_pass_one.
4319 Rename is_gc_pass_two to is_pass_two.
4320 Rename is_gc_or_icf to is_two_pass.
4321 Check for which pass based on whether symbols data is present.
4322 Make it two pass when unique segments for sections is desired.
4323 * output.cc (Output_section::Output_section): Initialize new
4324 members.
4325 * output.h (Output_section::is_unique_segment): New function.
4326 (Output_section::set_is_unique_segment): New function.
4327 (Output_section::is_unique_segment_): New member.
4328 (Output_section::extra_segment_flags): New function.
4329 (Output_section::set_extra_segment_flags): New function.
4330 (Output_section::extra_segment_flags_): New member.
4331 (Output_section::segment_alignment): New function.
4332 (Output_section::set_segment_alignment): New function.
4333 (Output_section::segment_alignment_): New member.
4334 (Output_segment::Output_segment): Initialize is_unique_segment_.
4335 (Output_segment::is_unique_segment): New function.
4336 (Output_segment::set_is_unique_segment): New function.
4337 (Output_segment::is_unique_segment_): New member.
4338 * plugin.cc (allow_unique_segment_for_sections): New function.
4339 (unique_segment_for_sections): New function.
4340 (Plugin::load): Add new functions to transfer vector.
4341 * Makefile.am (plugin_final_layout.readelf.stdout): Add readelf output.
4342 * Makefile.in: Regenerate.
4343 * testsuite/plugin_final_layout.sh: Check if unique segment
4344 functionality works.
4345 * testsuite/plugin_section_order.c (onload): Check if new interfaces
4346 are available.
4347 (allow_unique_segment_for_sections): New global.
4348 (unique_segment_for_sections): New global.
4349 (claim_file_hook): Call allow_unique_segment_for_sections.
4350 (all_symbols_read_hook): Call unique_segment_for_sections.
16164a6b 4351
1e2bee4f
CC
43522012-08-22 Cary Coutant <ccoutant@google.com>
4353
4354 * layout.cc (Layout::include_section): Don't assert on GROUP
4355 sections with --emit-relocs.
4356
1d5dfe78
CC
43572012-08-21 Cary Coutant <ccoutant@google.com>
4358
4359 * symtab.cc (Symbol_table::gc_mark_undef_symbols): Don't assert
4360 if --export-dynamic-symbol names an undef symbol.
4361
c9269dff
AM
43622012-08-18 Alan Modra <amodra@gmail.com>
4363
4364 * powerpc.cc: Formatting and white space.
4365 (Powerpc_relobj): Rename got2_section_ to special_.
4366 Add opd_ent_shndx_ and opd_ent_off_ vectors.
4367 (Powerpc_relobj::opd_shndx, init_opd, get_opd_ent, set_opd_ent,
4368 scan_opd_relocs, do_read_relocs, opd_ent_ndx): New functions.
4369 (Target_powerpc): Add Address typedef and invalid_address. Use
4370 throughout.
4371 (Target_powerpc::is_branch_reloc): New function.
4372 (Powerpc_relocate_functions): Add Address typedef, use throughout.
4373 (Powerpc_relocate_functions:rela, rela_ua): Correct type used
4374 for dst_mask, value and addend.
4375 (Powerpc_relobj::do_find_special_sections): Find .opd for 64-bit.
4376 (ld_2_1, cror_15_15_15, cror_31_31_31): New insn constants.
4377 (Output_data_glink::do_write): Correct toc base. Don't try to use
4378 uint16_t for 24-bit offset. Use get_output_section_offset and
4379 check return.
4380 (Target_powerpc::Scan::local): Handle more relocs.
4381 (Target_powerpc::do_finalize_sections): Set up DT_PPC64_GLINK.
4382 (Target_powerpc::Relocate::relocate): Correct toc base calculation.
4383 Plug in toc restoring insn after plt calls. Translate branches
4384 to function descriptor symbols to corresponding entry point.
4385 (Target_powerpc::relocate_for_relocatable): Check return from
4386 get_output_section_offset.
4387 * symtab.h: Comment typo.
4388
b1759dce
ILT
43892012-08-14 Ian Lance Taylor <iant@google.com>
4390
4391 * x86_64.cc (Target_x86_64::Scan::global): Fix erroneous call to
4392 unsupported_relocal_local to call unsupported_reloc_global.
4393
b9b2ae8b
NC
43942012-08-14 Nick Clifton <nickc@redhat.com>
4395
4396 PR ld/14265
4397 * script-sections.cc (Sections_element::output_section_name): Add
4398 keep return parameter.
4399 (Output_section_element::match_name): Add keep return parameter.
4400 Return the value of the keep_ member.
4401 * script-sections.h (class Output_section): Update
4402 output_section_name prototype.
4403 * layout.cc (Layout::keep_input_section): New public member
4404 function.
4405 (Layout::choose_output_section): Pass keep parameter to
4406 output_section_name.
4407 * layout.h (class Layout): Add keep_input_section.
4408 * object.cc (Sized_relobj_file::do_layout): Check for kept input
4409 sections.
4410 * testsuite/Makefile.am: Add a test.
4411 * testsuite/Makefile.in: Regenerate.
4412 * testsuite/pr14265.c: Source file for the test.
4413 * testsuite/pr14265.t: Linker script for the test.
4414 * testsuite/pr14265.sh: Shell script for the test.
4415
921b5322
AM
44162012-08-14 Alan Modra <amodra@gmail.com>
4417
4418 * target.h (Target::output_section_name): New function.
4419 (Target::do_output_section_name): New function.
4420 * layout.cc (Layout::choose_output_section): Call the above.
4421 * powerpc.cc (Target_powerpc::do_output_section_name): New function.
4422
6ce78956
AM
44232012-08-14 Alan Modra <amodra@gmail.com>
4424
4425 * powerpc.cc: Update for renamed R_PPC_REL16 relocs.
4426 (Output_data_got_powerpc::do_write): Don't rely on base class lookup
4427 for replace_constant call.
4428 (Output_data_plt_powerpc::do_print_to_mapfile): New function.
4429 (Output_data_glink::do_print_to_mapfile): New function.
4430 (Target_powerpc::Scan::local): Ignore R_PPC64_TOCSAVE.
4431 (Target_powerpc::Relocate::relocate): Likewise.
4432
d1a8cabd
AM
44332012-08-14 Alan Modra <amodra@gmail.com>
4434
4435 * powerpc.cc (Powerpc_relobj::set_got2_shndx): Delete.
4436 (Powerpc_relobj::do_find_special_sections): Don't use set_got2_shndx.
4437 (Output_data_glink::add_entry,find_entry): Remove shndx param.
4438 (class Glink_sym_ent): Rename from struct Glink_sym_ent. Remove
4439 all references to shndx_. Handle special case for R_PPC_PLTREL24
4440 here.
4441 (class Glink_sym_ent_hash): Rename from struct Glink_sym_ent_hash.
4442 (Output_data_glink::do_write): Retrieve got2_shdnx from object.
4443 (Target_powerpc::make_plt_entry): Don't special case R_PPC_PLTREL24
4444 here.
4445 (Target_powerpc::Scan::global): Nor on make_plt_entry call.
4446 (Target_powerpc::Relocate::relocate): Nor on glink->find_entry call.
4447
d83ce4e3
AM
44482012-08-12 Alan Modra <amodra@gmail.com>
4449
4450 * powerpc.cc: Whitespace fixes. Wrap overly long lines.
4451 (glink insn constants): Use uint32_t.
4452 (Output_data_glink::add_entry): Use insert, not [] operator.
4453
cf43a2fe
AM
44542012-08-11 Alan Modra <amodra@gmail.com>
4455
4456 * object.h (Sized_relobj_file::find_shdr): New function.
4457 (Sized_relobj_file::find_special_sections): New function.
4458 * object.cc (Sized_relobj_file::find_shdr): New function.
4459 (Sized_relobj_file::find_eh_frame): Use find_shdr.
4460 (Sized_relobj_file::find_special_sections): New function, split out..
4461 (Sized_relobj_file::do_read_symbols): ..from here.
4462 * output.h (Output_data_got::replace_constant): New function.
4463 (Output_data_got::num_entries): New function.
4464 (Output_data_got::last_got_offset,set_got_size): Use num_entries.
4465 (Output_data_got::got_offset): Protected rather than private.
4466 (Output_data_got::replace_got_entry): New function.
4467 * output.cc (Output_data_got::replace_got_entry): New function.
4468 * powerpc.cc (class Powerpc_relobj): New.
4469 (class Powerpc_relocate_functions): Delete all psymval variants or
4470 convert to value,addend type. Delete pcrela, pcrela_unaligned.
4471 Implement _ha functions using corresponding _hi function.
4472 (Powerpc_relobj::find_special_sections): New function.
4473 (Target_powerpc::do_make_elf_object): New function.
4474 (class Output_data_got_powerpc): New.
4475 (class Output_data_glink): New.
4476 (class Powerpc_scan_relocatable_reloc): New.
4477 Many more changes througout file.
4478
3c892704
NC
44792012-08-09 Nick Clifton <nickc@redhat.com>
4480
4481 * po/vi.po: Updated Vietnamese translation.
4482
82435b3b
ILT
44832012-08-07 Ian Lance Taylor <iant@google.com>
4484
4485 * layout.cc (Layout::add_target_dynamic_tags): If
4486 dynrel_includes_plt but no dyn_rel, emit dynamic reloc tags for
4487 plt_rel.
4488
a6dc81d2
NC
44892012-07-30 Nick Clifton <nickc@redhat.com>
4490
4491 * po/gold.pot: Updated template.
4492 * po/es.po: Updated Spanish translation.
4493
f1415016
CC
44942012-07-18 Cary Coutant <ccoutant@google.com>
4495
4496 PR gold/14344
4497 * configure.ac: Add check for -gpubnames support.
4498 * configure: Regenerate.
4499 * testsuite/Makefile.am (gdb_index_test_1): Add check for -gpubnames
4500 support; force -gno-pubnames.
4501 (gdb_index_test_2, gdb_index_test_3): Add check for -gpubnames
4502 support.
4503 (gdb_index_test_4): New test.
4504 * testsuite/Makefile.in: Regenerate.
4505 * testsuite/gdb_index_test_1.sh: Refactor code into common file.
4506 * testsuite/gdb_index_test_2.sh: Likewise.
4507 * testsuite/gdb_index_test_3.sh: Don't look for space after colon.
4508 * testsuite/gdb_index_test_4.sh: New script.
4509 * testsuite/gdb_index_test_comm.sh: New script with common code;
4510 don't look for space after colon.
4511
b7fd7c37
ST
45122012-07-16 Sriraman Tallam <tmsriram@google.com>
4513
4514 * gold.cc (queue_middle_tasks): Update function order only after
4515 deferred objects due to plugins are processed.
4516
1f3212db
ILT
45172012-07-11 Ian Lance Taylor <iant@google.com>
4518
4519 * arm.cc (Arm_relocate_functions::abs16): Remove unused typedef.
4520 (Arm_exidx_cantunwind::do_fixed_endian_write): Likewise.
4521 (Target_arm::scan_reloc_for_stub): Likewise.
4522 * common.cc (Symbol_table::do_allocate_commons_list): Likewise.
4523 * dwarf_reader.cc (Dwarf_die::skip_attributes): Likewise.
4524 * ehframe.cc (Eh_frame::do_add_ehframe_input_section): Likewise.
4525 * incremental.cc (Sized_incr_dynobj::do_add_symbols): Likewise.
4526 * powerpc.cc (Target_powerpc::relocate_tls): Likewise.
4527
81c82a68
ILT
45282012-07-10 Dodji Seketeli <dodji@redhat.com>
4529 Ian Lance Taylor <iant@google.com>
4530
4531 PR gold/14309
4532 * configure.ac: Test whether std::tr1::hash<off_t> works.
4533 * gold.h: Add a specialization for std::tr1::hash<off_t> if
4534 needed.
4535 * output.h (class Output_fill): Add virtual destructor.
4536 * configure, config.in: Rebuild.
4537
eabc84f4
RM
45382012-06-22 Roland McGrath <mcgrathr@google.com>
4539
4540 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4541
370e30b6
RÁE
45422012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
4543
4544 * plugin.cc (Plugin::load): Handle position independent executables.
4545
fb1b895d
CC
45462012-06-06 Cary Coutant <ccoutant@google.com>
4547
4548 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4549 add .debug_macro.
4550 (lines_only_debug_sections): Likewise.
4551 (gdb_fast_lookup_sections): New static array.
4552 (is_gdb_debug_section): Rename formal parameter.
4553 (is_lines_only_debug_section): Likewise.
4554 (is_gdb_fast_lookup_section): New function.
4555 (Layout::include_section): Check for ".zdebug_" prefix; pass
4556 section name suffix to is_gdb_debug_section, et al.; check for
4557 fast-lookup sections when building .gdb_index.
4558 * options.h (--strip-debug-gdb): Update GDB version number.
4559
7c0640fa
CC
45602012-06-06 Cary Coutant <ccoutant@google.com>
4561
4562 * configure.ac: Add check for fallocate.
4563 * configure: Regenerate.
4564 * config.in: Regenerate.
4565
4566 * options.h (class General_options): Add --mmap-output-file and
4567 --posix-fallocate options.
4568 * output.cc: (posix_fallocate): Remove; replace with...
4569 (gold_fallocate): New function.
4570 (Output_file::map_no_anonymous): Call gold_fallocate.
4571 (Output_file::map): Check --mmap-output-file option.
4572
2a49eb69
DK
45732012-06-05 Jing Yu <jingyu@google.com>
4574
4575 * gold.h (textdomain): Add do {} to empty while(0).
4576 (bindtextdomain): Likewise.
4577
fad072ac
CC
45782012-06-04 Cary Coutant <ccoutant@google.com>
4579
4580 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
4581 has_dynsym_index.
4582
8cc69fb6
ST
45832012-05-25 Sriraman Tallam <tmsriram@google.com>
4584
4585 * symtab.cc (Symbol_table::define_special_symbol):
4586 Initialize *poldsym to prevent uninitialized variable errors.
4587
1be75daa
CC
45882012-05-23 Cary Coutant <ccoutant@google.com>
4589
4590 * layout.cc (Layout::section_name_mapping): Add rules to handle
4591 exact match on .data.rel.ro.local or .data.rel.ro.
4592 (Layout::output_section_name): Check for exact matches.
4593
9b689de0
CC
45942012-05-23 Cary Coutant <ccoutant@google.com>
4595
4596 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4597 more carefully.
4598
b24fdbf5
CC
45992012-05-22 Cary Coutant <ccoutant@google.com>
4600
4601 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
4602 object before exporting symbol.
4603
e550e1a2
L
46042012-05-21 H.J. Lu <hongjiu.lu@intel.com>
4605
4606 * testsuite/tls_test.cc: Include "config.h" first.
4607 * testsuite/tls_test_c.c: Likewise.
4608
df7b86aa
NC
46092012-05-17 Daniel Richard G. <skunk@iskunk.org>
4610 Nick Clifton <nickc@redhat.com>
4611
4612 PR 14072
4613 * configure.in: Add check that sysdep.h has been included before
4614 any system header files.
4615 * configure: Regenerate.
4616 * config.in: Regenerate.
4617
1007b503
CC
46182012-05-14 Cary Coutant <ccoutant@google.com>
4619
4620 * layout.cc (Layout::make_output_section): Mark .tdata section
4621 as RELRO.
4622 * testsuite/relro_test.cc: Add a TLS variable.
4623
fd885f3a
L
46242012-05-10 H.J. Lu <hongjiu.lu@intel.com>
4625
4626 PR gold/14091
4627 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
4628 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
4629 R_X86_64_64.
4630
80f5885c
CC
46312012-05-08 Cary Coutant <ccoutant@google.com>
4632
4633 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
4634 (lines_only_debug_sections): Likewise.
4635
2e702c99
RM
46362012-05-02 Roland McGrath <mcgrathr@google.com>
4637
4638 * nacl.cc: New file.
4639 * nacl.h: New file.
4640 * Makefile.am (CCFILES, HFILES): Add them.
4641 * Makefile.in: Regenerate.
4642 * i386.cc (Output_data_plt_i386_nacl): New class.
4643 (Output_data_plt_i386_nacl_exec): New class.
4644 (Output_data_plt_i386_nacl_dyn): New class.
4645 (Target_i386_nacl): New class.
4646 (Target_selector_i386_nacl): New class.
4647 (target_selector_i386): Use it instead of Target_selector_i386.
4648 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
4649 (Target_x86_64_nacl): New class.
4650 (Target_selector_x86_64_nacl): New class.
4651 (target_selector_x86_64, target_selector_x32): Use it instead of
4652 Target_selector_x86_64.
4653 * arm.cc (Output_data_plt_arm_nacl): New class.
4654 (Target_arm_nacl): New class.
4655 (Target_selector_arm_nacl): New class.
4656 (target_selector_arm, target_selector_armbe): Use it instead of
4657 Target_selector_arm.
4658
4659 * target-select.cc (select_target): Take new Input_file* and off_t
4660 arguments, pass them on to recognize method of selector.
4661 * object.cc (make_elf_sized_object): Update caller.
4662 * parameters.cc (parameters_force_valid_target): Likewise.
4663 * incremental.cc (make_sized_incremental_binary): Likewise.
4664 * target-select.h: Update decl.
4665 (Target_selector::recognize): Take new Input_file* argument,
4666 pass it on to do_recognize.
4667 (Target_selector::do_recognize): Take new Input_file* argument.
4668 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
4669 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
4670 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
4671 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
4672
4673 * target.h (Target::Target_info): New members isolate_execinstr
4674 and rosegment_gap.
4675 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
4676 * arm.cc (Target_arm::arm_info): Update initializer.
4677 * i386.cc (Target_i386::i386_info): Likewise.
4678 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
4679 * sparc.cc (Target_sparc::sparc_info): Likewise.
4680 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
4681 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
4682 * layout.cc (Layout::attach_allocated_section_to_segment):
4683 Take new const Target* argument. If target->isolate_execinstr(), act
4684 like --rosegment.
4685 (Layout::find_first_load_seg): Take new const Target* argument;
4686 if target->isolate_execinstr(), reject PF_X segments.
4687 (Layout::relaxation_loop_body): Update caller.
4688 (Layout::set_segment_offsets): If target->isolate_execinstr(),
4689 reset file offset to zero when we hit LOAD_SEG, and then do a second
4690 loop over the segments before LOAD_SEG to reassign offsets after
4691 addresses have been determined. Handle target->rosegment_gap().
4692 (Layout::attach_section_to_segment): Take new const Target* argument;
4693 pass it to attach_allocated_section_to_segment.
4694 (Layout::make_output_section): Update caller.
4695 (Layout::attach_sections_to_segments): Take new const Target* argument;
4696 pass it to attach_section_to_segment.
4697 * gold.cc (queue_middle_tasks): Update caller.
4698 * layout.h (Layout): Update method decls with new arguments.
4699
4700 * arm.cc (Target_arm::Target_arm): Take optional argument for the
4701 Target_info pointer to use.
4702 (Target_arm::do_make_data_plt): New virtual method.
4703 (Target_arm::make_data_plt): New method that calls it.
4704 (Target_arm::make_plt_entry): Use it.
4705 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
4706 for the section alignment.
4707 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
4708 method.
4709 (Output_data_plt_arm::first_plt_entry_offset): Call it.
4710 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
4711 method.
4712 (Output_data_plt_arm::get_plt_entry_size): Call it.
4713 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
4714 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
4715 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
4716 method.
4717 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
4718 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
4719 method instead of sizeof(plt_entry).
4720 (Output_data_plt_arm::add_entry): Likewise.
4721 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
4722 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
4723 than static method.
4724 (Target_arm::plt_entry_size): Likewise.
4725 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
4726 Move to ...
4727 (Output_data_plt_arm_standard): ... here, new class.
4728 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
4729 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
4730 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
4731
4732 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
4733 Take additional argument for the PLT entry size.
4734 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
4735 Use get_plt_entry_size method rather than plt_entry_size variable.
4736 (Output_data_plt_x86_64::reserve_slot): Likewise.
4737 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
4738 (Output_data_plt_x86_64::add_entry): Likewise.
4739 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
4740 (Output_data_plt_x86_64::address_for_global): Likewise.
4741 (Output_data_plt_x86_64::address_for_local): Likewise.
4742 (Output_data_plt_x86_64::set_final_data_size): Likewise.
4743 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
4744 Make method non-static.
4745 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
4746 method.
4747 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
4748 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
4749 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
4750 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
4751 virtual method.
4752 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
4753 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
4754 virtual method.
4755 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
4756 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
4757 virtual method.
4758 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
4759 (Output_data_plt_x86_64::plt_entry_size)
4760 (Output_data_plt_x86_64::first_plt_entry)
4761 (Output_data_plt_x86_64::plt_entry)
4762 (Output_data_plt_x86_64::tlsdesc_plt_entry)
4763 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
4764 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
4765 (Output_data_plt_x86_64_standard): ... here, new class.
4766 (Target_x86_64::Target_x86_64): Take optional argument for the
4767 Target_info pointer to use.
4768 (Target_x86_64::do_make_data_plt): New virtual method.
4769 (Target_x86_64::make_data_plt): New method to call it.
4770 (Target_x86_64::init_got_plt_for_update): Use that.
4771 Call this->plt_->add_eh_frame method here.
4772 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
4773 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
4774 rather than static method.
4775 (Target_x86_64::plt_entry_size): Likewise.
4776 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
4777 rather than plt_entry_size variable. Move guts of PLT filling to...
4778 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
4779 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
4780 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
4781
4782 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
4783 additional argument for the section alignment.
4784 Don't do add_eh_frame_for_plt here.
4785 (Output_data_plt_i386::first_plt_entry_offset): Make the method
4786 non-static. Use get_plt_entry_size method rather than plt_entry_size
4787 variable.
4788 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
4789 method.
4790 (Output_data_plt_i386::get_plt_entry_size): Call it.
4791 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
4792 (Output_data_plt_i386::add_eh_frame): New method to call it.
4793 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
4794 method.
4795 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
4796 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
4797 method.
4798 (Output_data_plt_i386::fill_plt_entry): New method to call it.
4799 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
4800 method instead of plt_entry_size.
4801 (Output_data_plt_i386::plt_entry_size)
4802 (Output_data_plt_i386::plt_eh_frame_fde_size)
4803 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
4804 (Output_data_plt_i386_standard): ... here, new class.
4805 (Output_data_plt_i386_exec): New class.
4806 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
4807 (Output_data_plt_i386_exec::first_plt_entry): ... here.
4808 (Output_data_plt_i386::exec_plt_entry): Move to ...
4809 (Output_data_plt_i386_exec::plt_entry): ... here.
4810 (Output_data_plt_i386_dyn): New class.
4811 (Output_data_plt_i386::first_plt_entry): Move to ...
4812 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
4813 (Output_data_plt_i386::dyn_plt_entry): Move to ...
4814 (Output_data_plt_i386_dyn::plt_entry): ... here.
4815 (Target_i386::Target_i386): Take optional argument for the Target_info
4816 pointer to use.
4817 (Target_i386::do_make_data_plt): New virtual method.
4818 (Target_i386::make_data_plt): New method to call it.
4819 (Target_i386::make_plt_section): Use that.
4820 Call this->plt_->add_eh_frame method here.
4821 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
4822 rather than plt_entry_size variable.
4823 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
4824 (Output_data_plt_i386::address_for_local): Likewise.
4825 (Output_data_plt_i386::do_write): Likewise.
4826 Move guts of PLT filling to...
4827 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
4828 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
4829 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
4830 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
4831
b9b9f2ee
CC
48322012-05-01 Cary Coutant <ccoutant@google.com>
4833
4834 * dwarf_reader.cc (Dwarf_die::read_attributes)
4835 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
4836 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
4837 * reduced_debug_output.cc
4838 (Output_reduced_debug_info_section::get_die_end): Remove
4839 DW_FORM_GNU_ref_index. Add default case.
4840
57923f48
MW
48412012-04-26 Mark Wielaard <mjw@redhat.com>
4842
4843 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
4844 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
4845 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
4846 DW_AT_high_pc as offset from DW_AT_low_pc.
4847
4848 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
4849 * testsuite/Makefile.in: Regenerate.
4850 * testsuite/gdb_index_test_3.c: New test source file.
4851 * testsuite/gdb_index_test_3.sh: New test source file.
4852
2c54b4f4
ILT
48532012-04-25 Ian Lance Taylor <iant@google.com>
4854
4855 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
4856 pointer.
4857 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
4858 as a class, not a struct.
4859 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
4860 (Target_arm::apply_cortex_a8_workaround): Likewise.
4861 * gc.h: Declare Reloc_types as a struct, not a class.
4862 * object.h: Declare Symbols_data as a struct.
4863 * reloc.h: Declare Read_relocs_data as a struct.
4864 * target.h: Declare Relocate_info as a struct.
4865
a5a5f7a3
DM
48662012-04-24 David S. Miller <davem@davemloft.net>
4867
4868 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
4869 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
4870 and R_SPARC_WPLT30.
4871
f038d496
CC
48722012-04-24 Cary Coutant <ccoutant@google.com>
4873
4874 * incremental-dump.cc (find_input_containing_global): Replace
4875 magic number with symbolic constant.
4876 (dump_incremental_inputs): Update version number.
4877 * incremental.cc (Output_section_incremental_inputs): Update version
4878 number; import symbolic constants from Incremental_inputs_reader.
4879 (Incremental_inputs::create_data_sections): Align relocations
4880 section correctly for 64-bit targets.
4881 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
4882 constants; add padding.
4883 (Output_section_incremental_inputs::write_header): Add assert for
4884 header_size.
4885 (Output_section_incremental_inputs::write_input_files): Add assert
4886 for input_entry_size.
4887 (Output_section_incremental_inputs::write_info_blocks): Add padding;
4888 add assert for object_info_size, input_section_entry_size,
4889 global_sym_entry_size.
4890 * incremental.h (Incremental_inputs_reader): Add symbolic constants
4891 for data structure sizes; use them.
4892 (Incremental_input_entry_reader): Import symbolic constants from
4893 Incremental_inputs_reader; use them.
4894
a4d85145
DM
48952012-04-23 David S. Miller <davem@davemloft.net>
4896
4897 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
4898 and elf_flags_set_.
4899 (Target_sparc::Target_sparc): Initialize new fields.
4900 (Target_sparc::do_make_elf_object): New function.
4901 (Target_sparc::do_adjust_elf_header): New function.
4902
1d509098
CC
49032012-04-23 Cary Coutant <ccoutant@google.com>
4904
4905 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
4906 CU range table of gdb index.
4907
7ebeff7f
DM
49082012-04-20 David S. Miller <davem@davemloft.net>
4909
4910 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
4911 instead of false.
4912
13cf9988
DM
49132012-04-16 David S. Miller <davem@davemloft.net>
4914
2a1079e8
DM
4915 * sparc.cc (Target_sparc::got_address): New function.
4916 (Sparc_relocate_functions::gdop_hix22): New function.
4917 (Sparc_relocate_functions::gdop_lox10): New function.
4918 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
4919 relocs.
4920 (Target_sparc::Scan::local): Likewise if the global symbol is not
4921 preemptible and is not IFUNC.
4922 (Target_sparc::Relocate::relocate): Perform GOTDATA code
4923 transformations for local and non-preemptible non-IFUNC global
4924 symbols.
4925
0bc964fc
DM
4926 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
4927 writing out 64-bit part of ranges.
4928
661d7a80
DM
4929 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
4930 -fpic and -fpie respectively.
4931 * Makefile.in: Regenerate.
4932
8c2bf391
DM
4933 * sparc.cc (class Target_sparc): Add rela_ifunc_.
4934 (Target_sparc::Target_sparc): Initialize new field.
4935 (Target_sparc::do_plt_section_for_global): New function.
4936 (Target_sparc::do_plt_section_for_local): New function.
4937 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
4938 (Target_sparc::make_plt_section): New function, broken out of
4939 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
4940 (Target_sparc::make_plt_entry): Call make_plt_section.
4941 (Target_sparc::make_local_ifunc_plt_entry): New function.
4942 (Target_sparc::rela_ifunc_section): New function.
4943 (Target_sparc::plt_section): Remove const.
4944 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
4945 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
4946 and ifunc_count_ fields.
4947 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
4948 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
4949 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
4950 (Output_data_plt_sparc::rela_ifunc): New function.
4951 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
4952 (Output_data_plt_sparc::has_ifunc_section): New function.
4953 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
4954 (Output_data_plt_sparc::address_for_global): New function.
4955 (Output_data_plt_sparc::address_for_local): New function.
4956 (Output_data_plt_sparc::plt_index_to_offset): New function.
4957 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
4958 and entry_count.
4959 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
4960 entry_count.
4961 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
4962 R_SPARC_JMP_IREL to switch.
4963 (Target_sparc::Scan::check_non_pic): Likewise.
4964 (Target_sparc::Scan::local): Handle IFUNC symbols.
4965 (Target_sparc::Scan::local): Likewise.
4966 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
4967 and plt_address_for_local.
4968 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
4969 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
4970
13cf9988
DM
4971 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
4972 (class Output_data_reloc): Adjust calls to Output_reloc_type.
4973 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
4974 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
4975 global relocs too.
4976 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
4977 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
4978 calls.
4979 * sparc.cc (Target_sparc::Scan::global): Likewise.
4980 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4981
31821be0
CC
49822012-04-16 Cary Coutant <ccoutant@google.com>
4983
4984 * archive.cc (Library_base::should_include_member): Check for
4985 --export-dynamic-symbol.
4986 * options.h (class General_options): Add --export-dynamic-symbol.
4987 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
4988 --export-dynamic-symbol.
4989 (Symbol_table::gc_mark_undef_symbols): Likewise.
4990 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
4991
2615994e
DM
49922012-04-12 David S. Miller <davem@davemloft.net>
4993
4994 * sparc.cc (Reloc::wdisp10): New relocation method.
4995 (Reloc::h34): Likewise.
4996 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
4997 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
4998 R_SPARC_WDISP10.
4999 (Target_sparc::Scan::local): Likewise.
5000 (Target_sparc::Scan::global): Likewise.
5001 (Target_sparc::Relocate::relocate): Likewise.
5002
6782735d
CC
50032012-04-09 Cary Coutant <ccoutant@google.com>
5004
5005 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
5006 low_pc == 0.
5007
8c7a0b00
ILT
50082012-04-06 Ian Lance Taylor <iant@google.com>
5009
5010 * timer.cc: #include <unistd.h>.
5011
58797674
RM
50122012-04-06 Roland McGrath <mcgrathr@google.com>
5013
5014 * configure.in (AC_CHECK_HEADERS): Add locale.h.
5015 * config.in: Regenerate.
5016 * configure: Regenerate.
5017
44350750
NC
50182012-04-05 Nick Clifton <nickc@redhat.com>
5019
5020 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
5021 (AM_LC_MESSAGES): Add.
5022 * aclocal.m4: Regenerate.
5023 * config.in: Regenerate.
5024 * configure: Regenerate.
5025
c1027032
CC
50262012-03-21 Cary Coutant <ccoutant@google.com>
5027
5028 * Makefile.am: Add gdb-index.cc, gdb-index.h.
5029 * Makefile.in: Regenerate.
5030 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
5031 (Sized_elf_reloc_mapper::symbol_section): New function.
5032 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
5033 (make_elf_reloc_mapper): New function.
5034 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
5035 (Dwarf_abbrev_table::do_read_abbrevs): New function.
5036 (Dwarf_abbrev_table::do_get_abbrev): New function.
5037 (Dwarf_ranges_table::read_ranges_table): New function.
5038 (Dwarf_ranges_table::read_range_list): New function.
5039 (Dwarf_pubnames_table::read_section): New function.
5040 (Dwarf_pubnames_table::read_header): New function.
5041 (Dwarf_pubnames_table::next_name): New function.
5042 (Dwarf_die::Dwarf_die): New function.
5043 (Dwarf_die::read_attributes): New function.
5044 (Dwarf_die::skip_attributes): New function.
5045 (Dwarf_die::set_name): New function.
5046 (Dwarf_die::set_linkage_name): New function.
5047 (Dwarf_die::attribute): New function.
5048 (Dwarf_die::string_attribute): New function.
5049 (Dwarf_die::int_attribute): New function.
5050 (Dwarf_die::uint_attribute): New function.
5051 (Dwarf_die::ref_attribute): New function.
5052 (Dwarf_die::child_offset): New function.
5053 (Dwarf_die::sibling_offset): New function.
5054 (Dwarf_info_reader::check_buffer): New function.
5055 (Dwarf_info_reader::parse): New function.
5056 (Dwarf_info_reader::do_parse): New function.
5057 (Dwarf_info_reader::do_read_string_table): New function.
5058 (Dwarf_info_reader::lookup_reloc): New function.
5059 (Dwarf_info_reader::get_string): New function.
5060 (Dwarf_info_reader::visit_compilation_unit): New function.
5061 (Dwarf_info_reader::visit_type_unit): New function.
5062 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
5063 Sized_elf_reloc_mapper.
5064 (Sized_dwarf_line_info::symbol_section): Remove function.
5065 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
5066 (Sized_dwarf_line_info::read_line_mappings): Remove object
5067 parameter, adjust callers.
5068 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
5069 * dwarf_reader.h: Include <sys/types.h>.
5070 (class Track_relocs): Remove forward declaration.
5071 (class Elf_reloc_mapper): New class.
5072 (class Sized_elf_reloc_mapper): New class.
5073 (class Dwarf_abbrev_table): New class.
5074 (class Dwarf_range_list): New class.
5075 (class Dwarf_ranges_table): New class.
5076 (class Dwarf_pubnames_table): New class.
5077 (class Dwarf_die): New class.
5078 (class Dwarf_info_reader): New class.
5079 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
5080 (Sized_dwarf_line_info::symbol_section): Remove member function.
5081 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
5082 base class.
5083 * gdb-index.cc: New source file.
5084 * gdb-index.h: New source file.
5085 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
5086 and .debug_types sections, call Layout::add_to_gdb_index.
5087 (Sized_relobj_incr::do_section_name): Implement.
5088 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
5089 return type; Implement.
5090 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
5091 return type.
5092 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
5093 parameter list and return type.
5094 (Sized_incr_dynobj::do_section_contents): Likewise.
5095 * layout.cc: Include gdb-index.h.
5096 (Layout::Layout): Initialize gdb_index_data_.
5097 (Layout::init_fixed_output_section): Check for .gdb_index section.
5098 (Layout::add_to_gdb_index): New function. Instantiate.
5099 * layout.h: Add forward declaration for class Gdb_index.
5100 (Layout::add_to_gdb_index): New member function.
5101 (Layout::gdb_index_data_): New data member.
5102 * main.cc: Include gdb-index.h.
5103 (main): Print statistics for gdb index.
5104 * object.cc (Object::section_contents): Move code into
5105 do_section_contents.
5106 (need_decompressed_section): Check for sections needed when building
5107 gdb index.
5108 (build_compressed_section_map): Likewise.
5109 (Sized_relobj_file::do_read_symbols): Need local symbols when building
5110 gdb index.
5111 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
5112 sections; call Layout::add_to_gdb_index.
5113 (Sized_relobj_file::do_decompressed_section_contents): Call
5114 do_section_contents directly.
5115 * object.h (Object::do_section_contents): Adjust parameter list and
5116 return type.
5117 (Object::do_decompressed_section_contents): Call do_section_contents
5118 directly.
5119 (Sized_relobj_file::do_section_contents): Adjust parameter list and
5120 return type.
5121 * options.h (class General_options): Add --gdb-index option.
5122 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
5123 list and return type.
5124 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
5125 * reloc.h (Track_relocs::checkpoint): New function.
5126 (Track_relocs::reset): New function.
5127
5128 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
5129 New test cases.
5130 * testsuite/Makefile.in: Regenerate.
5131 * testsuite/gdb_index_test.cc: New test source file.
5132 * testsuite/gdb_index_test_1.sh: New test source file.
5133 * testsuite/gdb_index_test_2.sh: New test source file.
5134
647f1574
DK
51352012-03-19 Doug Kwan <dougkwan@google.com>
5136
5137 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 5138 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
5139 __exidx_start and __exidx_end. Make symbol table parameter
5140 anonymous as it is not used.
5141 * gold.cc (queue_middle_tasks): Call target hook to define any
5142 target-specific symbols.
5143 * target.h (Target::define_standard_symbols): New method.
5144 (Target::do_define_standard_symbols): Same.
5145 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
5146 * testsuite/Makefile.in: Regenerate.
5147 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
5148 and __exidx_end.
5149 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
5150 relocations are generated for __exidx_start and __exidx_end.
5151
7c6109da
DK
51522012-03-16 Doug Kwan <dougkwan@google.com>
5153
5154 * testsuite/Makefile.am: Disable test initpri3b.
5155 * testsuite/Makefile.in: Regenerate.
5156
7b8957f8
DK
51572012-03-15 Doug Kwan <dougkwan@google.com>
5158
5159 * arm.cc (Target_arm::got_section): Make .got section read-only
5160 if -z now is given.
5161
14dc9ef7
ILT
51622012-03-15 Ian Lance Taylor <iant@google.com>
5163
5164 PR gold/13850
5165 * layout.cc (Layout::make_output_section): Correctly mark
5166 SHT_INIT_ARRAY, et. al., as relro.
5167
fa40b62a
DK
51682012-03-14 Doug Kwan <dougkwan@google.com>
5169
5170 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
5171 dynamic relocations for protected symbols in shared objects.
5172
fd325007
ILT
51732012-03-13 Ian Lance Taylor <iant@google.com>
5174
5175 * resolve.cc (Symbol_table::resolve): When merging common symbols,
5176 keep the larger alignment.
5177
e8dd54e1
CC
51782012-03-12 Cary Coutant <ccoutant@google.com>
5179
5180 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
5181 handling of DW_LNE_define_file.
5182
feb5f3b0
CC
51832012-03-12 Cary Coutant <ccoutant@google.com>
5184
5185 * reduced_debug_output.cc
5186 (Output_reduced_debug_info_section::get_die_end): Add new FORM
5187 codes to switch.
5188
a1fb4256
CC
51892012-02-29 Cary Coutant <ccoutant@google.com>
5190
5191 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
5192
5dd8762a
CC
51932012-02-29 Cary Coutant <ccoutant@google.com>
5194
5195 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5196 Call Object::decompressed_section_contents.
5197 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
5198 New dtor.
5199 (Sized_dwarf_line_info::buffer_start_): New data member.
5200 * merge.cc (Output_merge_data::do_add_input_section): Call
5201 Object::decompressed_section_contents.
5202 (Output_merge_string::do_add_input_section): Likewise.
5203 * object.cc (need_decompressed_section): New function.
5204 (build_compressed_section_map): Decompress sections needed later.
5205 (Sized_relobj_file::do_decompressed_section_contents): New function.
5206 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5207 * object.h (Object::decompressed_section_contents): New function.
5208 (Object::discard_decompressed_sections): New function.
5209 (Object::do_decompressed_section_contents): New function.
5210 (Object::do_discard_decompressed_sections): New function.
5211 (Compressed_section_info): New type.
5212 (Compressed_section_map): Include decompressed section contents.
5213 (Sized_relobj_file::do_decompressed_section_contents): New function.
5214 (Sized_relobj_file::do_discard_decompressed_sections): New function.
5215
7b5de7ee
CC
52162012-02-16 Cary Coutant <ccoutant@google.com>
5217
5218 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
5219 * testsuite/Makefile.in: Regenerate.
5220
f9fa4a63
CC
52212012-02-14 Cary Coutant <ccoutant@google.com>
5222
5223 * options.cc (General_options::finalize): Disallow -pie and -static.
5224
2c175ebc
DK
52252012-02-03 Doug Kwan <dougkwan@google.com>
5226
5227 * arm.cc (Arm_relocate_functions::abs8,
5228 Arm_relocate_functions::abs16): Use
5229 Bits::has_signed_unsigned_overflow32.
5230 (Arm_relocate_functions::thm_abs8): Correct range of
5231 overflow check.
5232 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
5233 in assertions.
5234
90cff06f
DK
52352012-02-02 Doug Kwan <dougkwan@google.com>
5236
5237 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
5238 position independent outputs, not just shared objects.
5239
63887f3d
L
52402012-01-30 H.J. Lu <hongjiu.lu@intel.com>
5241
5242 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
5243 * configure: Regenerated.
5244
bef2b434
ILT
52452012-01-27 Ian Lance Taylor <iant@google.com>
5246
5247 * reloc.h (Bits): New class with static functions, copied from
5248 namespace utils in arm.cc.
5249 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
5250 instead.
5251
c335b55d
L
52522012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5253
5254 * incremental.cc (write_info_blocks): Correct relocation offset.
5255
41194d9f
L
52562012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5257
5258 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
5259 (Relocate::tls_gd_to_le): Likewise.
5260
1bae613c
L
52612012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5262
5263 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
5264
24482ca0
L
52652012-01-27 H.J. Lu <hongjiu.lu@intel.com>
5266
5267 * configure.ac: Check if -mcmodel=medium works.
5268 * configure: Regenerated.
5269
c2c7840a
CC
52702012-01-24 Cary Coutant <ccoutant@google.com>
5271
5272 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
5273 definition and ...
5274 (read_unsigned_LEB_128_x): ... this new function.
5275 (read_signed_LEB_128): Replaced with inline definition and ...
5276 (read_signed_LEB_128_x): ... this new function.
5277 * int_encoding.h (read_unsigned_LEB_128_x): New function.
5278 (read_unsigned_LEB_128): Add inline definition.
5279 (read_signed_LEB_128_x): New function.
5280 (read_signed_LEB_128): Add inline definition.
5281 * testsuite/Makefile.am (leb128_unittest): New unit test.
5282 * testsuite/Makefile.in: Regenerate.
5283 * testsuite/leb128_unittest.cc: New unit test.
5284
833de760 52852012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
5286
5287 PR gold/13617
5288 * i386.cc (Target_i386::do_code_fill): When using a jmp
5289 instruction, pad with nop instructions.
5290 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5291
618d6666
L
52922012-01-22 H.J. Lu <hongjiu.lu@intel.com>
5293
5294 * x86_64.cc (gc_process_relocs): Add typename on types used in
5295 template.
5296 (scan_relocs): Likewise.
5297 (relocate_section): Likewise.
5298 (apply_relocation): Likewise.
5299
3660ff06
L
53002012-01-10 H.J. Lu <hongjiu.lu@intel.com>
5301
5302 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
5303 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
5304 under x32.
5305
fc51264f
L
53062012-01-09 H.J. Lu <hongjiu.lu@intel.com>
5307
5308 * x86_64.cc: Initial support for x32.
5309
dd74ae06
CC
53102012-01-03 Cary Coutant <ccoutant@google.com>
5311
5312 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
5313 Use abstract base class for GOT.
5314 * gold/output.h (class Output_data_got_base): New abstract base class.
5315 (class Output_data_got): Derive from new base class, adjust ctors.
5316 (Output_data_got::reserve_slot): Make virtual; rename to
5317 do_reserve_slot; Adjust callers.
5318 * gold/target.h (Sized_target::init_got_plt_for_update): Return
5319 pointer to abstract base class.
5320 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
5321
83896202
ILT
53222011-12-18 Ian Lance Taylor <iant@google.com>
5323
5324 * object.h (Relobj::local_symbol_value): New function.
5325 (Relobj::local_plt_offset): New function.
5326 (Relobj::local_has_got_offset): New function.
5327 (Relobj::local_got_offset): New function.
5328 (Relobj::set_local_got_offset): New function.
5329 (Relobj::do_local_symbol_value): New pure virtual function.
5330 (Relobj::do_local_plt_offset): Likewise.
5331 (Relobj::do_local_has_got_offset): Likewise.
5332 (Relobj::do_local_got_offset): Likewise.
5333 (Relobj::do_set_local_got_offset): Likewise.
5334 (Sized_relobj::do_local_has_got_offset): Rename from
5335 local_has_got_offset.
5336 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
5337 (Sized_relobj::do_set_local_got_offset): Rename from
5338 set_local_got_offset.
5339 (Sized_relobj_file::do_local_plt_offset): Rename from
5340 local_plt_offset.
5341 (Sized_relobj_file::do_local_symbol_value): New function.
5342 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
5343 local_plt_offset.
5344 * output.cc (Output_data_got::Got_entry::write): Change object to
5345 Relobj. Use local_symbol_value.
5346 (Output_data_got::add_global_with_rel): Change rel_dyn to
5347 Output_data_reloc_generic*. Use add_global_generic.
5348 (Output_data_got::add_global_with_rela): Remove. Change all
5349 callers to use add_global_with_rel.
5350 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
5351 Output_data_reloc_generic*. Use add_global_generic.
5352 (Output_data_got::add_global_pair_with_rela): Remove. Change all
5353 callers to use add_global_pair_with_rel.
5354 (Output_data_got::add_local): Change object to Relobj*.
5355 (Output_data_got::add_local_plt): Likewise.
5356 (Output_data_got::add_local_with_rel): Change object to Relobj*,
5357 change rel_dyn to Output_data_reloc_generic*. Use
5358 add_local_generic.
5359 (Output_data_got::add_local_with_rela): Remove. Change all
5360 callers to use all_local_with_rel.
5361 (Output_data_got::add_local_pair_with_rel): Change object to
5362 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
5363 add_output_section_generic.
5364 (Output_data_got::add_local_pair_with_rela): Remove. Change all
5365 callers to use add_local_pair_with_rel.
5366 (Output_data_got::reserve_local): Change object to Relobj*.
5367 * output.h: (class Output_data_reloc_generic): Add pure virtual
5368 declarations for add_global_generic, add_local_generic,
5369 add_output_section_generic.
5370 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
5371 functions for Output_data_reloc_generic. Update declarations for
5372 changes listed in output.cc.
5373 (class Output_data_got): Change template parameter to got_size.
5374 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
5375 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
5376 function.
5377 (Sized_relobj_incr::do_local_plt_offset): New function.
5378 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
5379 add_global_generic.
5380
76677ad0
CC
53812011-12-17 Cary Coutant <ccoutant@google.com>
5382
5383 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
5384 * resolve.cc (Symbol_table::resolve): Likewise.
5385 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
5386 arrays.
5387 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
5388
8b8dd8d5
ILT
53892011-12-16 Ian Lance Taylor <iant@google.com>
5390
5391 * output.h (Output_data_reloc_generic::add): Only call
5392 add_dynamic_reloc if this is a dynamic reloc section.
5393
d55525b9
L
53942011-12-15 H.J. Lu <hongjiu.lu@intel.com>
5395
5396 PR gold/13505
5397 * target-reloc.h (apply_relocation): Replace <64, false> with
5398 <size, big_endian>.
5399
ff81c7c1
NC
54002011-11-25 Nick Clifton <nickc@redhat.com>
5401
5402 * po/it.po: New Italian translation.
5403
628f39be
SA
54042011-11-17 Sterling Augustine <saugustine@google.com>
5405
5406 * script.cc (script_include_directive): Implement.
5407 (read_script_file): New local variables name and search_path. Update
5408 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
5409 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
5410 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
5411
98ef3ea4
SA
54122011-11-11 Sterling Augustine <saugustine@google.com>
5413
5414 * yyscript.y (section_cmd): Add support for INCLUDE directive.
5415 (file_or_sections_cmd): Likewise.
5416
f4a8b6d7
DK
54172011-11-11 Doug Kwan <dougkwan@google.com>
5418
5419 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
5420 if --just-symbols is given.
5421
29ab395d
DK
54222011-11-10 Doug Kwan <dougkwan@google.com>
5423
5424 PR gold/13362
5425 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
5426 when processing data relocs.
5427 * reloc.h (Relocate_functions::rel_unaligned): New method.
5428 (Relocate_functions::pcrel_unaligned): Ditto.
5429 (Relocate_functions::rel32_unaligned): Ditto.
5430 (Relocate_functions::pcrel32_unaligned): Ditto.
5431
2c339f71
DK
54322011-11-09 Doug Kwan <dougkwan@google.com>
5433
5434 PR gold/13362
5435 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
5436 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
5437 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
5438 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5439 (Relocate_functions::rel_unaligned): New.
5440 (Relocate_functions::rel32_unaligned): New.
5441 * target-reloc.h (relocate_for_relocatable): Add code to handle
5442 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
5443 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
5444 arm_unaligned_reloc_r): New targets.
5445 * testsuite/Makefile.in: Regenerate.
5446 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
5447 linking.
5448
3f3cddf1
ILT
54492011-11-02 Ian Lance Taylor <iant@google.com>
5450
5451 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
5452 NATIVE_LINKER.
5453 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
5454 * options.cc (General_options::finalize): Use library search path
5455 from configure script if specified. If not native and no sysroot,
5456 only search TOOLLIBDIR.
5457 * options.h (Search_directory::Search_directory): Change name to
5458 const std::string&.
5459 (General_options::add_to_library_path_with_sysroot): Change arg to
5460 const std::string&.
5461 * configure, Makefile.in, config.in: Rebuild.
5462
a8e2273b
ILT
54632011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5464
5465 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
5466 we are working around the ARM1176 Erratum.
5467 * options.h (General_options::fix_arm1176): Add option.
5468 * testsuite/Makefile.am: Add testcases, and keep current ones
5469 working.
5470 * testsuite/Makefile.in: Regenerate.
5471 * testsuite/arm_fix_1176.s: New file.
5472 * testsuite/arm_fix_1176.sh: Likewise.
5473
cd6eab1c
ILT
54742011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
5475
5476 * arm.cc (Target_arm::Target_arm): Remove initialisation of
5477 may_use_blx_.
5478 (Target_arm::may_use_blx): Remove method.
5479 (Target_arm::set_may_use_blx): Likewise.
5480 (Target_arm::may_use_v4t_interworking): New method.
5481 (Target_arm::may_use_v5t_interworking): Likewise.
5482 (Target_arm::may_use_blx_): Remove member variable.
5483 (Arm_relocate_functions::arm_branch_common): Check for v5T
5484 interworking.
5485 (Arm_relocate_functions::thumb_branch_common): Likewise.
5486 (Reloc_stub::stub_type_for_reloc): Likewise.
5487 (Target_arm::do_finalize_sections): Correct interworking checks.
5488 * testsuite/Makefile.am: Add new tests.
5489 * testsuite/Makefile.in: Regenerate.
5490 * testsuite/arm_farcall_arm_arm.s: New test.
5491 * testsuite/arm_farcall_arm_arm.sh: Likewise.
5492 * testsuite/arm_farcall_arm_thumb.s: Likewise.
5493 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
5494 * testsuite/arm_farcall_thumb_arm.s: Likewise.
5495 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
5496 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
5497 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
5498
286adcf4
CC
54992011-10-31 Cary Coutant <ccoutant@google.com>
5500
5501 PR gold/13023
5502 * expression.cc (Expression::eval_with_dot): Add
5503 is_section_dot_assignment parameter.
5504 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
5505 absolute and assigning to dot within a section.
5506 * script-sections.cc
5507 (Output_section_element_assignment::set_section_addresses): Pass
5508 dot_section to set_if_absolute.
5509 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
5510 as is_section_dot_assignment flag to eval_with_dot.
5511 (Output_section_element_dot_assignment::set_section_addresses):
5512 Likewise.
5513 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
5514 parameter. Also set value if relative to dot_section; set the
5515 symbol's output_section.
5516 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
5517 parameter. Adjust all callers.
5518 (Expression::eval_maybe_dot): Likewise.
5519 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
5520 Adjust all callers.
5521 * testsuite/script_test_2.t: Test assignment of an absolute value
5522 to dot within an output section element.
5523
9634ed06
CC
55242011-10-31 Cary Coutant <ccoutant@google.com>
5525
5526 * options.h (class General_options): Add --[no-]gnu-unique options.
5527 * symtab.cc (Symbol_table::sized_write_globals): Convert
5528 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
5529
de4101c7
CC
55302011-10-31 Cary Coutant <ccoutant@google.com>
5531
5532 PR gold/13359
5533 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
5534 unnecessary assertion.
5535 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
5536
7257cc92
ST
55372011-10-31 Sriraman Tallam <tmsriram@google.com>
5538
5539 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5540 gc_mark_symbol.
5541 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
5542 gc_mark_symbol.
5543 Change to just keep the section associated with symbol.
5544 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
5545 they are externally visible and --export-dynamic is turned on.
5546 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
5547
bfc34b3f
ILT
55482011-10-19 Ian Lance Taylor <iant@google.com>
5549
5550 PR gold/13163
5551 * script-sections.cc
5552 (Output_section_element_dot_assignment::needs_output_section): New
5553 function.
5554
ea0d8c47
ILT
55552011-10-19 Ian Lance Taylor <iant@google.com>
5556
5557 PR gold/13204
5558 * layout.cc (Layout::segment_precedes): Don't assert failure if a
5559 --section-start option was seen.
5560 * options.h (General_options::any_section_start): New function.
5561
abd242a9
DM
55622011-10-18 David S. Miller <davem@davemloft.net>
5563
5564 PR binutils/13301
5565 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
5566 member to track relocation locations that have moved during TLS
5567 reloc optimizations.
5568 (Target_sparc::Relocate::Relocate): Initialize to NULL.
5569 (Target_sparc::Relocate::relocate): Adjust view down by 4
5570 bytes if it matches reloc_adjust_addr_.
5571 (Target_sparc::Relocate::relocate_tls): Always move the
5572 __tls_get_addr call delay slot instruction forward 4 bytes when
5573 performing relaxation.
5574
bab9090f
CC
55752011-10-18 Cary Coutant <ccoutant@google.com>
5576
5577 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
5578 (Output_file::map_no_anonymous): Check for non-zero
5579 return code from posix_fallocate.
5580
f7c5b166
CC
55812011-10-17 Cary Coutant <ccoutant@google.com>
5582
5583 PR gold/13245
5584 * plugin.cc (is_visible_from_outside): Check for symbols
5585 referenced from dynamic objects.
5586 * resolve.cc (Symbol_table::resolve): Don't count references
5587 from dynamic objects as references from real ELF files.
5588 * testsuite/plugin_test_2.sh: Adjust expected result.
5589
b490c0bb
CC
55902011-10-17 Cary Coutant <ccoutant@google.com>
5591
5592 * gold.cc: Include timer.h.
5593 (queue_middle_tasks): Stamp time.
5594 (queue_final_tasks): Likewise.
5595 * main.cc (main): Store timer in parameters. Print timers
5596 for each pass.
5597 * parameters.cc (Parameters::Parameters): Initialize timer_.
5598 (Parameters::set_timer): New function.
5599 (set_parameters_timer): New function.
5600 * parameters.h (Parameters::set_timer): New function.
5601 (Parameters::timer): New function.
5602 (Parameters::timer_): New data member.
5603 (set_parameters_timer): New function.
5604 * timer.cc (Timer::stamp): New function.
5605 (Timer::get_pass_time): New function.
5606 * timer.h (Timer::stamp): New function.
5607 (Timer::get_pass_time): New function.
5608 (Timer::pass_times_): New data member.
5609
f475cf7b
CC
56102011-10-17 Cary Coutant <ccoutant@google.com>
5611
5612 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
5613 task for members of lib groups.
5614
cdd7e244
CC
56152011-10-17 Cary Coutant <ccoutant@google.com>
5616
5617 PR gold/13288
4f95c8b4 5618 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
5619 (File_read::make_view): Move bounds check (replace with assert)...
5620 (File_read::find_or_make_view): ... to here.
5621
dfb45471
CC
56222011-10-12 Cary Coutant <ccoutant@google.com>
5623
4f95c8b4 5624 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
5625 ::read returns less than requested size.
5626
53bbcc1b
CC
56272011-10-10 Cary Coutant <ccoutant@google.com>
5628
4f95c8b4 5629 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
5630 Initialize defined_count_.
5631 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
5632 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
5633 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
5634 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
5635 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 5636 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
5637 member.
5638 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 5639 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
5640 Return zeroes instead of internal error.
5641
397b129b
CC
56422011-10-10 Cary Coutant <ccoutant@google.com>
5643
5644 PR gold/13249
4f95c8b4 5645 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 5646 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 5647 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
5648 (Output_reloc::type_): Adjust size of bit field.
5649 (Output_reloc::use_plt_offset_): New bit field.
5650 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
5651 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
5652 flag. Adjust all callers.
4f95c8b4 5653 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
5654 creating RELATIVE relocations.
5655
d5698657
NC
56562011-10-10 Nick Clifton <nickc@redhat.com>
5657
5658 * po/es.po: Updated Spanish translation.
5659 * po/fi.po: Updated Finnish translation.
5660
6a59a5c2
DN
56612011-10-03 Diego Novillo <dnovillo@google.com>
5662
5663 * options.cc (parse_uint): Fix dereference of RETVAL.
5664
f0558624
ST
56652011-09-29 Sriraman Tallam <tmsriram@google.com>
5666
5667 * layout.h (section_order_map_): New member.
5668 (get_section_order_map): New member function.
5669 * output.cc (Output_section::add_input_section): Check for patterns
5670 only when --section-ordering-file is specified.
5671 * gold.cc (queue_middle_tasks): Delay updating order of sections till
5672 output_sections have been formed.
5673 * layout.cc (Layout_Layout): Initialize section_order_map_.
5674 * plugin.cc (update_section_order): Store order in order_map. Do not
5675 update the order.
5676 * testsuite/Makefile.am: Add test case for plugin_final_layout.
5677 * testsuite/Makefile.in: Regenerate.
5678 * testsuite/plugin_section_order.c: New file.
5679 * testsuite/plugin_final_layout.cc: New file.
5680 * testsuite/plugin_final_layout.sh: New file.
5681
a7dac153
CC
56822011-09-29 Cary Coutant <ccoutant@google.com>
5683
4f95c8b4 5684 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 5685 Check for NULL.
4f95c8b4 5686 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
5687 symbols during incremental update.
5688 (Symbol_table::add_from_dynobj): Likewise.
5689
eebd87a5
ILT
56902011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5691 Ian Lance Taylor <iant@google.com>
5692
5693 * symtab.cc (Symbol_table::define_special_symbol): Always
5694 canonicalize version string.
5695
403a3331
CC
56962011-09-26 Cary Coutant <ccoutant@google.com>
5697
4f95c8b4
CC
5698 * gold.cc (queue_initial_tasks): Move option checks ...
5699 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
5700 some options; make others fatal.
5701
235061c2
CC
57022011-09-26 Cary Coutant <ccoutant@google.com>
5703
5704 gcc PR lto/47247
5705 * plugin.cc (get_symbols_v2): New function.
5706 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
5707 (is_referenced_from_outside): New function.
5708 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
5709 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
5710 (get_symbols): Pass version parameter.
5711 (get_symbols_v2): New function.
5712 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
5713 parameter.
5714 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
5715 (onload): Add LDPT_GET_SYMBOLS_V2.
5716 (all_symbols_read_hook): Use get_symbols_v2; check for
5717 LDPR_PREVAILING_DEF_IRONLY_EXP.
5718 * testsuite/plugin_test_3.sh: Update expected results.
5719
dc87f620
ILT
57202011-09-23 Simon Baldwin <simonb@google.com>
5721
5722 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
5723 configuration options.
5724 * configure: Regenerate.
5725 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
5726 * Makefile.in: Regenerate.
5727 * testsuite/Makefile.in: Regenerate.
5728
a8279f82
ST
57292011-09-19 Sriraman Tallam <tmsriram@google.com>
5730
5731 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
5732
0c9350c8
CC
57332011-09-19 Cary Coutant <ccoutant@google.com>
5734
5735 * incremental.cc (can_incremental_update): Fix typo in comment.
5736 * incremental.h (can_incremental_update): Likewise.
5737
aa06ae28
CC
57382011-09-18 Cary Coutant <ccoutant@google.com>
5739
5740 * incremental.cc (can_incremental_update): New function.
5741 * incremental.h (can_incremental_update): New function.
5742 * layout.cc (Layout::init_fixed_output_section): Call it.
5743 (Layout::make_output_section): Don't allow patch space in .eh_frame.
5744 * object.cc (Sized_relobj_file::do_layout): Call
5745 can_incremental_update.
5746
ebb300b2
CC
57472011-09-13 Cary Coutant <ccoutant@google.com>
5748
5749 * configure.ac: Check for glibc support for gnu_indirect_function
5750 support with static linking, setting automake conditional
5751 IFUNC_STATIC.
5752 * Makefile.in: Regenerate.
5753 * configure: Regenerate.
5754
5755 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
5756 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
5757 for IFUNC_STATIC.
5758 * testsuite/Makefile.in: Regenerate.
5759
1206d0d5
CC
57602011-09-13 Cary Coutant <ccoutant@google.com>
5761
5762 * incremental.cc (Sized_relobj_incr::do_layout): Call
5763 report_comdat_group for kept comdat sections.
5764 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
5765 * testsuite/Makefile.in: Regenerate.
5766 * testsuite/incr_comdat_test_1.cc: New source file.
5767 * testsuite/incr_comdat_test_2_v1.cc: New source file.
5768 * testsuite/incr_comdat_test_2_v2.cc: New source file.
5769 * testsuite/incr_comdat_test_2_v3.cc: New source file.
5770
40b29874
ILT
57712011-09-13 Ian Lance Taylor <iant@google.com>
5772
5773 * object.cc (Sized_relobj_file::do_layout): Remove unused local
5774 variable external_symbols_offset.
5775
1b045aac
ILT
57762011-09-12 Ian Lance Taylor <iant@google.com>
5777
5778 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
5779 triggered if object has no symbols.
5780
24c6c55a
DM
57812011-09-09 David S. Miller <davem@davemloft.net>
5782
5783 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
5784 (Output_fill_debug_line::do_write): Likewise.
5785
66570254
CC
57862011-08-29 Cary Coutant <ccoutant@google.com>
5787
5788 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
5789 casts to match formatting specs.
5790 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
5791
8ea8cd50
CC
57922011-08-26 Cary Coutant <ccoutant@google.com>
5793
5794 * layout.cc (Free_list::allocate): Provide guarantee of minimum
5795 remaining hole size when allocating.
5796 (Layout::make_output_section): Set fill methods for debug sections.
5797 * layout.h (Free_list::Free_list_node): Move from private to
5798 public.
5799 (Free_list::set_min_hole_size): New function.
5800 (Free_list::begin, Free_list::end): New functions.
5801 (Free_list::min_hole_): New data member.
5802 * output.cc: Include dwarf.h.
5803 (Output_fill_debug_info::do_minimum_hole_size): New function.
5804 (Output_fill_debug_info::do_write): New function.
5805 (Output_fill_debug_line::do_minimum_hole_size): New function.
5806 (Output_fill_debug_line::do_write): New function.
5807 (Output_section::Output_section): Initialize new data member.
5808 (Output_section::set_final_data_size): Ensure patch space is larger
5809 than minimum hole size.
5810 (Output_section::do_write): Fill holes in debug sections.
5811 * output.h (Output_fill): New class.
5812 (Output_fill_debug_info): New class.
5813 (Output_fill_debug_line): New class.
5814 (Output_section::set_free_space_fill): New function.
5815 (Output_section::free_space_fill_): New data member.
5816 * testsuite/Makefile.am (incremental_test_3): Add
5817 --incremental-patch option.
5818 (incremental_test_4): Likewise.
5819 (incremental_test_5): Likewise.
5820 (incremental_test_6): Likewise.
5821 (incremental_copy_test): Likewise.
5822 (incremental_common_test_1): Likewise.
5823 * testsuite/Makefile.in: Regenerate.
5824
7cf80422
NC
58252011-08-26 Nick Clifton <nickc@redhat.com>
5826
5827 * po/es.po: Updated Spanish translation.
5828
c3f7b0e5
CC
58292011-08-01 Cary Coutant <ccoutant@google.com>
5830
5831 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
5832 * gold/testsuite/Makefile.in: Regenerate.
5833 * gold/testsuite/justsyms_exec.c: New source file.
5834 * gold/testsuite/justsyms_lib.c: New source file.
5835
9590bf25
CC
58362011-08-01 Cary Coutant <ccoutant@google.com>
5837
5838 * layout.cc (Layout::set_segment_offsets): Don't realign text
5839 segment if -Ttext was specified.
5840 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
5841 file type.
5842 * object.h (Sized_relobj_file::e_type): New function.
5843 (Sized_relobj_file::e_type_): New data member.
5844 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
5845 base address for ET_EXEC files.
5846 * target.cc (Target::do_make_elf_object_implementation): Allow
5847 ET_EXEC files with --just-symbols option.
5848
dcd8d12e
CC
58492011-07-28 Cary Coutant <ccoutant@google.com>
5850
5851 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
5852 Add thread_number parameter.
5853 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
5854 * workqueue-threads.cc
5855 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
5856 current thread if its thread number is greater than desired thread
5857 count.
5858 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
5859 Add thread_number parameter.
5860 (Workqueue::should_cancel_thread): Likewise.
5861 (Workqueue::find_runnable_or_wait): Pass thread_number to
5862 should_cancel_thread.
5863 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
5864 parameter.
5865
804eb480
ST
58662011-07-22 Sriraman Tallam <tmsriram@google.com>
5867
5868 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
5869 only after checking if it cannot be forced local.
5870 * symtab.h (is_externally_visible): Check if the symbol is not forced
5871 local.
5872
f1ddb600
ILT
58732011-07-15 Ian Lance Taylor <iant@google.com>
5874
5875 * options.h (class General_options): Add --print-output-format.
5876 Move -EL next to -EB, for better --help output.
5877 * target-select.cc: Include <cstdio>, "options.h", and
5878 "parameters.h".
5879 (Target_selector::do_target_bfd_name): New function.
5880 (print_output_format): New function.
5881 * target-select.h (class Target_selector): Update declarations.
5882 (Target_selector::target_bfd_name): New function.
5883 (print_output_format): Declare.
5884 * main.cc: Include "target-select.h".
5885 (main): Handle --print-output-format.
5886 * gold.cc: Include "target-select.h".
5887 (queue_initial_tasks): Handle --print-output-format when there are
5888 no input files.
5889 * parameters.cc (parameters_force_valid_target): Give a better
5890 error message if -EB/-EL does not match target.
5891 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
5892 function.
5893
7d172687
ILT
58942011-07-15 Ian Lance Taylor <iant@google.com>
5895
5896 * i386.cc (class Output_data_plt_i386): Add layout_ field.
5897 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
5898 (Output_data_plt_i386::do_write): Write address of .dynamic
5899 section to first entry in .got.plt section.
5900 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
5901 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
5902 Initialize layout_.
5903 (Output_data_plt_x86_64::do_write): Write address of .dynamic
5904 section to first entry in .got.plt section.
5905 * layout.h (Layout::dynamic_section): New function.
5906
e9552f7e
ST
59072011-07-13 Sriraman Tallam <tmsriram@google.com>
5908
5909 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
5910 to claim_file call.
5911 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
5912 input_section_position_, and input_section_glob_.
5913 (read_layout_from_file): Call function section_ordering_specified.
5914 * layout.h (is_section_ordering_specified): New function.
5915 (section_ordering_specified): New function.
5916 (section_ordering_specified_): New boolean member.
5917 * main.cc(main): Call load_plugins after layout object is defined.
5918 * output.cc (Output_section::add_input_section): Use
5919 function section_ordering_specified to check if section ordering is
5920 needed.
5921 * output.cc (Output_section::add_relaxed_input_section): Use
5922 function section_ordering_specified to check if section ordering is
5923 needed.
5924 (Output_section::update_section_layout): New function.
5925 (Output_section::sort_attached_input_sections): Check if input section
5926 must be reordered.
5927 * output.h (Output_section::update_section_layout): New function.
5928 * plugin.cc (get_section_count): New function.
5929 (get_section_type): New function.
5930 (get_section_name): New function.
5931 (get_section_contents): New function.
5932 (update_section_order): New function.
58797674 5933 (allow_section_ordering): New function.
e9552f7e
ST
5934 (Plugin::load): Add the new interfaces to the transfer vector.
5935 (Plugin_manager::load_plugins): New parameter.
5936 (Plugin_manager::all_symbols_read): New parameter.
5937 (Plugin_manager::claim_file): New parameter. Save the elf object for
5938 unclaimed objects.
5939 (Plugin_manager::get_elf_object): New function.
5940 (Plugin_manager::get_view): Change to directly use the bool to check
5941 if get_view is called from claim_file_hook.
5942 * plugin.h (input_objects): New function
5943 (Plugin__manager::load_plugins): New parameter.
5944 (Plugin_manager::claim_file): New parameter.
5945 (Plugin_manager::get_elf_object): New function.
5946 (Plugin_manager::in_claim_file_handler): New function.
5947 (Plugin_manager::in_claim_file_handler_): New member.
5948 (layout): New function.
5949 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
5950 handler with an extra parameter. Make the elf object before calling
5951 claim_file handler.
5952 * testsuite/plugin_test.c (get_section_count): New function pointer.
5953 (get_section_type): New function pointer.
5954 (get_section_name): New function pointer.
5955 (get_section_contents): New function pointer.
5956 (update_section_order): New function pointer.
5957 (allow_section_ordering): New function pointer.
5958 (onload): Check if the new interfaces exist.
5959
9446efde
ILT
59602011-07-13 Ian Lance Taylor <iant@google.com>
5961
5962 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
5963 relro section.
5964 * x86_64.cc (Target_x86_64::got_section): Likewise.
5965 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
5966 (relro_now_test_SOURCES): New variable.
5967 (relro_now_test_DEPENDENCIES): New variable.
5968 (relro_now_test_LDFLAGS): New variable.
5969 (relro_now_test_LDADD): New variable.
5970 (relro_now_test.so): New target.
5971 * testsuite/Makefile.in: Rebuild.
5972
07aa62f2
ILT
59732011-07-12 Ian Lance Taylor <iant@google.com>
5974
5975 PR gold/12980
5976 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
5977 GLOB_DAT relocation rather than a RELATIVE relocation for a
5978 protected symbol when creating a shared library.
5979 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5980 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
5981 * testsuite/protected_main_1.cc (main): Test that protected
5982 function has same address.
5983
e2153196
ILT
59842011-07-11 Ian Lance Taylor <iant@google.com>
5985
5986 PR gold/12979
5987 * options.h (class General_options): Add -Bgroup.
5988 * options.cc (General_options::finalize): If -Bgroup is set,
5989 default to --unresolved-symbols=report-all.
5990 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
5991 * target-reloc.h (issue_undefined_symbol_error): Handle
5992 --unresolved-symbols=report-all.
5993
6daf5215
ILT
59942011-07-08 Ian Lance Taylor <iant@google.com>
5995
5996 PR gold/11985
5997 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
5998 if linker script discards key sections.
5999 (Layout::create_dynamic_symtab): Likewise.
6000 (Layout::assign_local_dynsym_offsets): Likewise.
6001 (Layout::sized_create_version_sections): Likewise.
6002 (Layout::create_interp): Likewise.
6003 (Layout::finish_dynamic_section): Likewise.
6004 (Layout::set_dynamic_symbol_size): Likewise.
6005
beabb2c6
ILT
60062011-07-08 Ian Lance Taylor <iant@google.com>
6007
6008 PR gold/12386
6009 * options.h (class General_options): Add --unresolved-symbols.
6010 * target-reloc.h (issue_undefined_symbol_error): Check
6011 --unresolved-symbols. Add comments.
6012
9c16daf1
ILT
60132011-07-08 Ian Lance Taylor <iant@google.com>
6014
6015 * testsuite/odr_violation2.cc (Ordering::operator()): Make
6016 expression more complex.
6017
191f1a2d
ILT
60182011-07-08 Ian Lance Taylor <iant@google.com>
6019
6020 PR gold/11317
6021 * target-reloc.h (issue_undefined_symbol_error): New inline
6022 function, broken out of relocate_section.
6023 (relocate_section): Call issue_undefined_symbol_error.
6024 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6025 there is no TLS segment if we are about to issue an undefined
6026 symbol error.
6027 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6028
62855347
ILT
60292011-07-08 Ian Lance Taylor <iant@google.com>
6030
6031 PR gold/12279
6032 * resolve.cc (Symbol_table::should_override): Add fromtype
6033 parameter. Change all callers. Give error when linking together
6034 TLS and non-TLS symbol.
6035 (Symbol_table::should_override_with_special): Add fromtype
6036 parameter. Change all callers.
6037 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
6038 there is no TLS segment if we have reported some errors.
6039 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
6040
67181c72
ILT
60412011-07-08 Ian Lance Taylor <iant@google.com>
6042
6043 PR gold/12372
6044 * target.h (Target::plt_address_for_global): New function.
6045 (Target::plt_address_for_local): New function.
6046 (Target::plt_section_for_global): Remove.
6047 (Target::plt_section_for_local): Remove.
6048 (Target::do_plt_address_for_global): New virtual function.
6049 (Target::do_plt_address_for_local): New virtual function.
6050 (Target::do_plt_section_for_global): Remove.
6051 (Target::do_plt_section_for_local): Remove.
6052 (Target::register_global_plt_entry): Add Symbol_table and Layout
6053 parameters.
6054 * output.cc (Output_data_got::Got_entry::write): Use
6055 plt_address_for_global and plt_address_for_local.
6056 * layout.cc (Layout::add_target_dynamic_tags): Use size and
6057 address of output section.
6058 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
6059 got_irelative_, and irelative_count_ fields. Update
6060 declarations.
6061 (Output_data_plt_i386::has_irelative_section): New function.
6062 (Output_data_plt_i386::entry_count): Add irelative_count_.
6063 (Output_data_plt_i386::set_final_data_size): Likewise.
6064 (class Target_i386): Add got_irelative_ and rel_irelative_
6065 fields. Update declarations.
6066 (Target_i386::Target_i386): Initialize new fields.
6067 (Target_i386::do_plt_address_for_global): New function replacing
6068 do_plt_section_for_global.
6069 (Target_i386::do_plt_address_for_local): New function replacing
6070 do_plt_section_for_local.
6071 (Target_i386::got_section): Create got_irelative_.
6072 (Target_i386::rel_irelative_section): New function.
6073 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
6074 fields. Don't define __rel_iplt_{start,end}.
6075 (Output_data_plt_i386::add_entry): Add symtab and layout
6076 parameters. Change all callers. Use different PLT and GOT for
6077 IFUNC symbols.
6078 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
6079 layout parameters. Change all callers. Use different PLT and
6080 GOT.
6081 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
6082 (Output_data_plt_i386::rel_irelative): New function.
6083 (Output_data_plt_i386::address_for_global): New function.
6084 (Output_data_plt_i386::address_for_local): New function.
6085 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
6086 IRELATIVE GOT when changing IFUNC GOT entries.
6087 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
6088 reloc.
6089 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
6090 if we didn't create an IRELATIVE GOT.
6091 (Target_i386::Relocate::relocate): Use plt_address_for_global and
6092 plt_address_for_local.
6093 (Target_i386::do_dynsym_value): Use plt_address_for_global.
6094 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
6095 got_irelative_, and irelative_count_ fields. Update
6096 declarations.
6097 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
6098 Initialize new fields. Remove symtab parameter. Change all
6099 callers.
6100 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
6101 irelative_count_.
6102 (Output_data_plt_x86_64::has_irelative_section): New function.
6103 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
6104 (class Target_x86_64): Add got_irelative_ and rel_irelative_
6105 fields. Update declarations.
6106 (Target_x86_64::Target_x86_64): Initialize new fields.
6107 (Target_x86_64::do_plt_address_for_global): New function replacing
6108 do_plt_section_for_global.
6109 (Target_x86_64::do_plt_address_for_local): New function replacing
6110 do_plt_section_for_local.
6111 (Target_x86_64::got_section): Create got_irelative_.
6112 (Target_x86_64::rela_irelative_section): New function.
6113 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
6114 all callers. Don't create __rel_iplt_{start,end}.
6115 (Output_data_plt_x86_64::add_entry): Add symtab and layout
6116 parameters. Change all callers. Use different PLT and GOT for
6117 IFUNC symbols.
6118 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
6119 layout parameters. Change all callers. Use different PLT and
6120 GOT.
6121 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
6122 parameters. Change all callers. Use different PLT and GOT for
6123 IFUNC symbols.
6124 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
6125 (Output_data_plt_x86_64::rela_irelative): New function.
6126 (Output_data_plt_x86_64::address_for_global): New function.
6127 (Output_data_plt_x86_64::address_for_local): New function.
6128 (Output_data_plt_x86_64::set_final_data_size): Likewise.
6129 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
6130 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
6131 (Target_x86_64::register_global_plt_entry): Add symtab and layout
6132 parameters.
6133 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
6134 reloc.
6135 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
6136 symbols if we didn't create an IRELATIVE GOT.
6137 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
6138 plt_address_for_local.
6139 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
6140 * testsuite/ifuncvar1.c: New test file.
6141 * testsuite/ifuncvar2.c: New test file.
6142 * testsuite/ifuncvar3.c: New test file.
6143 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
6144 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
6145 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
6146 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
6147 * testsuite/Makefile.in: Rebuild.
6148
33c15b45
CC
61492011-07-07 Cary Coutant <ccoutant@google.com>
6150
6151 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
6152 (two_file_test_1_ndebug.o): Likewise.
6153 (two_file_test_1b_ndebug.o): Likewise.
6154 (two_file_test_2_ndebug.o): Likewise.
6155 (two_file_test_main_ndebug.o): Likewise.
6156 (incremental_test_2): Link with no-debug versions.
6157
f48b5fb7
CC
61582011-07-06 Cary Coutant <ccoutant@google.com>
6159
6160 * gold/incremental.cc
6161 (Output_section_incremental_inputs::write_info_blocks): Check for
6162 hidden and internal symbols.
6163
221597a5
CC
61642011-07-06 Cary Coutant <ccoutant@google.com>
6165
6166 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
6167 Check disposition for startup file.
6168 (Incremental_inputs::report_command_line): Ignore
6169 --incremental-startup-unchanged option.
6170 * options.cc (General_options::parse_incremental_startup_unchanged):
6171 New function.
6172 (General_options::General_options): Initialize new data member.
6173 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
6174 (General_options): Add --incremental-startup-unchanged option.
6175 (General_options::incremental_startup_disposition): New function.
6176 (General_options::incremental_startup_disposition_): New data member.
6177
e24719f6
CC
61782011-07-06 Cary Coutant <ccoutant@google.com>
6179
6180 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
6181 input file index to Script_info ctor.
6182 (Sized_incremental_binary::do_file_has_changed): Find the
6183 command-line argument for files named in scripts.
6184 * incremental.h (Script_info::Script_info): New ctor
6185 with input file index.
6186 (Script_info::input_file_index): New function.
6187 (Script_info::input_file_index_): New data member.
6188 (Incremental_binary::get_library): Add const.
6189 (Incremental_binary::get_script_info): Add const.
6190 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
6191 * testsuite/Makefile.am (incremental_test_5): New test case.
6192 (incremental_test_6): New test case.
6193 * testsuite/Makefile.in: Regenerate.
6194
8f7c81e8
CC
61952011-07-06 Cary Coutant <ccoutant@google.com>
6196
6197 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
6198 debug output when command lines differ.
6199
9fbd3822
CC
62002011-07-06 Cary Coutant <ccoutant@google.com>
6201
6202 * incremental.cc (Incremental_inputs::report_command_line): Ignore
6203 --incremental-patch option.
6204 * layout.cc (Free_list::allocate): Extend allocation beyond original
6205 end if enabled.
6206 (Layout::make_output_section): Mark sections that should get
6207 patch space.
6208 * options.cc (parse_percent): New function.
6209 * options.h (parse_percent): New function.
6210 (DEFINE_percent): New macro.
6211 (General_options): Add --incremental-patch option.
6212 * output.cc (Output_section::Output_section): Initialize new data
6213 members.
6214 (Output_section::add_input_section): Print section name when out
6215 of patch space.
6216 (Output_section::add_output_section_data): Likewise.
6217 (Output_section::set_final_data_size): Add patch space when
6218 doing --incremental-full.
6219 (Output_section::do_reset_address_and_file_offset): Remove patch
6220 space.
6221 (Output_segment::set_section_list_addresses): Print debug output
6222 only if --incremental-update.
6223 * output.h (Output_section::set_is_patch_space_allowed): New function.
6224 (Output_section::is_patch_space_allowed_): New data member.
6225 (Output_section::patch_space_): New data member.
6226 * parameters.cc (Parameters::incremental_full): New function.
6227 * parameters.h (Parameters::incremental_full): New function
6228 * testsuite/Makefile.am (incremental_test_2): Add test for
6229 --incremental-patch option.
6230 * testsuite/Makefile.in: Regenerate.
6231 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
6232 (t18): Remove function body.
6233
f6cccc2c
DK
62342011-07-05 Doug Kwan <dougkwan@google.com>
6235
6236 PR gold/12771
6237 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
6238 Arm_Address type for relocation result.
6239 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
6240 overflow check.
6241 (Arm_relocate_functions::abs32): Use unaligned access.
6242 (Arm_relocate_functions::rel32): Ditto.
6243 (Arm_relocate_functions::prel31): Ditto.
6244 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
6245 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
6246 static data relocations.
6247 * testsuite/Makefile.in: Regnerate.
6248 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
6249
28a13fec
ILT
62502011-07-05 Ian Lance Taylor <iant@google.com>
6251
6252 PR gold/12392
6253 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
6254 symbols if necessary.
6255 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6256
24d47b34
ILT
62572011-07-05 Ian Lance Taylor <iant@google.com>
6258
6259 PR gold/12952
6260 * resolve.cc (Symbol::override_base_with_special): Simply override
6261 version with special symbol version, ignoring previous version.
6262
41f9cbbe
ILT
62632011-07-05 Ian Lance Taylor <iant@google.com>
6264
6265 * object.cc (Sized_relobj_file::include_section_group): Add
6266 information to comment about signature location.
6267
886288f1
ILT
62682011-07-02 Ian Lance Taylor <iant@google.com>
6269
6270 PR gold/12957
6271 * options.h (class General_options): Add -f and -F.
6272 * options.cc (General_options::finalize): Fatal error if -f/-F
6273 are used without -shared.
6274 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
6275
ae3a6d4f
ILT
62762011-07-02 Ian Lance Taylor <iant@google.com>
6277
6278 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
6279
21131061
ILT
62802011-07-01 Ian Lance Taylor <iant@google.com>
6281
6282 PR gold/12525
6283 PR gold/12952
6284 * resolve.cc (Symbol::override_base_with_special): Don't override
6285 the version if the overriding symbol has a different name.
6286 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
6287 all callers. If we give an error about an undefined version,
6288 define the base version if necessary.
6289 * dynobj.h (class Versions): Update declaration.
6290 * testsuite/weak_alias_test_5.cc: New file.
6291 * testsuite/weak_alias_test.script: New file.
6292 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
6293 and versioned_alias have the right value, and call t2.
6294 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
6295 weak_alias_test_5.so.
6296 (weak_alias_test_LDADD): Likewise.
6297 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
6298 * testsuite/Makefile.in: Rebuild.
6299
611062c0
ILT
63002011-07-01 Ian Lance Taylor <iant@google.com>
6301
6302 PR gold/12525
6303 * options.h (class General_options): Support -z notext.
6304 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
6305 -Wl,-z,notext.
6306 (two_file_shared_nonpic.so): Likewise.
6307 (two_file_shared_mixed.so): Likewise.
6308 (two_file_shared_mixed_1.so): Likewise.
6309 (weak_undef_lib_nonpic.so): Likewise.
6310 (alt/weak_undef_lib_nonpic.so): Likewise.
6311 (tls_test_shared_nonpic.so): Likewise.
6312 * testsuite/Makefile.in: Rebuild.
6313
328c7c2f
ILT
63142011-07-01 Ian Lance Taylor <iant@google.com>
6315
6316 PR gold/12525
6317 * configure.ac: Test whether static linking works, setting
6318 the automake conditional HAVE_STATIC.
6319 * testsuite/Makefile.am: Disable tests using -static if
6320 HAVE_STATIC is not true.
6321 * configure, testsuite/Makefile.in: Rebuild.
6322
02d7cd44
ILT
63232011-07-01 Ian Lance Taylor <iant@google.com>
6324
6325 PR gold/12525
6326 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
6327 Assert if we see DW_EH_PE_indirect.
6328 * target.h (Target::ehframe_datarel_base): New function.
6329 (Target::do_ehframe_datarel_base): New target function.
6330 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
6331 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
6332 function.
6333
07a60597
ILT
63342011-07-01 Ian Lance Taylor <iant@google.com>
6335
6336 PR gold/12571
6337 * options.h (class General_options): Add
6338 --ld-generated-unwind-info.
6339 * ehframe.cc (Fde::write): Add address parameter. Change all
6340 callers. If associated with PLT, fill in address and size.
6341 (Cie::set_output_offset): Only add merge mapping if there is an
6342 object.
6343 (Cie::write): Add address parameter. Change all callers.
6344 (Eh_frame::add_ehframe_for_plt): New function.
6345 * ehframe.h (class Fde): Update declarations. Move shndx_ and
6346 input_offset_ fields into union u_, with new plt field.
6347 (Fde::Fde): Adjust for new union field.
6348 (Fde::Fde) [Output_data version]: New constructor.
6349 (Fde::add_mapping): Only add merge mapping if there is an object.
6350 (class Cie): Update declarations.
6351 (class Eh_frame): Declare add_ehframe_for_plt.
6352 * layout.cc (Layout::layout_eh_frame): Break out code into
6353 make_eh_frame_section, and call it.
6354 (Layout::make_eh_frame_section): New function.
6355 (Layout::add_eh_frame_for_plt): New function.
6356 * layout.h (class Layout): Update declarations.
6357 * merge.cc (Merge_map::add_mapping): Add assertion.
6358 * i386.cc: Include "dwarf.h".
6359 (class Output_data_plt_i386): Make first_plt_entry,
6360 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
6361 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6362 and plt_eh_frame_fde.
6363 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
6364 boundary. Call add_eh_frame_for_plt if appropriate.
6365 * x86_64.cc: Include "dwarf.h".
6366 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
6367 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
6368 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
6369 and plt_eh_frame_fde.
6370 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
6371 appropriate.
6372
14788a3f
ILT
63732011-06-29 Ian Lance Taylor <iant@google.com>
6374
6375 PR gold/12629
6376 * object.cc (Sized_relobj_file::layout_section): Change shdr
6377 parameter to be const.
6378 (Sized_relobj_file::layout_eh_frame_section): New function, broken
6379 out of do_layout.
6380 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
6381 appropriate. Call layout_eh_frame_section.
6382 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
6383 sections.
6384 * object.h (class Sized_relobj_file): Update declarations.
6385
6c21fce1
ILT
63862011-06-29 Ian Lance Taylor <iant@google.com>
6387
37e41b03 6388 PR gold/12652
6c21fce1
ILT
6389 * script.cc (Token::integer_value): Accept trailing M/m/K/k
6390 modifier.
6391 (Lex::gather_token): Accept trailing M/m/K/k for integers.
6392
4d5e4e62
ILT
63932011-06-29 Ian Lance Taylor <iant@google.com>
6394
6395 PR gold/12675
6396 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
6397 SHT_X86_64_UNWIND.
6398 * layout.cc (Layout::layout_eh_frame): Likewise.
6399
886f533a
ILT
64002011-06-29 Ian Lance Taylor <iant@google.com>
6401
6402 PR gold/12695
6403 * layout.cc (Layout::symtab_section_shndx): New function.
6404 * layout.h (class Layout): Declare symtab_section_shndx.
6405 * output.cc (Output_section::write_header): Call it.
6406
f3ae1b28
ILT
64072011-06-29 Ian Lance Taylor <iant@google.com>
6408
6409 PR gold/12818
6410 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
6411 symbols which are not used in a relocation.
6412
aecf301f
ILT
64132011-06-28 Ian Lance Taylor <iant@google.com>
6414
6415 PR gold/12898
6416 * layout.cc (Layout::segment_precedes): Don't crash if a linker
6417 script create indistinguishable segments.
6418 (Layout::set_segment_offsets): Use stable_sort when sorting
6419 segments. Pass this to Compare_segments constructor.
6420 * layout.h (class Layout): Make segment_precedes non-static.
6421 (class Compare_segments): Change from struct to class. Add
6422 layout_ field. Add constructor.
6423 * script-sections.cc
6424 (Script_sections::attach_sections_using_phdrs_clause): Rename
6425 local orphan to is_orphan. Don't report failure to put empty
6426 section in segment. On attachment failure, report name of
6427 section, and attach to first PT_LOAD segment.
6428
03ef7571
ILT
64292011-06-28 Ian Lance Taylor <iant@google.com>
6430
6431 PR gold/12934
6432 * target-select.cc (Target_selector::Target_selector): Add
6433 emulation parameter. Change all callers.
6434 (select_target_by_bfd_name): Rename from select_target_by_name.
6435 Change all callers.
6436 (select_target_by_emulation): New function.
6437 (supported_emulation_names): New function.
6438 * target-select.h (class Target_selector): Add emulation_ field.
6439 Update declarations.
6440 (Target_selector::recognize_by_bfd_name): Rename from
6441 recognize_by_name. Change all callers.
6442 (Target_selector::supported_bfd_names): Rename from
6443 supported_names. Change all callers.
6444 (Target_selector::recognize_by_emulation): New function.
6445 (Target_selector::supported_emulations): New function.
6446 (Target_selector::emulation): New function.
6447 (Target_selector::do_recognize_by_bfd_name): Rename from
6448 do_recognize_by_name. Change all callers.
6449 (Target_selector::do_supported_bfd_names): Rename from
6450 do_supported_names. Change all callers.
6451 (Target_selector::do_recognize_by_emulation): New function.
6452 (Target_selector::do_supported_emulations): New function.
6453 (select_target_by_bfd_name): Change name in declaration.
6454 (select_target_by_emulation): Declare.
6455 (supported_emulation_names): Declare.
6456 * parameters.cc (parameters_force_valid_target): Try to find
6457 target based on emulation from -m option.
6458 * options.h (class General_options): Change doc string for -m.
6459 * options.cc (help): Print emulations.
6460 (General_options::parse_V): Likewise.
6461 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
6462 Add emulation parameter. Change all callers.
6463
200b2bb9
ILT
64642011-06-28 Ian Lance Taylor <iant@google.com>
6465
6466 * target.h (class Target): Add osabi_ field.
6467 (Target::osabi): New function.
6468 (Target::set_osabi): New function.
6469 (Target::Target): Initialize osabi_.
6470 (Target::do_adjust_elf_header): Make pure virtual.
6471 (Sized_target::do_adjust_elf_header): Declare.
6472 * target.cc (Sized_target::do_adjust_elf_header): New function.
6473 (class Sized_target): Instantiate all versions.
6474 * freebsd.h (class Target_freebsd): Remove.
6475 (Target_selector_freebsd::do_recognize): Call set_osabi on
6476 Target.
6477 (Target_selector_freebsd::do_recognize_by_name): Likewise.
6478 (Target_selector_freebsd::set_osabi): Remove.
6479 * i386.cc (class Target_i386): Inherit from Sized_target rather
6480 than Target_freebsd.
6481 * x86_64.cc (class Target_x86_64): Likewise.
6482
b3ce541e
ILT
64832011-06-28 Ian Lance Taylor <iant@google.com>
6484
6485 * target.h (Target::can_check_for_function_pointers): Rewrite.
6486 Make non-virtual.
6487 (Target::can_icf_inline_merge_sections): Likewise.
6488 (Target::section_may_have_icf_unsafe_poineters): Likewise.
6489 (Target::Target_info): Add can_icf_inline_merge_sections field.
6490 (Target::do_can_check_for_function_pointers): New virtual
6491 function.
6492 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
6493 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
6494 from can_check_for_function_pointers, move in file.
6495 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
6496 section_may_have_icf_unsafe_poineters, move in file.
6497 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
6498 * i386.cc (Target_i386::do_can_check_for_function_pointers):
6499 Rename from can_check_for_function_pointers, move in file.
6500 (Target_i386::can_icf_inline_merge_sections): Remove.
6501 (Target_i386::i386_info): Initialize
6502 can_icf_inline_merge_sections.
6503 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6504 Initialize can_icf_inline_merge_sections.
6505 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
6506 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
6507 Rename from can_check_for_function_pointers, move in file.
6508 (Target_x86_64::can_icf_inline_merge_sections): Remove.
6509 (Target_x86_64::x86_64_info): Initialize
6510 can_icf_inline_merge_sections.
6511 * testsuite/testfile.cc (Target_test::test_target_info):
6512 Likewise.
6513 * icf.cc (get_section_contents): Correct formatting.
6514
6d1c4efb
ILT
65152011-06-27 Ian Lance Taylor <iant@google.com>
6516
6517 * symtab.cc (Symbol::versioned_name): New function.
6518 (Symbol_table::add_to_final_symtab): Use versioned_name when
6519 appropriate.
6520 (Symbol_table::sized_write_symbol): Likewise.
6521 * symtab.h (class Symbol): Declare versioned_name.
6522 * stringpool.h (class Stringpool_template): Add variant of add
6523 which takes a std::basic_string.
6524 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
6525 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
6526 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
6527 (ver_test_12.o): New target.
6528 * testsuite/Makefile.in: Rebuild.
6529
57eb9b50
DK
65302011-06-27 Doug Kwan <dougkwan@google.com>
6531
6532 * arm.cc (Arm_relocate_functions::thm_jump8,
6533 Arm_relocate_functions::thm_jump11): Use a wider signed
6534 type to compute offset.
6535 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
6536 arm_thm_jump8.
6537 * testsuite/Makefile.in: Regenerate.
6538 * testsuite/arm_branch_in_range.sh: Check test results of
6539 arm_thm_jump11 and arm_thm_jump8.
6540 * testsuite/arm_thm_jump11.s: New test source file.
6541 * testsuite/arm_thm_jump11.t: New linker script.
6542 * testsuite/arm_thm_jump8.s: New test source file.
6543 * testsuite/arm_thm_jump8.t: New linker script.
6544
487b39df
ILT
65452011-06-24 Ian Lance Taylor <iant@google.com>
6546
6547 * layout.cc: Include "object.h".
6548 (ctors_sections_in_init_array): New static variable.
6549 (Layout::is_ctors_in_init_array): New function.
6550 (Layout::layout): Add entry to ctors_sections_in_init_array if
6551 appropriate.
6552 * layout.h (class Layout): Declare is_ctors_in_init_array.
6553 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
6554 is_ctors_reverse_view is set.
6555 (Sized_relobj_file::write_sections): Add layout parameter. Change
6556 all callers. Set is_ctors_reverse_view field of View_size.
6557 (Sized_relobj_file::reverse_words): New function.
6558 * object.h (Sized_relobj_file::View_size): Add
6559 is_ctors_reverse_view field.
6560 (class Sized_relobj_file): Update declarations.
6561 * testsuite/initpri3.c: New test.
6562 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
6563 initpri3b.
6564 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
6565 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
6566 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
6567 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
6568 * testsuite/Makefile.in: Rebuild.
6569
472076e4
CC
65702011-06-24 Cary Coutant <ccoutant@google.com>
6571
6572 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
6573 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
6574 (debug_msg_cdebug.err): New targets.
6575 * testsuite/Makefile.in: Regenerate.
6576 * testsuite/debug_msg.sh: Check output of link with compressed debug.
6577 Fix checks for link with shared library.
6578
a60af0db
DK
65792011-06-24 Doug Kwan <dougkwan@google.com>
6580
6581 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
6582 skip empty text sections.
6583 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
6584
5393d741
ILT
65852011-06-22 Ian Lance Taylor <iant@google.com>
6586
6587 PR gold/12910
6588 * options.h (class General_options): Add --ctors-in-init-array.
6589 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
6590 friends as SHT_PROGBITS for merging sections.
6591 (Layout::layout): Remove special handling of .init_array and
6592 friends. Don't sort if doing relocatable link. Sort for .ctors
6593 and .dtors if ctors_in_init_array.
6594 (Layout::make_output_section): Force correct section types for
6595 .init_array and friends. Don't sort if doing relocatable link,
6596 Don't sort .ctors and .dtors if ctors_in_init_array.
6597 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
6598 (Layout::output_section_name): Add relobj parameter. Change all
6599 callers. Handle .ctors. and .dtors. in code rather than table.
6600 Handle .ctors and .dtors if ctors_in_init_array.
6601 (Layout::match_file_name): New function, moved from output.cc.
6602 * layout.h (class Layout): Update declarations.
6603 * output.cc: Include "layout.h".
6604 (Input_section_sort_entry::get_priority): New function.
6605 (Input_section_sort_entry::match_file_name): Just call
6606 Layout::match_file_name.
6607 (Output_section::Input_section_sort_init_fini_compare::operator()):
6608 Handle .ctors and .dtors. Sort by explicit priority rather than
6609 by name.
6610 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
6611 * testsuite/initpri2.c: New test.
6612 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
6613 (check_PROGRAMS): Add initpri2.
6614 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
6615 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
6616 * configure, testsuite/Makefile.in: Rebuild.
6617
e1f74f98
ILT
66182011-06-19 Ian Lance Taylor <iant@google.com>
6619
6620 PR gold/12880
6621 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
6622 .interp section to a PT_INTERP segment even if we have seen a
6623 --dynamic-linker option. Don't do it if we have seen a PHDRS
6624 clause in a linker script.
6625 (Layout::finalize): Don't create a .interp section if we've
6626 already create a PT_INTERP segment.
6627 (Layout::create_interp): Always call choose_output_section (revert
6628 patch of 2011-06-17). Don't create PT_INTERP segment.
6629 * script-sections.cc
6630 (Script_sections::create_note_and_tls_segments): Add a .interp
6631 section to a PT_INTERP segment even if we have seen a
6632 --dynamic-linker option.
6633
766f91bb
ILT
66342011-06-18 Ian Lance Taylor <iant@google.com>
6635
6636 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
6637 merely because a non-PT_LOAD segment has a dynamic reloc.
6638
0d212c3a
ILT
66392011-06-18 Ian Lance Taylor <iant@google.com>
6640
6641 * layout.cc (Layout::finish_dynamic_section): Don't create
6642 DT_FLAGS entry if not needed.
6643
911a5072
ILT
66442011-06-18 Ian Lance Taylor <iant@google.com>
6645
6646 PR gold/12745
6647 * layout.cc (Layout::layout_eh_frame): Correct handling of
6648 writable .eh_frame section.
6649
534b4e5f
ILT
66502011-06-17 Ian Lance Taylor <iant@google.com>
6651
6652 PR gold/12893
6653 * resolve.cc (Symbol_table::resolve): Don't give an error if a
6654 symbol is redefined with the exact same object and value.
6655
10b4f102
ILT
66562011-06-17 Ian Lance Taylor <iant@google.com>
6657
6658 PR gold/12880
6659 * layout.h (class Layout): Add interp_segment_ field.
6660 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
6661 (Layout::attach_allocated_section_to_segment): If making shared
6662 library, put .interp section in PT_INTERP segment.
6663 (Layout::finalize): Also call create_interp if -dynamic-linker
6664 option was used.
6665 (Layout::create_interp): Assert that there is no PT_INTERP
6666 segment. If not using a SECTIONS clause, use make_output_section.
6667 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
6668 * script-sections.cc
6669 (Script_sections::create_note_and_tls_segments): If making shared
6670 library, put .interp section in PT_INTERP segment.
6671
a29b0dad
ILT
66722011-06-17 Ian Lance Taylor <iant@google.com>
6673
e588ea8d
ILT
6674 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
6675 when making a shared library.
6676
66772011-06-17 Ian Lance Taylor <iant@google.com>
6678
6679 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
6680 parameter. Change all callers. Don't issue warning about PC32
6681 against locally defined symbol.
a29b0dad 6682
9d3b0698
ILT
66832011-06-16 Ian Lance Taylor <iant@google.com>
6684
6685 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
6686 occurs in same object.
6687
85b0f90c
AM
66882011-06-14 Alan Modra <amodra@gmail.com>
6689
6690 * po/POTFILES.in: Regenerate.
6691
a94907d9
ILT
66922011-06-09 Ian Lance Taylor <iant@google.com>
6693
6694 * script-sections.cc
6695 (Orphan_output_section::set_section_addresses): For a relocatable
6696 link set address to 0.
6697
4fb3a1c3
CC
66982011-06-09 Cary Coutant <ccoutant@google.com>
6699
6700 PR gold/12804
6701 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
6702 used with --compress-debug-sections.
6703 * gold/object.cc (Sized_relobj_file::do_layout): Report
6704 uncompressed size of compressed input sections.
6705
61220854
CC
67062011-06-08 Cary Coutant <ccoutant@google.com>
6707
6708 PR gold/12804
6709 * testsuite/two_file_test_2_v1.cc: Change initialization of
6710 v2 to keep it in .data.
6711
e6455dfb
CC
67122011-06-07 Cary Coutant <ccoutant@google.com>
6713
6714 * common.cc (Symbol_table::do_allocate_commons_list): Call
6715 gold_fallback.
6716 * errors.cc (Errors::fatal): Adjust call to gold_exit.
6717 (Errors::fallback): New function.
6718 (gold_fallback): New function.
6719 * errors.h (Errors::fallback): New function.
6720 * gold.cc (gold_exit): Change status parameter to enum; adjust
6721 all callers.
6722 (queue_initial_tasks): Call gold_fallback.
6723 * gold.h: Include cstdlib.
6724 (Exit_status): New enum type.
6725 (gold_exit): Change status parameter to enum.
6726 (gold_fallback): New function.
6727 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
6728 (Layout::create_symtab_sections): Likewise.
6729 (Layout::create_shdrs): Likewise.
6730 * main.cc (main): Adjust call to gold_exit.
6731 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
6732 (Output_data_got::add_got_entry_pair): Likewise.
6733 (Output_section::add_input_section): Likewise.
6734 (Output_section::add_output_section_data): Likewise.
6735 (Output_segment::set_section_list_addresses): Likewise.
6736 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
6737
fb0e076f
CC
67382011-06-07 Cary Coutant <ccoutant@google.com>
6739
6740 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
6741 for incremental links.
6742 * output.cc (Output_segment::set_section_list_addresses): Remove
6743 FIXME and test for TLS or BSS.
6744
a5ee4d5d
CC
67452011-06-07 Cary Coutant <ccoutant@google.com>
6746
6747 * testsuite/Makefile.am: Add incremental_copy_test,
6748 incremental_common_test_1.
6749 * testsuite/Makefile.in: Regenerate.
6750 * testsuite/common_test_1_v1.c: New source file.
6751 * testsuite/common_test_1_v2.c: New source file.
6752 * testsuite/copy_test_v1.cc: New source file.
6753
5146f448
CC
67542011-06-07 Cary Coutant <ccoutant@google.com>
6755
6756 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
6757 update, allocate common from bss section's free list.
6758 * incremental-dump.cc (dump_incremental_inputs): Print flag for
6759 linker-defined symbols.
6760 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
6761 Skip GOT and PLT entries that are no longer referenced.
6762 (Output_section_incremental_inputs::write_info_blocks): Mark
6763 linker-defined symbols.
6764 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
6765 * output.cc (Output_section::allocate): New function.
6766 * output.h (Output_section::allocate): New function.
6767 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
6768 linker-defined symbols.
6769 (Symbol::override_base_with_special): Copy is_predefined_ flag.
6770 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
6771 (Symbol::init_base_output_data): Likewise.
6772 (Symbol::init_base_output_segment): Likewise.
6773 (Symbol::init_base_constant): Likewise.
6774 (Sized_symbol::init_output_data): Likewise.
6775 (Sized_symbol::init_output_segment): Likewise.
6776 (Sized_symbol::init_constant): Likewise.
6777 (Symbol_table::do_define_in_output_data): Likewise.
6778 (Symbol_table::do_define_in_output_segment): Likewise.
6779 (Symbol_table::do_define_as_constant): Likewise.
6780 * symtab.h (Symbol::is_predefined): New function.
6781 (Symbol::init_base_output_data): Add is_predefined parameter.
6782 (Symbol::init_base_output_segment): Likewise.
6783 (Symbol::init_base_constant): Likewise.
6784 (Symbol::is_predefined_): New data member.
6785 (Sized_symbol::init_output_data): Add is_predefined parameter.
6786 (Sized_symbol::init_output_segment): Likewise.
6787 (Sized_symbol::init_constant): Likewise.
6788 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
6789
26d3c67d
CC
67902011-06-07 Cary Coutant <ccoutant@google.com>
6791
6792 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
6793 instead of emit_copy_reloc.
6794 (Copy_relocs::emit_copy_reloc): Refactor.
6795 (Copy_relocs::make_copy_reloc): New function.
6796 (Copy_relocs::add_copy_reloc): Remove.
6797 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
6798 section.
6799 (Copy_relocs::make_copy_reloc): New function.
6800 (Copy_relocs::add_copy_reloc): Remove.
6801 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
6802 unchanged input files.
6803 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
6804 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
6805 Reserve BSS space for COPY relocations.
6806 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6807 (Output_section_incremental_inputs::write_info_blocks): Record
6808 whether a symbol is copied from a shared object.
6809 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
6810 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
6811 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
6812 (Incremental_input_entry_reader::get_output_symbol_index): Add
6813 is_copy parameter.
6814 (Incremental_binary::emit_copy_relocs): New function.
6815 (Incremental_binary::do_emit_copy_relocs): New function.
6816 (Sized_incremental_binary::Sized_incremental_binary): Initialize
6817 new data member.
6818 (Sized_incremental_binary::add_copy_reloc): New function.
6819 (Sized_incremental_binary::do_emit_copy_relocs): New function.
6820 (Sized_incremental_binary::Copy_reloc): New struct.
6821 (Sized_incremental_binary::Copy_relocs): New typedef.
6822 (Sized_incremental_binary::copy_relocs_): New data member.
6823 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
6824 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
6825 * target.h (Sized_target::emit_copy_reloc): New function.
6826 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
6827
7cdb37d9
CC
68282011-06-02 Cary Coutant <ccoutant@google.com>
6829
6830 PR gold/12163
6831 * gold/archive.cc (Archive::Archive): Initialize new data member.
6832 (Archive::include_all_members): Return if archive has already been
6833 included.
6834 * gold/archive.h (Archive::include_all_members_): New data member.
6835
cc643b88
NC
68362011-06-02 Nick Clifton <nickc@redhat.com>
6837
6838 * dynobj.h: Fix spelling mistake in comment.
6839 * output.cc: Likewise.
6840
f62a3ca7 68412011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 6842 Asier Llano
f62a3ca7
DK
6843
6844 PR gold/12826
cc643b88 6845 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
6846 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
6847 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
6848 redundant arm_exidx_test.so.
6849 * testsuite/Makefile.in: Regenerate.
6850 (check_SCRIPTS): Add pr12826.sh
6851 (check_DATA): Add pr12826.stdout
6852 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
6853 * testsuite/pr12826.sh: New file.
6854 * testsuite/pr12826_1.s: Ditto.
6855 * testsuite/pr12826_1.s: Ditto.
6856
8dbe1edc
ILT
68572011-05-30 Ian Lance Taylor <iant@google.com>
6858
6859 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
6860 sections.
6861
c49875be
ILT
68622011-05-29 Ian Lance Taylor <iant@google.com>
6863
6864 PR gold/12804
6865 * testsuite/Makefile.am: Use different file name for two_file_test
6866 temporary file for each incremental test.
6867 * testsuite/Makefile.in: Rebuild.
6868
69d53f7a
ILT
68692011-05-29 Ian Lance Taylor <iant@google.com>
6870
6871 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
6872 binary input file is empty.
6873
41d0ab5f
ILT
68742011-05-27 Ian Lance Taylor <iant@google.com>
6875
6876 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
6877 (ver_test_9.so): Likewise.
6878 * testsuite/Makefile.in: Rebuild.
6879
89d8a36b
CC
68802011-05-26 Cary Coutant <ccoutant@google.com>
6881
6882 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
6883 * incremental.cc (Incremental_inputs::report_input_section): Fix
6884 comment, indentation.
6885 (Incremental_inputs::report_comdat_group): New function.
6886 (Output_section_incremental_inputs::set_final_data_size): Adjust size
6887 of data for incremental input file entry.
6888 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
6889 group count, COMDAT group signatures.
6890 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
6891 an unchanged input file.
6892 * incremental.h (Incremental_object_entry::Incremental_object_entry):
6893 Initialize new data member.
6894 (Incremental_object_entry::add_comdat_group): New function.
6895 (Incremental_object_entry::get_comdat_group_count): New function.
6896 (Incremental_object_entry::get_comdat_signature_key): New function.
6897 (Incremental_object_entry::groups_): New data member.
6898 (Incremental_inputs::report_comdat_group): New function.
6899 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
6900 data for incremental input file entry.
6901 (Incremental_input_entry_reader::get_comdat_group_count): New function.
6902 (Incremental_input_entry_reader::get_input_section): Adjust size of
6903 data for incremental input file entry.
6904 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
6905 (Incremental_input_entry_reader::get_comdat_group_signature): New
6906 function.
6907 * object.cc (Sized_relobj::include_section_group): Report kept
6908 COMDAT groups for incremental links.
6909
1706a06f
ILT
69102011-05-24 David Meyer <pdox@google.com>
6911
6912 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
6913 with name parameter. Add found_name parameter.
6914 * fileread.cc (Input_file::find_file): Adjust code accordingly.
6915 * dirsearch.h (class Dirsearch): Update declaration.
6916
a10ae760
ILT
69172011-05-24 Ian Lance Taylor <iant@google.com>
6918
6919 * archive.cc (Library_base::should_include_member): Pull in object
6920 from archive if it defines the entry symbol.
6921 * parameters.cc (Parameters::entry): New function.
6922 * parameters.h (class Parameters): Declare entry.
6923 * output.h (class Output_file_header): Remove entry_ field.
6924 * output.cc (Output_file_header::Output_file_header): Remove entry
6925 parameter. Change all callers.
6926 (Output_file_header::entry): Use parameters->entry.
6927 * gold.cc (queue_middle_tasks): Likewise.
6928 * plugin.cc (Plugin_hook::run): Likewise.
6929
aa92d6ed
CC
69302011-05-24 Cary Coutant <ccoutant@google.com>
6931
6932 * gold.cc (queue_initial_tasks): Pass incremental base filename
6933 to Output_file::open_base_file; don't print error message.
6934 * incremental-dump.cc (main): Adjust call to
6935 Output_file::open_for_modification.
6936 * incremental-dump.cc (main): Likewise.
6937 * incremental.cc (Incremental_inputs::report_command_line):
6938 Ignore --incremental-base option when comparing command lines.
6939 Ignore parameter when given as separate argument.
6940 * options.h (class General_options): Add --incremental-base.
6941 * output.cc (Output_file::Output_file):
6942 (Output_file::open_base_file): Add base_name and writable parameters;
6943 read base file into new file; print error message here.
6944 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6945 callers.
6946 * output.h (Output_file::open_for_modification): Rename to...
6947 (Output_file::open_base_file): ...this; add base_name and
6948 writable parameters; adjust all callers.
6949 (Output_file::map_no_anonymous): Add writable parameter; adjust all
6950 callers.
6951 * testsuite/Makefile.am (incremental_test_4): Test
6952 --incremental-base.
6953 * testsuite/Makefile.in: Regenerate.
6954
2eedd706
CC
69552011-05-24 Cary Coutant <ccoutant@google.com>
6956
6957 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
6958 incremental_test_4.
6959 * testsuite/Makefile.in: Regenerate.
6960 * testsuite/two_file_test_1_v1.cc: New test source file.
6961 * testsuite/two_file_test_1b_v1.cc: New test source file.
6962 * testsuite/two_file_test_2_v1.cc: New test source file.
6963
0f1c85a6
CC
69642011-05-24 Cary Coutant <ccoutant@google.com>
6965
6966 * dynobj.h (Dynobj::do_dynobj): New function.
6967 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
6968 flag and soname for shared objects.
6969 * incremental.cc (Incremental_inputs::report_object): Make
6970 either Incremental_object_entry or Incremental_dynobj_entry; add
6971 soname to string table.
6972 (Incremental_inputs::report_input_section): Add assertion.
6973 (Output_section_incremental_inputs::set_final_data_size): Adjust
6974 type of input file entry for shared libraries; adjust size of
6975 shared library info entry.
6976 (Output_section_incremental_inputs::write_input_files): Write
6977 as_needed flag for shared libraries.
6978 (Output_section_incremental_inputs::write_info_blocks): Adjust type
6979 of input file entry for shared libraries; write soname.
6980 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
6981 soname from incremental info.
6982 * incremental.h (enum Incremental_input_flags): Add
6983 INCREMENTAL_INPUT_AS_NEEDED.
6984 (Incremental_input_entry::Incremental_input_entry): Initialize new
6985 data member.
6986 (Incremental_input_entry::set_as_needed): New function.
6987 (Incremental_input_entry::as_needed): New function.
6988 (Incremental_input_entry::do_dynobj_entry): New function.
6989 (Incremental_input_entry::as_needed_): New data member.
6990 (Incremental_object_entry::Incremental_object_entry): Don't check
6991 for shared library.
6992 (Incremental_object_entry::do_type): Likewise.
6993 (class Incremental_dynobj_entry): New class.
6994 (Incremental_input_entry_reader::as_needed): New function.
6995 (Incremental_input_entry_reader::get_soname): New function.
6996 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
6997 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
6998 size of shared library info entry.
58797674 6999 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
7000 incremental link when adding DT_NEEDED entries.
7001 * object.h (Object::Object): Initialize new data member.
7002 (Object::dynobj): New function.
7003 (Object::set_as_needed): New function.
7004 (Object::as_needed): New function.
7005 (Object::do_dynobj): New function.
7006 (Object::as_needed_): New data member.
7007
6fa2a40b
CC
70082011-05-24 Cary Coutant <ccoutant@google.com>
7009
7010 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
7011 info; adjust display of GOT entries.
7012 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7013 vector of input objects; remove file_status_.
7014 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
7015 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
7016 got_plt reader; call target hooks to reserve GOT entries.
7017 (Output_section_incremental_inputs::set_final_data_size): Adjust size
7018 of input file info header and GOT info entry.
7019 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
7020 relocation info.
7021 (Got_plt_view_info::got_descriptor): Remove.
7022 (Got_plt_view_info::sym_index): New data member.
7023 (Got_plt_view_info::input_index): New data member.
7024 (Local_got_offset_visitor::visit): Write input file index.
7025 (Global_got_offset_visitor::visit): Write 0 for input file index.
7026 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
7027 with sym_index and input_index.
7028 (Output_section_incremental_inputs::write_got_plt): Adjust size of
7029 incremental info GOT entry; replace got_descriptor with input_index.
7030 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
7031 map from input file index to object.
7032 (Sized_relobj_incr::do_layout): Replace direct data member reference
7033 with accessor function.
7034 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
7035 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
7036 Adjust size of input file info header.
7037 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
7038 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
7039 (Incremental_input_entry_reader::get_input_section): Adjust size of
7040 input file info header.
7041 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
7042 of incremental info GOT entry.
7043 (Incremental_got_plt_reader::get_got_desc): Remove.
7044 (Incremental_got_plt_reader::get_got_symndx): New function.
7045 (Incremental_got_plt_reader::get_got_input_index): New function.
7046 (Sized_incremental_binary::Sized_incremental_binary): Remove
7047 file_status_; add input_objects_.
7048 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
7049 (Sized_incremental_binary::set_file_is_unchanged): Remove.
7050 (Sized_incremental_binary::file_is_unchanged): Remove.
7051 (Sized_incremental_binary::set_input_object): New function.
7052 (Sized_incremental_binary::input_object): New function.
7053 (Sized_incremental_binary::file_status_): Remove.
7054 (Sized_incremental_binary::input_objects_): New data member.
7055 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
7056 references.
7057 (Sized_relobj_incr::invalid_address): Move to base class.
7058 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
7059 class.
7060 (Sized_relobj_incr::do_output_section_offset): Likewise.
7061 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
7062 (Sized_relobj_incr::section_offsets_): Likewise.
7063 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
7064 function.
7065 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
7066 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
7067 with accessor function.
7068 (Sized_relobj_file::do_layout): Likewise.
7069 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
7070 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
7071 (Sized_relobj_file::compute_final_local_value): Replace refs to
7072 section_offsets_ with accessor function.
7073 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
7074 * object.h (Relobj::Relobj): Initialize new data members.
7075 (Relobj::add_dyn_reloc): New function.
7076 (Relobj::first_dyn_reloc): New function.
7077 (Relobj::dyn_reloc_count): New function.
7078 (Relobj::first_dyn_reloc_): New data member.
7079 (Relobj::dyn_reloc_count_): New data member.
7080 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
7081 references.
7082 (Sized_relobj::Address): New typedef.
7083 (Sized_relobj::invalid_address): Move here from child class.
7084 (Sized_relobj::Sized_relobj): Initialize new data members.
7085 (Sized_relobj::sized_relobj): New function.
7086 (Sized_relobj::is_output_section_offset_invalid): Move here from
7087 child class.
7088 (Sized_relobj::get_output_section_offset): Likewise.
7089 (Sized_relobj::local_has_got_offset): Likewise.
7090 (Sized_relobj::local_got_offset): Likewise.
7091 (Sized_relobj::set_local_got_offset): Likewise.
7092 (Sized_relobj::do_for_all_local_got_entries): Likewise.
7093 (Sized_relobj::clear_got_offsets): New function.
7094 (Sized_relobj::section_offsets): Move here from child class.
7095 (Sized_relobj::do_output_section_offset): Likewise.
7096 (Sized_relobj::do_set_section_offset): Likewise.
7097 (Sized_relobj::Local_got_offsets): Likewise.
7098 (Sized_relobj::local_got_offsets_): Likewise.
7099 (Sized_relobj::section_offsets_): Likewise.
7100 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
7101 references.
7102 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
7103 class.
7104 (Sized_relobj_file::sized_relobj): New function
7105 (Sized_relobj_file::local_has_got_offset): Move to base class.
7106 (Sized_relobj_file::local_got_offset): Likewise.
7107 (Sized_relobj_file::set_local_got_offset): Likewise.
7108 (Sized_relobj_file::get_output_section_offset): Likewise.
7109 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
7110 (Sized_relobj_file::do_output_section_offset): Likewise.
7111 (Sized_relobj_file::do_set_section_offset): Likewise.
7112 (Sized_relobj_file::Local_got_offsets): Likewise.
7113 (Sized_relobj_file::local_got_offsets_): Likewise.
7114 (Sized_relobj_file::section_offsets_): Likewise.
7115 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
7116 (all constructors).
7117 (set_needs_dynsym_index): Convert relobj to derived class pointer.
7118 (Output_reloc::get_symbol_index): Likewise.
7119 (Output_reloc::local_section_offset): Likewise.
7120 (Output_reloc::get_address): Likewise.
7121 (Output_reloc::symbol_value): Likewise.
7122 (Output_data_got::reserve_slot): Move to class definition.
7123 (Output_data_got::reserve_local): New function.
7124 (Output_data_got::reserve_slot_for_global): Remove.
7125 (Output_data_got::reserve_global): New function.
7126 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
7127 (all constructors, two instantiations).
7128 (Output_reloc::get_relobj): New function (two instantiations).
7129 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
7130 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
7131 (Output_data_reloc::add_global): Adjust type of relobj.
7132 (Output_data_reloc::add_global_relative): Likewise.
7133 (Output_data_reloc::add_symbolless_global_addend): Likewise.
7134 (Output_data_reloc::add_local): Likewise.
7135 (Output_data_reloc::add_local_relative): Likewise.
7136 (Output_data_reloc::add_symbolless_local_addend): Likewise.
7137 (Output_data_reloc::add_local_section): Likewise.
7138 (Output_data_reloc::add_output_section): Likewise.
7139 (Output_data_reloc::add_absolute): Likewise.
7140 (Output_data_reloc::add_target_specific): Likewise.
7141 (Output_data_got::reserve_slot): Move definition here.
7142 (Output_data_got::reserve_local): New function.
7143 (Output_data_got::reserve_global): New function.
7144 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
7145 section_offsets_ with accessor function.
7146 (Sized_relobj_file::write_sections): Likewise.
7147 (Sized_relobj_file::do_relocate_sections): Likewise.
7148 * target.h (Sized_target::reserve_local_got_entry): New function.
7149 (Sized_target::reserve_global_got_entry): New function.
7150 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
7151 (Target_x86_64::reserve_global_got_entry): New function.
7152 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
7153
4829d394
CC
71542011-05-23 Cary Coutant <ccoutant@google.com>
7155
7156 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
7157 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
7158 bit when checking got_type.
7159 * incremental.cc (Sized_incremental_binary::setup_readers):
7160 Store symbol table and string table locations; initialize bit vector
7161 of file status flags.
7162 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
7163 unchanged files.
7164 (Sized_incremental_binary::do_process_got_plt): New function.
7165 (Sized_incremental_binary::get_symtab_view): Use stored locations.
7166 (Output_section_incremental_inputs::set_final_data_size): Record
7167 file index for each input file.
7168 (Output_section_incremental_inputs::write_got_plt): Store file index
7169 instead of input entry offset for each GOT entry.
7170 * incremental.h
7171 (Incremental_input_entry::Incremental_input_entry): Initialize new
7172 data member.
7173 (Incremental_input_entry::set_offset): Store file index.
7174 (Incremental_input_entry::get_file_index): New function.
7175 (Incremental_input_entry::file_index_): New data member.
7176 (Incremental_binary::process_got_plt): New function.
7177 (Incremental_binary::do_process_got_plt): New function.
7178 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7179 data members.
7180 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
7181 (Sized_incremental_binary::set_file_is_unchanged): New function.
7182 (Sized_incremental_binary::file_is_unchanged): New function.
7183 (Sized_incremental_binary::do_process_got_plt): New function.
7184 (Sized_incremental_binary::file_status_): New data member.
7185 (Sized_incremental_binary::main_symtab_loc_): New data member.
7186 (Sized_incremental_binary::main_strtab_loc_): New data member.
7187 * output.cc (Output_data_got::Got_entry::write): Add case
7188 RESERVED_CODE.
7189 (Output_data_got::add_global): Call add_got_entry.
7190 (Output_data_got::add_global_plt): Likewise.
7191 (Output_data_got::add_global_with_rel): Likewise.
7192 (Output_data_got::add_global_with_rela): Likewise.
7193 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
7194 (Output_data_got::add_global_pair_with_rela): Likewise.
7195 (Output_data_got::add_local): Call add_got_entry.
7196 (Output_data_got::add_local_plt): Likewise.
7197 (Output_data_got::add_local_with_rel): Likewise.
7198 (Output_data_got::add_local_with_rela): Likewise.
7199 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
7200 (Output_data_got::add_local_pair_with_rela): Likewise.
7201 (Output_data_got::reserve_slot): New function.
7202 (Output_data_got::reserve_slot_for_global): New function.
7203 (Output_data_got::add_got_entry): New function.
7204 (Output_data_got::add_got_entry_pair): New function.
7205 (Output_section::add_output_section_data): Edit FIXME.
7206 * output.h
7207 (Output_section_data_build::Output_section_data_build): New
7208 constructor with size parameter.
7209 (Output_data_space::Output_data_space): Likewise.
7210 (Output_data_got::Output_data_got): Initialize new data member; new
7211 constructor with size parameter.
7212 (Output_data_got::add_constant): Call add_got_entry.
7213 (Output_data_got::reserve_slot): New function.
7214 (Output_data_got::reserve_slot_for_global): New function.
7215 (class Output_data_got::Got_entry): Add RESERVED_CODE.
7216 (Output_data_got::add_got_entry): New function.
7217 (Output_data_got::add_got_entry_pair): New function.
7218 (Output_data_got::free_list_): New data member.
7219 * target.h (Sized_target::init_got_plt_for_update): New function.
7220 (Sized_target::register_global_plt_entry): New function.
7221 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
7222 Initialize new data member; call init; add constructor with PLT count.
7223 (Output_data_plt_x86_64::init): New function.
7224 (Output_data_plt_x86_64::add_relocation): New function.
7225 (Output_data_plt_x86_64::reserve_slot): New function.
7226 (Output_data_plt_x86_64::free_list_): New data member.
7227 (Target_x86_64::init_got_plt_for_update): New function.
7228 (Target_x86_64::register_global_plt_entry): New function.
7229 (Output_data_plt_x86_64::add_entry): Allocate from free list for
7230 incremental updates.
7231 (Output_data_plt_x86_64::add_relocation): New function.
7232 * testsuite/object_unittest.cc (Object_test): Set default options.
7233
ec69d6da
ILT
72342011-05-16 Ian Lance Taylor <iant@google.com>
7235
7236 * options.h (class General_options): Make -i a synonym for -r.
7237
732e31de
ILT
72382011-05-16 Ian Lance Taylor <iant@google.com>
7239
7240 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
7241
403676b5
CC
72422011-05-10 Cary Coutant <ccoutant@google.com>
7243
7244 * object.cc (Sized_relobj::do_count_local_symbols): Check for
7245 strip_all (-s).
7246
5b7b7d6e
ILT
72472011-05-06 Ian Lance Taylor <iant@google.com>
7248
7249 * layout.cc (Layout::layout): If the output section flags change,
7250 update the ordering.
7251
f0f9babf
CC
72522011-04-25 Cary Coutant <ccoutant@google.com>
7253
7254 * incremental-dump.cc (dump_incremental_inputs): Print local
7255 symbol info for each input file.
7256 * incremental.cc
7257 (Output_section_incremental_inputs::set_final_data_size): Add local
7258 symbol info to input file entries in incremental info.
7259 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7260 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
7261 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
7262 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
7263 implementation.
7264 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
7265 (Sized_incr_relobj::do_relocate): Write the local symbols.
7266 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
7267 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
7268 Adjust size of input file header.
7269 (Incremental_inputs_reader::get_local_symbol_offset): New function.
7270 (Incremental_inputs_reader::get_local_symbol_count): New function.
7271 (Incremental_inputs_reader::get_input_section): Adjust size of input
7272 file header.
7273 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
7274 (Sized_incr_relobj::This): New typedef.
7275 (Sized_incr_relobj::sym_size): New const data member.
7276 (Sized_incr_relobj::Local_symbol): New struct.
7277 (Sized_incr_relobj::do_output_local_symbol_count): New function.
7278 (Sized_incr_relobj::do_local_symbol_offset): New function.
7279 (Sized_incr_relobj::local_symbol_count_): New data member.
7280 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
7281 (Sized_incr_relobj::local_symbol_index_): New data member.
7282 (Sized_incr_relobj::local_symbol_offset_): New data member.
7283 (Sized_incr_relobj::local_dynsym_offset_): New data member.
7284 (Sized_incr_relobj::local_symbols_): New data member.
7285 * object.h (Relobj::output_local_symbol_count): New function.
7286 (Relobj::local_symbol_offset): New function.
7287 (Relobj::do_output_local_symbol_count): New function.
7288 (Relobj::do_local_symbol_offset): New function.
7289 (Sized_relobj::do_output_local_symbol_count): New function.
7290 (Sized_relobj::do_local_symbol_offset): New function.
7291
d0a9ace3
ILT
72922011-04-22 Vladimir Simonov <sv@sw.ru>
7293
7294 * descriptors.cc (set_close_on_exec): New function.
7295 (Descriptors::open): Use set_close_on_exec.
7296 * output.cc (S_ISLNK): Define if not defined.
7297
94a3fc8b
CC
72982011-04-22 Cary Coutant <ccoutant@google.com>
7299
7300 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
7301 global symbol map.
7302 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7303 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7304 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
7305 relocations.
7306 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
7307 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
7308 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
7309 * incremental.h
7310 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
7311 function.
7312 (Incremental_binary::apply_incremental_relocs): New function.
7313 (Incremental_binary::do_apply_incremental_relocs): New function.
7314 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
7315 data member.
7316 (Sized_incremental_binary::add_global_symbol): New function.
7317 (Sized_incremental_binary::global_symbol): New function.
7318 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
7319 (Sized_incremental_binary::symbol_map_): New data member.
7320 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
7321 * target.h (Sized_target::apply_relocation): New function.
7322 * target-reloc.h (apply_relocation): New function.
7323 * x86_64.cc (Target_x86_64::apply_relocation): New function.
7324
c87e4302
DK
73252011-04-22 Doug Kwan <dougkwan@google.com>
7326
7327 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
7328 flag of a SHT_ARM_EXIDX section.
2e702c99 7329 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
7330 * testsuite/Makefile.in: Regenerate.
7331 * testsuite/arm_exidx_test.s: New file.
7332 * testsuite/arm_exidx_test.sh: Same.
7333
e7782cf6
CC
73342011-04-20 Cary Coutant <ccoutant@google.com>
7335
7336 PR gold/12689
7337 * archive.h (Incremental_archive_entry::Archive_member):
7338 Initialize arg_serial_ (second constructor).
7339
308ecdc7
ILT
73402011-04-17 Ian Lance Taylor <iant@google.com>
7341
7342 * object.cc (Relocate_info::location): Simplify location string.
7343 * errors.cc (Errors::error_at_location): Don't print program
7344 name.
7345 (Errors::warning_at_location): Likewise.
7346 (Errors::undefined_symbol): Likewise.
7347 * testsuite/debug_msg.sh: Update accordingly.
7348
bec5b579
CC
73492011-04-14 Cary Coutant <ccoutant@google.com>
7350
7351 * gold/layout.cc (Layout::symtab_section_offset): New function.
7352 * gold/layout.h (Layout::symtab_section_offset): New function.
7353 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
7354
88597d34
ILT
73552011-04-12 Ian Lance Taylor <iant@google.com>
7356
7357 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
7358 with MREMAP_MAYMOVE.
7359 * output.h (class Output_file): Add map_is_allocated_ field.
7360 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
7361 not available, provide stubs. If mremap is not available, #define
7362 it to gold_mremap.
7363 (MREMAP_MAYMOVE): Define if not defined.
7364 (Output_file::Output_file): Initialize map_is_allocated_.
7365 (Output_file::resize): Check map_is_allocated_.
7366 (Output_file::map_anonymous): If mmap fails, use malloc.
7367 (Output_file::unmap): Don't do anything for an anonymous map.
7368 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
7369 is not available, provide stubs.
7370 (File_read::View::~View): Use free rather than delete[].
7371 (File_read::make_view): Use malloc rather than new[]. If mmap
7372 fails, use malloc.
7373 (File_read::find_or_make_view): Use malloc rather than new[].
7374 * gold.h: Remove HAVE_REMAP code.
7375 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
7376 exists. Rename mremap to gold_mremap. If mmap is not available
7377 don't do anything.
7378 * configure, config.in: Rebuild.
7379
11e361bc
ILT
73802011-04-11 Ian Lance Taylor <iant@google.com>
7381
7382 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
7383 initialize local variable v.
7384
cdc29364
CC
73852011-04-11 Cary Coutant <ccoutant@google.com>
7386
7387 * archive.cc (Archive::include_member): Adjust call to
7388 report_object.
7389 (Add_archive_symbols::run): Track argument serial numbers.
7390 (Lib_group::include_member): Likewise.
7391 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
7392 * archive.h (Incremental_archive_entry::Archive_member):
7393 Initialize arg_serial_.
7394 (Archive_member::arg_serial_): New data member.
7395 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
7396 (Sized_dynobj::do_add_symbols): Track symbols when doing an
7397 incremental link.
7398 (Sized_dynobj::do_for_all_local_got_entries): New function.
7399 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
7400 function.
7401 * fileread.cc (get_mtime): New function.
7402 * fileread.h (get_mtime): New function.
7403 * gold.cc (queue_initial_tasks): Check for incremental update.
7404 (process_incremental_input): New function.
7405 (queue_middle_tasks): Don't force valid target for incremental
7406 update.
7407 * incremental-dump.cc (find_input_containing_global): Adjust
7408 size of symbol info entry.
7409 (dump_incremental_inputs): Dump argument serial number and
7410 in_system_directory flag; bias shndx by 1; print symbol names
7411 when dumping per-file symbol lists; use new symbol info readers.
7412 * incremental.cc
7413 (Output_section_incremental_inputs:update_data_size): New function.
7414 (Sized_incremental_binary::setup_readers): Setup input readers
7415 for each input file; build maps for files added from libraries
7416 and scripts.
7417 (Sized_incremental_binary::check_input_args): New function.
7418 (Sized_incremental_binary::do_check_inputs): Build map of argument
7419 serial numbers to input arguments.
7420 (Sized_incremental_binary::do_file_has_changed): Rename
7421 do_file_is_unchanged to this; compare file modification times.
7422 (Sized_incremental_binary::do_init_layout): New function.
7423 (Sized_incremental_binary::do_reserve_layout): New function.
7424 (Sized_incremental_binary::do_get_input_reader): Remove.
7425 (Sized_incremental_binary::get_symtab_view): New function.
7426 (Incremental_checker::can_incrementally_link_output_file): Remove.
7427 (Incremental_inputs::report_command_line): Exclude --debug options.
7428 (Incremental_inputs::report_archive_begin): Add parameter; track
7429 argument serial numbers; don't put input file entry for archive
7430 before archive members.
7431 (Incremental_inputs::report_archive_end): Put input file entry
7432 for archive after archive members.
7433 (Incremental_inputs::report_object): Add parameter; track argument
7434 serial numbers and in_system_directory flag.
7435 (Incremental_inputs::report_script): Add parameter; track argument
7436 serial numbers.
7437 (Output_section_incremental_inputs::set_final_data_size): Adjust
7438 size of symbol info entry; check for forwarding symbols.
7439 (Output_section_incremental_inputs::write_input_files): Write
7440 in_system_directory flag and argument serial number.
7441 (Output_section_incremental_inputs::write_info_blocks): Map section
7442 indices between incremental info and original input file; store
7443 input section index for each symbol.
7444 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
7445 change operator() to visit().
7446 (class Global_got_offset_visitor): Likewise.
7447 (class Global_symbol_visitor_got_plt):
7448 (Output_section_incremental_inputs::write_got_plt): Use new visitor
7449 classes.
7450 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
7451 (Sized_incr_relobj::do_read_symbols): New function.
7452 (Sized_incr_relobj::do_layout): New function.
7453 (Sized_incr_relobj::do_layout_deferred_sections): New function.
7454 (Sized_incr_relobj::do_add_symbols): New function.
7455 (Sized_incr_relobj::do_should_include_member): New function.
7456 (Sized_incr_relobj::do_for_all_global_symbols): New function.
7457 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
7458 (Sized_incr_relobj::do_section_size): New function.
7459 (Sized_incr_relobj::do_section_name): New function.
7460 (Sized_incr_relobj::do_section_contents): New function.
7461 (Sized_incr_relobj::do_section_flags): New function.
7462 (Sized_incr_relobj::do_section_entsize): New function.
7463 (Sized_incr_relobj::do_section_address): New function.
7464 (Sized_incr_relobj::do_section_type): New function.
7465 (Sized_incr_relobj::do_section_link): New function.
7466 (Sized_incr_relobj::do_section_info): New function.
7467 (Sized_incr_relobj::do_section_addralign): New function.
7468 (Sized_incr_relobj::do_initialize_xindex): New function.
7469 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
7470 (Sized_incr_relobj::do_read_relocs): New function.
7471 (Sized_incr_relobj::do_gc_process_relocs): New function.
7472 (Sized_incr_relobj::do_scan_relocs): New function.
7473 (Sized_incr_relobj::do_count_local_symbols): New function.
7474 (Sized_incr_relobj::do_finalize_local_symbols): New function.
7475 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
7476 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
7477 (Sized_incr_relobj::do_relocate): New function.
7478 (Sized_incr_relobj::do_set_section_offset): New function.
7479 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
7480 (Sized_incr_dynobj::do_read_symbols): New function.
7481 (Sized_incr_dynobj::do_layout): New function.
7482 (Sized_incr_dynobj::do_add_symbols): New function.
7483 (Sized_incr_dynobj::do_should_include_member): New function.
7484 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
7485 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
7486 (Sized_incr_dynobj::do_section_size): New function.
7487 (Sized_incr_dynobj::do_section_name): New function.
7488 (Sized_incr_dynobj::do_section_contents): New function.
7489 (Sized_incr_dynobj::do_section_flags): New function.
7490 (Sized_incr_dynobj::do_section_entsize): New function.
7491 (Sized_incr_dynobj::do_section_address): New function.
7492 (Sized_incr_dynobj::do_section_type): New function.
7493 (Sized_incr_dynobj::do_section_link): New function.
7494 (Sized_incr_dynobj::do_section_info): New function.
7495 (Sized_incr_dynobj::do_section_addralign): New function.
7496 (Sized_incr_dynobj::do_initialize_xindex): New function.
7497 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
7498 (make_sized_incremental_object): New function.
7499 (Incremental_library::copy_unused_symbols): New function.
7500 (Incremental_library::do_for_all_unused_symbols): New function.
7501 * incremental.h (enum Incremental_input_flags): New type.
7502 (class Incremental_checker): Remove.
7503 (Incremental_input_entry::Incremental_input_entry): Add argument
7504 serial number.
7505 (Incremental_input_entry::arg_serial): New function.
7506 (Incremental_input_entry::set_is_in_system_directory): New function.
7507 (Incremental_input_entry::is_in_system_directory): New function.
7508 (Incremental_input_entry::arg_serial_): New data member.
7509 (Incremental_input_entry::is_in_system_directory_): New data member.
7510 (class Script_info): Move here from script.h.
7511 (Script_info::Script_info): Add filename parameter.
7512 (Script_info::filename): New function.
7513 (Script_info::filename_): New data member.
7514 (Incremental_script_entry::Incremental_script_entry): Add argument
7515 serial number.
7516 (Incremental_object_entry::Incremental_object_entry): Likewise.
7517 (Incremental_object_entry::add_input_section): Build list of input
7518 sections with map to original shndx.
7519 (Incremental_object_entry::get_input_section_index): New function.
7520 (Incremental_object_entry::shndx_): New data member.
7521 (Incremental_object_entry::name_key_): Rename; adjust all refs.
7522 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
7523 (Incremental_archive_entry::Incremental_archive_entry): Add argument
7524 serial number.
7525 (Incremental_inputs::report_archive_begin): Likewise.
7526 (Incremental_inputs::report_object): Likewise.
7527 (Incremental_inputs::report_script): Likewise.
7528 (class Incremental_global_symbol_reader): New class.
7529 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
7530 and store flags and input file type.
7531 (Incremental_input_entry_reader::arg_serial): New function.
7532 (Incremental_input_entry_reader::type): Extract type from flags.
7533 (Incremental_input_entry_reader::is_in_system_directory): New function.
7534 (Incremental_input_entry_reader::get_input_section_count): Call
7535 accessor function for type.
7536 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
7537 function for type; adjust size of global symbol entry.
7538 (Incremental_input_entry_reader::get_global_symbol_count): Call
7539 accessor function for type.
7540 (Incremental_input_entry_reader::get_object_count): Likewise.
7541 (Incremental_input_entry_reader::get_object_offset): Likewise.
7542 (Incremental_input_entry_reader::get_member_count): Likewise.
7543 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
7544 (Incremental_input_entry_reader::get_member_offset): Likewise.
7545 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
7546 (Incremental_input_entry_reader::Global_symbol_info): Remove.
7547 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
7548 (Incremental_input_entry_reader::get_global_symbol_reader): New
7549 function.
7550 (Incremental_input_entry_reader::get_output_symbol_index): New
7551 function.
7552 (Incremental_input_entry_reader::type_): Remove.
7553 (Incremental_input_entry_reader::flags_): New data member.
7554 (Incremental_inputs_reader::input_file_offset): New function.
7555 (Incremental_inputs_reader::input_file_index): New function.
7556 (Incremental_inputs_reader::input_file): Call input_file_offset.
7557 (Incremental_inputs_reader::input_file_at_offset): New function.
7558 (Incremental_relocs_reader::get_r_type): Reformat.
7559 (Incremental_relocs_reader::get_r_shndx): Reformat.
7560 (Incremental_relocs_reader::get_r_offset): Reformat.
7561 (Incremental_relocs_reader::data): New function.
7562 (Incremental_binary::Incremental_binary): Initialize new data members.
7563 (Incremental_binary::check_inputs): Add cmdline parameter.
7564 (Incremental_binary::file_is_unchanged): Remove.
7565 (Input_reader::arg_serial): New function.
7566 (Input_reader::get_unused_symbol_count): New function.
7567 (Input_reader::get_unused_symbol): New function.
7568 (Input_reader::do_arg_serial): New function.
7569 (Input_reader::do_get_unused_symbol_count): New function.
7570 (Input_reader::do_get_unused_symbol): New function.
7571 (Incremental_binary::input_file_count): New function.
7572 (Incremental_binary::get_input_reader): Change signature to use
7573 index instead of filename.
7574 (Incremental_binary::file_has_changed): New function.
7575 (Incremental_binary::get_input_argument): New function.
7576 (Incremental_binary::get_library): New function.
7577 (Incremental_binary::get_script_info): New function.
7578 (Incremental_binary::init_layout): New function.
7579 (Incremental_binary::reserve_layout): New function.
7580 (Incremental_binary::output_file): New function.
7581 (Incremental_binary::do_check_inputs): New function.
7582 (Incremental_binary::do_file_is_unchanged): Remove.
7583 (Incremental_binary::do_file_has_changed): New function.
7584 (Incremental_binary::do_init_layout): New function.
7585 (Incremental_binary::do_reserve_layout): New function.
7586 (Incremental_binary::do_input_file_count): New function.
7587 (Incremental_binary::do_get_input_reader): Change signature.
7588 (Incremental_binary::input_args_map_): New data member.
7589 (Incremental_binary::library_map_): New data member.
7590 (Incremental_binary::script_map_): New data member.
7591 (Sized_incremental_binary::Sized_incremental_binary): Initialize
7592 new data members.
7593 (Sized_incremental_binary::output_section): New function.
7594 (Sized_incremental_binary::inputs_reader): Add const.
7595 (Sized_incremental_binary::symtab_reader): Add const.
7596 (Sized_incremental_binary::relocs_reader): Add const.
7597 (Sized_incremental_binary::got_plt_reader): Add const.
7598 (Sized_incremental_binary::get_symtab_view): New function.
7599 (Sized_incremental_binary::Inputs_reader): New typedef.
7600 (Sized_incremental_binary::Input_entry_reader): New typedef.
7601 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
7602 (Sized_incremental_binary::do_file_is_unchanged): Remove.
7603 (Sized_incremental_binary::do_file_has_changed): New function.
7604 (Sized_incremental_binary::do_init_layout): New function.
7605 (Sized_incremental_binary::do_reserve_layout): New function.
7606 (Sized_input_reader::Inputs_reader): Remove.
7607 (Sized_input_reader::Input_entry_reader): Remove.
7608 (Sized_input_reader::do_arg_serial): New function.
7609 (Sized_input_reader::do_get_unused_symbol_count): New function.
7610 (Sized_input_reader::do_get_unused_symbol): New function.
7611 (Sized_incremental_binary::do_input_file_count): New function.
7612 (Sized_incremental_binary::do_get_input_reader): Change signature;
7613 use index instead of filename.
7614 (Sized_incremental_binary::section_map_): New data member.
7615 (Sized_incremental_binary::input_entry_readers_): New data member.
7616 (class Sized_incr_relobj): New class.
7617 (class Sized_incr_dynobj): New class.
7618 (make_sized_incremental_object): New function.
7619 (class Incremental_library): New class.
7620 * layout.cc (Free_list::num_lists): New static data member.
7621 (Free_list::num_nodes): New static data member.
7622 (Free_list::num_removes): New static data member.
7623 (Free_list::num_remove_visits): New static data member.
7624 (Free_list::num_allocates): New static data member.
7625 (Free_list::num_allocate_visits): New static data member.
7626 (Free_list::init): New function.
7627 (Free_list::remove): New function.
7628 (Free_list::allocate): New function.
7629 (Free_list::dump): New function.
7630 (Free_list::print_stats): New function.
7631 (Layout_task_runner::run): Resize output file for incremental updates.
7632 (Layout::Layout): Initialize new data members.
7633 (Layout::set_incremental_base): New function.
7634 (Layout::init_fixed_output_section): New function.
7635 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
7636 incremental updates.
7637 (Layout::create_gold_note): Do not create gold note section for
7638 incremental updates.
7639 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
7640 for incremental updates.
7641 (Layout::set_section_offsets): For incremental updates, allocate space
7642 from free list.
7643 (Layout::create_symtab_sections): Layout with offsets relative to
7644 start of section; for incremental updates, allocate space from free
7645 list.
7646 (Layout::create_shdrs): For incremental updates, allocate space from
7647 free list.
7648 (Layout::finish_dynamic_section): For incremental updates, do not
7649 check --as-needed (fixed in subsequent patch).
7650 * layout.h (class Free_list): New class.
7651 (Layout::set_incremental_base): New function.
7652 (Layout::incremental_base): New function.
7653 (Layout::init_fixed_output_section): New function.
7654 (Layout::allocate): New function.
7655 (Layout::incremental_base_): New data member.
7656 (Layout::free_list_): New data member.
7657 * main.cc (main): Print Free_list statistics.
7658 * object.cc (Relobj::finalize_incremental_relocs): Add
7659 clear_counts parameter; clear counts only when clear_counts is set.
7660 (Sized_relobj::Sized_relobj): Initialize new base class.
7661 (Sized_relobj::do_layout): Don't report special sections.
7662 (Sized_relobj::do_for_all_local_got_entries): New function.
7663 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
7664 symtab_off to all symbol table offsets.
7665 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
7666 * object.h (class Got_offset_list): Move to top of file.
7667 (Object::Object): Allow case where input_file == NULL.
7668 (Object::~Object): Likewise.
7669 (Object::input_file): Assert that input_file != NULL.
7670 (Object::lock): Allow case where input_file == NULL.
7671 (Object::unlock): Likewise.
7672 (Object::is_locked): Likewise.
7673 (Object::token): Likewise.
7674 (Object::release): Likewise.
7675 (Object::is_incremental): New function.
7676 (Object::get_mtime): New function.
7677 (Object::for_all_local_got_entries): New function.
7678 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
7679 (Object::set_is_in_system_directory): New function.
7680 (Object::is_in_system_directory): New function.
7681 (Object::do_is_incremental): New function.
7682 (Object::do_get_mtime): New function.
7683 (Object::do_for_all_local_got_entries): New function.
7684 (Object::is_in_system_directory_): New data member.
7685 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
7686 (class Sized_relobj_base): New class.
7687 (class Sized_relobj): Derive from Sized_relobj_base.
7688 (class Sized_relobj::Symbols): Redeclare from base class.
7689 (class Sized_relobj::local_got_offset_list): Remove.
7690 (class Sized_relobj::Output_sections): Redeclare from base class.
7691 (class Sized_relobj::do_for_all_local_got_entries): New function.
7692 (class Sized_relobj::write_local_symbols): Add offset parameter.
7693 (class Sized_relobj::local_symbol_offset_): Update comment.
7694 (class Sized_relobj::local_dynsym_offset_): Update comment.
7695 * options.cc (Input_arguments::add_file): Remove const.
7696 * options.h (Input_file_argument::Input_file_argument):
7697 Initialize arg_serial_ (all constructors).
7698 (Input_file_argument::set_arg_serial): New function.
7699 (Input_file_argument::arg_serial): New function.
7700 (Input_file_argument::arg_serial_): New data member.
7701 (Input_arguments::Input_arguments): Initialize file_count_.
7702 (Input_arguments::add_file): Remove const.
7703 (Input_arguments::number_of_input_files): New function.
7704 (Input_arguments::file_count_): New data member.
7705 (Command_line::number_of_input_files): Call
7706 Input_arguments::number_of_input_files.
7707 * output.cc (Output_segment_headers::Output_segment_headers):
7708 Set current size.
7709 (Output_section::Input_section::current_data_size): New function.
7710 (Output_section::Output_section): Initialize new data members.
7711 (Output_section::add_input_section): Don't do merge sections for
7712 an incremental link; allocate space from free list for an
7713 incremental update.
7714 (Output_section::add_output_section_data): Allocate space from
7715 free list for an incremental update.
7716 (Output_section::update_data_size): New function.
7717 (Output_section::set_fixed_layout): New function.
7718 (Output_section::reserve): New function.
7719 (Output_segment::set_section_addresses): Remove const.
7720 (Output_segment::set_section_list_addresses): Remove const; allocate
7721 space from free list for an incremental update.
7722 (Output_segment::set_offset): Adjust size of RELRO segment for an
7723 incremental update.
7724 * output.h (Output_data::current_data_size): Move here from
7725 child classes.
7726 (Output_data::pre_finalize_data_size): New function.
7727 (Output_data::update_data_size): New function.
7728 (Output_section_headers::update_data_size): new function.
7729 (Output_section_data_build::current_data_size): Move to Output_data.
7730 (Output_data_strtab::update_data_size): New function.
7731 (Output_section::current_data_size): Move to Output_data.
7732 (Output_section::set_fixed_layout): New function.
7733 (Output_section::has_fixed_layout): New function.
7734 (Output_section::reserve): New function.
7735 (Output_section::update_data_size): New function.
7736 (Output_section::has_fixed_layout_): New data member.
7737 (Output_section::free_list_): New data member.
7738 (Output_segment::set_section_addresses): Remove const.
7739 (Output_segment::set_section_list_addresses): Remove const.
7740 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
7741 New function.
7742 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
7743 New function.
7744 * readsyms.cc (Read_symbols::do_read_symbols): Add library
7745 parameter when calling Add_symbols constructor; store argument
7746 serial number for members of a lib group.
7747 (Add_symbols::locks): Allow case where token == NULL.
7748 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
7749 (Read_member::~Read_member): New function.
7750 (Read_member::is_runnable): New function.
7751 (Read_member::locks): New function.
7752 (Read_member::run): New function.
7753 (Check_script::~Check_script): New function.
7754 (Check_script::is_runnable): New function.
7755 (Check_script::locks): New function.
7756 (Check_script::run): New function.
7757 (Check_library::~Check_library): New function.
7758 (Check_library::is_runnable): New function.
7759 (Check_library::locks): New function.
7760 (Check_library::run): New function.
7761 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
7762 (Add_symbols::library_): New data member.
7763 (class Read_member): New class.
7764 (class Check_script): New class.
7765 (class Check_library): New class.
7766 * reloc.cc (Read_relocs::is_runnable): Allow case where
7767 token == NULL.
7768 (Read_relocs::locks): Likewise.
7769 (Scan_relocs::locks): Likewise.
7770 (Relocate_task::locks): Likewise.
7771 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
7772 to clear counters.
7773 (Sized_relobj::incremental_relocs_scan): Fix comment.
7774 (Sized_relobj::do_relocate): Pass output file offset to
7775 write_local_symbols.
7776 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
7777 from class declaration.
7778 * script.cc (read_input_script): Allocate Script_info; pass
7779 argument serial number to report_script.
7780 * script.h (class Script_info): Move to incremental.h.
7781 * symtab.cc (Symbol_table::add_from_incrobj): New function.
7782 * symtab.h (Symbol_table::add_from_incrobj): New function.
7783 (Symbol_table::set_file_offset): New function.
7784
b961d0d7
CC
77852011-04-05 Cary Coutant <ccoutant@google.com>
7786
7787 * incremental-dump.cc (dump_incremental_inputs): Change signature
7788 to take a Sized_incremental_binary; change caller. Use readers
7789 in Sized_incremental_binary.
7790 * incremental.cc
7791 (Sized_incremental_binary::find_incremental_inputs_sections):
7792 Rename do_find_incremental_inputs_sections to this.
7793 (Sized_incremental_binary::setup_readers): New function.
7794 (Sized_incremental_binary::do_check_inputs): Check
7795 has_incremental_info_ flag; move setup code to setup_readers;
7796 use input readers.
7797 (Sized_incremental_binary::do_file_is_unchanged): New function.
7798 (Sized_incremental_binary::do_get_input_reader): New function.
7799 * incremental.h (class Incremental_binary): Move to end of file.
7800 (Incremental_binary::file_is_unchanged): New function.
7801 (Incremental_binary::do_file_is_unchanged): New function.
7802 (Incremental_binary::Input_reader): New class.
7803 (Incremental_binary::get_input_reader): New function.
7804 (class Sized_incremental_binary): Move to end of file.
7805 (Sized_incremental_binary::Sized_incremental_binary): Setup the
7806 input section reader classes.
7807 (Sized_incremental_binary::has_incremental_info): New function.
7808 (Sized_incremental_binary::inputs_reader): New function.
7809 (Sized_incremental_binary::symtab_reader): New function.
7810 (Sized_incremental_binary::relocs_reader): New function.
7811 (Sized_incremental_binary::got_plt_reader): New function.
7812 (Sized_incremental_binary::do_file_is_unchanged): New function.
7813 (Sized_incremental_binary::Sized_input_reader): New class.
7814 (Sized_incremental_binary::get_input_reader): New function.
7815 (Sized_incremental_binary::find_incremental_inputs_sections):
7816 Rename do_find_incremental_inputs_sections to this.
7817 (Sized_incremental_binary::setup_readers): New function.
7818 (Sized_incremental_binary::has_incremental_info_): New data member.
7819 (Sized_incremental_binary::inputs_reader_): New data member.
7820 (Sized_incremental_binary::symtab_reader_): New data member.
7821 (Sized_incremental_binary::relocs_reader_): New data member.
7822 (Sized_incremental_binary::got_plt_reader_): New data member.
7823 (Sized_incremental_binary::current_input_file_): New data member.
7824
a869183f
PP
78252011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
7826
7827 PR gold/12640
7828 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
7829 violation.
7830
78312011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
7832
7833 * archive.cc (Archive::include_member): Adjust call to report_object.
7834 (Add_archive_symbols::run): Add script_info to call to
7835 report_archive_begin.
7836 (Lib_group::include_member): Adjust call to report_object.
7837 (Add_lib_group_symbols::run): Adjust call to report_object.
7838 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
7839 blocks. Add object count for script input files.
7840 * incremental.cc (Incremental_inputs::report_archive_begin): Add
7841 script_info parameter; change all callers.
7842 (Incremental_inputs::report_object): Add script_info parameter;
7843 change all callers.
7844 (Incremental_inputs::report_script): Store backpointer to
7845 incremental info entry.
7846 (Output_section_incremental_inputs::set_final_data_size): Record
7847 additional information for scripts.
7848 (Output_section_incremental_inputs::write_info_blocks): Likewise.
7849 * incremental.h (Incremental_script_entry::add_object): New function.
7850 (Incremental_script_entry::get_object_count): New function.
7851 (Incremental_script_entry::get_object): New function.
7852 (Incremental_script_entry::objects_): New data member; adjust
7853 constructor.
7854 (Incremental_inputs::report_archive_begin): Add script_info parameter.
7855 (Incremental_inputs::report_object): Add script_info parameter.
7856 (Incremental_inputs_reader::get_object_count): New function.
7857 (Incremental_inputs_reader::get_object_offset): New function.
7858 * options.cc (Input_arguments::add_file): Return reference to
7859 new input argument.
7860 * options.h (Input_argument::set_script_info): New function.
7861 (Input_argument::script_info): New function.
7862 (Input_argument::script_info_): New data member; adjust all
7863 constructors.
7864 (Input_file_group::add_file): Return reference to new input argument.
7865 (Input_file_lib::add_file): Likewise.
7866 (Input_arguments::add_file): Likewise.
7867 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
7868 * script.cc (Parser_closure::Parser_closure): Add script_info
7869 parameter; adjust all callers.
7870 (Parser_closure::script_info): New function.
7871 (Parser_closure::script_info_): New data member.
7872 (read_input_script): Report scripts earlier to incremental info.
7873 (script_add_file): Set script_info in Input_argument.
7874 (script_add_library): Likewise.
7875 * script.h (Script_options::Script_info): Rewrite class.
7876
a869183f 78772011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
7878
7879 * archive.cc (Library_base::should_include_member): Move
7880 method here from class Archive.
7881 (Archive::Archive): Initialize base class.
7882 (Archive::should_include_member): Move to base class.
7883 (Archive::do_for_all_unused_symbols): New function.
7884 (Add_archive_symbols::run): Remove redundant access to
7885 incremental_inputs.
7886 (Lib_group::Lib_group): Initialize base class.
7887 (Lib_group::do_filename): New function.
7888 (Lib_group::include_member): Pass pointer to Lib_group to
7889 report_object.
7890 (Lib_group::do_for_all_unused_symbols): New function.
7891 (Add_lib_group_symbols::run): Report archive information for
7892 incremental links.
7893 * archive.h (class Library_base): New base class.
7894 (class Archive): Derive from Library_base.
7895 (Archive::filename): Move to base class.
7896 (Archive::set_incremental_info): Likewise.
7897 (Archive::incremental_info): Likewise.
7898 (Archive::Should_include): Likewise.
7899 (Archive::should_include_member): Likewise.
7900 (Archive::Armap_entry): Remove.
7901 (Archive::Unused_symbol_iterator): Remove.
7902 (Archive::unused_symbols_begin): Remove.
7903 (Archive::unused_symbols_end): Remove.
7904 (Archive::do_filename): New function.
7905 (Archive::do_get_mtime): New function.
7906 (Archive::do_for_all_unused_symbols): New function.
7907 (Archive::task_): Move to base class.
7908 (Archive::incremental_info_): Likewise.
7909 (class Lib_group): Derive from Library_base.
7910 (Lib_group::do_filename): New function.
7911 (Lib_group::do_get_mtime): New function.
7912 (Lib_group::do_for_all_unused_symbols): New function.
7913 (Lib_group::task_): Move to base class.
7914 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
7915 function.
7916 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
7917 function.
7918 * incremental.cc (Incremental_inputs::report_archive_begin):
7919 Use Library_base; call library's get_mtime; add incremental inputs
7920 entry before members.
7921 (class Unused_symbol_visitor): New class.
7922 (Incremental_inputs::report_archive_end): Use Library_base; use
7923 visitor class to record unused symbols; don't add incremental inputs
7924 entry after members.
7925 (Incremental_inputs::report_object): Use Library_base.
7926 * incremental.h
7927 (Incremental_archive_entry::Incremental_archive_entry): Remove
7928 unused Archive parameter.
7929 (Incremental_inputs::report_archive_begin): Use Library_base.
7930 (Incremental_inputs::report_archive_end): Likewise.
7931 (Incremental_inputs::report_object): Likewise.
7932 * object.cc (Sized_relobj::do_for_all_global_symbols): New
7933 function.
7934 * object.h (Object::for_all_global_symbols): New function.
7935 (Object::do_for_all_global_symbols): New function.
7936 (Sized_relobj::do_for_all_global_symbols): New function.
7937 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
7938 function.
7939 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
7940 function.
7941
61ab3e40
ILT
79422011-03-27 Ian Lance Taylor <iant@google.com>
7943
7944 * archive.cc (Archive::interpret_header): Return -1 if something
7945 goes wrong. Change callers accordingly.
7946
30e1f9e6
CC
79472011-03-25 Cary Coutant <ccoutant@google.com>
7948
7949 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
7950 * testsuite/Makefile.in: Regenerate.
7951
9370ce59 79522011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
7953
7954 * plugin.cc (get_view): New.
7955 (Plugin::load): Pass get_view to the plugin.
7956 (Plugin_manager::get_view): New.
7957
9312bb0a
ILT
79582011-03-21 Ian Lance Taylor <iant@google.com>
7959
7960 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 7961 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 7962
7e12ba9e
ST
79632011-03-21 Sriraman Tallam <tmsriram@google.com>
7964
7965 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
7966 Change == to -eq.
7967 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
7968 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
7969 Change == to -eq.
7970 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
7971 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
7972
fd7a005d
ILT
79732011-03-14 Ian Lance Taylor <iant@google.com>
7974
7975 * script-sections.cc (Sort_output_sections::script_compare):
7976 Rename from is_before, change return type.
7977 (Sort_output_sections::operator()): Adjust accordingly.
7978
ed16fd1b
ILT
79792011-03-11 Jeffrey Yasskin <jyasskin@google.com>
7980
7981 PR gold/12572
7982 * testsuite/odr_violation2.cc: Add comment to make all error line
7983 numbers double digits.
7984 * testsuite/debug_msg.sh: Adjust expected errors.
7985
71ff8986
ILT
79862011-03-09 Jeffrey Yasskin <jyasskin@google.com>
7987
7988 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
7989 but mark earlier ones as non-canonical
7990 (offset_to_iterator): Update search target and example
7991 (do_addr2line): Return extra lines in a vector*
7992 (format_file_lineno): Extract from do_addr2line
7993 (one_addr2line): Add vector* out-param
7994 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
7995 when a lineno entry appeared last for its instruction
7996 (Dwarf_line_info): Add vector* out-param
7997 * object.cc (Relocate_info): Pass NULL for the vector* out-param
7998 * symtab.cc (Odr_violation_compare): Include the lineno in the
7999 comparison again.
8000 (linenos_from_loc): New. Combine the canonical line for an
8001 address with its other lines.
8002 (True_if_intersect): New. Helper functor to make
8003 std::set_intersection a query.
8004 (detect_odr_violations): Compare sets of lines instead of just
8005 one line for each function. This became less deterministic, but
8006 has fewer false positives.
8007 * symtab.h: Declarations.
8008 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
8009 mix an optimized and non-optimized object in the same binary
8010 (odr_violation2.so): Same.
8011 * testsuite/Makefile.in: Regenerate from Makefile.am.
8012 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
8013 * testsuite/debug_msg.sh: Update line numbers and add
8014 assertions.
8015 * testsuite/odr_violation1.cc: Use OdrDerived, in a
8016 non-optimized context.
8017 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
8018 isn't inlined, and use OdrDerived in an optimized context.
8019 * testsuite/odr_header1.h: Defines OdrDerived, where
8020 optimization will change the
8021 first-instruction-in-the-destructor's file and line number.
8022 * testsuite/odr_header2.h: Defines OdrBase.
8023
a19fefdc
ILT
80242011-03-09 Ian Lance Taylor <iant@google.com>
8025
8026 * fileread.cc (File_read::clear_views): Don't delete the whole
8027 file view.
8028
ecb351e9
ILT
80292011-03-08 Ian Lance Taylor <iant@google.com>
8030
8031 PR gold/12525
8032 * fileread.cc: #include <climits>.
8033 (GOLD_IOV_MAX): Define.
8034 (File_read::read_multiple): Limit number of entries by iov_max.
8035 * fileread.h (class File_read): Always set max_readv_entries to
8036 128.
8037
b821d13c
ILT
80382011-03-07 Ian Lance Taylor <iant@google.com>
8039
8040 PR gold/12525
8041 * options.h (class General_options): Add -dy and -dn.
8042
89243142
CC
80432011-03-02 Cary Coutant <ccoutant@google.com>
8044
8045 * testsuite/script_test_9.t: Add TLS segment.
8046
d0773f31
ILT
80472011-03-02 Simon Baldwin <simonb@google.com>
8048
8049 * configure.ac: Add check for gnu_indirect_function support in
8050 the toolchain building binutils.
8051 * configure: Rebuild.
8052
9370ce59 80532011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
8054
8055 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
8056 plugin only symbols.
8057 (Symbol_table::sized_finalize_symbol) Mark symbol only present
8058 in plugin files as not needed in the symbol table.
8059
4cf7a849
ST
80602011-02-11 Sriraman Tallam <tmsriram@google.com>
8061
8062 * output.cc (Output_section::add_input_section): Delay fill
8063 generation for section ordering.
8064
b578bd7d
ILT
80652011-02-09 Ian Lance Taylor <iant@google.com>
8066
8067 PR gold/12316
8068 * object.h (class Sized_relobj): Remove clear_local_symbols.
8069 * reloc.cc (Sized_relobj::do_relocate): Don't call
8070 clear_local_symbols.
8071
9370ce59 80722011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
8073
8074 * plugin.cc (is_visible_from_outside): Return true for symbols
8075 in the -u option.
8076
55382fb7
ILT
80772011-02-04 Jeffrey Yasskin <jyasskin@google.com>
8078
8079 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
8080 filename.
8081
4e271fff
ST
80822011-02-02 Sriraman Tallam <tmsriram@google.com>
8083
8084 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 8085 to std::string.
4e271fff 8086 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 8087 section_name to be std::string.
4e271fff
ST
8088 (is_function_ctor_or_dtor): Change type of parameter to std::string.
8089
d433c3ac
ILT
80902011-01-25 Ian Lance Taylor <iant@google.com>
8091
8092 * script.cc (script_add_extern): Rewrite to use
8093 add_symbol_reference.
8094
880473a6
DK
80952011-01-25 Doug Kwan <dougkwan@google.com>
8096
d433c3ac 8097 * icf.cc (get_section_contents): Always lock section's object.
880473a6 8098
f30f86fa
ILT
80992011-01-24 Ian Lance Taylor <iant@google.com>
8100
8101 * options.h (class General_options): Accept
8102 --no-detect-odr-violations.
8103
8e51a0b9
ILT
81042011-01-24 Ian Lance Taylor <iant@google.com>
8105
8106 * version.cc (version_string): Bump to 1.11.
8107
0f3b89d8
ILT
81082011-01-24 Ian Lance Taylor <iant@google.com>
8109
8110 * plugin.cc (class Plugin_rescan): Define new class.
8111 (Plugin_manager::claim_file): Set any_claimed_.
8112 (Plugin_manager::save_archive): New function.
8113 (Plugin_manager::save_input_group): New function.
8114 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
8115 necessary.
8116 (Plugin_manager::new_undefined_symbol): New function.
8117 (Plugin_manager::rescan): New function.
8118 (Plugin_manager::rescannable_defines): New function.
8119 (Plugin_manager::add_input_file): Set any_added_.
8120 * plugin.h (class Plugin_manager): define new fields rescannable_,
8121 undefined_symbols_, any_claimed_, and any_added_. Declare
8122 Plugin_rescan as friend. Declare new functions.
8123 (Plugin_manager::Rescannable): Define type.
8124 (Plugin_manager::Rescannable_list): Define type.
8125 (Plugin_manager::Undefined_symbol_list): Define type.
8126 (Plugin_manager::Plugin_manager): Initialize new fields.
8127 * archive.cc (Archive::defines_symbol): New function.
8128 (Add_archive_symbols::run): Pass archive to plugins if any.
8129 * archive.h (class Archive): Declare defines_symbol.
8130 * readsyms.cc (Input_group::~Input_group): New function.
8131 (Finish_group::run): Pass input_group to plugins if any.
8132 * readsyms.h (class Input_group): Declare destructor.
8133 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
8134 any.
8135
3bb951e5
ILT
81362011-01-10 Ian Lance Taylor <iant@google.com>
8137
8138 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
8139 section as relro.
8140 (Layout::set_segment_offsets): Reset increase_relro before calling
8141 set_section_addresses a second time.
8142
0aa45fac
CC
81432011-01-04 Cary Coutant <ccoutant@google.com>
8144
8145 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
8146 sections before NOBITS sections.
8147
0db46eb4
L
81482011-01-01 H.J. Lu <hongjiu.lu@intel.com>
8149
8150 * version.cc (print_version): Update copyright to 2011.
8151
829c9745
CC
81522010-12-23 Cary Coutant <ccoutant@google.com>
8153
8154 * output.h (Output_data_reloc::add_output_section): Pass OD instead
8155 of OS to this->add. Add OD parameter to second form of the function.
8156
7500420b
ILT
81572010-12-20 Ian Lance Taylor <iant@google.com>
8158
8159 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
8160 second of two consecutive entries with same offset.
8161
f8e9a930
RW
81622010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8163
8164 * testsuite/Makefile.am (ifuncmain2static_LDADD)
8165 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
8166 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
8167 to avoid unneeded links against $(LDADD).
8168 * testsuite/Makefile.in: Regenerate.
8169
2fbb4320
ILT
81702010-12-15 Ian Lance Taylor <iant@google.com>
8171
8172 PR gold/12324
8173 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
8174 for R_X86_64_32 and R_X86_64_PC32.
8175 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
8176 ver_matching_def_pic.o.
8177 (ver_matching_def_pic.o): New target.
8178
fedb228d
RW
81792010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8180
8181 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
8182 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
8183 Move definition before File_read::View member definitions.
8184 (File_read::View::~View): Initialize and hold lock before
8185 updating current_mapped_bytes.
8186
9b547ce6
RW
81872010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8188
8189 * dwarf_reader.cc: Remove outdated comment.
8190 * gold-threads.cc: Fix typo in error message.
8191 * archive.cc: Fix typos in comments.
8192 * archive.h: Likewise.
8193 * arm-reloc-property.cc: Likewise.
8194 * arm-reloc-property.h: Likewise.
8195 * arm-reloc.def: Likewise.
8196 * arm.cc: Likewise.
8197 * attributes.h: Likewise.
8198 * cref.cc: Likewise.
8199 * ehframe.cc: Likewise.
8200 * fileread.h: Likewise.
8201 * gold.h: Likewise.
8202 * i386.cc: Likewise.
8203 * icf.cc: Likewise.
8204 * incremental.h: Likewise.
8205 * int_encoding.cc: Likewise.
8206 * layout.h: Likewise.
8207 * main.cc: Likewise.
8208 * merge.h: Likewise.
8209 * object.cc: Likewise.
8210 * object.h: Likewise.
8211 * options.cc: Likewise.
8212 * readsyms.cc: Likewise.
8213 * reduced_debug_output.cc: Likewise.
8214 * reloc.cc: Likewise.
8215 * script-sections.cc: Likewise.
8216 * sparc.cc: Likewise.
8217 * symtab.h: Likewise.
8218 * target-reloc.h: Likewise.
8219 * target.cc: Likewise.
8220 * target.h: Likewise.
8221 * timer.cc: Likewise.
8222 * timer.h: Likewise.
8223 * x86_64.cc: Likewise.
8224
83e17bd5
CC
82252010-12-09 Cary Coutant <ccoutant@google.com>
8226
8227 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
8228 stack.
8229 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
8230 parameter; change all callers.
8231 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
8232 * options.h (warn_execstack): New option.
8233
017257f8
DK
82342010-12-07 Doug Kwan <dougkwan@google.com>
8235
8236 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
8237 like function call relocations.
8238
c20cbc06
ILT
82392010-12-07 Ian Lance Taylor <iant@google.com>
8240
8241 * archive.cc (Archive::get_elf_object_for_member): Permit
8242 punconfigured to be NULL.
8243 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
8244 (Archive::include_member): Pass NULL to get_elf_object_for_member
8245 if we searched for the archive and this is the first included
8246 object.
8247
4dbfafcc
ILT
82482010-12-01 Ian Lance Taylor <iant@google.com>
8249
8250 * dwarf_reader.h (class Sized_dwarf_line_info): Add
8251 track_relocs_type_ field.
8252 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8253 Set track_relocs_type_.
8254 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
8255 contents when using RELA relocs.
8256 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
8257 reloc_map_.
8258 * reloc.cc (Track_relocs::next_addend): New function.
8259 * reloc.h (class Track_relocs): Declare next_addend.
8260
e5e19edd
ILT
82612010-12-01 Ian Lance Taylor <iant@google.com>
8262
8263 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
8264 virtual destructor.
8265
9a5ce24c
ILT
82662010-12-01 Ian Lance Taylor <iant@google.com>
8267
8268 * README: Update compilers known to work and fail.
8269
c7791212
NC
82702010-11-23 Matthias Klose <doko@ubuntu.com>
8271
8272 * configure.in: For --enable-gold, handle value `default' instead of
8273 `both*'. Always install ld as ld.bfd, install as ld if gold is
8274 not the default.
8275 * configure: Regenerate.
8276
0ad220c9
DK
82772010-11-18 Doug Kwan <dougkwan@google.com>
8278
8279 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
8280 and right_alignment to be zero. Store result alignment only if it is
8281 greater than existing alignment.
8282
ab8056e0
CC
82832010-11-16 Cary Coutant <ccoutant@google.com>
8284
8285 PR gold/12220
8286 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8287 Check for ".zdebug_line".
8288
fd064a5b
CC
82892010-11-16 Doug Kwan <dougkwan@google.com>
8290 Cary Coutant <ccoutant@google.com>
8291
8292 * output.h (Output_segment::set_section_addresses): Pass increase_relro
8293 by reference; adjust all callers.
8294 * output.cc (Output_segment::set_section_addresses): Adjust references
8295 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
8296 list is empty.
8297 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
8298 end at page boundary.
8299
6fc6ea19
CC
83002010-11-16 Cary Coutant <ccoutant@google.com>
8301
8302 PR gold/12220
8303 * layout.cc (Layout::choose_output_section): Transform names of
8304 compressed sections even when using a script with a SECTIONS clause.
8305 (Layout::output_section_name): Remove code to transform
8306 compressed debug section names.
8307 * output.cc (Output_section::add_input_section): Use uncompressed
8308 section size when tracking input sections.
8309
95a2c8d6
RS
83102010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
8311
8312 * symtab.h (Symbol::NON_PIC_REF): Remove.
8313 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
8314 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
8315 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
8316 (Symbol::use_plt_offset): Take a flags argument and pass it
8317 directly to needs_dynamic_reloc. Restrict check for undefined
8318 weak symbols to function calls.
8319 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
8320 (Target_arm::Scan::global): Use it.
8321 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
8322 (Target_arm::Relocate::relocate): Likewise.
8323 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
8324 parameter with an r_type parameter. Use get_reference_flags
8325 to get the flags.
8326 (Target_arm::Relocate::relocate): Update accordingly.
8327 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
8328 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
8329 (Target_i386::Scan::global): Likewise.
8330 (Target_i386::Relocate::relocate): Likewise.
8331 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
8332 parameter with an r_type parameter. Use get_reference_flags
8333 to get the flags.
8334 (Target_i386::Relocate::relocate): Update accordingly.
8335 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
8336 (Target_powerpc::Scan::global): Use it.
8337 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
8338 (Target_powerpc::Relocate::relocate): Likewise.
8339 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
8340 (Target_sparc::Scan::global): Use it.
8341 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
8342 (Target_sparc::Relocate::relocate): Likewise.
8343 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
8344 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
8345 (Target_x86_64::Scan::global): Likewise.
8346 (Target_x86_64::Relocate::relocate): Likewise.
8347
f625ae50
DK
83482010-11-08 Doug Kwan <dougkwan@google.com>
8349 Cary Coutant <ccoutant@google.com>
8350
8351 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
8352 (Arm_exidx_merge_section::section_contents_): New data member.
8353 (Arm_input_section::Arm_input_section): Initialize original_contents_.
8354 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 8355 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
8356 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
8357 in parameters instead of calling Object::section_contents without
8358 locking.
8359 (Arm_output_section::group_section): New parameter TASK. Pass it
8360 to callees that need locking objects.
8361 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
8362 to lock EXIDX input sections. Fix a formatting issue. Call
8363 Arm_exidx_merged_section::build_contents to create merged section
8364 contents.
8365 (Arm_output_section::create_stub_group): New parameter TASK. Use it
8366 to lock object of stub table owner.
8367 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
8368 TEXT_SIZE to initialize data member TEXT_SIZE_.
8369 (Arm_exidx_input_section::addralign): Fix typo in comment.
8370 (Arm_exidx_input_section::text_size): New method.
8371 (Target_arm::do_relax): New parameter TASK. Pass it to callees
8372 that require locking objects. Lock objects before scanning for stubs
8373 and updating local symbols.
8374 (Arm_input_section<big_endian>::init): Copy contents of original
8375 input section.
2e702c99 8376 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
8377 original input section instead of calling Object::section_contents
8378 without locking.
8379 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
8380 size without calling Object::section_size().
8381 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
8382 for size. Allocate a buffer for merged EXIDX entries.
8383 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 8384 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
8385 building code to Arm_exidx_merged_section::build_contetns. Write
8386 out contetns in buffer instead of building it on the fly.
8387 (Arm_relobj::make_exidx_input_section): Also pass text section size
8388 to Arm_exidx_input_section constructor.
8389 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
8390 (Arm_dynobj::do_read_symbols): Fix memory leak.
8391 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
8392 * target.h: (class Task): Add forward declaration.
8393 (Target::relax): Add new parameter TASK and pass it to
8394 Target::do_relax().
8395 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
8396
5f9bcf58
CC
83972010-11-05 Cary Coutant <ccoutant@google.com>
8398
8399 PR gold/10708
8400 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
8401 object when reading from the file.
8402 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
8403 second layout pass.
8404 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
8405 when reading section contents.
8406 (get_section_contents): Likewise.
8407 (icf::find_identical_sections): Likewise.
8408 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
8409 object when reading from the file.
8410 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
8411 the object when doing deferred section layout.
8412
e597fa08
NC
84132010-11-03 Nick Clifton <nickc@redhat.com>
8414
8415 PR gold/12001
8416 * script.h (class Symbol_assignment: name): New member. Returns
8417 the name of the symbol.
8418 * scrfipt.cc (Script_options::is_pending_assignment): New member.
8419 Returns true if the given symbol name is on the list of
8420 assignments wating to be processed.
8421 * archive.cc (should_incldue_member): If the symbol is undefined,
8422 check to see if it is on the list of symbols pending assignment.
8423
3f9a3278
ILT
84242010-11-03 Ryan Mansfield <rmansfield@qnx.com>
8425
8426 * script-sections.cc (Script_sections::find_memory_region): Check
8427 for a NULL output section pointer.
8428
d06fb4d1
DK
84292010-10-29 Doug Kwan <dougkwan@google.com>
8430
8431 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
8432 Output_section::add_relaxed_input_section.
8433 * output.cc (Output_section::add_relaxed_input_section): Add new
8434 arguments LAYOUT and NAME. Set section order index.
8435 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8436 Copy section order index.
8437 * output.h (Output_section::add_relaxed_input_section): Add new
8438 arguments LAYOUT and NAME.
8439
90e24de5
ILT
84402010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8441
8442 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 8443 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
8444 * testsuite/Makefile.in: Regenerate.
8445
c9484ea5
DK
84462010-10-20 Doug Kwan <dougkwan@google.com>
8447
8448 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
8449 without SHF_LINK_ORDER flags.
8450 * layout.cc (Layout::choose_output_section): Do not filter
8451 SHF_LINK_ORDER flag in a relocatable link.
8452
5bc2f5be
CC
84532010-10-17 Cary Coutant <ccoutant@google.com>
8454
8455 * output.h (Output_segment::set_section_addresses): Change function
8456 signature. Update all callers.
8457 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
8458 sections.
8459 (Output_segment::set_section_addresses): Align after last TLS
8460 section. Add padding before last relro section instead of after.
8461
0c91cf04
DK
84622010-10-17 Doug Kwan <dougkwan@google.com>
8463
8464 * gold/arm.cc (Target_arm::got_section): Use correct order and set
8465 GOT output section to be writable.
8466
8c21d9d3
CC
84672010-10-14 Cary Coutant <ccoutant@google.com>
8468
8469 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
8470 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
8471 * gold.cc (queue_initial_tasks): Check parameters for incremental link
8472 mode.
8473 * incremental.cc (report_command_line): Ignore all forms of
8474 --incremental.
8475 * layout.cc (Layout::Layout): Check parameters for incremental link
8476 mode.
8477 * options.cc (General_options::parse_incremental): New function.
8478 (General_options::parse_no_incremental): New function.
8479 (General_options::parse_incremental_full): New function.
8480 (General_options::parse_incremental_update): New function.
8481 (General_options::incremental_mode_): New data member.
8482 (General_options::finalize): Check incremental_mode_.
8483 * options.h (General_options): Update help text for --incremental.
8484 Add --no-incremental, --incremental-full, --incremental-update.
8485 (General_options::Incremental_mode): New enum type.
8486 (General_options::incremental_mode): New function.
8487 (General_options::incremental_mode_): New data member.
8488 * parameters.cc (Parameters::incremental_mode_): New data member.
8489 (Parameters::set_options): Set incremental_mode_.
8490 (Parameters::set_incremental_full): New function.
8491 (Parameters::incremental): New function.
8492 (Parameters::incremental_update): New function.
8493 (set_parameters_incremental_full): New function.
8494 * parameters.h (Parameters::set_incremental_full): New function.
8495 (Parameters::incremental): New function.
8496 (Parameters::incremental_update): New function.
8497 (Parameters::incremental_mode_): New data member.
8498 (set_parameters_incremental_full): New function.
8499 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
8500 incremental link mode.
8501 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
8502 (Sized_relobj::do_relocate_sections): Likewise.
8503 * testsuite/Makefile.am (incremental_test): Use --incremental-full
8504 option.
8505 * testsuite/Makefile.in: Regenerate.
8506 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 8507
bb32aa18 85082010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
8509
8510 * script-sections.h (class Script_sections): Make
8511 Sections_elements typedef public.
8512 * script-sections.cc (class Sort_output_sections): Add elements_
8513 field. Add constructor which sets it; change all callers.
8514 (Sort_output_sections::is_before): New function.
8515 (Sort_output_sections::operator()): Call is_before.
8516 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
8517 conditional.
8518 * testsuite/script_test_10.sh: New test. Test script section
8519 order.
8520 * testsuite/script_test_10.t: Likewise.
8521 * testsuite/script_test_10.s: Likewise.
8522 * testsuite/Makefile.am: Wrap the cross linker tests and the
8523 common tests into NATIVE_OR_CROSS_LINKER.
8524 (check_SCRIPTS): Add script_test_10.sh.
8525 (check_DATA): Add script_test_10.stdout.
8526 (script_test_10.o, script_test_10): New targets.
8527 (script_test_10.stdout): New target.
8528 * configure, testsuite/Makefile.in: Regenerate.
8529
3cef7179
ILT
85302010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8531
8532 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
8533 error for the deprecated relocations.
8534 (Target_arm::Scan::global): Likewise.
8535 (Target_arm::Relocate::relocate): Likewise.
8536
7411e9a8
RS
85372010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
8538
8539 * fileread.cc (Input_file::find_file): Initialize *found_name
8540 and *namep when using the fallback search for case 4.
8541
6a9da32a
CC
85422010-10-11 Cary Coutant <ccoutant@google.com>
8543
8544 * options.h (class General_options): Redefine -z lazy as an alias for
8545 the negation of -z now.
8546
ac897c20
ILT
85472010-10-11 Ian Lance Taylor <iant@google.com>
8548
8549 * resolve.cc (symbol_to_bits): Report the value of the unsupported
8550 binding.
8551
ea5cae92
NC
85522010-10-06 Nick Clifton <nickc@redhat.com>
8553
8554 * script-sections.cc(class Memory_region): Remove
8555 current_lma_offset_ field. Rename current_vma_offset_ to
8556 current_offset_. Add last_section_ field.
8557 (Memory_region::get_current_vma_address): Rename to
8558 get_current_address.
8559 (Memory_region::get_current_lma_address): Delete.
8560 (Memory_region::increment_vma_offset): Rename to
8561 increment_offset.
8562 (Memory_region::increment_lma_offset): Delete.
8563 (Memory_region::attributes_compatible): New method. Returns
8564 true if the provided section is compatible with the region.
8565 (Memory_region::get_last_section): New method. Returns the last
8566 section to use the region.
8567 (Memory_region::set_last_section): New method. Stores the last
8568 section to use the region.
8569 (Script_sections::block_in_region): New method. Returns true if
8570 a block of memory is contained within a region.
8571 (Script_sections::find_memory_region): New method. Locates a
8572 memory region to be used to set a VMA or LMA address.
8573 (Output_section_definition::set_section_addresses): Add code to
8574 check for addresses set by memory regions.
8575 (Output_segment::set_section_addresses): Remove memory region
8576 walking code.
8577 (Script_sections::create_segment): Add a warning if a header
8578 segment is created outside of any region.
8579 * script-sections.h (class Script_sections): Add prototypes for
8580 find_memory_region and block_in_region methods.
8581 * testsuite/memory_test.s: Use .long instead of .word.
8582 * testsuite/memory_test.t: Add some more output sections.
8583 * testsuite/memory_test.sh: Update expected output.
8584
a9bfd952
DK
85852010-10-02 Doug Kwan <dougkwan@google.com>
8586
8587 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
8588 defintion to symtab.h
8589 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
8590 declaration to defintion.
8591
bacff3ab
NC
85922010-10-01 Nick Clifton <nickc@redhat.com>
8593
8594 * expression.cc (eval): Replace dummy argument with NULL.
8595 (eval_maybe_dot): Check for a NULL result section pointer.
8596 (Symbol_expression::value): Likewise.
8597 (Dot_expression::value): Likewise.
8598 (BINARY_EXPRESSION): Likewise.
8599 (Max_expression::value): Likewise.
8600 (Min_expression::value): Likewise.
8601 (Absolute_expression::value): Likewise.
8602 (Addr_expression::value_from_output_section): Likewise.
8603 (Loaddddr_expression::value_from_output_section): Likewise.
8604 (Segment_start_expression::value): Likewise.
8605 * script-sections.cc
8606 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
8607 argument with NULL.
8608 (Sections_elememt_dot_assignment::set_section_addresses):
8609 Likewise.
8610 (Output_data_expression::do_write_to_buffer): Likewise.
8611 (Output_section_definition::finalize_symbols): Likewise.
8612 (Output_section_definition::set_section_addresses): Likewise.
8613
f81bc8b5
DK
86142010-09-30 Doug Kwan <dougkwan@google.com>
8615
8616 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
8617
c95e9f27
ST
86182010-09-28 Sriraman Tallam <tmsriram@google.com>
8619
8620 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 8621 function.
c95e9f27
ST
8622 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
8623 virtual function.
8624 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
8625 virtual function.
8626 * icf.cc (get_section_contents): Inline merge sections only when
8627 target allows it.
8628
3cac54d2
RW
86292010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
8630
8631 * configure: Regenerate.
8632
2904037a
ILT
86332010-09-17 Ian Lance Taylor <iant@google.com>
8634
8635 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
8636 * testsuite/Makefile.am (memory_test.o): New target.
8637 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
8638 memory_test.t.
8639 * testsuite/Makefile.in: Rebuild.
2904037a 8640
bca7fb63
DK
86412010-09-17 Doug Kwan <dougkwan@google.com>
8642
8643 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
8644 defintion if relocation uses GOT entries of the symbol.
8645 * testsuite/icf_safe_test.sh: Fix test.
8646 * testsuite/icf_safe_so_test.sh: Fix test.
8647
4ef28648
CC
86482010-09-16 Cary Coutant <ccoutant@google.com>
8649
8650 * script_sections.cc (class Memory_region): Remove "NULL" from
8651 vector initializations.
8652
793990de
CC
86532010-09-15 Cary Coutant <ccoutant@google.com>
8654
8655 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
8656 Resolve forwarding symbols.
8657
81e015e2
DK
86582010-09-15 Doug Kwan <dougkwan@google.com>
8659
8660 * gold/testsuite/script_test_3.t: Add ARM special sections.
8661 * gold/testsuite/script_test_4.t: Same.
8662 * gold/testsuite/script_test_5.t: Same.
8663 * gold/testsuite/script_test_6.t: Same.
8664 * gold/testsuite/script_test_7.t: Same.
8665 * gold/testsuite/script_test_7.t: Same.
8666 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
8667
36171d64
CC
86682010-09-14 Cary Coutant <ccoutant@google.com>
8669
8670 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
8671 (Target_x86_64::Relocate::relocate_tls): Replace check for
8672 saw_tls_block_reloc_ with test for executable section.
8673
d89051bd
CC
86742010-09-12 Cary Coutant <ccoutant@google.com>
8675
8676 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
8677 position-independent executables to shared libraries need dynamic
8678 relocations.
8679 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
8680 position-independent executables.
8681 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
8682 * testsuite/Makefile.in: Regenerate.
8683
fca41f0f
NC
86842010-09-10 Nick Clifton <nickc@redhat.com>
8685
8686 PR gold/11997
8687 * testsuite/memory_test.t: Discard any sections that are not
8688 needed.
8689
6695e4b3
L
86902010-09-09 H.J. Lu <hongjiu.lu@intel.com>
8691
8692 PR gold/11996
8693 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
8694 "This::" to work around a bug in gcc 4.2.
8695
8696 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
8697
0f72bf6f
RÁE
86982010-09-09 Rafael Espindola <espindola@google.com>
8699
8700 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
8701 sections with different PF_X flags in the same segment.
8702 (Layout::find_first_load_seg): Search all segments to find the first
8703 one.
8704 * options.h (rosegment): New.
8705
87062010-09-08 Rafael Espindola <espindola@google.com>
a6577478 8707
05a79166 8708 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 8709
aa98ff75
DK
87102010-09-08 Doug Kwan <dougkwan@google.com>
8711
8712 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
8713 (Arm_relobj::do_relocate_sections): Add new parameter for output
8714 file to match the parent.
8715 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
8716 of local symbols instead of input values. Update code to track
8717 changes in gold::relocate_section.
8718 * object.cc (Sized_relobj::compute_final_local_value): New methods.
8719 (Sized_relobj::compute_final_local_value_internal): New methods.
8720 (Sized_relobj::do_finalize_local_symbols): Move code from loop
8721 body into private version of Sized_relobj::compute_final_local_value.
8722 Call the inline method.
8723 * object.h (Symbol_value::Symbol_value): Define destructor. Free
8724 merged symbol value if there is one.
8725 (Symbol_value::has_output_value): New method defintiion.
8726 (Sized_relobj::Compute_final_local_value_status): New enum type.
8727 (Sized_relobj::compute_final_local_value): New methods.
8728 (Sized_relobj::compute_final_local_value_internal): New methods.
8729 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
8730 and arm_cortex_a8.sh.
8731 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
8732 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
8733 New tests.
8734 * Makefile.in: Regenerate.
8735 * testsuite/arm_bl_out_of_range.s: Update test.
8736 * testsuite/thumb_bl_out_of_range.s: Ditto.
8737 * testsuite/thumb_blx_out_of_range.s: Ditto.
8738 * testsuite/arm_branch_out_of_range.sh: New file.
8739 * testsuite/arm_cortex_a8.sh: Ditto.
8740 * testsuite/arm_cortex_a8_b.s: Ditto.
8741 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
8742 * testsuite/arm_cortex_a8_b_local.s: Ditto.
8743 * testsuite/arm_cortex_a8_bl.s: Ditto.
8744 * testsuite/arm_cortex_a8_blx.s: Ditto.
8745 * testsuite/arm_cortex_a8_local.s: Ditto.
8746 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
8747 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
8748
05a79166
L
87492010-09-08 Rafael Espindola <espindola@google.com>
8750
8751 * Makefile.am (memory_test.stdout): Run readelf with -W.
8752 * Makefile.in: Regenerate.
8753 * testsuite/memory_test.sh: Make the regexps accept both 32 and
8754 64 bit output.
8755
33dbc701
RÁE
87562010-09-08 Rafael Espindola <espindola@google.com>
8757
8758 * script-sections.cc (Script_sections::add_memory_region): Convert
8759 field precision to int.
8760 * script.cc (script_set_section_region, script_set_section_region):
8761 Convert field precision to int.
8762
731ca54a
RÁE
87632010-09-08 Rafael Espindola <espindola@google.com>
8764
8765 * arm.cc (do_finalize_sections): Create the __exidx_start and
8766 __exdix_end symbols even when the section is missing.
8767
7f8cd844
NC
87682010-09-08 Nick Clifton <nickc@redhat.com>
8769
8770 * README: Remove claim that MEMORY is not supported.
8771 * expression.cc (script_exp_function_origin)
8772 (script_exp_function_length): Move from here to ...
8773 * script.cc: ... here.
8774 (script_set_section_region, script_add_memory)
8775 (script_parse_memory_attr, script_include_directive): New
8776 functions.
8777 * script-sections.cc
8778 (class Memory_region): New class.
8779 (class Output_section_definition): Add set_memory_region,
8780 set_section_vma, set_section_lma and get_section_name methods.
8781 (class Script_Sections): Add add_memory_region,
8782 find_memory_region, find_memory_region_origin,
8783 find_memory_region_length and set_memory_region methods.
8784 Have set_section_addresses method walk the list of set memory
8785 regions.
8786 Extend the print methos to display memory regions.
8787 * script-sections.h: Add prototypes for new methods.
8788 Add enum for MEMORY region attributes.
8789 * yyscript.y: Add support for parsing MEMORY regions.
8790 * script-c.h: Add prototypes for new functions.
8791 * testsuite/Makefile.am: Add test of MEMORY region functionality.
8792 * testsuite/Makefile.in: Regenerate.
8793 * testsuite/memory_test.sh: New script.
8794 * testsuite/memory_test.s: New assembler source file.
8795 * testsuite/memory_test.t: New linker script.
8796
a4649286
DK
87972010-08-27 Doug Kwan <dougkwan@google.com>
8798
8799 * gold/resolve.cc (Symbol_table::should_override): Let a weak
8800 reference override an existing dynamic weak reference.
8801 * testsuite/Makefile.am: Add new test dyn_weak_ref.
8802 * testsuite/Makefile.in: Regenerate.
8803 * testsuite/dyn_weak_ref.sh: New file.
8804 * testsuite/dyn_weak_ref_1.c: Ditto.
8805 * testsuite/dyn_weak_ref_2.c: Ditto.
8806
b56648ad
ILT
88072010-08-27 Ian Lance Taylor <iant@google.com>
8808
8809 * incremental.h (class Incremental_input_entry): Add virtual
8810 destructor.
8811
809313cb
ILT
88122010-08-27 Ian Lance Taylor <iant@google.com>
8813
8814 * testsuite/start_lib_test_3.c: Mark t3 as used.
8815
11e32464
NC
88162010-08-27 Nick Clifton <nickc@redhat.com>
8817
8818 * options.cc (version_script): Fix small typo in previous
8819 whitespace tidyup.
8820
ca09d69a
NC
88212010-08-25 Nick Clifton <nickc@redhat.com>
8822
8823 * archive.cc: Formatting fixes: Remove whitespace between
8824 typename and following asterisk. Remove whitespace between
8825 function name and opening parenthesis.
8826 * archive.h: Likewise.
8827 * arm.cc: Likewise.
8828 * attributes.cc: Likewise.
8829 * attributes.h: Likewise.
8830 * common.cc: Likewise.
8831 * copy-relocs.cc: Likewise.
8832 * dirsearch.h: Likewise.
8833 * dynobj.cc: Likewise.
8834 * ehframe.cc: Likewise.
8835 * ehframe.h: Likewise.
8836 * expression.cc: Likewise.
8837 * fileread.cc: Likewise.
8838 * fileread.h: Likewise.
8839 * gc.h: Likewise.
8840 * gold-threads.cc: Likewise.
8841 * gold.cc: Likewise.
8842 * i386.cc: Likewise.
8843 * icf.h: Likewise.
8844 * incremental-dump.cc: Likewise.
8845 * incremental.cc: Likewise.
8846 * layout.cc: Likewise.
8847 * layout.h: Likewise.
8848 * main.cc: Likewise.
8849 * merge.cc: Likewise.
8850 * merge.h: Likewise.
8851 * object.cc: Likewise.
8852 * object.h: Likewise.
8853 * options.cc: Likewise.
8854 * options.h: Likewise.
8855 * output.cc: Likewise.
8856 * output.h: Likewise.
8857 * plugin.cc: Likewise.
8858 * plugin.h: Likewise.
8859 * powerpc.cc: Likewise.
8860 * reloc.cc: Likewise.
8861 * script-c.h: Likewise.
8862 * script-sections.cc: Likewise.
8863 * script.cc: Likewise.
8864 * stringpool.cc: Likewise.
8865 * symtab.cc: Likewise.
8866 * symtab.h: Likewise.
8867 * target.cc: Likewise.
8868 * timer.cc: Likewise.
8869 * timer.h: Likewise.
8870 * version.cc: Likewise.
8871 * x86_64.cc: Likewise.
8872
b8fa8750
NC
88732010-08-24 Nick Clifton <nickc@redhat.com>
8874
8875 PR 11899
8876 * layout.cc (segment_precedes): Sort segments by their physical
8877 addresses, if they have been set.
8878
9919d93b
CC
88792010-08-23 Cary Coutant <ccoutant@google.com>
8880
8881 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
8882 symbols data.
8883 (Lib_group::include_member): Unlock object after deleting its
8884 symbols data.
8885 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
8886 the bug fixed here.
8887
97b4be1c
CC
88882010-08-19 Neil Vachharajani <nvachhar@google.com>
8889 Cary Coutant <ccoutant@google.com>
8890
8891 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
8892 constructor, and set_blocker.
8893 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
8894 readsyms_blocker_.
8895 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
8896 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
8897 * testsuite/Makefile.am (start_lib_test): New test case.
8898 * testsuite/Makefile.in: Regenerate.
8899 * testsuite/start_lib_test_main.c: New file.
8900 * testsuite/start_lib_test_1.c: New file.
8901 * testsuite/start_lib_test_2.c: New file.
8902 * testsuite/start_lib_test_3.c: New file.
8903
dd0b1884
ILT
89042010-08-19 Ian Lance Taylor <iant@google.com>
8905
8906 * Makefile.in: Rebuild with automake 1.11.1.
8907 * aclocal.m4: Likewise.
8908 * testsuite/Makefile.in: Likewise.
8909
7223e9ca
ILT
89102010-08-19 Ian Lance Taylor <iant@google.com>
8911
8912 PR 10893
8913 * i386.cc (class Output_data_plt_i386): Update declarations.
8914 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
8915 local_ifuncs_ fields.
8916 (Target_i386::do_plt_section_for_global): New function.
8917 (Target_i386::do_plt_section_for_local): New function.
8918 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
8919 parameter; change all callers. Initialize global_ifuncs_ and
8920 local_ifuncs_. If doing a static link define __rel_iplt_start and
8921 __rel_iplt_end.
8922 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
8923 (Output_data_plt_i386::add_local_ifunc_entry): New function.
8924 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
8925 symbols.
8926 (Target_i386::make_plt_section): New function, broken out of
8927 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
8928 (Target_i386::make_plt_entry): Call make_plt_section.
8929 (Target_i386::make_local_ifunc_plt_entry): New function.
8930 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
8931 (Target_i386::Scan::local): Handle IFUNC symbols. Add
8932 R_386_IRELATIVE to switch.
8933 (Target_i386::Scan::global): Likewise.
8934 (Target_i386::Relocate::relocate): Likewise.
8935 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
8936 switch.
8937 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
8938 (Target_x86_64::do_plt_section_for_global): New function.
8939 (Target_x86_64::do_plt_section_for_local): New function.
8940 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
8941 parameter; change all callers. If doing a static link define
8942 __rela_iplt_start and __rela_iplt_end.
8943 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
8944 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
8945 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
8946 to point to .plt.
8947 (Target_x86_64::make_local_ifunc_plt_entry): New function.
8948 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
8949 switch.
8950 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
8951 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
8952 R_X86_64_IRELATIVE to switch.
8953 (Target_x86_64::Scan::global): Likewise.
8954 (Target_x86_64::Relocate::relocate): Likewise.
8955 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
8956 switch.
8957 * target.h (class Target): Add plt_section_for_global and
8958 plt_section_for_local functions. Add do_plt_section_for_global
8959 and do_plt_section_for_local virtual functions.
8960 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
8961 clarifying comments.
8962 (Symbol::use_plt_offset): Handle IFUNC symbol.
8963 * object.cc (Sized_relobj::Sized_relobj): Initialize
8964 local_plt_offsets_.
8965 (Sized_relobj::local_has_plt_offset): New function.
8966 (Sized_relobj::local_plt_offset): New function.
8967 (Sized_relobj::set_local_plt_offset): New function.
8968 (Sized_relobj::do_count): Handle IFUNC symbol.
8969 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
8970 a bit away from input_shndx_ field. Add set_is_func_symbol and
8971 is_ifunc_symbol functions.
8972 (class Sized_relobj): Update declarations. Remove Tls_got_entry
8973 and Local_tls_got_offsets. Define Local_plt_offsets. Add
8974 local_plt_offsets_ field.
8975 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
8976 * output.h (class Output_section_data): Add non-const
8977 output_section function.
8978 (class Output_data_got): Update declarations.
8979 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
8980 Add use_plt_offset parameter to global and local constructors.
8981 Change all callers. Change local_sym_index_ field to 31 bits.
8982 Change GSYM_CODE and CONSTANT_CODE accordingly.
8983 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
8984 doing a static link don't set sh_link field.
8985 (Output_data_got::Got_entry::write): Use PLT offset if
8986 appropriate.
8987 (Output_data_got::add_global_plt): New function.
8988 (Output_data_got::add_local_plt): New function.
8989 * target-reloc.h (relocate_section): Handle IFUNC symbol.
8990 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
8991 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
8992 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
8993 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
8994 IFUNC conditional.
8995 * testsuite/ifunc-sel.h: New file.
8996 * testsuite/ifuncmain1.c: New file.
8997 * testsuite/ifuncmain1vis.c: New file.
8998 * testsuite/ifuncmod1.c: New file.
8999 * testsuite/ifuncdep2.c: New file.
9000 * testsuite/ifuncmain2.c: New file.
9001 * testsuite/ifuncmain3.c: New file.
9002 * testsuite/ifuncmod3.c: New file.
9003 * testsuite/ifuncmain4.c: New file.
9004 * testsuite/ifuncmain5.c: New file.
9005 * testsuite/ifuncmod5.c: New file.
9006 * testsuite/ifuncmain6pie.c: New file.
9007 * testsuite/ifuncmod6.c: New file.
9008 * testsuite/ifuncmain7.c: New file.
9009 * configure, testsuite/Makefile.in: Rebuild.
9010
56f75c03
ILT
90112010-08-18 Ian Lance Taylor <iant@google.com>
9012
9013 * incremental.cc
9014 (Output_section_incremental_inputs::write_input_files): Add cast
9015 to avoid signed/unsigned comparison warning.
9016 (Output_section_incremental_inputs::write_info_blocks): Likewise.
9017
55455f89
CC
90182010-08-12 Cary Coutant <ccoutant@google.com>
9019
9020 * common.cc (Sort_commons::operator()): Remove unnecessary code.
9021
e2054bcb
ILT
90222010-08-13 Ian Lance Taylor <iant@google.com>
9023
9024 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
9025
74f67560
DK
90262010-08-12 Cary Coutant <ccoutant@google.com>
9027 Doug Kwan <dougkwan@google.com>
9028
9029 * resolve.cc (Symbol_table::should_override): When a weak dynamic
9030 defintion overrides non-weak undef, remember that the original undef
9031 is not weak.
9032 * symtab.cc (Symbol_table::sized_write_global): For undef without
9033 an original weak binding, set binding to global in output.
9034 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
9035 * testsuite/Makefile.in: Regenerate.
9036 * testsuite/strong_ref_weak_def.sh: New file.
9037 * testsuite/strong_ref_weak_def_1.c: Ditto.
9038 * testsuite/strong_ref_weak_def_2.c: Ditto.
9039
d1238d12
CC
90402010-08-12 Cary Coutant <ccoutant@google.com>
9041
9042 * testsuite/incremental_test.sh: Rewrite.
9043 * testsuite/incremental_test_1.c: Rewrite.
9044 * testsuite/incremental_test_2.c: Rewrite.
9045
0e70b911
CC
90462010-08-12 Cary Coutant <ccoutant@google.com>
9047
9048 * arm.cc (Target_arm::got_size): Add const.
9049 (Target_arm::got_entry_count): New function.
9050 (Target_arm::plt_entry_count): New function.
9051 (Target_arm::first_plt_entry_offset): New function.
9052 (Target_arm::plt_entry_size): New function.
9053 (Output_data_plt_arm::entry_count): New function.
9054 (Output_data_plt_arm::first_plt_entry_offset): New function.
9055 (Output_data_plt_arm::get_plt_entry_size): New function.
9056 * i386.cc (Target_i386::got_size): Add const.
9057 (Target_i386::got_entry_count): New function.
9058 (Target_i386::plt_entry_count): New function.
9059 (Target_i386::first_plt_entry_offset): New function.
9060 (Target_i386::plt_entry_size): New function.
9061 (Output_data_plt_i386::entry_count): New function.
9062 (Output_data_plt_i386::first_plt_entry_offset): New function.
9063 (Output_data_plt_i386::get_plt_entry_size): New function.
9064 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
9065 find_incremental_inputs_sections. Dump incremental_got_plt section.
9066 * incremental.cc: Include target.h.
9067 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
9068 parameter. Adjust all callers. Find incremental_got_plt section.
9069 (Incremental_inputs::create_data_sections): Create incremental_got_plt
9070 section.
9071 (Output_section_incremental_inputs::set_final_data_size): Calculate
9072 size of incremental_got_plt section.
9073 (Output_section_incremental_inputs::do_write): Write the
9074 incremental_got_plt section.
9075 (Got_plt_view_info): New struct.
9076 (Local_got_offset_visitor): New class.
9077 (Global_got_offset_visitor): New class.
9078 (Global_symbol_visitor_got_plt): New class.
9079 (Output_section_incremental_inputs::write_got_plt): New function.
9080 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
9081 Add parameter. Adjust all callers.
9082 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9083 (Incremental_inputs::got_plt_section): New function.
9084 (Incremental_inputs::got_plt_section_): New data member.
9085 (Incremental_got_plt_reader): New class.
9086 * layout.cc (Layout::create_incremental_info_sections): Add the
9087 incremental_got_plt section.
9088 * object.h (Got_offset_list::get_list): New function.
9089 (Got offset_list::for_all_got_offsets): New function.
9090 (Sized_relobj::local_got_offset_list): New function.
9091 * powerpc.cc (Target_powerpc::got_size): Add const.
9092 (Target_powerpc::got_entry_count): New function.
9093 (Target_powerpc::plt_entry_count): New function.
9094 (Target_powerpc::first_plt_entry_offset): New function.
9095 (Target_powerpc::plt_entry_size): New function.
9096 (Output_data_plt_powerpc::entry_count): New function.
9097 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
9098 (Output_data_plt_powerpc::get_plt_entry_size): New function.
9099 * sparc.cc (Target_sparc::got_size): Add const.
9100 (Target_sparc::got_entry_count): New function.
9101 (Target_sparc::plt_entry_count): New function.
9102 (Target_sparc::first_plt_entry_offset): New function.
9103 (Target_sparc::plt_entry_size): New function.
9104 (Output_data_plt_sparc::entry_count): New function.
9105 (Output_data_plt_sparc::first_plt_entry_offset): New function.
9106 (Output_data_plt_sparc::get_plt_entry_size): New function.
9107 * symtab.h (Symbol::got_offset_list): New function.
9108 (Symbol_table::for_all_symbols): New function.
9109 * target.h (Sized_target::got_entry_count): New function.
9110 (Sized_target::plt_entry_count): New function.
9111 (Sized_target::plt_entry_size): New function.
9112 * x86_64.cc (Target_x86_64::got_size): Add const.
9113 (Target_x86_64::got_entry_count): New function.
9114 (Target_x86_64::plt_entry_count): New function.
9115 (Target_x86_64::first_plt_entry_offset): New function.
9116 (Target_x86_64::plt_entry_size): New function.
9117 (Output_data_plt_x86_64::entry_count): New function.
9118 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
9119 (Output_data_plt_x86_64::get_plt_entry_size): New function.
9120
09ec0418
CC
91212010-08-12 Cary Coutant <ccoutant@google.com>
9122
9123 * archive.cc: Include incremental.h.
9124 (Archive::Archive): Initialize incremental_info_.
9125 (Archive::include_member): Record archive members in incremental info.
9126 (Add_archive_symbols::run): Record begin and end of an archive in
9127 incremental info.
9128 (Lib_group::include_member): Record objects in incremental info.
9129 * archive.h (Incremental_archive_entry): Forward declaration.
9130 (Archive::set_incremental_info): New member function.
9131 (Archive::incremental_info): New member function.
9132 (Archive::Unused_symbol_iterator): New class.
9133 (Archive::unused_symbols_begin): New member function.
9134 (Archive::unused_symbols_end): New member function.
9135 (Archive::incremental_info_): New data member.
9136 * incremental-dump.cc (find_input_containing_global): New function.
9137 (dump_incremental_inputs): Dump new incremental info sections.
9138 * incremental.cc: Include symtab.h.
9139 (Output_section_incremental_inputs): New class.
9140 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
9141 new incremental info sections.
9142 (Sized_incremental_binary::do_check_inputs): Likewise.
9143 (Incremental_inputs::report_archive): Remove.
9144 (Incremental_inputs::report_archive_begin): New function.
9145 (Incremental_inputs::report_archive_end): New function.
9146 (Incremental_inputs::report_object): New function.
9147 (Incremental_inputs::finalize_inputs): Remove.
9148 (Incremental_inputs::report_input_section): New function.
9149 (Incremental_inputs::report_script): Rewrite.
9150 (Incremental_inputs::finalize): Do nothing but finalize string table.
9151 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9152 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9153 (Incremental_inputs::create_data_sections): New function.
9154 (Incremental_inputs::relocs_entsize): New function.
9155 (Output_section_incremental_inputs::set_final_data_size): New function.
9156 (Output_section_incremental_inputs::do_write): New function.
9157 (Output_section_incremental_inputs::write_header): New function.
9158 (Output_section_incremental_inputs::write_input_files): New function.
9159 (Output_section_incremental_inputs::write_info_blocks): New function.
9160 (Output_section_incremental_inputs::write_symtab): New function.
9161 * incremental.h (Incremental_script_entry): Forward declaration.
9162 (Incremental_object_entry): Forward declaration.
9163 (Incremental_archive_entry): Forward declaration.
9164 (Incremental_inputs): Forward declaration.
9165 (Incremental_inputs_header_data): Remove.
9166 (Incremental_inputs_header): Remove.
9167 (Incremental_inputs_header_write): Remove.
9168 (Incremental_inputs_entry_data): Remove.
9169 (Incremental_inputs_entry): Remove.
9170 (Incremental_inputs_entry_write): Remove.
9171 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
9172 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
9173 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
9174 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
9175 Likewise.
9176 (Incremental_input_entry): New class.
9177 (Incremental_script_entry): New class.
9178 (Incremental_object_entry): New class.
9179 (Incremental_archive_entry): New class.
9180 (Incremental_inputs::Incremental_inputs): Initialize new data members.
9181 (Incremental_inputs::report_inputs): Remove.
9182 (Incremental_inputs::report_archive): Remove.
9183 (Incremental_inputs::report_archive_begin): New function.
9184 (Incremental_inputs::report_archive_end): New function.
9185 (Incremental_inputs::report_object): Change prototype.
9186 (Incremental_inputs::report_input_section): New function.
9187 (Incremental_inputs::report_script): Change prototype.
9188 (Incremental_inputs::get_reloc_count): New function.
9189 (Incremental_inputs::set_reloc_count): New function.
9190 (Incremental_inputs::create_data_sections): New function.
9191 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
9192 (Incremental_inputs::inputs_section): New function.
9193 (Incremental_inputs::symtab_section): New function.
9194 (Incremental_inputs::relocs_section): New function.
9195 (Incremental_inputs::get_stringpool): Add const.
9196 (Incremental_inputs::command_line): Add const.
9197 (Incremental_inputs::inputs): Remove.
9198 (Incremental_inputs::command_line_key): New function.
9199 (Incremental_inputs::input_file_count): New function.
9200 (Incremental_inputs::input_files): New function.
9201 (Incremental_inputs::relocs_entsize): New function.
9202 (Incremental_inputs::sized_create_inputs_section_data): Remove.
9203 (Incremental_inputs::finalize_inputs): Remove.
9204 (Incremental_inputs::Input_info): Remove.
9205 (Incremental_inputs::lock_): Remove.
9206 (Incremental_inputs::inputs_): Change type.
9207 (Incremental_inputs::inputs_map_): Remove.
9208 (Incremental_inputs::current_object_entry_): New data member.
9209 (Incremental_inputs::inputs_section_): New data member.
9210 (Incremental_inputs::symtab_section_): New data member.
9211 (Incremental_inputs::relocs_section_): New data member.
9212 (Incremental_inputs::reloc_count_): New data member.
9213 (Incremental_inputs_reader): New class.
9214 (Incremental_symtab_reader): New class.
9215 (Incremental_relocs_reader): New class.
9216 * layout.cc (Layout::finalize): Move finalization of incremental info
9217 and creation of incremental info sections to follow finalization of
9218 symbol table. Set offsets for postprocessing sections.
9219 (Layout::create_incremental_info_sections): Call
9220 Incremental_inputs::create_data_sections. Add incremental symtab
9221 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
9222 sections to layout after input sections.
9223 * layout.h (struct Timespec): Forward declaration.
9224 (Layout::incremental_inputs): Add const.
9225 (Layout::create_incremental_info_sections): Add parameter.
9226 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
9227 * object.cc: Include incremental.h.
9228 (Relobj::finalize_incremental_relocs): New function.
9229 (Sized_relobj::do_layout): Record input sections in incremental info.
9230 * object.h (Object::output_section): New function.
9231 (Object::output_section_offset): Moved from Relobj.
9232 (Object::get_incremental_reloc_base): New function.
9233 (Object::get_incremental_reloc_count): New function.
9234 (Object::do_output_section): New function.
9235 (Object::do_output_section_offset): Moved from Relobj.
9236 (Object::do_get_incremental_reloc_base): New function.
9237 (Object::do_get_incremental_reloc_count): New function.
9238 (Object::Object): Initialize new data members.
9239 (Relobj::output_section): Renamed do_output_section and moved to
9240 protected.
9241 (Relobj::output_section_offset): Moved to Object.
9242 (Relobj::do_get_incremental_reloc_base): New function.
9243 (Relobj::do_get_incremental_reloc_count): New function.
9244 (Relobj::allocate_incremental_reloc_counts): New function.
9245 (Relobj::count_incremental_reloc): New function.
9246 (Relobj::finalize_incremental_relocs): New function.
9247 (Relobj::next_incremental_reloc_index): New function.
9248 (Relobj::reloc_counts_): New data member.
9249 (Relobj::reloc_bases_): New data member.
9250 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
9251 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
9252 (Sized_relobj::incremental_relocs_scan): New function.
9253 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9254 (Sized_relobj::incremental_relocs_write): New function.
9255 (Sized_relobj::incremental_relocs_write_reltype): New function.
9256 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
9257 incremental link.
9258 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
9259 archives and object files elsewhere.
9260 (Add_symbols::run): Report object files here.
9261 (Finish_group::run): Report end of archive at end of group.
9262 * reloc.cc: Include layout.h, incremental.h.
9263 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
9264 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
9265 (Sized_relobj::incremental_relocs_scan): New function.
9266 (Sized_relobj::incremental_relocs_scan_reltype): New function.
9267 (Sized_relobj::do_relocate_sections): Write incremental relocations.
9268 (Sized_relobj::incremental_relocs_write): New function.
9269 (Sized_relobj::incremental_relocs_write_reltype): New function.
9270 * script.cc (read_input_script): Rewrite test for incremental link.
9271 Change call to Incremental_inputs::report_script.
9272 * symtab.h (Symbol_table::first_global_index): New function.
9273 (Symbol_table::output_count): New function.
9274
ce0d1972
DK
92752010-08-12 Doug Kwan <dougkwan@google.com>
9276
9277 * arm.cc (Target_arm::merge_object_attributes): Check command line
9278 options --no-wchar-size-warning and --no-enum-size-warning.
9279 * options.h (General_options): Add ld-compatible options
9280 --no-enum-size-warning and --no-wchar-size-warning.
9281
6e5710ce
ILT
92822010-08-04 Ian Lance Taylor <iant@google.com>
9283
9284 * x86_64.cc (Target_x86_64::Scan::local): Use
9285 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
9286 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
9287 (Target_x86_64::Scan::global): Likewise.
9288 (Target_x86_64::Relocate::relocate): Likewise.
9289 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
9290 Likewise.
9291
fef830db
CC
92922010-08-03 Cary Coutant <ccoutant@google.com>
9293
9294 * merge.cc (Output_merge_string::do_add_input_section): Count strings
9295 to reserve space in merged_strings vector. Keep total input size
9296 for stats.
9297 (Output_merge_string::do_print_merge_stats): Print total input size.
9298 * merge.h (Output_merge_string): Add input_size_ field.
9299 * stringpool.cc (Stringpool_template::string_length): Move
9300 implementations out of Stringpool_template class and place in
9301 stringpool.h.
9302 * stringpool.h (string_length): Move out of Stringpool_template.
9303
1e3811b0
ILT
93042010-08-03 Ian Lance Taylor <iant@google.com>
9305
9306 PR 11712
9307 * layout.cc (relaxation_loop_body): If address of load segment is
9308 set, adjust address to include headers if possible.
9309
7af0c620
ILT
93102010-08-03 Ian Lance Taylor <iant@google.com>
9311
9312 * version.cc (version_string): Bump to 1.10.
9313
22f0da72
ILT
93142010-08-03 Ian Lance Taylor <iant@google.com>
9315
9316 PR 11805
9317 * layout.h (enum Output_section_order): Define.
9318 (class Layout): Update declarations.
9319 * layout.cc (Layout::get_output_section): Add order parameter.
9320 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
9321 is_first_non_relro parameters. Change all callers.
9322 (Layout::choose_output_section): Likewise.
9323 (Layout::add_output_section_data): Likewise.
9324 (Layout::make_output_section): Likewise. Set order.
9325 (Layout::default_section_order): New function.
9326 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
9327 * output.cc (Output_section::Output_section): Initialize order_.
9328 Don't initialize deleted fields.
9329 (Output_segment::Output_segment): Don't initialize deleted
9330 fields.
9331 (Output_segment::add_output_section_to_load): New function
9332 replacing add_output_section. Change all callers to call this or
9333 add_output_section_to_nonload.
9334 (Output_segment::add_output_section_to_nonload): New function.
9335 (Output_segment::remove_output_section): Rewrite.
9336 (Output_segment::add_initial_output_data): Likewise.
9337 (Output_segment::has_any_data_sections): Likewise.
9338 (Output_segment::is_first_section_relro): Likewise.
9339 (Output_segment::maximum_alignment): Likewise.
9340 (Output_segment::has_dynamic_reloc): New function replacing
9341 dynamic_reloc_count. Change all callers.
9342 (Output_segment::has_dynamic_reloc_list): New function replacing
9343 dynamic_reloc_count_list. Change all callers.
9344 (Output_segment::set_section_addresses): Rewrite.
9345 (Output_segment::set_offset): Rewrite.
9346 (Output_segment::find_first_and_last_list): Remove.
9347 (Output_segment::set_tls_offsets): Rewrite.
9348 (Output_segment::first_section_load_address): Likewise.
9349 (Output_segment::output_section_count): Likewise.
9350 (Output_segment::section_with_lowest_load_address): Likewise.
9351 (Output_segment::write_section_headers): Likewise.
9352 (Output_segment::print_sections_to_map): Likewise.
9353 * output.h (class Output_data): Remove dynamic_reloc_count_
9354 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
9355 (Output_data::add_dynamic_reloc): Rewrite.
9356 (Output_data::has_dynamic_reloc): New function.
9357 (Output_data::dynamic_reloc_count): Remove.
9358 (class Output_section): Add order_ field. Remvoe is_relro_local_,
9359 is_last_relro_, is_first_non_relro_, is_interp_,
9360 is_dynamic_linker_section_ fields. Add order and set_order
9361 functions. Remove is_relro_local, set_is_relro_local,
9362 is_last_relro, set_is_last_relro, is_first_non_relro,
9363 set_is_first_non_relro functions, is_interp, set_is_interp,
9364 is_dynamic_linker_section, and set_is_dynamic_linker_section
9365 functions.
9366 (class Output_segment): Change Output_data_list from std::list to
9367 std:;vector. Add output_lists_ field. Remove output_data_ and
9368 output_bss_ fields. Update declarations.
9369
3ff2ccb0
ILT
93702010-08-02 Ian Lance Taylor <iant@google.com>
9371
9372 * arm.cc (Target_arm::gc_process_relocs): Use typename.
9373 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
9374 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
9375
88a4108b
ILT
93762010-08-02 Ian Lance Taylor <iant@google.com>
9377
9378 PR 11855
9379 * script.cc (Script_options::Script_options): Initialize
9380 symbol_definitions_ and symbol_references_.
9381 (Script_options::add_symbol_assignment): Update
9382 symbol_definitions_ and symbol_references_.
9383 (Script_options::add_symbol_reference): New function.
9384 (script_symbol): New function.
9385 * script.h (class Script_options): Add symbol_definitions_ and
9386 symbol_references_ fields.
9387 (Script_options::referenced_const_iterator): New type.
9388 (Script_options::referenced_begin): New function.
9389 (Script_options::referenced_end): New function.
9390 (Script_options::is_referenced): New function.
9391 (Script_options::any_unreferenced): New function.
9392 * script-c.h (script_symbol): Declare.
9393 * yyscript.y (exp): Call script_symbol.
9394 * symtab.cc: Include "script.h".
9395 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
9396 Change all callers. Check symbols referenced by scripts.
9397 (Symbol_table::add_undefined_symbols_from_command_line): Add
9398 layout parameter. Change all callers.
9399 (Symbol_table::do_add_undefined_symbols_from_command_line):
9400 Likewise. Break out loop body. Check symbols referenced by
9401 scripts.
9402 (Symbol_table::add_undefined_symbol_from_command_line): New
9403 function broken out of
9404 do_add_undefined_symbols_from_command_line.
9405 * symtab.h (class Symbol_table): Update declarations.
9406 * archive.cc: Include "layout.h".
9407 (Archive::should_include_member): Add layout parameter. Change
9408 all callers. Check for symbol mentioned in expression.
9409 * archive.h (class Archive): Update declaration.
9410 * object.cc (Sized_relobj::do_should_include_member): Add layout
9411 parameter.
9412 * object.h (Object::should_include_member): Add layout parameter.
9413 Change all callers.
9414 (Object::do_should_include_member): Add layout parameter.
9415 (class Sized_relobj): Update declaration.
9416 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
9417 parameter.
9418 * dynobj.h (class Sized_dynobj): Update declaration.
9419 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
9420 layout parameter.
9421 * plugin.h (class Sized_pluginobj): Update declaration.
9422
5f1ab67a
ILT
94232010-08-02 Ian Lance Taylor <iant@google.com>
9424
9425 PR 11866
9426 * output.cc (Output_segment::set_offset): Search for the first and
9427 last sections rather than assuming that the list is in order.
9428 (Output_segment::find_first_and_last_list): New function.
9429 * output.h (class Output_segment): Update declarations.
9430 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
9431 (relro_strip_test_SOURCES): New variable.
9432 (relro_strip_test_DEPENDENCIES): New variable.
9433 (relro_strip_test_LDFLAGS): New variable.
9434 (relro_strip_test_LDADD): New variable.
9435 (relro_strip_test.so): New target.
9436
a8df5856
ILT
94372010-08-02 Ian Lance Taylor <iant@google.com>
9438
9439 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
9440 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
9441 (Target_i386::got_tlsdesc_section): New function.
9442 (Target_i386::got_section): Create space for GOT entries for
9443 TLSDESC relocations.
9444 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
9445 R_386_TLS_GOTDESC.
9446 (Target_i386::Scan::global): Likewise.
9447 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
9448 using TLSDESC GOT.
9449 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
9450 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
9451 (Target_x86_64::got_tlsdesc_section): New function.
9452 (Target_x86_64::got_section): Create space for GOT entries for
9453 TLSDESC relocations.
9454 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
9455 R_386_TLS_GOTDESC.
9456 (Target_x86_64::Scan::global): Likewise.
9457 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
9458 using TLSDESC GOT.
9459
0c10a0a6
ILT
94602010-08-02 Ian Lance Taylor <iant@google.com>
9461
9462 * testsuite/final_layout.sh: Use dc to convert from hex to
9463 decimal.
9464
41cbeecc
ST
94652010-07-29 Sriraman Tallam <tmsriram@google.com>
9466
9467 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
9468 paramter to the call to gold::gc_process_relocs.
9469 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
9470 paramter to the call to gold::gc_process_relocs.
9471 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
9472 parameter to the call to gold::gc_process_relocs.
9473 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
9474 template parameter to the call to gold::gc_process_relocs.
9475 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
9476 paramter to the call to gold::gc_process_relocs.
9477 * gc.h (get_embedded_addend_size): New function.
9478 (gc_process_relocs): Save the size of the reloc for use by ICF.
9479 * icf.cc (get_section_contents): Get the addend from the text section
9480 for SHT_REL relocation sections.
9481 * icf.h (Icf::Reloc_addend_size_info): New typedef.
9482 (Icf::Reloc_info): Add new member reloc_addend_size_info.
9483 * int_encoding.h (read_from_pointer): New overloaded function.
9484 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
9485 * testsuite/icf_sht_rel_addend_test.sh: New file.
9486 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
9487 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
9488
6ea55b82
RW
94892010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9490
9491 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
9492 * Makefile.in: Regenerate.
9493 * testsuite/Makefile.in: Regenerate.
9494
9691462b
ILT
94952010-07-27 Jeffrey Yasskin <jyasskin@google.com>
9496
9497 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
9498 * gold/testsuite/debug_msg.cc: Likewise.
9499 * gold/testsuite/odr_violation1.cc
9500 * gold/testsuite/odr_violation2.cc
9501
76897331
CC
95022010-07-21 Cary Coutant <ccoutant@google.com>
9503
9504 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
9505 string, and length fields.
9506 (Output_merge_string::Merged_strings_list): New type.
9507 (Output_merge_string::Merged_strings_lists): New typedef.
9508 (Output_merge_string): Replace merged_strings_ with
9509 merged_strings_lists_.
9510 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
9511 Merged_strings_list per input object and section. Don't store pointer
9512 to the string. Don't store length with each merged string entry.
9513 (Output_merge_string::finalize_merged_data): Loop over list of merged
9514 strings lists. Recompute length of each merged string.
9515
78384e8f
CC
95162010-07-15 Cary Coutant <ccoutant@google.com>
9517
9518 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
9519 here.
9520
783659f9
ILT
95212010-07-14 Ian Lance Taylor <iant@google.com>
9522
9523 * descriptors.cc (Descriptors::open): Report correct name in error
9524 message.
9525
131687b4
DK
95262010-07-13 Doug Kwan <dougkwan@google.com>
9527
9528 * arm.cc (Arm_input_section::Arm_input_section): For a
9529 SHT_ARM_EXIDX section, always keeps the input sections.
9530 (Arm_input_section::set_exidx_section_link): New method.
9531 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
9532 has_errors_ to false.
9533 (Arm_exidx_input_section::has_errors,
9534 Arm_exidx_input_section::set_has_errors): New methods.
9535 (Arm_exidx_input_section::has_errors_): New data member.
9536 (Arm_relobj::get_exidx_shndx_list): New method.
9537 (Arm_output_section::append_text_sections_to_list): Do not skip
9538 section without SHF_EXECINSTR.
9539 (Arm_output_section::fix_exidx_coverage): Skip input sections with
9540 errors.
2e702c99 9541 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
9542 section header. Make error messages more verbose. Check for
9543 a non-executable section linked to an EXIDX section.
9544 (Arm_relobj::do_read_symbols): Remove error checking, which has been
9545 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
9546 check that there is no deferred EXIDX section if we exit early.
9547 Instead of not making an EXIDX section in case of an error, make one
9548 and set the has_errors flag of it.
9549 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
9550 in a relocatable link.
9551 (Target_arm::do_relax): Look for the EXIDX output section instead of
9552 assuming that it is called .ARM.exidx.
2e702c99 9553 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
9554 section list. Do not check for SHF_EXECINSTR section flags but
9555 skip any input section with errors.
9556 * output.cc (Output_section::Output_section): Initialize
9557 always_keeps_input_sections_ to false.
9558 (Output_section::add_input_section): Check for
9559 always_keeps_input_sections_.
9560 * output.h (Output_section::always_keeps_input_sections,
9561 Output_section::set_always_keeps_input_sections): New methods.
9562 (Output_section::always_keeps_input_sections): New data member.
9563
69517287
RÁE
95642010-07-13 Rafael Espindola <espindola@google.com>
9565
9566 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
9567 * fileread.h (Input_file): Add try_extra_search_path and find_file.
9568
82742395
ILT
95692010-07-13 Philip Herron <herron.philip@googlemail.com>
9570 Ian Lance Taylor <iant@google.com>
9571
9572 * output.h (Output_section_lookup_maps::add_merge_section):
9573 Correct check of whether value was inserted.
9574 (Output_section_lookup_maps::add_merge_input_section): Likewise.
9575 (Output_section_lookup_maps::add_relaxed_input_section):
9576 Likewise.
9577 * arm.cc (Target_arm::got_section): Remove used local os.
9578 * i386.cc (Target_i386::got_section): Likewise.
9579 * x86_64.cc (Target_x86_64::got_section): Likewise.
9580 * sparc.cc (Target_sparc::got_section): Likewise.
9581 (Target_sparc::relocate): Remove unused local have_got_offset.
9582 * powerpc.cc (Target_powerpc::relocate): Likewise.
9583
f2d707b5
ILT
95842010-07-13 Ian Lance Taylor <iant@google.com>
9585
241531d6
ILT
9586 * compressed_output.cc (zlib_decompress): Fix signature in
9587 !HAVE_ZLIB_H case.
9588
f2d707b5
ILT
9589 * archive.cc (Archive::include_member): Unlock an external member
9590 of a thin archive. Don't bother to delete an object we know is
9591 NULL.
9592
a2e47362
CC
95932010-07-12 Cary Coutant <ccoutant@google.com>
9594
9595 * compressed_output.cc (zlib_decompress): New function.
9596 (get_uncompressed_size): New function.
9597 (decompress_input_section): New function.
9598 * compressed_output.h (get_uncompressed_size): New function.
9599 (decompress_input_section): New function.
9600 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
9601 Handle compressed debug sections.
9602 * layout.cc (is_compressed_debug_section): New function.
9603 (Layout::output_section_name): Map compressed section names to
9604 canonical names.
9605 * layout.h (is_compressed_debug_section): New function.
9606 (is_debug_info_section): Recognize compressed debug sections.
9607 * merge.cc: Include compressed_output.h.
9608 (Output_merge_data::do_add_input_section): Handle compressed
9609 debug sections.
9610 (Output_merge_string::do_add_input_section): Handle compressed
9611 debug sections.
9612 * object.cc: Include compressed_output.h.
9613 (Sized_relobj::Sized_relobj): Initialize new data members.
9614 (build_compressed_section_map): New function.
9615 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
9616 * object.h (Object::section_is_compressed): New method.
9617 (Object::do_section_is_compressed): New method.
9618 (Sized_relobj::Compressed_section_map): New type.
9619 (Sized_relobj::do_section_is_compressed): New method.
9620 (Sized_relobj::compressed_sections_): New data member.
9621 * output.cc (Output_section::add_input_section): Handle compressed
9622 debug sections.
9623 * reloc.cc: Include compressed_output.h.
9624 (Sized_relobj::write_sections): Handle compressed debug sections.
9625
ce279a62
CC
96262010-07-08 Cary Coutant <ccoutant@google.com>
9627
9628 * resolve.cc (Symbol_table::resolve): Remember whether undef was
9629 weak when resolving to a dynamic def.
9630 (Symbol_table::should_override): Add adjust_dyndef flag; set it
9631 for weak undef/dynamic def cases. Adjust callers.
9632 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
9633 undef_binding_weak_.
9634 (Symbol_table::sized_write_globals): Adjust symbol binding.
9635 (Symbol_table::sized_write_symbol): Add binding parameter.
9636 * symtab.h (Symbol::set_undef_binding): New method.
9637 (Symbol::is_undef_binding_weak): New method.
9638 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
9639 (Symbol_table::should_override): Add new parameter.
9640 (Symbol_table::sized_write_symbol): Add new parameter.
9641
9642 * testsuite/weak_undef_file1.cc: Add new test case.
9643 * testsuite/weak_undef_file2.cc: Fix header comment.
9644 * testsuite/weak_undef_test.cc: Add new test case.
9645
b2286c10
DK
96462010-06-29 Doug Kwan <dougkwan@google.com>
9647
9648 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
9649 Initialize USE_SYMBOL_.
9650 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
9651 definition.
9652 (Arm_reloc_property::uses_symbol_): New data member declaration.
9653 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
9654 uses symbol value and symbol is undefined but not weakly undefined.
9655
4802450a
RÁE
96562010-06-28 Rafael Espindola <espindola@google.com>
9657
9658 * plugin.cc (Plugin::load): Use dlerror.
9659
e5ca47ba
ILT
96602010-06-26 Jeffrey Yaskin <jyasskin@google.com>
9661
9662 * symtab.cc (detect_odr_violations): When reporting an ODR
9663 violation, report an object where the symbol is defined.
9664
8a75a161
DK
96652010-06-25 Doug Kwan <dougkwan@google.com>
9666
9667 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
9668 (Target_arm::section_may_have_icf_unsafe_pointers): New method
9669 definition.
9670 (Target_arm::Scan::local_reloc_may_be_function_pointer,
9671 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
9672 target hook to detect function points.
9673 (Target_arm::Scan::possible_function_pointer_reloc): New method.
9674 * icf.h (Icf::check_section_for_function_pointers): Change type of
9675 parameter SECTION_NAME to const reference to std::string. Use
9676 target hook to determine if section may have unsafe pointers.
9677 * target.h (Target::section_may_have_icf_unsafe_pointers): New
9678 method definition.
9679
42218b9f
RÁE
96802010-06-21 Rafael Espindola <espindola@google.com>
9681
9682 * fileread.cc (Input_file::find_fie): New
9683 (Input_file::open): Use Input_file::find_fie.
9684 * fileread.h (Input_file::find_fie): New
9685 * plugin.cc (set_extra_library_path): New.
9686 (Plugin::load): Add set_extra_library_path to the transfer vector.
9687 (Plugin_manager::set_extra_library_path): New.
9688 (Plugin_manager::add_input_file): Use the extra search path if set.
9689 (set_extra_library_path(): New.
9690 * plugin.h (Plugin_manager): Add set_extra_library_path and
9691 extra_search_path_.
9692
a0506cca
CC
96932010-06-19 Cary Coutant <ccoutant@google.com>
9694
9695 * layout.cc (gdb_sections): Add .debug_types.
9696 (lines_only_debug_sections): Likewise.
9697
6508b958
RÁE
96982010-06-18 Rafael Espindola <espindola@google.com>
9699
9700 * plugin.cc (add_input_file,add_input_library)
9701 (Plugin_manager::add_input_file): Make filename arguments const.
9702 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
9703 const.
9704
3e235302
DK
97052010-06-16 Doug Kwan <dougkwan@google.com>
9706
9707 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
9708 .ARM.attributes section if we have not merged any input
9709 attributes sections.
9710
106e8a6c
DK
97112010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9712
9713 * arm.cc: Allow combining objects with no EABI version
9714 information.
9715
91ff43fe
RÁE
97162010-06-15 Rafael Espindola <espindola@google.com>
9717
9718 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
9719
68ed838c
ILT
97202010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9721
9722 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
9723 (struct iovec): Correct !HAVE_READV definition.
9724
f3a2388f
CC
97252010-06-10 Cary Coutant <ccoutant@google.com>
9726
9727 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
9728 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
9729 reloc sections.
9730 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
9731
9732 PR 11683
9733 * symtab.h (Symbol::is_placeholder): New member function.
9734 * target-reloc.h (relocate_section): Check for placeholder symbols.
9735
9736 * testsuite/Makefile.am (plugin_test_8): New test.
9737 (plugin_test_9): New test.
9738 * testsuite/Makefile.in: Regenerate.
9739
e1df38aa
NC
97402010-06-09 Nick Clifton <nickc@redhat.com>
9741
9742 * yyscript.y (input_list_element): Allow strings prefixed with
9743 the '-' character. Treat these as libraries.
9744 * script.cc (script_add_library): New function. Adds a library
9745 specified by "-l<name>" found in an input script.
9746 * script-c.h: Add prototype for script_add_library.
9747
25bbe950
DK
97482010-06-07 Doug Kwan <dougkwan@google.com>
9749
9750 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
9751 Restrict stub-group size to be within long conditional branch
9752 range when working around cortex-A8 erratum.
9753
0f32ea4c
ILT
97542010-06-07 Damien Diederen <dd@crosstwine.com>
9755
9756 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
9757 #ifdef typo.
9758
8fe2a369
ST
97592010-06-03 Sriraman Tallam <tmsriram@google.com>
9760
9761 PR gold/11658
9762 * output.cc
9763 (Output_section::Input_section_sort_entry::compare_section_ordering):
9764 Change to return non-zero correctly.
9765 (Output_section::Input_section_sort_section_order_index_compare
9766 ::operator()): Change to fix ambiguity in comparisons.
9767
6e9ba2ca
ST
97682010-06-01 Sriraman Tallam <tmsriram@google.com>
9769
9770 * gold.h (is_wildcard_string): New function.
9771 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
9772 (Layout::layout_eh_frame): Ditto.
9773 (Layout::find_section_order_index): New method.
9774 (Layout::read_layout_from_file): New method.
9775 * layout.h (Layout::find_section_order_index): New method.
9776 (Layout::read_layout_from_file): New method.
9777 (Layout::input_section_position_): New private member.
9778 (Layout::input_section_glob_): New private member.
9779 * main.cc (main): Call read_layout_from_file here.
9780 * options.h (--section-ordering-file): New option.
9781 * output.cc (Output_section::input_section_order_specified_): New
9782 member.
9783 (Output_section::Output_section): Initialize new member.
9784 (Output_section::add_input_section): Add new parameter.
9785 Keep input sections when --section-ordering-file is used.
9786 (Output_section::set_final_data_size): Sort input sections when
9787 section ordering file is specified.
9788 (Output_section::Input_section_sort_entry): Add new parameter.
9789 Check sorting type.
9790 (Output_section::Input_section_sort_entry::compare_section_ordering):
9791 New method.
9792 (Output_section::Input_section_sort_compare::operator()): Change to
9793 consider section_order_index.
9794 (Output_section::Input_section_sort_init_fini_compare::operator()):
9795 Change to consider section_order_index.
9796 (Output_section::Input_section_sort_section_order_index_compare
9797 ::operator()): New method.
9798 (Output_section::sort_attached_input_sections): Change to sort
9799 according to section order when specified.
e1df38aa
NC
9800 (Output_section::add_input_section<32, true>): Add new parameter.
9801 (Output_section::add_input_section<64, true>): Add new parameter.
9802 (Output_section::add_input_section<32, false>): Add new parameter.
9803 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
9804 * output.h (Output_section::add_input_section): Add new parameter.
9805 (Output_section::input_section_order_specified): New
9806 method.
9807 (Output_section::set_input_section_order_specified): New method.
9808 (Input_section::Input_section): Initialize section_order_index_.
9809 (Input_section::section_order_index): New method.
9810 (Input_section::set_section_order_index): New method.
9811 (Input_section::section_order_index_): New member.
9812 (Input_section::Input_section_sort_section_order_index_compare): New
9813 struct.
9814 (Output_section::input_section_order_specified_): New member.
9815 * script-sections.cc (is_wildcard_string): Delete and move modified
9816 method to gold.h.
9817 (Output_section_element_input::Output_section_element_input): Modify
9818 call to is_wildcard_string.
9819 (Output_section_element_input::Input_section_pattern
9820 ::Input_section_pattern): Ditto.
9821 (Output_section_element_input::Output_section_element_input): Ditto.
9822 * testsuite/Makefile.am (final_layout): New test case.
9823 * testsuite/Makefile.in: Regenerate.
9824 * testsuite/final_layout.cc: New file.
9825 * testsuite/final_layout.sh: New file.
9826
3537c84b
RÁE
98272010-06-01 Rafael Espindola <espindola@google.com>
9828
9829 * plugin.cc (Plugin::load): Pass the output name to the plugin.
9830
105b6afd
RÁE
98312010-06-01 Rafael Espindola <espindola@google.com>
9832
9833 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
9834 visibility of symbols.
9835
29e11421
DK
98362010-05-27 Doug Kwan <dougkwan@google.com>
9837
9838 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
9839 from start of output section instead of address for a local symbol
9840 in a merged or relaxed section when doing a relocatable link.
9841
5e0f337e
RÁE
98422010-05-26 Rafael Espindola <espindola@google.com>
9843
703d02da 9844 PR 11604
5e0f337e
RÁE
9845 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
9846 adding sections the garbage collector removed.
9847 * gold/testsuite/Makefile.am: Add test.
9848 * gold/testsuite/Makefile.in: Regenerate.
9849 * gold/testsuite/plugin_test_7.sh: New.
9850 * gold/testsuite/plugin_test_7_1.c: New.
9851 * gold/testsuite/plugin_test_7_2.c: New.
9852
f4187277
RÁE
98532010-05-26 Rafael Espindola <espindola@google.com>
9854
9855 * script-sections.cc (Output_section_definition::set_section_addresses):
9856 Check for --section-start.
9857
5c388529
DK
98582010-05-26 Doug Kwan <dougkwan@google.com>
9859
9860 * arm.cc (Arm_scan_relocatable_relocs): New class.
9861 (Target_arm::relocate_special_relocatable): New method.
9862 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
9863 (Arm_relocate_functions::thumb_branch_common): Same.
9864 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
9865 instead of Default_scan_relocatable_relocs.
9866 * target-reloc.h (relocate_for_relocatable): Let target handle
9867 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
9868 * target.h (Sized_target::relocate_special_relocatable): New method.
9869
bca1c3ae
ILT
98702010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9871
9872 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
9873
0439c796
DK
98742010-05-23 Doug Kwan <dougkwan@google.com>
9875
9876 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
9877 instead of a cast.
9878 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
9879 with a direct branch, not a conditional branch, to a stub.
9880 * merge.cc (Output_merge_base::record_input_section): New method
9881 defintion.
9882 (Output_merge_data::do_add_input_section): Record input section if
9883 keeps-input-sections flag is set.
9884 (Output_merge_string::do_add_input_section): Ditto.
9885 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
9886 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
9887 INPUT_SECTIONS_.
9888 (Output_merge_base::keeps_input_sections,
9889 Output_merge_base::set_keeps_input_sections,
9890 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
9891 method definitions.
9892 (Output_merge_base::Input_sections): New type declaration.
9893 (Output_merge_base::input_sections_begin,
9894 Output_merge_base::input_sections_end,
9895 Output_merge_base::do_set_keeps_input_sections): New method definitions.
9896 (Output_merge_base::bool keeps_input_sections_,
9897 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
9898 Output_merge_base::input_sections_): New data members.
9899 (Output_merge_data::do_set_keeps_input_sections): New method
9900 defintion.
9901 (Output_merge_string::do_set_keeps_input_sections): Ditto.
9902 * output.cc (Output_section::Input_section::relobj): Move method
9903 defintion from class declaration to here and handle merge sections.
9904 (Output_section::Input_section::shndx): Ditto.
9905 (Output_section::Output_section): Remove initializations of removed
9906 data members and initialize new data member LOOKUP_MAPS_.
9907 (Output_section::add_input_section): Set keeps-input-sections flag
9908 for a newly created merge output section as appropriate. Adjust code
9909 to use Output_section_lookup_maps class.
9910 (Output_section::add_relaxed_input_section): Adjst code for lookup
9911 maps code refactoring.
2e702c99 9912 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
9913 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
9914 class. If adding input section to a newly created merge output
9915 section fails, remove the new merge section.
9916 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 9917 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 9918 (Output_section::find_merge_section): Ditto.
0439c796 9919 (Output_section::build_lookup_maps): New method defintion.
2e702c99 9920 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
9921 Output_section_lookup_maps class.
9922 (Output_section::get_input_sections): Export merge sections. Adjust
9923 code to use Output_section_lookup_maps class.
9924 (Output_section:::add_script_input_section): Adjust code to use
9925 Output_section_lookup_maps class. Update lookup maps for merge
9926 sections also.
9927 (Output_section::discard_states): Use Output_section_lookup_maps.
9928 (Output_section::restore_states): Same.
9929 * output.h (Merge_section_properties): Move class defintion out of
9930 Output_section.
9931 (Output_section_lookup_maps): New class.
9932 (Output_section::Input_section::is_merge_section): New method
9933 defintion.
9934 (Output_section::Input_section::relobj): Move defintion out of class
9935 defintion. Declare method only.
9936 (Output_section::Input_section::shndx): Ditto.
9937 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 9938 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
9939 (Output_section::Merge_section_by_properties_map,
9940 Output_section::Output_section_data_by_input_section_map,
9941 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
9942 Remove types.
2e702c99 9943 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
9944 KEEPS_INPUT_SECTIONS.
9945 (Output_section::build_lookup_maps): New method declaration.
9946 (Output_section::merge_section_map_,
9947 Output_section::merge_section_by_properties_map_,
9948 Output_section::relaxed_input_section_map_,
9949 Output_section::is_relaxed_input_section_map_valid_): Remove data
9950 members.
9951 (Output_section::lookup_maps_): New data member.
9952
76295588
L
99532010-05-21 Doug Kwan <dougkwan@google.com>
9954
9955 PR gold/11619
9956 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
9957 avoid a compilation error.
9958
d103a984
RÁE
99592010-05-19 Rafael Espindola <espindola@google.com>
9960
9961 * script-sections.cc (Output_section_definition::allocate_to_segment):
9962 Update the phdrs_list even when the output section is NULL.
9963 * testsuite/Makefile.am: Add test.
9964 * testsuite/Makefile.in: Regenerate.
9965 * testsuite/script_test_9.cc: New.
9966 * testsuite/script_test_9.sh: New.
9967 * testsuite/script_test_9.t: New.
9968
6625d24e
DK
99692010-05-19 Doug Kwan <dougkwan@google.com>
9970
9971 * arm.cc (Arm_input_section::original_size): New method.
9972 (Arm_input_section::do_addralign): Add a cast.
9973 (Arm_input_section::do_output_offset): Remove static cast.
9974 (Arm_input_section::original_addralign,
9975 Arm_input_section::original_size_): Change type to uint32_t.
9976 (Arm_input_section::init): Add safe casts for section alignment
9977 and size.
9978 (Arm_input_section::set_final_data_size): Do not set address and
9979 offset of stub table.
9980 (Arm_output_section::fix_exidx_coverage): Change use of of
9981 Output_section::Simple_input_section to that of
9982 Output_section::Input_section.
9983 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
9984 except for the first pass.
9985 * output.cc (Output_section::get_input_sections): Change type of
9986 input_sections to std::list<Input_section>.
9987 (Output_section::add_script_input_section): Rename from
9988 Output_section::add_simple_input_section. Change type of SIS
9989 parameter from Simple_input_section to Input_section.
9990 * output.h (Output_section::Simple_input_section): Remove class.
9991 (Output_section::Input_section): Change class visibility to public.
9992 (Output_section::Input_section::addralign): Use stored alignments
9993 for special input sections if set.
9994 (Output_section::Input_section::set_addralign): New method.
9995 (Output_section::get_input_sections): Change parameter type from
9996 list of Simple_input_section to list of Input_section.
9997 (Output_section::add_script_input_section): Rename from
9998 Output_section::add_simple_input_section. Change first parameter's
9999 type from Simple_input_section to Input_section and remove the
10000 second and third parameters.
10001 * script-sections.cc (Input_section::Input_section_list): Change
10002 type to list of Output_section::Input_section/
10003 (Input_section_info::Input_section_info): Change parameter type of
10004 INPUT_SECTION to Output_section::Input_section.
10005 (Input_section_info::input_section): Change return type.
10006 (Input_section_info::input_section_): Change type to
10007 Output_section::Input_section.
10008 (Output_section_element_input::set_section_addresses): Adjust code
10009 to use Output_section::Input_section instead of
10010 Output_section::Simple_input_section. Adjust code for renaming
10011 of Output_section::add_simple_input_section.
10012 (Orphan_output_section::set_section_addresses): Ditto.
10013
e1e82ea4
RW
100142010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10015
10016 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
10017 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
10018
91e75c8a
RÁE
100192010-05-18 Rafael Espindola <espindola@google.com>
10020
10021 * options.cc (General_options::finalize): Handle -nostdlib.
10022 * options.h (nostdlib): New option.
10023 * script.cc (script_add_search_dir): Handle -nostdlib.
10024
da59ad79
DK
100252010-05-12 Doug Kwan <dougkwan@google.com>
10026
10027 * arm.cc (Target_arm::do_finalize_sections): Create an empty
10028 attributes section only if there no attributes section after merging.
10029 (Target_arm::merge_object_attributes): Move value of
e1df38aa 10030 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
10031 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
10032 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
10033 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
10034 and arm_attr_merge_7.stdout.
10035 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
10036 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
10037 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
10038 arm_attr_merge_7b.o): New rules.
10039 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
10040 arm_attr_merge_7
10041 * testsuite/Makefile.in: Regenerate.
10042 * testsuite/arm_attr_merge.sh: New file.
10043 * testsuite/arm_attr_merge_[67][ab].s: Same.
10044
3e01a7fd
NC
100452010-05-05 Nick Clifton <nickc@redhat.com>
10046
10047 * po/es.po: Updated Spanish translation.
10048
7ad2014a
L
100492010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10050
10051 * Makefile.am (install-exec-local): Properly install gold as
10052 default cross linker.
10053 * Makefile.in: Regenerated.
10054
4fda8867
NC
100552010-04-27 H.J. Lu <hongjiu.lu@intel.com>
10056 Nick Clifton <nickc@redhat.com>
10057
10058 * configure.ac (install_as_default): Define and set to false
10059 unless --enable-gold or --enable-gold=both/gold has been
10060 specified.
10061 * configure: Regenerate.
10062
10063 * Makefile.am (install-exec-local): Install the executable as
10064 'ld.gold'. If install_as_default is true then also install it as
10065 'ld'.
10066 * Makefile.in: Regenerated.
10067
bd288ea2
ILT
100682010-04-24 Ian Lance Taylor <iant@google.com>
10069
10070 * layout.cc (Layout::layout_reloc): In relocatable link don't
10071 combine reloc sections for grouped sections.
10072
ef38fd8a
ST
100732010-04-23 Sriraman Tallam <tmsriram@google.com>
10074
10075 * gc.h (gc_process_relocs): Pass information on relocs pointing to
10076 sections that are not ordinary to icf.
10077 * icf.cc (get_section_contents): Handle relocation pointing to section
10078 with no object or shndx information.
10079 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
10080 * testsuite/Makefile.in: Regenerate.
10081 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
10082 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
10083
f6973bdc
ILT
100842010-04-22 Ian Lance Taylor <iant@google.com>
10085
10086 * expression.cc (Expression::Expression_eval_info): Add
10087 result_alignment_pointer field.
10088 (Expression::eval_with_dot): Add result_alignment_pointer
10089 parameter. Change all callers.
10090 (Expression::eval_maybe_dot): Likewise.
10091 (class Binary_expression): Add alignment_pointer parameter to
10092 left_value and right_value. Change all callers.
10093 (BINARY_EXPRESSION): Set result alignment.
10094 (class Trinary_expression): Add alignment_pointer parameter to
10095 arg2_value and arg3_value. Change all callers.
10096 (Trinary_cond::value): Set result alignment.
10097 (Max_expression::value, Min_expression::value): Likewise.
10098 (Align_expression::value): Likewise.
10099 * script-sections.cc (class Sections_element): Add dot_alignment
10100 parameter to set_section_addresses virtual function. Update
10101 instantiations.
10102 (class Output_section_element): Likewise.
10103 (Script_sections::create_segments): Add dot_alignment parameter.
10104 Change all callers.
10105 (Script_sections::create_segments_from_phdrs_clause): Likewise.
10106 (Script_sections::set_phdrs_clause_addresses): Likewise.
10107 * script-sections.h: Update declarations.
10108 * script.h: Update declarations.
10109 * output.h (Output_segment::set_minimum_p_align): Don't decrease
10110 min_p_align.
10111 * testsuite/script_test_3.t: Set large alignment.
10112 * testsuite/script_test_3.sh: Make sure that at least one LOAD
10113 segment has expected alignment.
10114
9c9c98a5
NC
101152010-04-22 Nick Clifton <nickc@redhat.com>
10116
10117 * po/gold.pot: Updated by the Translation project.
10118 * po/vi.po: Updated Vietnamese translation.
10119
2253bfba
L
101202010-04-22 H.J. Lu <hongjiu.lu@intel.com>
10121
10122 * testsuite/Makefile.am (check_PROGRAMS): Add
10123 icf_virtual_function_folding_test.
10124 * testsuite/Makefile.in: Regenerated.
10125
85fdf906
AH
101262010-04-15 Andrew Haley <aph@redhat.com>
10127
10128 * options.h (merge_exidx_entries): New option.
10129 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
10130 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
10131 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
10132 (Target_arm::merge_exidx_entries): New function.
10133 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
10134 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
10135 to Arm_exidx_fixup constructor.
10136 Add new arg, merge_exidx_entries.
10137 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
10138 Arm_output_section::fix_exidx_coverage.
10139
ce97fa81
ST
101402010-04-18 Sriraman Tallam <tmsriram@google.com>
10141
10142 * icf.cc (get_section_contents): Check for preemptible functions.
10143 Ignore addend when appropriate.
10144 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
10145 section folded.
10146 (add_from_relobj): Check for section folded.
10147 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
10148 * symtab.h (should_add_dynsym_entry): Add new parameter.
10149 * target-reloc.h (scan_relocs): Check for section folded.
10150 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
10151 Check reloc types for function pointers in shared objects.
10152 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
10153 case.
10154 (icf_preemptible_functions_test): New test case.
10155 (icf_string_merge_test): New test case.
10156 * testsuite.Makefile.in: Regenerate.
10157 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
10158 bar_glob. Refactor code.
10159 * testsuite/icf_preemptible_functions_test.cc: New file.
10160 * testsuite/icf_preemptible_functions_test.sh: New file.
10161 * testsuite/icf_string_merge_test.cc: New file.
10162 * testsuite/icf_string_merge_test.sh: New file.
10163 * testsuite/icf_virtual_function_folding_test.cc: New file.
10164 * testsuite/icf_virtual_function_folding_test.sh: New file.
10165
04ceb17c
DK
101662010-04-14 Doug Kwan <dougkwan@google.com>
10167
10168 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
10169 for local symbol recounting if we remove a section due to ICF.
10170 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
10171 there are no regular objects in input.
10172
153e7da4
DK
101732010-04-13 Doug Kwan <dougkwan@google.com>
10174
10175 * arm.cc (Arm_input_section::set_final_data_size): Compute
10176 accurate final data size instead of using current data size.
10177
4dbd9faf
DK
101782010-04-09 Doug Kwan <dougkwan@google.com>
10179
10180 * layout.cc (Layout::choose_output_section): Handle script section
10181 types.
10182 (Layout::make_output_section_for_script): Add section type parameter.
10183 Handle script section types.
10184 * layout.h (Layout::make_output_section_for_script): Add section
10185 type parameter.
10186 * output.cc (Output_section::Output_section): Initialize data member
10187 is_noload_.
10188 (Output_section::do_reset_address_and_file_offset): Do not set address
10189 to 0 if section is a NOLOAD section.
10190 * output.h (Output_section::is_noload): New method.
10191 (Output_section::set_is_noload): Ditto.
10192 (Output_section::is_noload_): New data member.
10193 * script-c.h (Script_section_type): New enum type.
10194 (struct Parser_output_section_header): Add new file section_type.
10195 * script-sections.cc (Sections_element::output_section_name): Add
10196 parameter for returning script section type.
10197 (Output_section_definition::output_section_name): Ditto.
10198 (Output_section_definition::section_type)P; New method.
10199 (Output_section_definiton::script_section_type_name): Ditto.
10200 (Output_section_definition::script_section_type_): New data member.
10201 (Output_section_definition::Output_section_definition): Initialize
10202 data member Output_section_definition::script_section_type_.
10203 (Output_section_definition::create_sections): Pass script section type
10204 to Layout::make_output_section_for_script.
10205 (Output_section_definition::output_section_name): Return script
10206 section type to caller.
10207 (Output_section_definition::set_section_address): Do not advance
10208 dot value and load address if section type is NOLOAD. Set address
10209 of NOLOAD sections regardless of section flags.
10210 (Output_section_definition::print): Print section type if it is
10211 not SCRIPT_SECTION_TYPE_NONE.
10212 (Output_section_definition::section_type): New method.
10213 (Output_section_definition::script_section_type_name): Ditto.
10214 (Script_sections::output_section_name): Add new parameter
10215 PSECTION_TYPE for returning script section type. Pass it to
10216 section elements. Handle discard sections.
10217 (Sort_output_sections::operator()): Handle NOLOAD sections.
10218 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 10219 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
10220 returning script section type.
10221 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
10222 INFO and NOLOAD.
10223 * yyscript.y (union): Add new field SECTION_TYPE.
10224 (COPY, DSECT, INFO, NOLOAD): New tokens.
10225 (opt_address_and_section_type): Change type to output_section_header.
10226 (section_type): New non-terminal
10227 (section_header): Handle section type.
2253bfba 10228 (opt_address_and_section_type): Return section type value.
4dbd9faf 10229
721ea635
L
102302010-04-09 H.J. Lu <hongjiu.lu@intel.com>
10231
10232 * testsuite/plugin_common_test_1.c (foo): Add prototype.
10233 * testsuite/plugin_common_test_2.c (foo): Likewise.
10234
6bf924b0
DK
102352010-04-08 Doug Kwan <dougkwan@google.com>
10236
10237 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
10238 Output_merge_data.
10239 * output.cc (Output_section::add_merge_input_section): Simplify
10240 code and return status of Output_merge_base::add_input_section.
e1df38aa 10241 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
10242 returns true.
10243
24af6f92
DK
102442010-04-07 Doug Kwan <dougkwan@google.com>
10245
10246 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
10247 if section is marked as containing instructions but has no mapping
10248 symbols.
10249 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
10250 correct section index.
10251 (Arm_relobj::find_linked_text_section): Ditto.
10252
00698fc5
CC
102532010-04-07 Cary Coutant <ccoutant@google.com>
10254
10255 * archive.cc (include_member): Destroy Read_symbols_data object before
10256 releasing file.
10257 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
10258 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
10259 (Read_symbols_data::~Read_symbols_data) New destructor.
10260 (Section_relocs::Section_relocs) New constructor.
10261 (Section_relocs::~Section_relocs) New destructor.
10262 (Read_relocs_data::Read_relocs_data) New constructor.
10263 (Read_relocs_data::~Read_relocs_data) New destructor.
10264 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
10265 pointers to NULL after deleting.
10266
7296d933
DK
102672010-04-07 Doug Kwan <dougkwan@google.com>
10268
10269 * arm.cc: Replace "endianity" with "endianness" in comments.
10270 (Arm_exidx_cantunwind): Ditto.
10271 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
10272 (Arm_relobj::merge_flags_and_attributes): New method.
10273 (Arm_relobj::merge_flags_and_attributes_): New data member.
10274 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
10275 (Arm_relobj::scan_sections_for_stubs): Ditto.
10276 (Arm_relobj::do_read_symbols): Check to see if we really want to
10277 merge processor-specific flags and attributes. Exit early if
10278 an object is empty except for section names and the undefined symbol.
10279 (Target_arm::do_finalize_sections): Move check for ELF format to
10280 Arm_relobj::do_read_symbols. Merge processor specific flags and
10281 attributes from a regular object only when we have determined that
10282 it is aapropriate. Do not create an .ARM.attributes section in
10283 output if there is no regular input object.
10284 (Target_arm::merge_processor_specific_flags): Check
10285 --warn-mismatch before printing any error.
10286 (Target_arm::merge_object_attributes): Ditto.
10287 * gold.cc (queue_middle_tasks): Handle the case in which there is
10288 no regular object in input.
10289 * options.cc (General_options::parse_EB): New method.
10290 (General_options::parse_EL): Same.
10291 (General_options::General_options): Initialize endianness_.
10292 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
10293 New options.
10294 (General_options::Endianness): New enum.
10295 (General_options::endianness): New method.
10296 (General_options::endianness_): New data member.
10297 * parameters.cc (Parameters::set_options): Check target endianness.
10298 (Parameters::set_target_once): Ditto.
10299 (Parameters::check_target_endianness): New method.
10300 (parameters_force_valid_target): If either -EL or -EB is specified,
10301 use it to define endianness of default target.
10302 * parameters.h (Parameters::check_target_endianness): New method
10303 declaration.
10304 * target.h (class Target): Change "endianity" to "endianness"
10305 in comments.
10306
efc8d4f2
RW
103072010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
10308
10309 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
10310 * configure: Regenerate.
10311 * Makefile.in: Regenerate.
10312 * testsuite/Makefile.in: Regenerate.
10313
be234d88
CC
103142010-04-06 Cary Coutant <ccoutant@google.com>
10315
10316 gcc PR lto/42757
10317 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
10318 prevailing definitions of common symbols.
10319 * testsuite/plugin_test_6.sh: New test case.
10320 * testsuite/plugin_common_test_1.c: New test case.
10321 * testsuite/plugin_common_test_2.c: New test case.
10322 * testsuite/Makefile.am (plugin_test_6): New test case.
10323 * testsuite/Makefile.in: Regenerate.
10324
bd32c6bd
NC
103252010-04-06 Nick Clifton <nickc@redhat.com>
10326
10327 * po/vi.po: New Vietnamese translation.
10328
323c532f
DK
103292010-03-30 Doug Kwan <dougkwan@google.com>
10330
10331 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
10332
4fcd97eb
DK
103332010-03-25 Doug Kwan <dougkwan@google.com>
10334
10335 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
10336 to avoid a conversion warning on a 32-bit host.
10337
4ebf39db
ILT
103382010-03-24 Ian Lance Taylor <iant@google.com>
10339
10340 * testsuite/script_test_3.t: Add a TLS segment.
10341 * testsuite/Makefile.am (check_PROGRAMS): Add
10342 tls_phdrs_script_test.
10343 (tls_phdrs_script_test_SOURCES): Define.
10344 (tls_phdrs_script_test_DEPENDENCIES): Define.
10345 (tls_phdrs_script_test_LDFLAGS): Define.
10346 (tls_phdrs_script_test_LDADD): Define.
10347 * testsuite/Makefile.in: Rebuild.
10348
4a599bdd
CC
103492010-03-23 Cary Coutant <ccoutant@google.com>
10350
10351 * fileread.cc (find_or_make_view): Fix comment.
10352
6c93b22c
ILT
103532010-03-23 Ian Lance Taylor <iant@google.com>
10354
10355 * script-sections.cc (class Orphan_section_placement): Define
10356 PLACE_TLS and PLACE_TLS_BSS.
10357 (Orphan_section_placement::Orphan_section_placement): Initialize
10358 new places.
10359 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
10360 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
10361 (tls_script_test_SOURCES): Define.
10362 (tls_script_test_DEPENDENCIES): Define.
10363 (tls_script_test_LDFLAGS): Define.
10364 (tls_script_test_LDADD): Define.
10365 * testsuite/Makefile.in: Rebuild.
10366
a2c7281b
DK
103672010-03-22 Doug Kwan <dougkwan@google.com>
10368
10369 * arm.cc (Arm_relocate_functions::abs8,
10370 Arm_relocate_functions::abs16): Use correct check for overflow
10371 specified in the ARM ELF specs.
10372 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
10373 target of a BLX instruction specially.
10374 (Reloc_stub::stub_type_for_reloc): Ditto.
10375 (Relocate::relocate): Use symbolic names instead of numeric relocation
10376 codes to report error.
10377 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
10378 workaround.
10379 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
10380 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
10381 thumb2_blx_out_of_range.stdout
10382 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
10383 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
10384 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
10385 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
10386 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
10387 thumb2_blx_in_range, thumb2_blx_in_range.o,
10388 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
10389 thumb2_blx_out_of_range.o): New rules.
2e702c99 10390 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
10391 thumb2_blx_in_range and thumb2_blx_out_of_range.
10392 * testsuite/Makefile.in: Regenerate.
10393 * arm_branch_in_range.sh: Add tests for THUMB BLX.
10394 * testsuite/thumb_blx_in_range.s: New file.
10395 * testsuite/thumb_blx_out_of_range.s: New file.
10396
b0193076
RÁE
103972010-03-22 Rafael Espindola <espindola@google.com>
10398
10399 * archive.cc (Should_include): Move to archive.h.
10400 (should_include_member): Make it a member of Archive.
10401 (Lib_group): New.
10402 (Add_lib_group_symbols): New.
10403 * archive.h: Include options.h.
10404 (Archive_member): Moved from Archive.
10405 (Should_include): Moved from archive.cc.
10406 (Lib_group): New.
10407 (Add_lib_group_symbols): New.
10408 * dynobj.cc (do_should_include_member): New.
10409 * dynobj.h (do_should_include_member): New.
10410 * gold.cc (queue_initial_tasks): Update call to queue.
10411 * main.cc (main): Print lib group stats.
10412 * object.cc (do_should_include_member): New.
10413 * object.h: Include archive.h.
10414 (Object::should_include_member): New.
10415 (Object::do_should_include_member): New.
10416 (Sized_relobj::do_should_include_member): New.
10417 * options.cc (General_options::parse_start_lib): New.
10418 (General_options::parse_end_lib): New.
10419 (Input_arguments::add_file): Handle lib groups.
10420 (Input_arguments::start_group): Check we are not in a lib.
10421 (Input_arguments::start_lib): New.
10422 (Input_arguments::end_lib): New.
10423 * options.h (General_options): Add start_lib and end_lib.
10424 (Input_argument::lib_): New.
10425 (Input_argument::lib): New.
10426 (Input_argument::is_lib): New.
10427 (Input_file_lib): New.
10428 (Input_arguments::in_lib_): New.
10429 (Input_arguments::in_lib): New.
10430 (Input_arguments::start_lib): New.
10431 (Input_arguments::end_lib_): New.
10432 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
10433 in unused members as preempted.
10434 (Sized_pluginobj::do_should_include_member): New.
10435 * plugin.h (Sized_pluginobj::do_should_include_member): New.
10436 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
10437 return the blocker.
10438 (Read_symbols::do_whole_lib_group): New.
10439 (Read_symbols::do_lib_group): New.
10440 (Read_symbols::do_read_symbols): Handle lib groups.
10441 (Read_symbols::get_name): Handle lib groups.
10442 * readsyms.h (Read_symbols): Add an archive member pointer.
10443 (Read_symbols::do_whole_lib_group): New.
10444 (Read_symbols::do_lib_group): New.
10445 (Read_symbols::member_): New.
10446 * script.cc (read_input_script): Update call to queue_soon.
10447
d099120c
DK
104482010-03-19 Doug Kwan <dougkwan@google.com>
10449
10450 * arm.cc (Stub_table::Stub_table): Initialize new data members
10451 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10452 (Stub_table::add_reloc_stub): Assign stub offset and update
10453 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
10454 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
10455 New data members.
2e702c99 10456 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
10457 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
10458 instead of going over all reloc stubs.
2e702c99 10459 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
10460 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10461 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 10462 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
10463 Stringpool_template::offset_.
10464 * stringpool.h (Stringpool_template::set_no_zero_null): Set
10465 Stringpool_template::offset_ to zero.
10466
1aa37384
DK
104672010-03-15 Doug Kwan <dougkwan@google.com>
10468
10469 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
10470 offset_.
10471 (Stringpool_template::new_key_offset): New method.
10472 (Stringpool_template::add_string): Assign offsets when adding new
10473 strings.
10474 (Stringpool_template::set_string_offsets): Do not set string offsets
10475 when not optimizing.
10476 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
10477 member size_.
2e702c99
RM
10478 (Chunked_vector::clear): Clear size_.
10479 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
10480 (Chunked_vector::size): Return size_.
10481 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 10482 (Chunked_vector::size_): New data member.
1aa37384
DK
10483 (Stringpool_template::set_no_zero_null): Assert string set is empty.
10484 (Stringpool_template::new_key_offset): New method declaration.
10485 (Stringpool_template::offset_): New data member.
10486
b672b057
RÁE
104872010-03-15 Rafael Espindola <espindola@google.com>
10488
10489 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
10490 Add_symbols' constructor.
10491 * readsyms.h (Add_symbols): Remove the input_group member.
10492
b6848d3c
ILT
104932010-03-10 Ian Lance Taylor <iant@google.com>
10494
10495 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
10496 target to ask whether a reference to a symbol requires a stack
10497 split.
10498 * target.h (Target::is_call_to_non_split): New function.
10499 (Target::do_is_call_to_non_split): Declare virtual function.
10500 * target.cc: Include "symtab.h".
10501 (Target::do_is_call_to_non_split): New function.
10502 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
10503
a2a5469e
CC
105042010-03-10 Cary Coutant <ccoutant@google.com>
10505
10506 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
10507 (File_read::open[1]): Remove initial mapping of whole_file_view_.
10508 (File_read::open[2]): Add whole_file_view_ to list of views.
10509 (File_read::make_view): Remove test of whole_file_view_.
10510 (File_read::find_or_make_view): Create whole_file_view_ if
10511 necessary.
10512 (File_read::clear_views): Replace bool parameter with enum;
10513 adjust all callers. Don't delete views with permanent data;
10514 do delete cached views and views from archives if
10515 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
10516 if clearing the corresponding view.
10517 * fileread.h (File_read::Clear_views_mode): New enum.
10518 (File_read::View::is_permanent_view): New method.
10519 (File_read::clear_views): Replace bool parameter
10520 with enum; adjust all callers.
10521 * options.h (General_options): Change keep_files_mapped option;
10522 add map_whole_files.
10523 * readsyms.cc (Add_symbols::run): Delete sd_ object before
10524 releasing the file.
10525 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
10526 the file.
10527
8861f32b
DM
105282010-03-10 David S. Miller <davem@davemloft.net>
10529
10530 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
10531
d62d0f5f
ST
105322010-03-09 Sriraman Tallam <tmsriram@google.com>
10533
10534 * icf.cc (get_section_contents): Add '@' marker after processing the
10535 merge reloc.
10536
9177756d
DK
105372010-03-08 Doug Kwan <dougkwan@google.com>
10538
10539 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
10540 due to a conversion warning.
10541 (Arm_relobj::update_output_local_symbol_count): Check for local
10542 symbol with unset output index.
10543
9e9e071b
ILT
105442010-03-05 Ian Lance Taylor <iant@google.com>
10545
10546 * options.h (class General_options): Add --spare-dynamic-tags.
10547 * output.cc (Output_data_dynamic::set_final_data_size): Implement
10548 --spare-dynamic-tags.
10549
a81ee015
ILT
105502010-03-05 Ian Lance Taylor <iant@google.com>
10551
10552 * incremental.cc: Include "libiberty.h".
10553
44ec90b9
RO
105542010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
10555
10556 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
10557 function, is_info_ member.
10558 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
10559 (Versions::Versions): Update caller.
10560 (Versions::define_base_version): Likewise.
10561 (Versions::add_def): Likewise.
10562
0897ed3b
ST
105632010-03-03 Sriraman Tallam <tmsriram@google.com>
10564
10565 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
10566 (Scan::possible_function_pointer_reloc): New function.
10567 (Scan::local_reloc_may_be_function_pointer): Change to call
10568 possible_function_pointer_reloc.
10569 (Scan::global_reloc_may_be_function_pointer): Ditto.
10570 * icf.h (Icf::check_section_for_function_pointers): Change to reject
10571 relocations in ".data.rel.ro._ZTV" section.
10572 * testsuite/icf_safe_so_test.sh: Change to pass i386.
10573 * testsuite/icf_safe_so_test.cc: Ditto.
10574 * testsuite/icf_safe_test.cc: Ditto.
10575 * testsuite/icf_safe_test.sh: Ditto.
10576
d3bbad62
ILT
105772010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10578 Ian Lance Taylor <iant@google.com>
10579
10580 * target-reloc.h (relocate_section): Check the symbol table index
10581 for -1U before setting the local symbol index.
10582 (scan_relocatable_relocs): If copying the relocation, record that
10583 the local symbol is required.
10584 * object.h (Symbol_value::is_output_symtab_index_set): New
10585 function.
10586 (Symbol_value::may_be_discarded_from_output_symtab): New
10587 function.
10588 (Symbol_value::has_output_symtab_entry): New function.
10589 (Symbol_value::needs_output_symtab_entry): Remove.
10590 (Symbol_value::output_symtab_index): Make sure the symbol index is
10591 set.
10592 (Symbol_value::set_output_symtab_index): Make sure the symbol
10593 index is not set. Make sure the new index is valid.
10594 (Symbol_value::set_must_have_output_symtab_entry): New function.
10595 (Symbol_value::has_output_dynsym_entry): New function.
10596 (Symbol_value::set_output_dynsym_index): Make sure the new index
10597 is valid.
10598 (Sized_relobj::set_must_have_output_symtab_entry): New function.
10599 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
10600 local symbol if permitted.
10601 (Sized_relobj::do_finalize_local_symbols): Call
10602 is_output_symtab_index_set rather than needs_output_symtab_entry.
10603 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
10604 rather than needs_output_symtab_entry. Call
10605 has_output_dynsym_entry rather than needs_output_dynsym_entry.
10606 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
10607 is_output_symtab_index_set rather than needs_output_symtab_entry.
10608 * testsuite/discard_locals_relocatable_test.c: New file.
10609 * testsuite/discard_locals_test.sh: Test -r.
10610 * testsuite/Makefile.am (check_DATA): Add
10611 discard_locals_relocatable_test1.syms,
10612 discard_local_relocatable_test2.syms.
10613 (MOSTLYCLEANFILES): Likewise. Also add
10614 discard_locals_relocatable_test1.lout and
10615 discard_locals_relocatable_test2.out.
10616 (discard_locals_relocatable_test1.syms): New target.
10617 (discard_locals_relocatable_test.o): New target.
10618 (discard_locals_relocatable_test1.out): New target.
10619 (discard_locals_relocatable_test2.syms): New target.
10620 (discard_locals_relocatable_test2.out): New target.
10621 (various): Add missing ../ld-new dependencies.
10622 * testsuite/Makefile.in: Rebuild.
10623
7e8ccf26
NC
106242010-03-03 Nick Clifton <nickc@redhat.com>
10625
10626 * po/fi.po: New Finnish translation.
10627
2a0ff005
DK
106282010-03-01 Doug Kwan <dougkwan@google.com>
10629
10630 * layout.cc (Layout::Layout): Force section types of .init_array*,
10631 .preinit_array* and .fini_array* sections.
10632 * output.cc (Output_section::Input_section_sort_entry::has_priority):
10633 Fix check of return value of std::string::find.().
10634 (Output_section::Input_section_sort_compare::operator()): Remove
10635 comment about .init_array.
10636 (Output_section::Input_section_sort_init_fini_compare::operator()):
10637 New method.
10638 (Output_section::sort_attached_input_sections): Handle .init_array
10639 and .fini_array specially.
10640 * output.h (Output_section::Inut_section_sort_compare): Update
10641 comment.
10642 (Output_section::Input_section_sort_init_fini_compare): New struct.
10643
c3e4ae29
DK
106442010-02-26 Doug Kwan <dougkwan@google.com>
10645
10646 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
10647 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
10648 * testsuite/debug_msg.sh: Avoid matching source line number for
10649 use of global variable undef_int.
10650
2fd9ae7a
DK
106512010-02-26 Doug Kwan <dougkwan@google.com>
10652
10653 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
10654 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
10655 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
10656 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
10657 * options.cc (General_options::General_options): Initialize member
10658 fix_v4bx_.
10659 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
10660 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
10661 and rm_no_fix_v4bx.stdout
10662 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
10663 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
10664 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
10665 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
10666 and arm_no_fix_v4bx.
10667 * Makefile.in: Regenerate.
10668 * testsuite/arm_fix_v4bx.s: New file.
10669 * testsuite/arm_fix_v4bx.sh: Ditto.
10670
67ec7d0b
DK
106712010-02-24 Doug Kwan <dougkwan@google.com>
10672
10673 * arm.cc (Target_arm::got_section): Make the .got section the first
10674 non RELRO section in the data segment.
10675 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
10676 suffixes of section names.
10677
10165461
DK
106782010-02-24 Doug Kwan <dougkwan@google.com>
10679
10680 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
10681 flags and attributes merging if an input file is a binary file.
10682 * fileread.cc (Input_file::open): Record format of original file.
10683 * fileread.h (Input_file::Format): New enum type.
2e702c99 10684 (Input_file::Input_file): Initialize data member format_.
10165461
DK
10685 (Input_file::format): New method definition.
10686 (Input_file::format_):: New data member.
10687
4a54abbb
DK
106882010-02-24 Doug Kwan <dougkwan@google.com>
10689
10690 * arm.cc (Arm_output_data_got): New class.
10691 (ARM_TCB_SIZE): New constant
10692 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
10693 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
10694 If user uses a script with a SECTIONS clause, issue only a warning
10695 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 10696 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
10697 garbage collection.
10698 (Target_arm::got_mode_index_entry): Handle static linking.
10699 (Target_arm::Scan::local): Ditto.
10700 (Target_arm::Scan::global): Ditto.
10701 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
10702 all incorrectly implemented relocations.
e1df38aa 10703 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
10704 Arm_output_section::fix_exidx_coverage.
10705 * layout.cc (Layout::section_name_mapping): Remove trailing dots
10706 from ".ARM.exidx." and ".ARM.extab.".
10707
ca419a6f
ILT
107082010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10709
10710 * arm.cc (Target_arm::do_finalize_sections): Create attribute
10711 section if it does not already exist.
10712 * attributes.cc (Attributes_section_data::Attributes_section_data):
10713 Don't crash if size is zero.
10714
135b9c78
ILT
107152010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
10716 Ian Lance Taylor <iant@google.com>
10717
10718 * gold.cc (queue_middle_tasks): If no input files were opened,
10719 exit.
10720 * workqueue.h (Task_function::Task_function): Assert that there is
10721 a blocker.
10722
bb0bfe4f
DK
107232010-02-22 Doug Kwan <dougkwan@google.com>
10724
10725 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
10726 * icf.cc (get_section_contents): Cast snprintf arguments to long long
10727 types to avoid warnings due to different uint64_t implementations
10728 on different hosts.
10729
2a2b6d42
DK
107302010-02-21 Doug Kwan <dougkwan@google.com>
10731
10732 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
10733 handling of the maximum backward branch offset.
2e702c99 10734 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
10735 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
10736 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 10737 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
10738 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
10739 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
10740 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
10741 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
10742 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
10743 thumb_bl_out_of_range thumb_bl_out_of_range.o,
10744 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
10745 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
10746 thumb2_bl_out_of_range.o): New rules.
10747 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
10748 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
10749 thumb2_bl_out_of_range
10750 * testsuite/Makefile.in: Regenerate.
10751 * testsuite/arm_bl_in_range.s: New file.
10752 * testsuite/arm_bl_out_of_range.s: Ditto.
10753 * testsuite/arm_branch_in_range.sh: Ditto.
10754 * testsuite/arm_branch_range.t: Ditto.
10755 * testsuite/thumb2_branch_range.t: Ditto.
10756 * testsuite/thumb_bl_in_range.s: Ditto.
10757 * testsuite/thumb_bl_out_of_range.s: Ditto.
10758 * testsuite/thumb_branch_range.t: Ditto.
10759
b487ad64
ST
107602010-02-20 Sriraman Tallam <tmsriram@google.com>
10761
10762 * gc.h (gc_process_relocs): Change vectors to point to the new list.
10763 Add reloc offset information.
10764 * icf.cc (get_section_contents): Change iterators to point to the new
10765 vectors. Add reloc offset information to the contents.
10766 * icf.h (Icf::Sections_reachable_info): New typedef.
10767 (Icf::Sections_reachable_list): New typedef.
10768 (Icf::Offset_info): New typedef.
10769 (Icf::Reloc_info): New struct typedef.
10770 (Icf::Reloc_info_list): New typedef.
10771 (Icf::symbol_reloc_list): Delete method.
10772 (Icf::addend_reloc_list): Delete method.
10773 (Icf::section_reloc_list): Delete method.
10774 (Icf::reloc_info_list): New method.
10775 (Icf::reloc_info_list_): New member.
10776
f96accdf
DK
107772010-02-19 Doug Kwan <dougkwan@google.com>
10778
10779 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
10780 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
10781 * arm.cc (Arm_relocation_functions): New forward declaration.
10782 (Target_arm::Target_arm): Initialize new data members
10783 got_mod_index_offset_ and tls_base_symbol_defined_.
10784 (Target_arm::Relocate::relocate_tls): New method.
10785 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
10786 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
10787 New methods.
2e702c99 10788 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
10789 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
10790 (Target_arm::got_mod_index_offset_,
10791 Target_arm::tls_base_symbol_defined_): New data members.
10792 (Target_arm::Scan::local, Target::Scan::global,
10793 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
10794 relocations.
10795
c8761b9a
DK
107962010-02-18 Doug Kwan <dougkwan@google.com>
10797
10798 * arm.cc (Arm_relobj::find_linked_text_section): New method.
10799 (Arm_relobj::make_exidx_input_section): Pass section index of linked
10800 text section as a parameter becuase some broken tools may not set
10801 the link in section header.
10802 (Target_arm::has_got_section): New method.
10803 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
10804 without any mapping symbol as data only. Remove warning.
10805 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
10806 link in its section header, try to discover the link by inspecting the
10807 REL31 relocation at the beginning of the section.
10808 (Target_arm::Scan::check_non_pic): Report name of offending relocation
10809 in error message.
10810 (Target_arm::Scan::global): Treat any reference to the symbol
10811 _GLOBAL_OFFSET_TABLE_ as a GOT access.
10812
21bb3914
ST
108132010-02-12 Sriraman Tallam <tmsriram@google.com>
10814
10815 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
10816 (Scan::global_reloc_may_be_function_pointer): New function.
10817 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10818 (Scan::global_reloc_may_be_function_pointer): New function.
10819 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
10820 (Scan::global_reloc_may_be_function_pointer): New function.
10821 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
10822 (Scan::global_reloc_may_be_function_pointer): New function.
10823 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
10824 (Scan::global_reloc_may_be_function_pointer): New function.
10825 (Scan::possible_function_pointer_reloc): New function.
10826 (Target_x86_64::can_check_for_function_pointers): New function.
10827 * gc.h (gc_process_relocs): Scan relocation types to determine if
10828 function pointers were taken for targets that support it.
10829 * icf.cc (Icf::find_identical_sections): Include functions for
10830 folding in safe ICF whose pointer is not taken.
10831 * icf.h (Secn_fptr_taken_set): New typedef.
10832 (fptr_section_id_): New member.
10833 (section_has_function_pointers): New function.
10834 (set_section_has_function_pointers): New function.
10835 (check_section_for_function_pointers): New function.
10836 * options.h: Fix comment for safe ICF option.
10837 * target.h (can_check_for_function_pointers): New function.
10838 * testsuite/Makefile.am: Add icf_safe_so_test test case.
10839 Modify icf_safe_test for X86-64.
10840 * testsuite/Makefile.in: Regenerate.
10841 * testsuite/icf_safe_so_test.cc: New file.
10842 * testsuite/icf_safe_so_test.sh: New file.
10843 * testsuite/icf_safe_test.cc (kept_func_3): New function.
10844 (main): Change to take pointer to function kept_func_3.
10845 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
10846 folding is done correctly for X86-64.
10847
0da6fa6c
DM
108482010-02-12 David S. Miller <davem@davemloft.net>
10849
10850 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
10851 is_symbolless parameter.
10852 (Output_reloc<SHT_REL>::is_symbolless): New.
10853 (Output_reloc<SHT_REL>::is_symbolless_): New.
10854 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
10855 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
10856 (Output_reloc<SHT_RELA>::is_symbolless): New.
10857 (Output_data_reloc::add_global): Handle is_symbolless.
10858 (Output_data_reloc::add_global_relative): Likewise.
10859 (Output_data_reloc::add_local): Likewise.
10860 (Output_data_reloc::add_local_relative): Likewise.
10861 (Output_data_reloc::add_symbolless_global_addend): New.
10862 (Output_data_reloc::add_symbolless_local_addend): New.
10863 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
10864 is_symbolless.
10865 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
10866 instead of ->is_relative_
10867 (Output_reloc::write): Likewise.
10868 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
10869 (Output_reloc::write_rel): Simplify.
10870
10871 * sparc.cc (Target_sparc::Scan::local): Use
10872 ->add_symbolless_local_addend as needed.
10873 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
10874 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
10875 based upon relocation offset.
10876
e4782e83
DK
108772010-02-11 Doug Kwan <dougkwan@google.com>
10878
10879 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
10880 (Target_arm::Scan::global): Ditto. Also remove a comment before the
10881 beginning of function.
10882 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
10883 and MOVT_ABS relocations. Those are non issued in scanning. Fix
10884 parameter is_32bit in calls to should_apply_static_reloc.
10885 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
10886 (check_DATA): Add arm_abs_global.stdout.
10887 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
10888 arm_abs_global.stdout): New rules.
10889 (MOSTLLYCLEANFILES): Add arm_abs_global
10890 * Makefile.in: Regenerate.
10891 * testsuite/arm_abs_global.s: New file.
10892 * testsuite/arm_abs_global.sh: Ditto.
10893 * testsuite/arm_abs_lib.s: Ditto.
10894
93ceb764
ILT
108952010-02-11 Ian Lance Taylor <iant@google.com>
10896
10897 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
10898 Read_relocs task.
10899 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
10900 Allocate_commons_task first.
10901 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
10902 task, rather than symtab_lock_.
10903 (Gc_process_relocs::~Gc_process_relocs): New function.
10904 (Gc_process_relocs::is_runnable): Check this_blocker_.
10905 (Gc_process_relocs::locks): Use next_blocker_ rather than
10906 blocker_.
10907 (Scan_relocs::~Scan_relocs): New function.
10908 (Scan_relocs::is_runnable): Check this_blocker_ rather than
10909 symtab_lock_.
10910 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
10911 next_blocker_.
10912 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
10913 fields. Add this_blocker_ and next_blocker_ fields. Adjust
10914 constructor accordingly.
10915 (class Gc_process_relocs): Likewise.
10916 (class Scan_relocs): Likewise.
10917 * common.h (class Allocate_commons_task): Remove symtab_lock_
10918 field, and corresponding constructor parameter.
10919 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
10920 symtab_lock_.
10921 (Allocate_commons_task::locks): Likewise.
10922
114dfbe1
ILT
109232010-02-11 Ian Lance Taylor <iant@google.com>
10924
10925 * gold-threads.h (class Once): Define.
10926 (class Initialize_lock): Rewrite as child of Once.
10927 * gold-threads.cc (class Once_initialize): Define.
10928 (once_pointer_control): New static variable.
10929 (once_pointer, once_arg): New static variables.
10930 (c_run_once): New static function.
10931 (Once::Once, Once::run_once, Once::internal_run): New functions.
10932 (class Initialize_lock_once): Remove.
10933 (initialize_lock_control): Remove.
10934 (initialize_lock_pointer): Remove.
10935 (initialize_lock_once): Remove.
10936 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
10937 (Initialize_lock::initialize): Rewrite.
10938 (Initialize_lock::do_run_once): New function.
10939 * archive.cc (Archive::interpret_header): Only clear name if it is
10940 not already empty.
10941 * fileread.cc: Include "gold-threads.h"
10942 (file_counts_lock): New static variable.
10943 (file_counts_initialize_lock): Likewise.
10944 (File_read::release): Only increment counts when using --stats.
10945 Use a lock around the increment.
10946 * parameters.cc (class Set_parameters_target_once): Define.
10947 (set_parameters_target_once): New static variable.
10948 (Parameters::Parameters): Move here from parameters.h.
10949 (Parameters::set_target): Rewrite.
10950 (Parameters::set_target_once): New function.
10951 (Parameters::clear_target): Move here and rewrite.
10952 * parameters.h (class Parameters): Update declarations. Add
10953 set_parameters_target_once_ field.
10954 (Parameters::Parameters): Move to parameters.cc.
10955 (Parameters::clear_target): Likewise.
10956 * readsyms.cc (Read_symbols::do_group): Create a Start_group
10957 task.
10958 (Start_group::~Start_group): New function.
10959 (Start_group::is_runnable): New function.
10960 (Start_group::locks, Start_group::run): New functions.
10961 (Finish_group::run): Change saw_undefined to size_t.
10962 * readsyms.h (class Start_group): Define.
10963 (class Finish_group): Change saw_undefined_ field to size_t.
10964 (Finish_group::Finish_group): Remove saw_undefined and
10965 this_blocker parameters. Change all callers.
10966 (Finish_group::set_saw_undefined): New function.
10967 (Finish_group::set_blocker): New function.
10968 * symtab.h (class Symbol_table): Change saw_undefined to return
10969 size_t. Change saw_undefined_ field to size_t.
10970 * target-select.cc (Set_target_once::do_run_once): New function.
10971 (Target_selector::Target_selector): Initialize set_target_once_
10972 field. Don't initialize lock_ and initialize_lock_ fields.
10973 (Target_selector::instantiate_target): Rewrite.
10974 (Target_selector::set_target): New function.
10975 * target-select.h (class Set_target_once): Define.
10976 (class Target_selector): Update declarations. Make
10977 Set_target_once a friend. Remove lock_ and initialize_lock_
10978 fields. Add set_target_once_ field.
10979
fa17a3f4
ILT
109802010-02-10 Ian Lance Taylor <iant@google.com>
10981
10982 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
10983 queueing any tasks.
10984 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
10985 (queue_middle_tasks): Add all blockers before queueing any tasks.
10986 (queue_final_tasks): Likewise.
10987 * token.h (Task_token::add_blockers): New function.
10988 * object.h (Input_objects::number_of_relobjs): New function.
10989
c7177d31
ILT
109902010-02-10 Ian Lance Taylor <iant@google.com>
10991
5de0e392
ILT
10992 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
10993 shared, not if not position independent.
10994 * x86_64.cc (Relocate::relocate_tls): Likewise.
10995 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
10996 (tls_pie_pic_test): New target.
10997 * testsuite/Makefile.in: Rebuild.
10998
c7177d31
ILT
10999 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
11000 (tls_test_main_pie.o, tls_test_pie.o): New targets.
11001 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
11002 * testsuite/Makefile.in: Rebuild.
11003
684b268a
DM
110042010-02-09 David S. Miller <davem@davemloft.net>
11005
11006 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
11007 R_SPARC_RELATIVE using ->add_local_relative().
11008 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
11009
612a8d3d
DM
11010 * output.h (Output_data_dynamic::add_section_size): New method
11011 that takes two Output_data objects.
11012 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
11013 entry param. Handle it in initializers.
11014 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
11015 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
11016 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
11017 arg.
11018 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
11019 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
11020 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
11021 for dynrel_includes_plt.
11022 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11023 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11024 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
11025 before .rela.plt
11026 (Target_sparc::do_finalize_sections): Update to pass true for
11027 dynrel_includes_plt.
11028 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
11029 output before .rela.plt
11030 (Target_powerpc::do_finalize_sections): Update to pass true for
11031 dynrel_includes_plt when 32-bit.
11032
cb1be87e
DK
110332010-02-08 Doug Kwan <dougkwan@google.com>
11034
11035 * arm.cc (Arm_relobj::simple_input_section_output_address): New
11036 method.
11037 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
11038 Arm_relobj::scan_section_for_cortex_a8_stubs,
11039 Arm_relobj::do_relocation_section): Instead of calling
11040 Output_section::output_address, use faster
11041 Arm_relobj::simple_input_section_output_address.
11042
705b5121
DM
110432010-02-08 David S. Miller <davem@davemloft.net>
11044
11045 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
11046 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
11047 relocation helper function.
11048
024c4466
DM
11049 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
11050 just like R_SPARC_GOT{10,13,22}.
11051 (Target_sparc::Scan::local): Likewise.
11052 (Target_sparc::Relocate:relocate): Likewise.
11053
9109c078
ILT
110542010-02-06 Ian Lance Taylor <iant@google.com>
11055
11056 * configure.ac: Rewrite targetobjs duplicate removal code to use
11057 only shell constructs.
11058 * configure: Rebuild.
11059
cf846138
DK
110602010-02-05 Doug Kwan <dougkwan@google.com>
11061
11062 PR 11247
11063 * arm.cc (Arm_relobj::section_is_scannable): New method.
11064 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
11065 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
11066
6cfaf60b
DK
110672010-02-04 Doug Kwan <dougkwan@google.com>
11068
11069 PR 11247
11070 * arm-reloc-property.cc (cstdio): Include.
11071 * configure.ac (targetobjs): Remove duplicates.
11072 * configure: Regenerate.
11073 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
11074 big and little endian version for a given address size.
11075
5c57f1be
DK
110762010-02-03 Doug Kwan <dougkwan@google.com>
11077
11078 * arm-reloc-property.cc
11079 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11080 definition.
11081 * arm-reloc-property.h
11082 (Arm_reloc_property_table::get_implemented_static_reloc_property):
11083 New method definition.
11084 (Arm_reloc_property_table::reloc_name_in_error_message): New method
11085 declaration.
11086 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
11087 overflow to N.
11088 (GOT_PREL): Change implemented to Y.
11089 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
11090 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
11091 (Arm_relocate_functions::movw_abs_nc): Remove method.
11092 (Arm_relocate_functions::movt_abs): Ditto.
11093 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
11094 (Arm_relocate_functions::thm_movt_abs): Ditto.
11095 (Arm_relocate_functions::movw_rel_nc): Ditto.
11096 (Arm_relocate_functions::movw_rel): Ditto.
11097 (Arm_relocate_functions::movt_rel): Ditto.
11098 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
11099 (Arm_relocate_functions:thm_movw_rel): Ditto.
11100 (Arm_relocate_functions:thm_movt_rel): Ditto.
11101 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
11102 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
11103 New method definitions.
11104 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
11105 (Arm_relocation_functions::arm_grp_ldr): Ditto.
11106 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
11107 (Arm_relocation_functions::arm_grp_ldc): Ditto.
11108 (Target_arm::Relocate::relocate): Check for non-static or
11109 unimplemented relocation code and exit early. Change calls to
11110 Target_arm::reloc_uses_thumb_bit and
11111 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
11112 instead. Refactor code to handle similar relocations to increase
11113 code sharing. Remove check for unsupported relocation code in switch
11114 statement.
11115 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
11116 relocation property table to find out size. Change error message to
11117 print out the name of a relocation code instead of the numeric value.
11118 (Target_arm::scan_reloc_for_stub): Use relocation property table
11119 instead of calling Target_arm::reloc_uses_thumb_bit().
11120
218c5831
DK
111212010-02-02 Doug Kwan <dougkwan@google.com>
11122
11123 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
11124 types of relaxed input section.
11125
0d31c79d
DK
111262010-02-02 Doug Kwan <dougkwan@google.com>
11127
11128 * Makefile.am (HFILES): Add arm-reloc-property.h.
11129 (DEFFILES): New.
2e702c99
RM
11130 (TARGETSOURCES): Add arm-reloc-property.cc
11131 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
11132 (libgold_a_SOURCES): $(DEFFILES)
11133 * Makefile.in: Regenerate.
11134 * arm-reloc-property.cc: New file.
11135 * arm-reloc-property.h: New file.
11136 * arm-reloc.def: New file.
11137 * arm.cc: Update comments.
11138 (arm-reloc-property.h): New included header.
11139 (arm_reloc_property_table): New global variable.
11140 (Target_arm::do_select_as_default_target): New method definition.
11141 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
11142 arm-reloc-property to targ_extra_obj.
11143 * parameters.cc (set_parameters_target): Call
11144 Target::select_as_default_target().
11145 * target.h (Target::select_as_default_target): New method definition.
11146 (Target::do_select_as_default_target): Same.
11147
546c7457
DK
111482010-02-01 Doug Kwan <dougkwan@google.com>
11149
11150 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
11151 first_output_text_section_.
11152 (Arm_exidx_fixup::first_output_text_section): New method definition.
11153 (Arm_exidx_fixup::first_output_text_section_): New data member.
11154 (Arm_exidx_fixup::process_exidx_section): Record the first text
11155 output section seen.
11156 (Arm_output_section::fix_exidx_coverage): Set correct linked section
11157 and entsize in output section header.
11158
11b861d5
DK
111592010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11160
11161 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
11162 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
11163 (Arm_relocate_functions::thm_alu11): New Method.
11164 (Arm_relocate_functions::thm_pc8): New Method.
11165 (Arm_relocate_functions::thm_pc12): New Method.
11166 (Target_arm::Scan::local): Handle the relocations.
11167 (Target_arm::Scan::global): Likewise.
11168 (Target_arm::Relocate::relocate): Likewise.
11169 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
11170
c9a2c125
DK
111712010-01-29 Doug Kwan <dougkwan@google.com>
11172
11173 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
11174 of relocation types as ld.
11175
1521477a
DK
111762010-01-29 Doug Kwan <dougkwan@google.com>
11177
11178 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
11179 to public.
11180 (Arm_relocate_functions::thumb_branch_common): Ditto.
11181 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
11182 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
11183 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
11184 Arm_relocate_functions::jump24): Remove.
11185 (Target_arm::Relocate::relocate): Adjust code to call
11186 Arm_relocation_functions::arm_branch_common and
11187 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 11188 wrappers. Merge switch-cases together to reduce source code size.
1521477a 11189
e7eca48c
DK
111902010-01-29 Doug Kwan <dougkwan@google.com>
11191
11192 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
11193 output_local_symbol_count_needs_update_.
11194 (Arm_relobj::output_local_symbol_count_needs_update,
11195 Arm_relobj::set_output_local_symbol_count_needs_update,
11196 Arm_relobj::update_output_local_symbol_count): New methods.
11197 (Arm_relobj::output_local_symbol_count_needs_update_): New data
11198 member.
11199 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
11200 of pointed function as in a R_ARM_PREL31 relocation.
11201 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
11202 for output local symbol count updating.
11203 (Target_arm::do_relax): Update output local symbol counts in objects
11204 if necessary.
11205 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
11206
02961d7e
ILT
112072010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11208
11209 * arm.cc: Added support for the ARM relocations:
11210 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
11211 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
11212 (Arm_relocate_functions::movw_rel_nc): Renamed (was
11213 movw_prel_nc).
11214 (Arm_relocate_functions::movw_rel): New method.
11215 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
11216 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
11217 thm_movw_prel_nc).
11218 (Arm_relocate_functions::thm_movw_rel): New method.
11219 (Arm_relocate_functions::thm_movt_rel): Renamed (was
11220 thm_movt_prel).
11221 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
11222 relocations.
11223 (Target_arm::Scan::global): Likewise.
11224 (Target_arm::Relocate::relocate): Likewise.
11225 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11226 Likewise.
11227
b10d2873
ILT
112282010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11229
11230 * arm.cc: Added support for ARM group relocations.
11231 (Target_arm::reloc_needs_sym_origin): New method.
11232 (Arm_relocate_functions::calc_grp_kn): New method.
11233 (Arm_relocate_functions::calc_grp_residual): New method.
11234 (Arm_relocate_functions::calc_grp_gn): New method.
11235 (Arm_relocate_functions::arm_grp_alu): New Method.
11236 (Arm_relocate_functions::arm_grp_ldr): New Method.
11237 (Arm_relocate_functions::arm_grp_ldrs): New Method.
11238 (Arm_relocate_functions::arm_grp_ldc): New Method.
11239 (Target_arm::Scan::local): Handle the ARM group relocations.
11240 (Target_arm::Scan::global): Likewise.
11241 (Target_arm::Relocate::relocate): Likewise.
11242 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11243 Likewise.
11244
2b328d4e
DK
112452010-01-26 Doug Kwan <dougkwan@google.com>
11246
11247 * arm.cc (set): Include.
11248 (class Arm_exidx_fixup): Change type of last_input_section_ to const
11249 pointer type.
2e702c99 11250 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
11251 (Arm_output_section::append_text_sections_to_list): New method.
11252 (Arm_output_section::fix_exidx_coverage): Ditto.
11253 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 11254 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
11255 Relobj::set_section_offset() instead of
11256 Sized_relobj::invalidate_section_offset().
2e702c99 11257 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
11258 parameter for section headers. Ignore relocation sections for
11259 unallocated sections and EXIDX sections.
11260 (Target_arm::fix_exidx_coverage): New method.
11261 (Target_arm::output_section_address_less_than): New type.
11262 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
11263 linked text section instead of the EXIDX section.
11264 (Arm_output_section::create_stub_group): Add an assertion to check
11265 that this is not an EXIDX output section.
11266 (Arm_output_section::append_text_sections_to_list): New method.
11267 (Arm_output_section::fix_exidx_coverage): Ditto.
11268 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 11269 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
11270 (Target_arm::do_relax): Fix EXIDX output section coverage in the
11271 first pass.
11272 (Target_arm::fix_exidx_coverage): New method.
11273 * object.h (Relobj::set_output_section): New method.
11274 (Sized_relobj::invalidate_section_offset): Remove method.
11275 (Sized_relobj::do_invalidate_section_offset): Remove method.
11276 (Sized_relobj::do_set_section_offset): Handle offset value -1.
11277
c7f3c371
DK
112782010-01-25 Doug Kwan <dougkwan@google.com>
11279
11280 * arm.cc (Arm_exidx_merged_section::do_output_offset):
11281 Fix warning due to signed and unsigned comparison on a 32-bit host.
11282
8923b24c
DK
112832010-01-22 Doug Kwan <dougkwan@google.com>
11284
11285 * arm.cc (Target_arm::do_relax): Record an output section for section
11286 offset adjustment it contains any stub table that has changed.
11287 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
11288 offsets in an output section if necessary.
11289 * output.cc (Output_section::Output_section): Initialize
11290 section_offsets_need_adjustments_.
11291 (Output_section::add_input_section_for_script): Renamed to
11292 Output_section::add_simple_input_section.
11293 (Output_section::save_states): Add a comment.
11294 (Output_section::discard_states): New method defintion.
11295 (Output_section::adjust_section_offsets): Same.
11296 * output.h (Output_section::add_input_section_for_script): Renamed to
11297 Output_section::add_simple_input_section.
11298 (Output_section::discard_states): New method declaration.
11299 (Output_section::adjust_section_offsets): Same.
11300 (Output_section::section_offsets_need_adjustment,
11301 Output_section::set_section_offsets_need_adjustment): New method
11302 definitions.
11303 (Output_section::section_offsets_need_adjustment_): New data member.
11304 * script-sections.cc
11305 (Output_section_element_input::set_section_address): Adjust code for
11306 renaming of Output_section::add_input_section_for_script.
11307 (Orphan_output_section::set_section_address): Same.
11308
9b2fd367
DK
113092010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11310
11311 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
11312 Fix_v4bx enum values .
11313 * gold/options.h (General_options): New option definitions.
11314 (General_options::fix_v4bx): New method.
11315 (General_options::Fix_v4bx): New enum.
11316 * gold/options.cc (General_options::parse_fix_v4bx): New method.
11317 (General_options::parse_fix_v4bx_interworking): New method.
11318
80d0d023
DK
113192010-01-22 Doug Kwan <dougkwan@google.com>
11320
11321 * arm.cc (Arm_exidx_fixup): New class.
11322
af2cdeae
DK
113232010-01-21 Doug Kwan <dougkwan@google.com>
11324
11325 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
11326 classes.
11327 (Arm_exidx_section_offset_map): New type.
11328
993d07c1
DK
113292010-01-21 Doug Kwan <dougkwan@google.com>
11330
11331 * arm.cc (Arm_exidx_input_section): New class.
11332 (Arm_relobj::exidx_input_section_by_link,
11333 Arm_relobj::exidx_input_section_by_shndx,
11334 Arm_relobj::make_exidx_input_section): New methods.
11335 (read_arm_attributes_section): Remove.
11336 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
11337 information about them.
11338 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
11339 to here.
11340
5ac169d4
DK
113412010-01-20 Doug Kwan <dougkwan@google.com>
11342
11343 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
11344 Input_section_specifier to Section_id.
11345 (Target_arm::new_arm_input_section: Adjust code for change of key
11346 type.
11347 (Target_arm::find_arm_input_section): Ditto.
11348 * gc.h (object.h): Include for Section_id nand Section_id_hash.
11349 (Section_id): Remove.
11350 (Garbage_collection::Section_id_hash): Remove.
11351 * icf.h (object.h): Include for Section_id nand Section_id_hash.
11352 (Section_id): Remove.
11353 (Icf::Section_id_hash): Remove.
11354 * object.h (Section_id, Const_section_id, Section_id_hash,
11355 Const_section_id_hash): New type definitions.
11356 * output.cc (Output_section::add_relaxed_input_section): Change to
11357 use Const_section_id instead of Input_section_specifier as key type.
11358 (Output_section::add_merge_input_section): Ditto.
11359 (Output_section::build_relaxation_map): Change to use Section_id
11360 instead of Input_section_specifier as key type.
2e702c99 11361 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
11362 Ditto.
11363 (Output_section::convert_input_sections_to_relaxed_sections): Change
11364 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 11365 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
11366 (Output_section::find_relaxed_input_section): Ditto.
11367 * output.h (Input_section_specifier): Remove class.
11368 (Output_section::Output_section_data_by_input_section_map): Change
11369 key type to Const_section_id.
11370 (Output_section::Output_relaxed_input_section_by_input_section_map):
11371 Ditto.
11372 (Output_section::Relaxation_map): Change key type to Section_id.
11373
a2162063
ILT
113742010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11375
11376 * gold/arm.cc: Added support for R_ARM_V4BX relocation
11377 (class Arm_v4bx_stub): New class.
11378 (DEF_STUBS): Updated definition to support v4_veneer_bx.
11379 (Stub_factory::make_arm_v4bx_stub): New method.
11380 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
11381 (Stub_table::empty): Handle v4bx stubs.
11382 (Stub_table::add_arm_v4bx_stub): New method.
11383 (Stub_table::find_arm_v4bx_stub): New method.
11384 (Arm_relocate_functions::v4bx): New method.
11385 (Target_arm::fix_v4bx): New method.
11386 (Target_arm::Target_arm): Handle R_ARM_V4BX.
11387 (Stub_table::relocate_stubs): Likewise.
11388 (Stub_table::do_write): Likewise.
11389 (Stub_table::update_data_size_and_addralign): Likewise.
11390 (Stub_table::finalize_stubs): Likewise.
11391 (Target_arm::Scan::local): Likewise.
11392 (Target_arm::Scan::global): Likewise.
11393 (Target_arm::do_finalize_sections): Likewise.
11394 (Target_arm::Relocate::relocate): Likewise.
11395 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11396 Likewise.
11397 (Target_arm::scan_reloc_for_stub): Likewise.
11398 (Target_arm::scan_reloc_section_for_stubs): Likewise.
11399
5696ab0b
ILT
114002010-01-19 Ian Lance Taylor <iant@google.com>
11401
11402 * output.cc (Output_section_headers::do_sized_write): Write large
11403 segment count to sh_info field.
11404 (Output_file_header::do_sized_write): For large segment count,
11405 write PN_XNUM to e_phnum field.
11406
800d0f56
ILT
114072010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11408
11409 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
11410 (Arm_relocate_functions::thm_jump8): New function.
11411 (Arm_relocate_functions::thm_jump11): New function.
11412 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
11413 R_ARM_THM_JUMP11.
11414 (Target_arm::Scan::global): Likewise.
11415 (Target_arm::Relocate::relocate): Likewise.
11416 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
11417 Likewise.
11418
41263c05
DK
114192010-01-14 Doug Kwan <dougkwan@google.com>
11420
11421 * arm.cc (map, utility): Include headers.
11422 (Target_arm::apply_cortex_a8_workaround): New method.
11423 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
11424 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
11425 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
11426 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
11427 the --[no-]fix-cortex-a8 command line options.
11428 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
11429 (Target_arm::relocate_stub): Use addend in instruction template.
11430 * options.h (DEFINE_bool): Set the user-set flag.
11431 (General_options): Add --[no-]-fix-cortex options.
11432 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 11433 : Update fast look-up map after conversion.
41263c05 11434
459e9b03
ST
114352010-01-14 Sriraman Tallam <tmsriram@google.com>
11436
11437 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
11438 in the first pass of do_layout.
11439
b521dfe4
DK
114402010-01-13 Doug Kwan <dougkwan@google.com>
11441
11442 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11443 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
11444 apparent compiler problem of not folding static constant integral
11445 data members of elfcpp::Elf_sizes<32>.
11446
44272192
DK
114472010-01-13 Doug Kwan <dougkwan@google.com>
11448
11449 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
11450 Arm_relobj::section_needs_cortex_a8_stub_scanning,
11451 Arm_relobj::scan_section_for_cortex_a8_erratum,
11452 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
11453 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
11454 sections to scan for relocation stubs into a new method
11455 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
11456 relocation and Cortex-A8 stub scanning.
11457 (Target_arm::do_relax): Force stubs to be after stubbed sections
11458 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 11459 the beginning of a new relaxation pass. Update a comment.
44272192
DK
11460 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
11461
44b71ece
ILT
114622010-01-12 Ian Lance Taylor <iant@google.com>
11463
11464 * target-reloc.h (visibility_error): New inline function.
11465 (relocate_section): Call visibility_error.
11466 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
11467 (MOSTLYCLEANFILES): Likewise.
11468 (protected_4_pic.o, protected_3.err): New targets.
11469 * testsuite/protected_4.cc: New file.
11470
a120bc7f
DK
114712010-01-12 Doug Kwan <dougkwan@google.com>
11472
11473 * arm.cc (Cortex_a8_reloc): New class.
11474 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
11475 and cortex_a8_relocs_info_.
11476 (Target_arm::fix_cortex_a8): New method definition.
11477 (Target_arm::Cortex_a8_relocs_info): New type.
11478 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
11479 New data member declarations.
11480 (Target_arm::scan_reloc_for_stub): Record information about
11481 relocations for THUMB branches that might be exempted from the
11482 Cortex-A8 workaround.
11483 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
11484 at the beginning of a relaxation pass.
11485
20138696
DK
114862010-01-12 Doug Kwan <dougkwan@google.com>
11487
11488 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
11489 (Arm_relobj::Mapping_symbol_position,
11490 Arm_reloj::Mapping_symbol_position_less,
11491 Arm_relobj::Mapping_symbols_info): New types.
11492 (Target_arm::is_mapping_symbol_name): New method definition.
11493 (Arm_relobj::do_count_local_symbols): Save information about mapping
11494 symbols.
11495
089d69dc
DK
114962010-01-11 Doug Kwan <dougkwan@google.com>
11497
11498 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
11499 Arm_relocate_functions::thumb32_branch_upper,
11500 Arm_relocate_functions::thumb32_branch_lower,
11501 Arm_relocate_functions::thumb32_cond_branch_offset,
11502 Arm_relocate_functions::thumb32_cond_branch_upper,
11503 Arm_relocate_functions::thumb32_cond_branch_lower,
11504 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
11505 branch offset encoding.
11506 (Arm_relocate_functions::thumb_branch_common): Use new branch
11507 offset encoding methods to avoid code duplication.
11508 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
11509 (Stub_addend_reader::operator()): Use new branch encoding method
11510 to avoid code duplication.
11511
99e5bff2
DK
115122010-01-11 Doug Kwan <dougkwan@google.com>
11513
11514 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
11515 (Target_arm::do_finalize_sections): Define special EXIDX section
11516 symbols only if referenced.
11517 * gc.h (Garbage_collection::add_reference): New method.
11518 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
11519 code duplication.
11520
98e090bd
ILT
115212010-01-11 Ian Lance Taylor <iant@google.com>
11522
d0a91bd8
ILT
11523 * script.cc (Version_script_info::build_expression_list_lookup):
11524 Change complaing about duplicate wildcard match from error to
11525 warning.
11526
98e090bd
ILT
11527 * script.cc (class Lazy_demangler): Recreate--revert part of patch
11528 of 2009-12-30.
11529 (Version_script_info::Version_script_info): Initialize globs_,
11530 default_version_, default_is_global_, and exact_. Don't
11531 initialize globals_ or locals_.
11532 (Version_script_info::build_lookup_tables): Build local symbols
11533 first.
11534 (Version_script_info::unquote): New function.
11535 (Version_script_info::add_exact_match): New function.
11536 (Version_script_info::build_expression_list_lookup): Remove lookup
11537 parameter. Add is_global parameter. Change all callers. Handle
11538 wildcard pattern specially. Unquote pattern. Call
11539 add_exact_match.
11540 (Version_script_info::get_name_to_match): New function.
11541 (Version_script_info::get_symbol_version): New function.
11542 (Version_script_info::get_symbol_version_helper): Remove.
11543 (Version_script_info::check_unmatched_names): Call unquote.
11544 * script.h (class Version_script_info): Change get_symbol_version
11545 to be non-inline and add is_global parameter; change all callers.
11546 Rewrite symbol_is_local. Update declarations. Define struct
11547 Version_tree_match, Exact, Globs. Don't define struct Lookup.
11548 Remove globals_ and locals_ members. Add exact_, globs_,
11549 default_version_, is_global_.
11550 (Version_script_info::Glob): Remove pattern, add expression and
11551 is_global. Update constructor. Change all callers.
11552 * dynobj.cc (Versions::finalize): Mark the version symbol as the
11553 default version.
11554 (Versions::symbol_section_contents): If a symbol is undefined, or
11555 defined in a dynamic object, set the version index to
11556 VER_NDX_LOCAL.
11557 * symtab.cc (Symbol_table::add_from_relobj): Don't call
11558 symbol_is_local.
11559 (Symbol_table::add_from_pluginobj): Likewise.
11560 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
11561
d56962d3
DK
115622010-01-11 Doug Kwan <dougkwan@google.com>
11563
11564 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
11565 (incremental_dump_LDADD): Add linking option for libintl.
11566 * Makefile.in: Regenerate.
11567
94e6ee91
L
115682010-01-11 H.J. Lu <hongjiu.lu@intel.com>
11569
11570 PR gold/11144
11571 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
11572 instead of -Ds.
11573 * testsuite/Makefile.in: Regenerated.
11574
e96c574b
DK
115752010-01-10 Doug Kwan <dougkwan@google.com>
11576
11577 * options.h (DEFINE_var): Use parentheses around argument varname__
11578 in macro body to avoid any unintended subsequent substitutions.
11579
7198066b
ILT
115802010-01-10 Ian Lance Taylor <iant@google.com>
11581
ba4d53bf
ILT
11582 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
11583 candidates before doing symbol resolution.
11584
7198066b
ILT
11585 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
11586 ODR candidates if only one is weak.
11587
a2beed37
ILT
115882010-01-08 Ian Lance Taylor <iant@google.com>
11589
11590 * script.cc (Version_script_info::build_expression_list_lookup):
11591 Don't warn about ambiguous version, just record the ambiguity.
11592 (Version_script_info::get_symbol_version_helper): Give error if
11593 version is ambiguous.
11594
2fb7225c
DK
115952010-01-08 Doug Kwan <dougkwan@google.com>
11596
11597 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
703d02da
AM
11598 prev_data_size_ and prev_addralign_. Remove initializer for
11599 deleted data member has_been_changed_.
11600 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
11601 to determine if the table is empty.
11602 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
11603 Remove.
11604 (Stub_table::add_reloc_stub): Define method in class definition
11605 instead of just declaring it there.
11606 (Stub_table::add_cortex_a8_stub): New method definition.
11607 (Stub_table::update_data_size_and_addralign): Ditto.
11608 (Stub_table::finalize_stubs): Ditto.
11609 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
11610 (Stub_table::do_addralign_): Return address alignment in the
11611 (Stub_table::do_reset_address_and_file_offset): Define method in
11612 class definition instead of declaring it there. Set current data
11613 size to be the data size of the previous pass.
11614 (Stub_table::set_final_data_size): Use current data size as the
11615 final data size.
11616 (Stub_table::relocate_stub): Change parameter type of stub from
11617 Reloc_stub pointer to Stub pointer.
11618 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
11619 (Stub_table::Cortex_a8_stub_list): New typedef.
11620 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
11621 Stub_table::prev_addralign_): New data member.
11622 (Arm_relobj::Arm_relobj): Initialize data member
11623 section_has_cortex_a8_workaround_.
11624 (Arm_relobj::section_has_cortex_a8_workaround,
11625 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
11626 definitions.
11627 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
11628 declarations.
11629 (Target_arm::relocate_stub): Change parameter type of stub from
11630 Reloc_stub pointer to Stub pointer.
11631 (Insn_template::size, Insn_template::alignment): Handle
11632 THUMB16_SPECIAL_TYPE.
11633 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
11634 Stub_table::update_data_size_and_addralign,
11635 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
11636 definitions.
11637 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
11638 (Stub_table::do_write): Ditto.
11639 (Target_arm::do_relax): Adjust code for changes in Stub_table.
2fb7225c 11640
880cd20d
ILT
116412010-01-08 Ian Lance Taylor <iant@google.com>
11642
11643 PR 11108
11644 * symtab.h (class Symbol): Remove fields is_target_special_ and
11645 has_plt_offset_. Add field is_defined_in_discarded_section_.
11646 (Symbol::is_defined_in_discarded_section): New function.
11647 (Symbol::set_is_defined_in_discarded_section): New function.
11648 (Symbol::has_plt_offset): Rewrite.
11649 (Symbol::set_plt_offset): Verify that new offset is not -1U.
11650 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
11651 Don't initialize is_target_special_ or has_plt_offset_.
11652 Initialize is_defined_in_discarded_section_.
11653 (Symbol_table::add_from_relobj): If appropriate, set
11654 is_defined_in_discarded_section.
11655 * resolve.cc (Symbol::override_base_with_special): Don't test
11656 is_target_special_. Change has_plt_offset_ to has_plt_offset().
11657 * target-reloc.h (relocate_section): Do special handling for
11658 symbols defined in discarded sections for global symbols as well
11659 as local symbols.
11660
2703e3eb
ILT
116612010-01-08 Ian Lance Taylor <iant@google.com>
11662
11663 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
11664 the SHT_SYMTAB case.
11665
339d40a3
ILT
116662010-01-08 Ian Lance Taylor <iant@google.com>
11667
11668 * object.cc (Sized_relobj::do_layout): Don't get confused if
11669 layout_eh_frame returns NULL.
11670
abecea76
ILT
116712010-01-08 Ian Lance Taylor <iant@google.com>
11672
11673 PR 11084
11674 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
11675 dynamic symbol table, use the normal symbol table.
11676 (Sized_dynobj::do_read_symbols): Remove assertion about type of
11677 symbol table.
11678
6b7dd3f3
ILT
116792010-01-08 Ian Lance Taylor <iant@google.com>
11680
11681 PR 11072
11682 * layout.cc (Layout::include_section): Remove .gnu_debuglink
11683 sections.
11684
36c50e63
L
116852010-01-08 H.J. Lu <hongjiu.lu@intel.com>
11686
11687 * version.cc (print_version): Change to "Copyright 2010".
11688
e291e7b9
ILT
116892010-01-08 Ian Lance Taylor <iant@google.com>
11690
11691 PR 10287
11692 PR 11063
11693 * i386.cc (class Target_i386): Change return type of plt_section
11694 to be non-const.
11695 (class Output_data_plt_i386): Add tls_desc_rel_ field.
11696 (Output_data_plt_i386::Output_data_plt_i386): Initialize
11697 tls_desc_rel_ field.
11698 (Output_data_plt_i386::rel_tls_desc): New function.
11699 (Target_i386::rel_tls_desc_section): New function.
11700 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
11701 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
11702 R_386_TLS_DESC reloc in rel_tls_desc_section.
11703 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
11704 Define struct Tlsdesc_info.
11705 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
11706 (Target_x86_64::do_reloc_symbol_index): New function.
11707 (Target_x86_64::add_tlsdesc_info): New function.
11708 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
11709 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
11710 tlsdesc_rel_ field.
11711 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
11712 all callers.
11713 (Output_data_plt_x86_64::rela_tlsdesc): New function.
11714 (Target_x86_64::rela_tlsdesc_section): New function.
11715 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
11716 handling.
11717 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
11718 (Target_x86_64::do_reloc_addend): New function.
11719 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
11720 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
11721 declarations. Define TARGET_CODE. Add arg field to u1_ union.
11722 (Output_reloc::type): New function.
11723 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
11724 (Output_reloc::is_target_specific): New function.
11725 (Output_reloc::target_arg): New function.
11726 (class Output_reloc) [SHT_RELA]: Add four new constructors for
11727 absolute relocs and target specific relocs.
11728 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
11729 add_target_specific.
11730 (class Output_data_reloc) [SHT_RELA]: Likewise.
11731 * output.cc (Output_reloc::Output_reloc): Add four new versions
11732 for absolute relocs and target specific relocs.
11733 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
11734 (Output_reloc::get_symbol_index): Likewise.
11735 (Output_reloc::local_section_offset): Check that local_sym_index_
11736 is not TARGET_CODE or 0.
11737 (Output_reloc::symbol_value): Likewise.
11738 (Output_reloc::write) [SHT_RELA]: Call target for target specific
11739 reloc.
11740 * target.h (class Target): Add reloc_symbol_index and reloc_addend
11741 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
11742 functions.
11743 * layout.cc (add_target_dynamic_tags): Use output section for
11744 DT_PLTRELSZ and DT_JMPREL.
11745
3a44184e
ILT
117462010-01-07 Ian Lance Taylor <iant@google.com>
11747
11748 PR 11061
11749 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
11750 function.
11751 (class Output_data_reloc_generic): Define.
11752 (class Output_data_reloc_base): Change base class to
11753 Output_data_reloc_generic. Change add() method to call
11754 bump_relative_reloc_count for a relative reloc. Remove
11755 sort_relocs_ field.
11756 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
11757 to sort_relocs().
11758 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
11759 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
11760 appropriate.
11761 * layout.h (class Layout): Update declaration.
11762
ea715a34
ILT
117632010-01-07 Ian Lance Taylor <iant@google.com>
11764
11765 * output.h (class Output_data): Add const version of
11766 output_section and do_output_section.
11767 (class Output_section_data): Add const version of
11768 do_output_section.
11769 (class Output_section): Likewise.
11770 * layout.cc (Layout::add_target_dynamic_tags): New function.
11771 * layout.h (class Layout): Update declarations.
11772 * arm.cc (Target_arm::do_finalize_sections): Use
11773 add_target_dynamic_tags.
11774 * i386.cc (Target_i386::do_finalize_sections): Likewise.
11775 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
11776 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
11777 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
11778
659948a4
ILT
117792010-01-07 Ian Lance Taylor <iant@google.com>
11780
11781 PR 11042
11782 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
11783 object as needed.
11784
9d3b86f6
ILT
117852010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
11786 Ian Lance Taylor <iant@google.com>
11787
11788 PR 11019
11789 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
11790 Xindex::read_symtab_xindex.
11791
bb0d3eb0
DK
117922010-01-07 Doug Kwan <dougkwan@google.com>
11793
11794 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
11795 (Insn_template::thumb16_bcond_insn): New method declaration.
11796 (Insn_template): Fix spelling.
11797 (Stub::thumb16_special): New method declaration.
11798 (Stub::do_write): Define virtual method which was previously pure
11799 virtual.
11800 (Stub::do_thumb16_special): New method declaration.
11801 (Stub::do_fixed_endian_write): New template member.
11802 (Reloc_stub::do_write): Remove.
11803 (Reloc_stub::do_fixed_endian_write): Remove.
11804 (Cortex_a8_stub): New class definition.
11805 (Stub_factory::make_cortex_a8_stub): New method definition.
11806 (Stub_factory::Stub_factory): Add missing static storage class
11807 qualifier for elf32_arm_stub_a8_veneer_blx.
11808
ffeef7df
ILT
118092010-01-07 Ian Lance Taylor <iant@google.com>
11810
dc3f80fe
ILT
11811 PR 10980
11812 * options.h (class General_options): Add --warn-unresolved-symbols
11813 and --error-unresolved-symbols.
11814 * errors.cc (Errors::undefined_symbol): Implement
11815 --warn-unresolved-symbols.
11816
ffeef7df
ILT
11817 * options.h (class General_options): Add -z text and -z textoff.
11818 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
11819
f1ec9ded
ST
118202010-01-06 Sriraman Tallam <tmsriram@google.com>
11821
11822 * gc.h (Garbage_collection::Cident_section_map): New typedef.
11823 (Garbage_collection::cident_sections): New function.
11824 (Garbage_collection::add_cident_section): New function.
11825 (Garbage_collection::cident_sections_): New member.
11826 (gc_process_relocs): Add references to sections whose names are C
11827 identifiers.
11828 * gold.h (cident_section_start_prefix): New constant.
11829 (cident_section_stop_prefix): New constant.
11830 (is_cident): New function.
11831 * layout.cc (Layout::define_section_symbols): Replace string constants
11832 with the newly defined constants.
11833 * object.cc (Sized_relobj::do_layout): Track sections whose names are
11834 C identifiers.
11835 * testsuite/Makefile.am: Add gc_orphan_section_test.
11836 * testsuite/Makefile.in: Regenerate.
11837 * testsuite/gc_orphan_section_test.cc: New file.
11838 * testsuite/gc_orphan_section_test.sh: New file.
11839
6eda8c29
ILT
118402010-01-06 Ian Lance Taylor <iant@google.com>
11841
b9674e17
ILT
11842 PR 10980
11843 * options.h (class General_options): Add --warn-shared-textrel.
11844 * layout.cc (Layout::finish_dynamic_section): Implement
11845 --warn-shared-textrel.
11846
6eda8c29
ILT
11847 PR 10980
11848 * options.h (class General_options): Add --warn-multiple-gp.
11849
32dcd44e
ILT
118502010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
11851
11852 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
11853 $(THREADSLIB) and $(LIBDL).
11854 * Makefile.in: Rebuild.
11855
a192ba05
ILT
118562010-01-06 Ian Lance Taylor <iant@google.com>
11857
11858 PR 10980
11859 * options.cc (General_options::parse_section_start): New function.
11860 (General_options::section_start): New function.
11861 (General_options::General_options): Initialize all members.
11862 * options.h: Include <map>
11863 (class General_options): Add --section-start. Add section_starts_
11864 member.
11865 * layout.cc (Layout::attach_allocated_section_to_segment): If
11866 --section-start was used, set the address of the segment. Remove
11867 local sort_sections.
11868 (Layout::relaxation_loop_body): If the address of the load segment
11869 has been set by --section-start, don't use it.
11870 * output.h (Output_segment::update_flags_for_output_section): New
11871 function.
11872 * output.cc (Output_segment::add_output_section): Call
11873 update_flags_for_output_section.
11874
dde3f402
ILT
118752010-01-05 Ian Lance Taylor <iant@google.com>
11876
62dfdd4d
ILT
11877 PR 10980
11878 * options.h (class General_options): Add --undefined-version.
11879 * script.cc (struct Version_expression): Add was_matched_by_symbol
11880 field.
11881 (Version_script_info::matched_symbol): New function.
11882 (Version_script_info::get_symbol_version_helper): Call
11883 matched_symbol.
11884 (Version_script_info::check_unmatched_names): New function.
11885 * script.h (class Version_script_info): Update declarations.
11886 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
11887
9c4ae156
ILT
11888 * options.h (class General_options): Use DEFINE_bool_alias for
11889 allow_multiple_definition.
11890 * resolve.cc (Symbol_table::should_override): Don't test
11891 allow_multiple_definition.
11892
dde3f402
ILT
11893 PR 10980
11894 * options.h (class General_options): Add --cref.
11895 * main.cc (main): Print cref table if --cref. Don't close mapfile
11896 until after printing cref table.
11897 * cref.cc: Include "symtab.h".
11898 (class Cref_inputs): Define Cref_table_compare and Cref_table.
11899 (Cref_table_compare::operator()): New function.
11900 (Cref_inputs::gather_cref): New function.
11901 (filecol): New static const.
11902 (Cref_inputs::print_cref): New function.
11903 (Cref::print_cref): New function.
11904 * cref.h: Include <cstdio>.
11905 (class Cref): Update declarations.
11906 * mapfile.h (Mapfile::file): New function.
11907 * object.h (class Object): Define Symbols. Declare virtual
11908 do_get_global_symbols.
11909 (Object::get_global_symbols): New function.
11910 * object.cc (Input_objects::add_object): Pass object to cref_ if
11911 --cref.
11912 (Input_objects::archive_start): Likewise.
11913 (Input_objects::archive_stop): Likewise.
11914 (Input_objects::print_cref): New function.
11915 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
11916 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
11917 --cref.
11918 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
11919 function.
11920 * plugin.h (class Sized_pluginobj): Update declarations.
11921
8781f709
ILT
119222010-01-05 Ian Lance Taylor <iant@google.com>
11923
11924 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
11925 to is_default_version. Rename insdef to insdefault.
11926 (Symbol_table::add_from_relobj): Rename def to is_default_version
11927 and local to is_forced_local.
11928 (Symbol_table::add_from_pluginobj): Likewise.
11929 (Symbol_table::add_from_dynobj): Likewise.
11930 (Symbol_table::define_special_symbol): Rename insdef to
11931 insdefault.
11932
fe35d28d
ILT
119332010-01-04 Ian Lance Taylor <iant@google.com>
11934
30bc8c46
ILT
11935 PR 10980
11936 * options.h (class General_options): Add
11937 --allow-multiple-definition and -z muldefs.
11938 * resolve.cc (Symbol_table::should_override): Don't warn about a
11939 multiple symbol definition if --allow-multiple-definition or -z
11940 muldefs.
11941
7eaea549
ILT
11942 PR 10980
11943 * options.h (class General_options): Add --add-needed and
11944 --copy-dt-needed-entries. Tweak --as-needed help entry.
11945 * object.cc (Input_objects::check_dynamic_dependencies): Give an
11946 error if --copy-dt-needed-entries aka --add-needed is used and
11947 would cause a change in behaviour.
11948
fe35d28d
ILT
11949 PR 10980
11950 * options.h (class General_options): Add -G as a short version of
11951 --shared. Add no-op options -assert, -g, and -i.
11952
55a2bb35
ST
119532010-01-04 Sriraman Tallam <tmsriram@google.com>
11954
11955 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
11956 check for .text or .gnu.linkonce.t sections.
11957 * icf.cc (Icf::find_identical_sections): Ditto.
11958 Change the detection for mangled function name within the section
11959 name.
11960 * icf.h (is_section_foldable_candidate): New function.
11961
719328e1
ILT
119622009-12-30 Ian Lance Taylor <iant@google.com>
11963
11964 PR 10980
11965 * options.h (class General_options): Permit two dashes with
11966 --retain-symbols-file.
11967
d7bb5745
ILT
119682009-12-30 Ian Lance Taylor <iant@google.com>
11969
403a15dd
ILT
11970 PR 10979
11971 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
11972 don't put the file header and segment headers in the text
11973 segment.
11974
eda294df
ILT
11975 PR 10979
11976 * common.cc (Sort_commons::operator()): Stabilize sort when both
11977 entries are NULL.
11978 (Symbol_table::do_allocate_commons_list): When allocating common
11979 symbols, skip a symbol which is no longer common.
11980 * symtab.h (Symbol::is_common): Test whether the symbol comes from
11981 an object before checking its type.
11982 * testsuite/common_test_2.c: New file.
11983 * testsuite/common_test_3.c: New file.
11984 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
11985 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
11986 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
11987 (common_test_2_pic.o, common_test_2.so): New targets.
11988 (common_test_3_pic.o, common_test_3.so): New targets.
11989 * testsuite/Makefile.in: Rebuild.
11990
d7bb5745
ILT
11991 PR 10979
11992 * script.cc (read_input_script): If we see a new SECTIONS clause,
11993 and we have added an input section, give an error.
11994 * layout.h (class Layout): Add have_added_input_section function.
11995 Add have_added_input_section_ field.
11996 * layout.cc (Layout::Layout): Initialize
11997 have_added_input_section_.
11998 (Layout::layout): Set have_added_input_section_.
11999 (Layout::layout_eh_frame): Likewise.
12000
fc59c572
ILT
120012009-12-30 Ian Lance Taylor <iant@google.com>
12002
12003 PR 10931
12004 * options.h (class General_options): Add --sort-common option.
12005 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
12006 * common.cc (Sort_common): Add sort_order parameter to
12007 constructor. Add sort_order_ field.
12008 (Sort_commons::operator): Check sort_order_.
12009 (Symbol_table::allocate_commons): Determine the sort order.
12010 (Symbol_table::do_allocate_commons): Add sort_order parameter.
12011 Change all callers.
12012 (Symbol_table::do_allocate_commons_list): Likewise.
12013
1c74fab0
ILT
120142009-12-30 Ian Lance Taylor <iant@google.com>
12015
12016 PR 10916
12017 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
12018 symbols from this object, don't change the visibility of an
12019 undefined symbol.
12020 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
12021
6affe781
ILT
120222009-12-30 Ian Lance Taylor <iant@google.com>
12023
12024 PR 10861
12025 * script.h (class Version_script_info): Define Language enum.
12026 Update declarations. Define Glob, Exact, and Lookup types. Add
12027 new fields globals_, locals_, and is_finalized_.
12028 * script.cc: Various formatting fixes.
12029 (class Parser_closure): Change language_stack_ from a vector of
12030 std::string to one of Version_script_info::Language. Adjust all
12031 uses accordingly.
12032 (class Lazy_demangler): Remove.
12033 (struct Version_expression): Change language from std::string to
12034 Version_script_info::Language.
12035 (Version_script_info::Version_script_info): New function.
12036 (Version_script_info::~Version_script_info): Don't call clear.
12037 (Version_script_info::finalize): New function.
12038 (Version_script_info::build_lookup_tables): New function.
12039 (Version_script_info::build_expression_list_lookup): New
12040 function.
12041 (Version_script_info::get_symbol_version_helper): Rewrite to use
12042 lookup tables.
12043 (Version_script_info::print_expression_list): Adjust to use
12044 Version_script_info::Language.
12045 (script_push_lex_into_version_mode): Check that the version script
12046 has not been finalized.
12047 (version_script_push_lang): Change language string to
12048 Version_script_info::Language.
12049 * options.cc (Command_line::version_script): New function.
12050 * options.h (class General_options): Add finalize_dynamic_list
12051 function. Change version_script from declaration to definition.
12052 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
12053 * testsuite/version_script.map: Remove duplicate def of foo.
12054 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
12055 version_script.map.
12056 * testsuite/Makefile.in: Rebuild.
12057
818bf354
ILT
120582009-12-30 Ian Lance Taylor <iant@google.com>
12059
12060 PR 10843
12061 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
12062 if the input symbol index is 0, make the output symbol index 0.
12063
ebcc8304
ILT
120642009-12-30 Ian Lance Taylor <iant@google.com>
12065
12066 PR 10670
12067 * options.h (class General_options): Add -x/--discard-all.
12068 * object.cc (Sized_relobj::do_count_local_symbols): Handle
12069 --discard-all. If the local symbol needs a dynamic entry, check
12070 that before handling --discard-locals.
12071
176fe33f
ILT
120722009-12-30 Ian Lance Taylor <iant@google.com>
12073
bb321bb1
ILT
12074 PR 10450
12075 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
12076 flags to PF_R.
12077 (Output_segment::add_output_section): Don't change the flags if
12078 the type is PT_TLS.
12079
176fe33f
ILT
12080 PR 10450
12081 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
12082 GNU hash table if they need a dynamic value. Otherwise, don't add
12083 them if they are defined in a dynamic object or are forced local.
12084
e8cd95c7
ILT
120852009-12-29 Ian Lance Taylor <iant@google.com>
12086
1b81fb71
ILT
12087 PR 10450
12088 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
12089 .gnu.hash table for a 32-bit target.
12090
8d6d383d
ILT
12091 PR 10450
12092 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
12093 regular and a dynamic object only needs a dynamic symbol table
12094 entry if it is externally visible.
12095
e785ec03
ILT
12096 PR 10450
12097 * i386.cc (class Target_i386): Initialize global_offset_table_ in
12098 constructor. Add global_offset_table_ field.
12099 (Target_i386::got_section): Set global_offset_table_.
12100 (Target_i386::do_finalize_sections): Set global_offset_table_
12101 size.
12102 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
12103 in constructor. Add global_offset_table_ field.
12104 (Target_x86_64::got_section): Set global_offset_table_.
12105 (Target_x86_64::do_finalize_sections): Set global_offset_table_
12106 size.
12107
1a2dff53
ILT
12108 * layout.cc (Layout::Layout): Initialize increase_relro_.
12109 (Layout::get_output_section): Add is_relro, is_last_relro, and
12110 is_first_non_relro parameters. Change all callers.
12111 (Layout::choose_output_section): Likewise.
12112 (Layout::add_output_section_data): Likewise.
12113 (Layout::make_output_section): Likewise.
12114 (Layout::set_segment_offsets): Clear increase_relro when using a
12115 linker script.
12116 * layout.h (class Layout): Add increase_relro method. Add
12117 increase_relro_ field. Update declarations.
12118 * output.cc (Output_section::Output_section): Initialize
12119 is_last_relro_ and is_first_non_relro_.
12120 (Output_segment::add_output_section): Group relro sections is
12121 do_sort is true. Handle is_last_relro and is_first_non_relro.
12122 (Output_segment::maximum_alignment): Remove relro handling.
12123 (Output_segment::set_section_addresses): Add increase_relro
12124 parameter. Change all callers. Add initial alignment to align
12125 relro sections on separate page. Remove old relro handling.
12126 (Output_segment::set_section_list_addresses): Remove in_relro
12127 parameter. Change all callers.
12128 (Output_segment::set_offset): Add increase parameter. Change all
12129 callers. Remove old relro handling.
12130 * output.h (class Output_section): Add new methods: is_last_relro,
12131 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
12132 Add is_last_relro_ and is_first_non_relro_ fields.
12133 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
12134 Create separate .got.plt section. Call increase_relro.
12135 * x86_64.cc (Target_x86_64::got_section): Likewise.
12136 * testsuite/relro_script_test.t: Add .got.plt.
12137
f0ba79e2
ILT
12138 PR 10450
12139 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
12140 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
12141 (Layout::finalize): Call set_dynamic_symbol_size.
12142 (Layout::set_dynamic_symbol_size): New function.
12143 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
12144 set_dynamic_symbol_size.
12145
e8cd95c7
ILT
12146 PR 10450
12147 * output.h (class Output_section): Add is_entsize_zero_ field.
12148 * output.cc (Output_section::Output_section): Initialize
12149 is_entsize_zero_.
12150 (Output_section::set_entsize): If two different entsizes are
12151 requested, force it to zero.
12152 (Output_section::add_input_section): Set flags for .debug_str
12153 before updating section flags. Set entsize.
12154 (Output_section::update_flags_for_input_section): Set SHF_MERGE
12155 and SHF_STRING if all input sections have those flags.
12156
3e1b9a8a
RÁE
121572009-12-29 Rafael Espindola <espindola@google.com>
12158
12159 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
12160 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
12161 reporting.
3e1b9a8a 12162
3dcad376
ST
121632009-12-29 Sriraman Tallam <tmsriram@google.com>
12164
12165 * options.cc (General_options::parse_version): Allow -v to exit
12166 without an error if there is nothing to link.
12167
084e2665
ILT
121682009-12-29 Ian Lance Taylor <iant@google.com>
12169
12170 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
12171 using a version of gcc before 4.1.
12172 * configure: Rebuild.
12173
250acde3
CD
121742009-12-28 Chris Demetriou <cgd@google.com>
12175
12176 * attributes.cc (Output_attributes_section_data::do_write): Use
12177 std::vector::front rather than std::vector::data.
12178
99fff23b
ILT
121792009-12-28 Ian Lance Taylor <iant@google.com>
12180
12181 * symtab.h (class Symbol_table): Add enum Defined.
12182 * resolve.cc (Symbol_table::should_override): Add defined
12183 parameter. Change all callers. Test whether object is NULL
12184 before calling a method on it.
12185 (Symbol_table::report_resolve_problem): Add defined parameter.
12186 Change all callers.
12187 (Symbol_table::should_override_with_special): Likewise.
12188 * symtab.cc (Symbol_table::define_in_output_data): Add defined
12189 parameter. Change all callers.
12190 (Symbol_table::do_define_in_output_data): Likewise.
12191 (Symbol_table::define_in_output_segment): Likewise.
12192 (Symbol_table::do_define_in_output_segment): Likewise.
12193 (Symbol_table::define_as_constant): Likewise.
12194 (Symbol_table::do_define_as_constant): Likewise.
12195 * script.h (class Symbol_assignment): Add is_defsym parameter to
12196 constructor; change all callers.
12197 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
12198 parameter. Change all callers. Add is_defsym_ field.
12199 (class Parser_closure): Add parsing_defsym parameter to
12200 constructor; change all callers. Add parsing_defsym accessor
12201 function. Add parsing_defsym_ field.
12202
556bd683
ILT
122032009-12-28 Ian Lance Taylor <iant@google.com>
12204
12205 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 12206 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 12207
1782c879
ILT
122082009-12-23 Ian Lance Taylor <iant@google.com>
12209
12210 * i386.cc (Target_i386::do_calls_non_split): Recognize
12211 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
12212 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
12213 -fsplit-stack prologue when using %r11.
1782c879 12214
329ca2b1
ST
122152009-12-21 Sriraman Tallam <tmsriram@google.com>
12216
12217 * options.cc (General_options::parse_version): Make -v continue and do
12218 the link like GNU ld does.
12219
d675ff46
RÁE
122202009-12-17 Rafael Avila de Espindola <espindola@google.com>
12221
12222 * Makefile.am (CCFILES): Add timer.cc.
12223 (HFILES): Add timer.h.
12224 * configure.ac: Check for sysconf and times.
12225 * main.cc: include timer.h.
12226 (main): Use Timer instead of get_run_time.
12227 * timer.cc: New.
12228 * timer.h: New.
12229 * workqueue.cc: include timer.h.
12230 (Workqueue::find_and_run_task):
12231 Report user, sys and wall time.
12232 * Makefile.in: Regenerate.
12233 * config.in: Regenerate.
12234 * configure: Regenerate.
12235
d6344fb5
DK
122362009-12-16 Doug Kwan <dougkwan@google.com>
12237
12238 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
12239 sections.
12240 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
12241 relaxed input sections.
12242 * output.cc (Output_section::find_relaxed_input_section): Change
12243 return type to Output_relaxed_input_section pointer. Adjust code
12244 for new type of relaxed_input_section_map_.
12245 * output.h (Output_section::find_relaxed_input_section): Change
12246 return type to Output_relaxed_input_section pointer.
12247 (Output_section::Output_relaxed_input_section_by_input_section_map):
12248 New type.
12249 (Output_section::relaxed_input_section_map_): Change type to
12250 Output_section::Output_relaxed_input_section_by_input_section_map.
12251 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
12252 input section.
12253
0e0d5469
ILT
122542009-12-15 Ian Lance Taylor <iant@google.com>
12255
12256 * layout.cc (Layout::create_shstrtab): Only write out after input
12257 sections if we are compressing debug sections.
12258
0649a889
ILT
122592009-12-15 Ian Lance Taylor <iant@google.com>
12260
12261 * archive.cc (Archive::add_symbols): Only look up a symbol without
12262 a version if there is, in fact, a version.
12263
2ea97941
ILT
122642009-12-14 Ian Lance Taylor <iant@google.com>
12265
12266 Revert -Wshadow changes, all changes from:
12267 2009-12-11 Doug Kwan <dougkwan@google.com>
12268 2009-12-11 Nick Clifton <nickc@redhat.com>
12269 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
12270
b0eec2cc
DK
122712009-12-11 Doug Kwan <dougkwan@google.com>
12272
12273 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
12274 due to -Wshadow.
12275 * attributes.cc (Object_attribute::size): Ditto.
12276 (Attributes_section_data::size): Ditto.
12277 (Attributes_section_data::Attributes_section_data): Ditto.
12278 (Output_attributes_section_data::do_write): Ditto.
12279 * attributes.h (Object_attribute::set_type): Ditto.
12280 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
12281
91d6fa6a
NC
122822009-12-11 Nick Clifton <nickc@redhat.com>
12283
12284 * archive.cc: Fix shadowed variable warnings.
12285 * arm.cc: Likewise.
12286 * compressed_output.cc: Likewise.
12287 * compressed_output.h: Likewise.
12288 * configure: Likewise.
12289 * dwarf_reader.cc: Likewise.
12290 * dynobj.cc: Likewise.
12291 * dynobj.h: Likewise.
12292 * ehframe.cc: Likewise.
12293 * ehframe.h: Likewise.
12294 * errors.cc: Likewise.
12295 * expression.cc: Likewise.
12296 * fileread.cc: Likewise.
12297 * fileread.h: Likewise.
12298 * freebsd.h: Likewise.
12299 * i386.cc: Likewise.
12300 * icf.cc: Likewise.
12301 * incremental.h: Likewise.
12302 * layout.cc: Likewise.
12303 * layout.h: Likewise.
12304 * mapfile.cc: Likewise.
12305 * merge.cc: Likewise.
12306 * merge.h: Likewise.
12307 * object.cc: Likewise.
12308 * object.h: Likewise.
12309 * options.h: Likewise.
12310 * output.cc: Likewise.
12311 * output.h: Likewise.
12312 * parameters.cc: Likewise.
12313 * plugin.cc: Likewise.
12314 * powerpc.cc: Likewise.
12315 * reduced_debug_output.cc: Likewise.
12316 * reduced_debug_output.h: Likewise.
12317 * reloc.cc: Likewise.
12318 * reloc.h: Likewise.
12319 * resolve.cc: Likewise.
12320 * script-sections.cc: Likewise.
12321 * script.cc: Likewise.
12322 * script.h: Likewise.
12323 * sparc.cc: Likewise.
12324 * symtab.cc: Likewise.
12325 * symtab.h: Likewise.
12326 * target-select.cc: Likewise.
12327 * target-select.h: Likewise.
12328 * token.h: Likewise.
12329 * workqueue.cc: Likewise.
12330 * workqueue.h: Likewise.
12331 * x86_64.cc: Likewise.
12332
a0351a69
DK
123332009-12-10 Doug Kwan <dougkwan@google.com>
12334
12335 * arm.cc (attributes.h): New include.
12336 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
12337 (Arm_relobj::~Arm_relobj): Delete object pointed by
12338 attributes_section_data_.
12339 (Arm_relobj::attributes_section_data): New method definition.
12340 (Arm_relobj::attributes_section_data_): New data member declaration.
12341 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
12342 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
12343 attributes_section_data_.
12344 (Arm_dynobj::attributes_section_data): New method definition.
12345 (Arm_dynobj::attributes_section_data_): New data member declaration.
12346 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
12347 initialization value of may_use_blx_ to false.
2e702c99 12348 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
12349 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
12350 object attributes to compute results instead of hard-coding.
12351 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
12352 Target_arm::get_secondary_compatible_arch,
12353 Target_arm::set_secondary_compatible_arch
12354 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12355 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
12356 New method declarations.
12357 (Target_arm::get_aeabi_object_attribute): New method definition.
12358 (Target_arm::attributes_section_data_): New data member declaration.
12359 (read_arm_attributes_section): New template definition.
12360 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
12361 (Arm_dynobj::do_read_symbols): Ditto.
12362 (Target_arm::do_finalize_sections): Merge attributes sections from
12363 input. Check for BLX use after attributes section merging.
12364 Fix __exidx_start and __exidx_end visibility. Create an
12365 .ARM.attributes section if necessary.
12366 (Target_arm::get_secondary_compatible_arch,
12367 Target_arm::set_secondary_compatible_arch,
12368 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
12369 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 12370 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
12371 New method definitions.
12372
b59befec
ILT
123732009-12-09 Ian Lance Taylor <iant@google.com>
12374
12375 * plugin.cc (Plugin::load): Don't cast from void* to a function
12376 pointer.
12377
1276bc89
ILT
123782009-12-09 Ian Lance Taylor <iant@google.com>
12379
12380 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
12381 information fields.
12382
2f2de248
L
123832009-12-09 H.J. Lu <hongjiu.lu@intel.com>
12384
12385 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
12386 Replace two_file_shared_1.so with two_file_shared_2.so.
12387 * testsuite/Makefile.in: Regenerated.
12388
4f787271
DK
123892009-12-08 Doug Kwan <dougkwan@google.com>
12390
12391 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
12392 (HFILES): Add attributes.h and int_encoding.h.
12393 * Makefile.in: Regenerate.
12394 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
12395 function definitions to int_encoding.cc
12396 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
12397 prototypes to int_encoding.h
12398 * reduced_debug_output.cc (int_encoding.h): New include.
12399 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
12400 function definitions to int_encoding.cc
12401 (insert_into_vector, read_from_pointer): Move template definitions to
12402 int_encoding.h
12403 * attributes.cc: New file.
12404 * attributes.h: New file.
12405 * int_encoding.cc: New file.
12406 * int_encoding.h: New file.
12407
20b52f1a
RÁE
124082009-12-07 Rafael Avila de Espindola <espindola@google.com>
12409
12410 PR gold/11055
12411 * incremental-dump.cc (dump_incremental_inputs): New.
12412 (main): Use dump_incremental_inputs.
12413
53d7974c
L
124142009-12-07 H.J. Lu <hongjiu.lu@intel.com>
12415
12416 PR gold/10893
12417 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
12418 checking elfcpp::STT_FUNC.
12419 (Target_i386::Relocate::relocate): Likewise.
12420 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
12421
12422 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
12423 symbols from shared libraries into normal FUNC symbols.
12424
12425 * symtab.h (Symbol): Add is_func and use it.
12426
05a352e6
DK
124272009-12-05 Doug Kwan <dougkwan@google.com>
12428
12429 * arm.cc (Target_arm::arm_info): Initialize new fields
12430 attributes_section and attributes_vendor.
12431 * i386.cc (Target_i386::i386_info): Same.
12432 * object.cc (Sized_relobj::do_layout): Skip attribute section.
12433 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
12434 fields attributes_section and attributes_vendor.
53d7974c 12435 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
12436 * target.h (Target::attributes_section, Target::attributes_vendor,
12437 Target::is_attributes_section, Target::attribute_arg_type,
12438 Target::attributes_order): New method definitions.
12439 (Target::Target_info::attributes_section,
12440 Target::Target_info::attributes_vendor): New fields.
12441 (Target::do_attribute_arg_type, Target::do_attributes_order): New
12442 virtual method definitions.
12443 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
12444 attributes_section and attributes_vendor.
12445 * testsuite/testfile.cc (Target_test::test_target_info): Same.
12446
f4e5969c
DK
124472009-12-05 Doug Kwan <dougkwan@google.com>
12448
12449 * arm.cc: Update comments about interworking and stub generation.
12450 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
12451 considered as non-PIC.
12452 (Arm_relocate_functions::base_abs): Fix formatting.
12453 (Arm_relocate_functions::got_prel): Fix comment. Change interface
12454 of function to use GOT entry address instead of offset.
12455 (Target_arm::Scan::global): Issue an error if a symbol would need a
12456 PLT does not get one because it is untyped. Remove code to create
12457 dynamic symbols for relative branches.
12458 (Target_arm::Relocate::relocate: Use 0 instead of false since function
12459 takes unsigned integer instead of boolean.
12460
1abce4a6
L
124612009-12-05 H.J. Lu <hongjiu.lu@intel.com>
12462
12463 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
12464 (two_file_test_LDADD): Likewise.
12465 (common_test_1_LDADD): Likewise.
12466 (exception_test_LDADD) Likewise.
12467 (weak_test_LDADD): Likewise.
12468 (many_sections_test_LDADD): Likewise.
12469 (initpri1_LDADD): Likewise.
12470 (script_test_1_LDADD): Likewise.
12471 (script_test_2_LDADD): Likewise.
12472 (justsyms_LDADD): Likewise.
12473 (binary_test_LDADD): Likewise.
12474 (large_LDADD): Likewise.
12475 * testsuite/Makefile.in: Regenerated.
12476
adcf2816 124772009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 12478
adcf2816
L
12479 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
12480 (Symbol_table::override_with_special): Likewise.
12481 (Symbol_table::add_from_object): Likewise.
12482
28e67f5d
RÁE
124832009-12-04 Rafael Avila de Espindola <espindola@google.com>
12484
12485 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12486 Don't set the data_offset twice.
12487
ae10a101
RÁE
124882009-12-04 Rafael Avila de Espindola <espindola@google.com>
12489
12490 * testsuite/Makefile.in: Regenerate.
12491
f59f41f3
DK
124922009-12-03 Doug Kwan <dougkwan@google.com>
12493
12494 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
12495 (Target_arm::do_finalize_sections): Add parameter for symbol table
12496 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
12497 * i386.cc (Target_i386::do_finalize_sections): Add an additional
12498 parameter for symbol table pointer.
12499 * layout.cc (Layout::finalize): Call Target::finalize_sections with
12500 an additional parameter for a pointer to symbol table.
12501 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
12502 parameter for a symbol table pointer.
12503 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
12504 * target.h (Target::finalize_sections, Target::do_finalize_sections):
12505 Ditto.
12506 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
12507 parameter for a symbol table pointer.
12508
ca55d848
RÁE
125092009-12-03 Rafael Avila de Espindola <espindola@google.com>
12510
12511 * incremental.cc (Incremental_inputs_header)
12512 (Incremental_inputs_header_write, Incremental_inputs_entry)
12513 (Incremental_inputs_entry_write): Move ...
12514 * incremental.h (Incremental_inputs_header)
12515 (Incremental_inputs_header_write, Incremental_inputs_entry)
12516 (Incremental_inputs_entry_write): here.
12517
3aec4f9c
RÁE
125182009-12-02 Rafael Avila de Espindola <espindola@google.com>
12519
12520 * incremental.cc (make_sized_incremental_binary): Set the target.
12521 Error if it is incompatible.
12522 * output.h (Output_file): Add filename method.
12523
9c0ae74d
RÁE
125242009-12-02 Rafael Avila de Espindola <espindola@google.com>
12525
12526 * incremental.cc (Incremental_inputs_entry): Remove unused argument
12527 from the get_* methods.
12528
a45500ae
RÁE
125292009-12-02 Rafael Avila de Espindola <espindola@google.com>
12530
12531 * incremental-dump.cc (main): Check that the offeset of a script is 0.
12532 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
12533 Write 0 for the data_offset of scripts.
12534
325e6408
RÁE
125352009-12-02 Rafael Avila de Espindola <espindola@google.com>
12536
12537 * testsuite/Makefile.am: Add the incremental_test.sh test.
12538 * testsuite/incremental_test.sh: New.
12539 * testsuite/incremental_test_1.c: New.
12540 * testsuite/incremental_test_2.c: New.
12541
954c3e2e
RÁE
125422009-12-01 Rafael Avila de Espindola <espindola@google.com>
12543
703d02da 12544 * incremental-dump.cc (main): Fix typos.
954c3e2e 12545
f8086623
RÁE
125462009-11-27 Rafael Avila de Espindola <espindola@google.com>
12547
12548 PR gold/11025
12549 * incremental-dump.cc (main): Use llu to print 64 bit values.
12550
3b0dd6ac
L
125512009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
12552 H.J. Lu <hongjiu.lu@intel.com>
12553
12554 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
12555 $(LIBDL).
12556 (incremental_dump_LDADD): Likewise.
12557 * Makefile.in: Regenerated.
12558
a6d1ef57 125592009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 12560
a6d1ef57
DK
12561 Revert:
12562
12563 2009-11-25 Doug Kwan <dougkwan@google.com>
12564
12565 * arm.cc (Target_arm::Target_arm): Move method definition
12566 outside of class definition. Add code to handle
12567 --target1-rel, --target1-abs and --target2= options.
12568 (Target_arm::get_reloc_reloc_type): Change method to be
12569 non-static and const.
12570 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
12571 New data member declaration.
12572 (Target_arm::Scan::local, Target_arm::Scan::global,
12573 Target_arm::Relocate::relocate,
12574 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
12575 Adjust call to Target_arm::get_real_reloc_type.
12576 (Target_arm::get_real_reloc_type): Use command line options
12577 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12578 * options.h (--target1-rel, --target1-abs, --target2): New
12579 ARM-only options.
12580
50aeb7d4
DK
125812009-11-25 Doug Kwan <dougkwan@google.com>
12582
12583 * arm.cc (Target_arm::Target_arm): Move method definition outside of
12584 class definition. Add code to handle --target1-rel, --target1-abs
12585 and --target2= options.
12586 (Target_arm::get_reloc_reloc_type): Change method to be non-static
12587 and const.
12588 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
12589 member declaration.
12590 (Target_arm::Scan::local, Target_arm::Scan::global,
12591 Target_arm::Relocate::relocate,
12592 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
12593 call to Target_arm::get_real_reloc_type.
12594 (Target_arm::get_real_reloc_type): Use command line options to
12595 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
12596 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
12597 options.
12598
51938283
DK
125992009-11-25 Doug Kwan <dougkwan@google.com>
12600
12601 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
12602 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
12603 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
12604 formatting.
12605 (Arm_relocate_functions::thm_call): Replace body with a call to
12606 Arm_relocate_functions::thumb_branch_common.
12607 (Arm_relocate_functions::thm_jump24,
12608 Arm_relocate_functions::thm_xpc22): New method definitions.
12609 (Arm_relocate_functions::thumb_branch_common): New method definition.
12610 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
12611 operator.
12612 (Target_arm::Relocate::relocate): Adjust call to thm_call.
12613 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
12614
e2b8f3c4
RÁE
126152009-11-24 Rafael Avila de Espindola <espindola@google.com>
12616
12617 * Makefile.am: Build incremental-dump
12618 * Makefile.in: Regenerate.
12619 * incremental-dump.cc: New.
12620 * incremental.cc (Incremental_inputs_header_data,
12621 Incremental_inputs_entry_data): Move to incremental.h
12622 * incremental.h: (Incremental_inputs_header_data,
12623 Incremental_inputs_entry_data): Move from incremental.cc
12624
bcba9aec
RÁE
126252009-11-24 Rafael Avila de Espindola <espindola@google.com>
12626
12627 * incremental.cc (Incremental_inputs_header,
12628 Incremental_inputs_header_write, Incremental_inputs_entry,
12629 Incremental_inputs_entry_write): Add a typedef with the data type.
12630
7c3afe08
RÁE
126312009-11-24 Rafael Avila de Espindola <espindola@google.com>
12632
12633 * incremental.cc (Incremental_inputs_header,
12634 Incremental_inputs_header_write, Incremental_inputs_entry,
12635 Incremental_inputs_entry_write): Update comment about which
12636 type has the filed descriptions.
12637
d204b6e9
DK
126382009-11-15 Doug Kwan <dougkwan@google.com>
12639
12640 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
12641 (Arm_relocate_functions::arm_branch_common): Change method defintion
12642 in class definition to a method declaration and update list of formal
12643 parameters.
12644 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
12645 Arm_relocation_functions::jump24): Adjust call to
12646 Arm_relocate_functions::arm_branch_common. Update list of formal
12647 parameters.
12648 (Arm_relocate_functions::xpc25): New method definition.
12649 (Arm_relocate_functions::arm_branch_common): Move method defintion
12650 out from class definition. Use stubs for mode-switching and extending
12651 branch ranges.
12652 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
12653 specially. Change code to enable use of stubs in ARM branches.
12654
43d12afe
DK
126552009-11-10 Doug Kwan <dougkwan@google.com>
12656
12657 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
12658 in method declaration.
12659 (Target_arm::relocate_stub): New method declaration.
12660 (Target_arm::default_target): Change to return a pointer instead of
12661 a const reference.
12662 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
12663 Target_arm::default_target.
12664 (Arm_Relobj::do_relocate_sections): Remove options paramater in
12665 method definition.
12666 (Target_arm::relocate_section): Adjust view.
12667 (Target_arm::relocate_stub): New method definition.
12668
ac33a407
DK
126692009-11-10 Doug Kwan <dougkwan@google.com>
12670
12671 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
12672 a format warning.
12673 * incremental.cc (open_incremental_binary): Initialized local
12674 variables to avoid warnings.
12675 * object.cc (make_elf_object): Ditto.
12676 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
12677 a format warning.
e1df38aa 12678
88ee28e9
L
12679009-11-09 H.J. Lu <hongjiu.lu@intel.com>
12680
12681 PR gold/10930
12682 * testsuite/plugin_test.c: Include "config.h".
12683
2daedcd6
DK
126842009-11-09 Doug Kwan <dougkwan@google.com>
12685
12686 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
12687 (arm_symbol_value): Remove.
12688 (Arm_relocate_functions::arm_branch_common,
12689 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
12690 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
12691 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
12692 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
12693 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
12694 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
12695 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
12696 Arm_relocate_functions::thm_mobw_abs_nc,
12697 Arm_relocate_functions::thm_mov_abs,
12698 Arm_relocate_functions::movw_prel_nc,
12699 Arm_relocate_functions::thm_movt_abs,
12700 Arm_relocate_functions::movt_prel,
12701 Arm_relocate_functions::thm_movw_prel_nc,
12702 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
12703 (Target_arm::Relocate::relocate): Only decompose address into two
12704 parts if relocation type uses the thumb-bit and pass the actual
12705 bit instead of a flag indicating that the thumb-bit is used. Adjust
12706 calls to methods in Arm_relocate_functions for this change.
12707
1276bc89 127082009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
12709
12710 PR 10925
12711 * reloc.cc: Instantiate
12712 Sized_relobj::initialize_input_to_output_maps and
12713 Sized_relobj:free_input_to_output_maps.
12714
e53ad1b5
ILT
127152009-11-06 Ian Lance Taylor <iant@google.com>
12716
12717 PR 10876
12718 * defstd.cc (in_segment): Set only_if_ref true for "end".
12719
eb44217c
DK
127202009-11-06 Doug Kwan <dougkwan@google.com>
12721
12722 * arm.cc (class Reloc_stub): Correct a comment.
12723 (Target_arm::Target_arm): Initialize arm_input_section_map_.
12724 (Target_arm::scan_section_for_stubs): New method declaration.
12725 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
12726 Change methods from private to protected.
12727 (Target_arm::do_may_relax): New method definition.
12728 (Target_arm::do_relax, Target_arm::group_sections,
12729 Target_arm::scan_reloc_for_stub,
12730 Target_arm::scan_reloc_section_for_stubs): New method declarations.
12731 (Target_arm::arm_input_section_map_): New data member declaration.
12732 (Target_arm::scan_reloc_for_stub,
12733 Target_arm::scan_reloc_section_for_stubs,
12734 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
12735 Target_arm::do_relax): New method definitions.
12736
5d329b7d
ILT
127372009-11-06 Mikolaj Zalewski <mikolaj@google.com>
12738
12739 * configure.ac: Check for (struct stat)::st_mtim
12740 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
12741 * config.in: Regenerate.
12742 * configure: Regenerate.
12743
96a0d71b
ILT
127442009-11-05 Ian Lance Taylor <iant@google.com>
12745
12746 PR 10910
12747 * output.cc (Output_segment::add_output_section): Add missing
12748 return statement.
12749
594c8e5e
ILT
127502009-11-04 Ian Lance Taylor <iant@google.com>
12751
12752 PR 10880
12753 * object.h (class Object): Add is_needed and set_is_needed
12754 methods. Add is_needed_ field. Make bool fields into bitfields.
12755 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
12756 defined in a dynamic object and referenced by a regular object,
12757 set is_needed for the dynamic object.
12758 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
12759 if the file is marked with as_needed and it is not needed.
12760
22b127cc
ILT
127612009-11-04 Ian Lance Taylor <iant@google.com>
12762
12763 PR 10887
12764 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
12765 tags if data is discarded by linker script.
12766 * i386.cc (Target_i386::do_finalize_sections): Likewise.
12767 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
12768 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
12769 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
12770
f5c870d2
ILT
127712009-11-04 Ian Lance Taylor <iant@google.com>
12772
12773 * layout.cc (Layout::get_output_section): Add is_interp and
12774 is_dynamic_linker_section parameters. Change all callers.
12775 (Layout::choose_output_section): Likewise.
12776 (Layout::make_output_section): Likewise.
12777 (Layout::add_output_section_data): Add is_dynamic_linker_section
12778 parameter. Change all callers.
12779 * layout.h (class Layout): Update declarations.
12780 * output.h (class Output_section): Add is_interp, set_is_interp,
12781 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
12782 Add is_interp_, is_dynamic_linker_section_ fields. Change
12783 generate_code_fills_at_write_ to a bitfield.
12784 * output.cc (Output_section::Output_sections): Initialize new
12785 fields.
12786 (Output_segment::add_output_section): Add do_sort parameter.
12787 Change all callers.
12788
1ae4d23b
ILT
127892009-11-03 Ian Lance Taylor <iant@google.com>
12790
12791 PR 10860
12792 * options.h (class General_options): Add --warn-common.
12793 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
12794 merging two common symbols.
12795 (Symbol_table::should_override): Handle --warn-common when merging
12796 a common symbol with a defined symbol. Use report_resolve_problem
12797 for multiple definitions.
12798 (Symbol_table::report_resolve_problem): New function.
12799 * symtab.h (class Symbol_table): Declare report_resolve_problem.
12800
55da9579
DK
128012009-11-03 Doug Kwan <dougkwan@google.com>
12802
12803 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
12804 stub_factory_.
12805 (Target_arm::stub_factory): New method definition.
12806 (Target_arm::new_arm_input_section,
12807 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
12808 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 12809 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
12810 New type definitions.
12811 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
12812 member declarations.
12813 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
12814 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
12815 New method definitions.
12816
37a9ac43
ILT
128172009-11-03 Ian Lance Taylor <iant@google.com>
12818
12819 * options.h (class General_options): Add --warn_constructors.
12820
b3d6a3d4
ILT
128212009-11-03 Ian Lance Taylor <iant@google.com>
12822
12823 PR 10893
12824 * defstd.cc (in_section): Add entries for __rel_iplt_start,
12825 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
12826
934b01dd
ILT
128272009-11-03 Ian Lance Taylor <iant@google.com>
12828
12829 PR 10895
12830 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
12831 --msgid-bugs-address.
12832 (install-pdf): New target.
12833 (install-data_yes): Look up one directory to find mkinstalldirs.
12834
03c1939b
L
128352009-11-03 H.J. Lu <hongjiu.lu@intel.com>
12836
12837 * po/Make-in (.po.gmo): Don't generate .gmo files in source
12838 tree.
12839
ebd95253
DK
128402009-10-30 Doug Kwan <dougkwan@google.com>
12841
12842 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
12843
e9bbb538
DK
128442009-10-30 Doug Kwan <dougkwan@google.com>
12845
12846 * arm.cc (Stub_addend_reader): New struct template definition
12847 and partial specializations.
12848 (Stub_addend_reader::operator()): New method definition for a
12849 partially specialized template.
12850
d5b40221
DK
128512009-10-30 Doug Kwan <dougkwan@google.com>
12852
12853 * arm.cc (Arm_relobj::processor_specific_flags): New method
12854 definition.
12855 (Arm_relobj::do_read_symbols): New method declaration.
12856 (Arm_relobj::processor_specific_flags_): New data member declaration.
12857 (Arm_dynobj): New class definition.
12858 (Target_arm::do_finalize_sections): Add input_objects parameter.
12859 (Target_arm::do_adjust_elf_header): New method declaration.
12860 (Target_arm::are_eabi_versions_compatible,
12861 (Target_arm::merge_processor_specific_flags): New method declaration.
12862 (Target_arm::do_make_elf_object): New overloaded method definitions
12863 and declaration.
12864 (Arm_relobj::do_read_symbols): New method definition.
12865 (Arm_dynobj::do_read_symbols): Ditto.
12866 (Target_arm::do_finalize_sections): Add input_objects parameters.
12867 Merge processor-specific flags from all input objects.
12868 (Target_arm::are_eabi_versions_compatible,
12869 Target_arm::merge_processor_specific_flags,
12870 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
12871 New method definitions.
12872 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
12873 Input_objects pointer type parameter.
12874 * layout.cc (Layout::finalize): Pass input objects to target's.
12875 finalize_sections function.
12876 * output.cc (Output_file_header::do_sized_write): Set ELF file
12877 header's processor-specific flags.
12878 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
12879 Input_objects pointer type parameter.
12880 * sparc.cc (Target_sparc::do_finalize_sections): Same.
12881 * target.h (Input_objects): New forward class declaration.
12882 (Target::processor_specific_flags,
12883 Target::are_processor_specific_flags_sect): New method definitions.
12884 (Target::finalize_sections): Add input_objects parameter.
12885 (Target::Target): Initialize processor_specific_flags_ and
12886 are_processor_specific_flags_set_.
12887 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
12888 parameter.
12889 (Target::set_processor_specific_flags): New method definition.
12890 (Target::processor_specific_flags_,
12891 Target::are_processor_specific_flags_set_): New data member
12892 declarations.
12893 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
12894 Input_objects pointer type parameter.
12895
ebabffbd
DK
128962009-10-30 Doug Kwan <dougkwan@google.com>
12897
12898 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
12899
ad0f2072
ILT
129002009-10-28 Ian Lance Taylor <iant@google.com>
12901
12902 * object.h (class Relobj): Drop options parameter from
12903 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
12904 do_scan_relocs, do_relocate. Change all callers.
12905 (class Sized_relobj): Drop options parameters from
12906 do_gc_process_relocs, do_scan_relocs, do_relocate,
12907 do_relocate_sections, relocate_sections, emit_relocs_scan,
12908 emit_relocs_scan_reltype. Change all callers.
12909 (struct Relocate_info): Remove options field and all references to
12910 it.
12911 * reloc.h (class Read_relocs): Remove options constructor
12912 parameter and options_ field. Change all callers.
12913 (class Gc_process_relocs, class Scan_relocs): Likewise.
12914 (class Relocate_task): Likewise.
12915 * target-reloc.h (scan_relocs): Remove options parameter. Change
12916 all callers.
12917 (scan_relocatable_relocs): Likewise.
12918 * target.h (class Sized_target): Remove options parameter from
12919 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
12920 all callers.
12921 * gc.h (gc_process_relocs): Remove options parameter. Change all
12922 callers.
12923 * arm.cc: Update functions to remove options parameters.
12924 * i386.cc: Likewise.
12925 * powerpc.cc: Likewise.
12926 * sparc.cc: Likewise.
12927 * x86_64.cc: Likewise.
12928 * testsuite/testfile.cc: Likewise.
12929
8ffa3667
DK
129302009-10-28 Doug Kwan <dougkwan@google.com>
12931
12932 * arm.cc (Arm_relobj): New class definition.
e1df38aa 12933 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
12934 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
12935 New method definitions.
12936
40f36857
CC
129372009-10-28 Cary Coutant <ccoutant@google.com>
12938
12939 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
12940 (Plugin::cleanup_done_): New member.
12941 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
12942 (Plugin_manager::cleanup_done_): Remove.
12943 (Plugin_manager::add_input_file): Edit error message.
12944 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
12945 (Plugin_manager::cleanup): Remove use of cleanup_done_.
12946
2c849493
ILT
129472009-10-27 Mikolaj Zalewski <mikolajz@google.com>
12948
12949 * fileread.cc: (File_read::View::~View): Use the new
12950 data_ownership_ filed.
12951 (File_read::~File_read): Dispose the new whole_file_view_.
12952 (File_read::open): Mmap the whole file if needed.
12953 (File_read::open): Use whole_file_view_ instead of contents_.
12954 (File_read::find_view): Use whole_file_view_ if applicable.
12955 (File_read::do_read): Use whole_file_view_ instead of contents_.
12956 (File_read::make_view): Use whole_file_view_ instead of contents_,
12957 update File_read::View::View call.
12958 (File_read::find_or_make_view): Update File_read::View::View
12959 call.
12960 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
12961 remove contents_
12962 (File_read::View::Data_ownership): New enum.
12963 (File_read::View::View): Replace bool mapped_ with Data_ownership
12964 argument.
12965 (File_read::View::mapped_): Remove (replaced by data_ownership_).
12966 (File_read::View::data_ownership_): New field.
12967 (File_read::contents_): Remove (replaced by whole_file_view_).
12968 (File_read::whole_file_view_): New field.
12969 * options.h (class General_options): Add --keep-files-mapped.
12970
24998053
CC
129712009-10-27 Cary Coutant <ccoutant@google.com>
12972
12973 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
12974 * testsuite/Makefile.am (plugin_test_5): New test case.
12975 * testsuite/Makefile.in: Regenerate.
12976
72adc4fa
DK
129772009-10-25 Doug Kwan <dougkwan@google.com>
12978
12979 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
12980 from private to protected to allow access by child class.
12981 (Sized_relobj::do_relocate_sections): New method declaration.
12982 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 12983 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
12984 Sized_relobj::relocate_sections. Instantiate template explicitly
12985 for different target sizes and endianity.
12986
07f508a2
DK
129872009-10-24 Doug Kwan <dougkwan@google.com>
12988
12989 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
12990 (Arm_input_section::as_arm_input_section): New method.
12991 (Arm_output_section): New class definition.
12992 (Arm_output_section::create_stub_group,
12993 Arm_output_section::group_sections): New method definitions.
12994
10ad9fe5
DK
129952009-10-22 Doug Kwan <dougkwan@google.com>
12996
12997 * arm.cc (Arm_input_section): New class definition.
12998 (Arm_input_section::init, Arm_input_section:do_write,
12999 Arm_input_section::set_final_data_size,
13000 Arm_input_section::do_reset_address_and_file_offset): New method
13001 definitions.
13002
56ee5e00
DK
130032009-10-21 Doug Kwan <dougkwan@google.com>
13004
13005 * arm.cc (Stub_table, Arm_input_section): New forward class
13006 declarations.
13007 (Stub_table): New class defintion.
13008 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
13009 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
13010 New method definition.
13011
b569affa
DK
130122009-10-21 Doug Kwan <dougkwan@google.com>
13013
13014 * arm.cc: Update copyright comments.
13015 (Target_arm): New forward class template declaration.
13016 (Arm_address): New type.
13017 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
13018 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
13019 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
13020 constants.
13021 (Insn_template): Same.
13022 (DEF_STUBS): New macro.
13023 (Stub_type): New enum type.
13024 (Stub_template): New class definition.
13025 (Stub): Same.
13026 (Reloc_stub): Same.
13027 (Stub_factory): Same.
13028 (Target_arm::Target_arm): Initialize may_use_blx_ and
13029 should_force_pic_veneer_.
13030 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
13031 Target_arm::should_force_pic_veneer,
13032 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
13033 Target_arm::using_thumb_only, Target_arm:;default_target): New
13034 method defintions.
13035 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
13036 New data member declarations.
13037 (Insn_template::size, Insn_template::alignment): New method defintions.
13038 (Stub_template::Stub_template): New method definition.
13039 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
13040 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
13041 (Stub_factory::Stub_factory): New method definition.
13042 * gold.h (string_hash): New template.
13043 * output.h (Input_section_specifier::hash_value): Use
13044 gold::string_hash.
13045 (Input_section_specifier::string_hash): Remove.
13046 * stringpool.cc (Stringpool_template::string_hash): Use
13047 gold::string_hash.
13048
6c172549
DK
130492009-10-20 Doug Kwan <dougkwan@google.com>
13050
13051 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
13052 symbols of relaxed input sections.
13053 * output.h (Output_section::find_relaxed_input_section): Make
13054 method public.
13055
c5617f2f
DK
130562009-10-16 Doug Kwan <dougkwan@google.com>
13057
13058 * dynobj.cc (Versions::Versions): Initialize version_script_.
13059 Only insert base version symbol definition for a shared object
13060 if version script defines any version versions.
13061 (Versions::define_base_version): New method definition.
13062 (Versions::add_def): Check that base version is not needed.
13063 (Versions::add_need): Define base version lazily.
13064 * dynobj.h (Versions::define_base_version): New method declaration.
13065 (Versions::needs_base_version_): New data member declaration.
13066 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
13067 (check_DATA): Add no_version_test.stdout.
13068 (libno_version_test.so, no_version_test.o no_version_test.stdout):
13069 New make rules.
13070 * testsuite/Makefile.in: Regenerate.
13071 * testsuite/no_version_test.c: New file.
13072 * testsuite/no_version_test.sh: Ditto.
13073
3c12dcdb
DK
130742009-10-16 Doug Kwan <dougkwan@google.com>
13075
13076 * expression.cc (class Segment_start_expression): New class definition.
13077 (Segment_start_expression::value): New method definition.
13078 (script_exp_function_segment_start): Return a new
13079 Segment_start_expression.
13080 * gold/script-c.h (script_saw_segment_start_expression): New function
13081 prototype.
13082 * script-sections.cc (Script_sections::Script_sections): Initialize
13083 SAW_SEGMENT_START_EXPRESSION_ to false.
13084 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
13085 and -Tbbs options to specify section addresses if given in
13086 command line and no SEGMENT_START expression is seen in a script.
13087 * script-sections.h (Script_sections::saw_segment_start_expression,
13088 Script_sections::set_saw_segment_start_expression): New method
13089 definition.
13090 (Script_sections::saw_segment_start_expression_): New data member
13091 declaration.
13092 * script.cc (script_saw_segment_start_expression): New function.
13093 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
13094 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
13095 script_test_7.sh and script_test_8.sh.
13096 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
13097 script_test_8.stdout.
13098 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
13099 (script_test_6, script_test_6.stdout, script_test_7,
13100 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
13101 * Makefile.in: Regenerate.
13102 * testsuite/script_test_6.sh: New file.
13103 * testsuite/script_test_6.t: Same.
13104 * testsuite/script_test_7.sh: Same.
13105 * testsuite/script_test_7.t: Same.
13106 * testsuite/script_test_8.sh: Same.
13107
64b1ae37
DK
131082009-10-16 Doug Kwan <dougkwan@google.com>
13109
13110 * output.cc (Output_segment::set_section_list_address): Cast
13111 expressions to unsigned long long type to avoid format warnings.
13112
661be1e2
ILT
131132009-10-15 Ian Lance Taylor <iant@google.com>
13114
12edd763 13115 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 13116 dot assignment to script_sections_.
12edd763
ILT
13117 * script-sections.cc (Script_sections::add_dot_assignment):
13118 Initialize if necessary.
13119
68b6574b
ILT
13120 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
13121 program headers with no load segment if there is a linker script.
13122
661be1e2
ILT
13123 * layout.cc (Layout::set_segment_offsets): Align the file offset
13124 to the segment aligment for -N or -n with no load segment.
13125 * output.cc (Output_segment::add_output_section): Don't crash if
13126 the first section is a TLS section.
13127 (Output_segment::set_section_list_addresses): Print an error
13128 message if the address moves backward in a linker script.
13129 * script-sections.cc
13130 (Output_section_element_input::set_section_addresses): Don't
13131 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
13132 (Orphan_output_section::set_section_addresses): Likewise.
13133
f15f61a7
DK
131342009-10-15 Doug Kwan <dougkwan@google.com>
13135
13136 * layout.cc (Layout::finish_dynamic_section): Generate tags
13137 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
13138 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
13139 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
13140
82bb573a
ILT
131412009-10-14 Ian Lance Taylor <iant@google.com>
13142
13143 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
13144 fields.
13145 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
13146 data_shdr fields of relinfo.
13147 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
13148 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
13149 R_386_TLS_LDO_32, adjust based on section flags.
13150 (Target_i386::Relocate::fix_up_ldo): Remove.
13151
374ad285
ILT
131522009-10-13 Ian Lance Taylor <iant@google.com>
13153
13154 Add support for -pie.
13155 * options.h (class General_options): Add -pie and
13156 --pic-executable.
13157 (General_options::output_is_position_independent): Test -pie.
13158 (General_options::output_is_executable): Return true if not shared
13159 and not relocatable.
13160 (General_options::output_is_pie): Remove.
13161 * options.cc (General_options::finalize): Reject incompatible uses
13162 of -pie.
13163 * gold.cc (queue_middle_tasks): A -pie link is not static.
13164 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
13165 * symtab.cc (Symbol::final_value_is_known): Return false if
13166 output_is_position_independent.
13167 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
13168 output_is_position_independent.
13169 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
13170 output_is_position_independent.
13171 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
13172 output_is_position_independent.
13173 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
13174 two_file_pie_test.
13175 (basic_pie_test.o, basic_pie_test): New targets.
13176 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
13177 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
13178 (two_file_pie_test): New target.
13179 * testsuite/Makefile.in: Rebuild.
13180 * README: Remove note saying that -pie is not supported.
13181
c6585162
ILT
131822009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
13183
13184 * options.h (class General_options): Add -init and -fini.
13185 * layout.cc (Layout::finish_dynamic_section): Emit
13186 given init and fini functions.
13187
032ce4e9
ST
131882009-10-13 Sriraman Tallam <tmsriram@google.com>
13189
13190 * gc.h (gc_process_relocs): Check if icf is enabled using new
13191 function.
13192 * gold.cc (queue_initial_tasks): Likewise.
13193 (queue_middle_tasks): Likewise.
13194 * object.cc (do_layout): Likewise.
13195 * symtab.cc (is_section_folded): Likewise.
13196 * main.cc (main): Likewise.
13197 * reloc.cc (Read_relocs::run): Likewise.
13198 (Sized_relobj::do_scan_relocs): Likewise.
13199 * icf.cc (is_function_ctor_or_dtor): New function.
13200 (Icf::find_identical_sections): Check if function is ctor or dtor when
13201 safe icf is chosen.
13202 * options.h (General_options::icf): Change option to be an enum.
13203 (Icf_status): New enum.
13204 (icf_enabled): New method.
13205 (icf_safe_folding): New method.
13206 (set_icf_status): New method.
13207 (icf_status_): New variable.
13208 * (options.cc) (General_options::finalize): Set icf_status_.
13209 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
13210 icf_test and icf_keep_unique_test to use the --icf enum flag.
13211 * testsuite/icf_safe_test.sh: New file.
e1df38aa 13212 * testsuite/icf_safe_test.cc: New file.
032ce4e9 13213
f345227a
ST
132142009-10-12 Sriraman Tallam <tmsriram@google.com>
13215
13216 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
13217 includes to gc.h and icf.h.
13218 * arm.cc: Include gc.h.
13219 * gold.cc: Likewise.
13220 * i386.cc: Likewise.
13221 * powerpc.cc: Likewise.
13222 * sparc.cc: Likewise.
13223 * x86_64.cc: Likewise.
13224 * gc.h: Include icf.h.
13225
1c7814ed
ILT
132262009-10-11 Ian Lance Taylor <iant@google.com>
13227
13228 * plugin.cc: Include "gold.h" before other header files.
13229
ae3b5189
CD
132302009-10-10 Chris Demetriou <cgd@google.com>
13231
13232 * options.h (Input_file_argument::Input_file_type): New enum.
13233 (Input_file_argument::is_lib_): Replace with...
13234 (Input_file_argument::type_): New member.
13235 (Input_file_argument::Input_file_argument): Take Input_file_type
13236 'type' rather than boolean 'is_lib' as second argument.
13237 (Input_file_argument::is_lib): Use type_.
13238 (Input_file_argument::is_searched_file): New function.
13239 (Input_file_argument::may_need_search): Handle is_searched_file.
13240 * options.cc (General_options::parse_library): Support -l:filename.
13241 (General_options::parse_just_symbols): Update for Input_file_argument
13242 changes.
13243 (Command_line::process): Likewise.
13244 * archive.cc (Archive::get_file_and_offset): Likewise.
13245 * plugin.cc (Plugin_manager::release_input_file): Likewise.
13246 * script.cc (read_script_file, script_add_file): Likewise.
13247 * fileread.cc (Input_file::Input_file): Likewise.
13248 (Input_file::will_search_for): Handle is_searched_file.
13249 (Input_file::open): Likewise.
13250 * readsyms.cc (Read_symbols::get_name): Likewise.
13251 * testsuite/Makefile.am (searched_file_test): New test.
13252 * testsuite/Makefile.in: Regenerate.
13253 * testsuite/searched_file_test.cc: New file.
13254 * testsuite/searched_file_test_lib.cc: New file.
13255
f3048a1d
ILT
132562009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13257 Ian Lance Taylor <iant@google.com>
13258
13259 * descriptor.cc: Include <cstdio> and "binary-io.h".
13260 (Descriptors::open): Open the files in binary mode always.
13261 * script.cc (Lex::get_token): Treat \r as whitespace.
13262
d4780e57
ILT
132632009-10-09 Ian Lance Taylor <iant@google.com>
13264
13265 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
13266
d9a893b8
ILT
132672009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13268 Ian Lance Taylor <iant@google.com>
13269
13270 * configure.ac: Check for readv function also.
13271 * fileread.cc (readv): Define if not HAVE_READV.
13272 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
13273 does not exist.
13274 * config.in: Regenerate.
13275 * configure: Regenerate.
13276
c0a62865
DK
132772009-10-09 Doug Kwan <dougkwan@google.com>
13278
13279 * layout.cc (Layout::make_output_section): Call target hook to make
13280 ordinary output section.
13281 (Layout::finalize): Adjust parameter list of call the
13282 Target::may_relax().
13283 * layout.h (class Layout::section_list): New method.
13284 * merge.h (Output_merge_base::entsize): Change visibility to public.
13285 (Output_merge_base::is_string, Output_merge_base::do_is_string):
13286 New methods.
13287 (Output_merge_string::do_is_string): New method.
13288 * object.cc (Sized_relobj::do_setup): renamed from
13289 Sized_relobj::set_up.
13290 * object.h (Sized_relobj::adjust_shndx,
13291 Sized_relobj::initializ_input_to_output_maps,
13292 Sized_relobj::free_input_to_output_maps): Change visibilities to
13293 protected.
13294 (Sized_relobj::setup): Virtualize.
13295 (Sized_relobj::do_setup): New method declaration.
13296 (Sized_relobj::invalidate_section_offset,
13297 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
13298 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
13299 * options.cc (parse_int): New function.
13300 * options.h (parse_int): New declaration.
13301 (DEFINE_int): New macro.
13302 (stub_group_size): New option.
13303 * output.cc (Output_section::Output_section): Initialize memebers
13304 merge_section_map_, merge_section_by_properties_map_,
13305 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
13306 (Output_section::add_input_section): Handled deferred code-fill
13307 generation and remove an old comment.
13308 (Output_section::add_relaxed_input_section): New method definition.
13309 (Output_section::add_merge_input_section): Use merge section by
13310 properties map to speed to search. Update merge section maps
13311 as appropriate.
13312 (Output_section::build_relaxation_map): New method definition.
13313 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
13314 Same.
13315 (Output_section::relax_input_section): Renamed to
13316 Output_section::convert_input_sections_to_relaxed_sections and change
13317 interface to take a vector of pointers to relaxed sections.
13318 (Output_section::find_merge_section,
13319 Output_section::find_relaxed_input_section): New method definitions.
13320 (Output_section::is_input_address_mapped,
13321 Output_section::output_offset, Output_section::output_address):
13322 Use output section data maps to speed up searching.
13323 (Output_section::find_starting_output_address): Add comments.
13324 (Output_section::do_write,
13325 Output_section::write_to_postprocessing_buffer): Do code-fill
13326 generation as appropriate.
13327 (Output_section::get_input_sections): Invalidate relaxed input section
13328 map.
13329 (Output_section::restore_states): Adjust type of checkpoint .
13330 Invalidate relaxed input section map.
13331 * output.h (Output_merge_base): New class declaration.
13332 (Input_section_specifier): New class defintion.
13333 (class Output_relaxed_input_section) Change base class to
13334 Output_section_data_build.
13335 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
13336 base class initializer.
13337 (Output_section::add_relaxed_input_section): New method declaration.
13338 (Output_section::Input_section): Change visibility to protected.
2e702c99 13339 (Output_section::Input_section::relobj,
c0a62865
DK
13340 Output_section::Input_section::shndx): Handle relaxed input sections.
13341 Output_section::input_sections) Change visibility to protected. Also
13342 define overload to return a non-const pointer.
13343 (Output_section::Merge_section_properties): New class defintion.
13344 (Output_section::Merge_section_by_properties_map,
13345 Output_section::Output_section_data_by_input_section_map,
13346 Output_section::Relaxation_map): New types.
13347 (Output_section::relax_input_section): Rename method to
13348 Output_section::convert_input_sections_to_relaxed_sections and change
13349 interface to take a vector of relaxed section pointers.
13350 (Output_section::find_merge_section,
13351 Output_section::find_relaxed_input_section,
13352 Output_section::build_relaxation_map,
13353 Output_section::convert_input_sections_in_list_to_relaxed_sections):
13354 New method declarations.
13355 (Output_section::merge_section_map_
13356 Output_section::merge_section_by_properties_map_,
13357 Output_section::relaxed_input_section_map_,
13358 Output_section::is_relaxed_input_section_map_valid_,
13359 Output_section::generate_code_fills_at_write_): New data members.
13360 * script-sections.cc
13361 (Output_section_element_input::set_section_addresses): Call
13362 current_data_size and addralign methods of relaxed input sections.
13363 (Orphan_output_section::set_section_addresses): Call current_data_size
13364 and addralign methods of relaxed input sections.
13365 * symtab.cc (Symbol_table::compute_final_value): Extract template
13366 from the body of Symbol_table::sized_finalize_symbol.
13367 (Symbol_table::sized_finalized_symbol): Call
13368 Symbol_table::compute_final_value.
13369 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
13370 (Symbol_table::compute_final_value): New templated method declaration.
13371 * target.cc (Target::do_make_output_section): New method defintion.
13372 * target.h (Target::make_output_section): New method declaration.
13373 (Target::relax): Add more parameters for input objects, symbol table
13374 and layout. Adjust call to do_relax.
13375 (Target::do_make_output_section): New method declaration.
13376 (Target::do_relax): Add parameters for input objects, symbol table
13377 and layout.
13378
d446d6c4
ILT
133792009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13380
13381 * pread.c: Include stdio.h.
13382
bc06c745
ILT
133832009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13384
13385 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
13386 defined.
13387
75aea3d0
ILT
133882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
13389
13390 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
13391 Change read_shndx type to unsigned int.
13392 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13393 int.
13394 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13395 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
13396 Change read_shndx type to unsigned int.
13397 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
13398 int.
13399 (Sized_dwarf_line_info::read_line_mappings): Likewise.
13400 * layout.cc (Layout::create_symtab_sections): Cast the result of
13401 local_symcount * symsize to off_t in the gold_assert.
13402
be8fcb75
ILT
134032009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13404
13405 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
13406 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
13407 R_ARM_BASE_ABS.
13408 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
13409 (Arm_relocate_functions::thm_abs5): New function.
13410 (Arm_relocate_functions::abs12): New function.
13411 (Arm_relocate_functions::abs16): New function.
13412 (Arm_relocate_functions::base_abs): New function.
13413 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
13414 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
13415 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
13416 R_ARM_BASE_ABS.
13417 (Scan::global): Likewise.
13418 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
13419 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
13420 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
13421 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
13422 R_ARM_BASE_ABS.
13423
c2a122b6
ILT
134242009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13425
13426 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
13427 (Arm_relocate_functions::movt_prel): New function.
13428 (Arm_relocate_functions::thm_movw_prel_nc): New function.
13429 (Arm_relocate_functions::thm_movt_prel): New function.
13430 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
13431 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
13432 (Scan::global, Relocate::relocate): Likewise.
13433 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13434
c4aa1e2d
ILT
134352009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13436
13437 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
13438 Incremental_checker.
13439 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
13440 unsigned int.
13441 (class Incremental_inputs_header): New class.
13442 (Incremental_inputs_header_writer): Edit comment.
13443 (Incremental_inputs_entry): New class.
13444 (Incremental_inputs_entry_writer): Edit comment.
13445 (Sized_incremental_binary::do_find_incremental_inputs_section):
13446 Add *strtab_shndx parameter, fill it.
13447 (Sized_incremental_binary::do_check_inputs): New method.
13448 (Incremental_checker::can_incrementally_link_output_file): Use
13449 Sized_incremental_binary::check_inputs.
13450 (Incremental_inputs::report_command_line): Save command line in
13451 command_line_.
13452 * incremental.h:
13453 (Incremental_binary::find_incremental_inputs_section): New
13454 method.
13455 (Incremental_binary::do_find_incremental_inputs_section): Add
13456 strtab_shndx parameter.
13457 (Incremental_binary::do_check_inputs): New pure virtual method.
13458 (Sized_incremental_binary::do_check_inputs): Declare.
13459 (Incremental_checker::Incremental_checker): Add incremental_inputs
13460 parameter, use it to initialize incremental_inputs_.
13461 (Incremental_checker::incremental_inputs_): New field.
13462 (Incremental_checker::command_line): New method.
13463 (Incremental_checker::inputs): New method.
13464 (Incremental_checker::command_line_): New field.
13465
c549a694
ILT
134662009-10-09 Mikolaj Zalewski <mikolajz@google.com>
13467
13468 * incremental.cc: Include <cstdarg> and "target-select.h".
13469 (vexplain_no_incremental): New function.
13470 (explain_no_incremental): New function.
13471 (Incremental_binary::error): New method.
13472 (Sized_incremental_binary::do_find_incremental_inputs_section): New
13473 method.
13474 (make_sized_incremental_binary): New function.
13475 (open_incremental_binary): New function.
13476 (can_incrementally_link_file): Add checks if output is ELF and has
13477 inputs section.
13478 * incremental.h: Include "elfcpp_file.h" and "output.h".
13479 (Incremental_binary): New class.
13480 (Sized_incremental_binary): New class.
13481 (open_incremental_binary): Declare.
13482 * object.cc (is_elf_object): Use
13483 elfcpp::Elf_recognizer::is_elf_file.
13484 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
13485 * output.h (Output_file::filesize): New method.
13486
fd3c5f0b
ILT
134872009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13488
13489 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
13490 New function.
13491 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
13492 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
13493 function.
13494 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
13495 function.
13496 (Arm_relocate_functions::movw_abs_nc): New function.
13497 (Arm_relocate_functions::movt_abs): New function.
13498 (Arm_relocate_functions::thm_movw_abs_nc): New function.
13499 (Arm_relocate_functions::thm_movt_abs): New function.
13500 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
13501 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
13502 (Scan::global): Likewise.
13503 (Relocate::relocate): Likewise.
13504 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13505
7f5309a5
ILT
135062009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13507
13508 * arm.cc (Arm_relocate_functions::got_prel) New function.
13509 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
13510 (Relocate::relocate): Likewise.
13511 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
13512
364c7fa5
ILT
135132009-10-06 Ian Lance Taylor <iant@google.com>
13514
13515 * options.h (class General_options): Define
13516 split_stack_adjust_size parameter.
13517 * object.h (class Object): Add uses_split_stack_ and
13518 has_no_split_stack_ fields. Add uses_split_stack and
13519 has_no_split_stack accessor functions. Declare
13520 handle_split_stack_section.
13521 (class Reloc_symbol_changes): Define.
13522 (class Sized_relobj): Define Function_offsets. Declare
13523 split_stack_adjust, split_stack_adjust_reltype, and
13524 find_functions.
13525 * object.cc (Object::handle_split_stack_section): New function.
13526 (Sized_relobj::do_layout): Call handle_split_stack_section.
13527 * dynobj.cc (Sized_dynobj::do_layout): Call
13528 handle_split_stack_section.
13529 * reloc.cc (Sized_relobj::relocate_sections): Call
13530 split_stack_adjust for executable sections in split_stack
13531 objects. Pass reloc_map to relocate_section.
13532 (Sized_relobj::split_stack_adjust): New function.
13533 (Sized_relobj::split_stack_adjust_reltype): New function.
13534 (Sized_relobj::find_functions): New function.
13535 * target-reloc.h: Include "object.h".
13536 (relocate_section): Add reloc_symbol_changes parameter. Change
13537 all callers.
13538 * target.h (class Target): Add calls_non_split method. Declare
13539 do_calls_non_split virtual method. Declare match_view and
13540 set_view_to_nop.
13541 * target.cc: Include "elfcpp.h".
13542 (Target::do_calls_non_split): New function.
13543 (Target::match_view): New function.
13544 (Target::set_view_to_nop): New function.
13545 * gold.cc (queue_middle_tasks): Give an error if mixing
13546 split-stack and non-split-stack objects with -r.
13547 * i386.cc (Target_i386::relocate_section): Add
13548 reloc_symbol_changes parameter.
13549 (Target_i386::do_calls_non_split): New function.
13550 * x86_64.cc (Target_x86_64::relocate_section): Add
13551 reloc_symbol_changes parameter.
13552 (Target_x86_64::do_calls_non_split): New function.
13553 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
13554 parameter.
13555 * powerpc.cc (Target_powerpc::relocate_section): Add
13556 reloc_symbol_changes parameter.
13557 * sparc.cc (Target_sparc::relocate_section): Add
13558 reloc_symbol_changes parameter.
13559 * configure.ac: Call AM_CONDITIONAL for the default target.
13560 * configure: Rebuild.
13561 * testsuite/Makefile.am (TEST_AS): New variable.
13562 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
13563 (check_DATA): Add split_i386 and split_x86_64 files.
13564 (SPLIT_DEFSYMS): Define.
13565 (split_i386_[1234n].o): New targets.
13566 (split_i386_[124]): New targets.
13567 (split_i386_[1234r].stdout): New targets.
13568 (split_x86_64_[1234n].o): New targets.
13569 (split_x86_64_[124]): New targets.
13570 (split_x86_64_[1234r].stdout): New targets.
13571 (MOSTLYCLEANFILES): Add new executables.
13572 * testsuite/split_i386.sh: New file.
13573 * testsuite/split_x86_64.sh: New file.
13574 * testsuite/split_i386_1.s: New file.
13575 * testsuite/split_i386_2.s: New file.
13576 * testsuite/split_i386_3.s: New file.
13577 * testsuite/split_i386_4.s: New file.
13578 * testsuite/split_i386_n.s: New file.
13579 * testsuite/split_x86_64_1.s: New file.
13580 * testsuite/split_x86_64_2.s: New file.
13581 * testsuite/split_x86_64_3.s: New file.
13582 * testsuite/split_x86_64_4.s: New file.
13583 * testsuite/split_x86_64_n.s: New file.
13584 * testsuite/testfile.cc (Target_test): Update relocation_section
13585 function.
13586 * testsuite/Makefile.in: Rebuild.
13587
e8a9fcda
ILT
135882009-10-06 Ian Lance Taylor <iant@google.com>
13589
13590 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
13591 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
13592 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
13593 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
13594 the address on ldo_addrs_.
13595 (Target_i386::Relocate::fix_up_ldo): New function.
13596
e99daf92
ILT
135972009-10-06 Rafael Espindola <espindola@google.com>
13598
13599 * plugin.cc (add_input_library): New.
13600 (Plugin::load): Add add_input_library to tv.
13601 (Plugin_manager::add_input_file): Add the is_lib argument.
13602 (add_input_file): Update call to Plugin_manager::add_input_file.
13603 (add_input_library): New.
13604 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
13605
966d4097
DK
136062009-09-30 Doug Kwan <dougkwan@google.com>
13607
13608 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
13609 symbol and call Symbol::may_need_copy_reloc to determine if
13610 a copy reloc is needed.
13611 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
13612 nocopyreloc is given in command line.
13613 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
13614 given in command line.
13615 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
13616 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
13617 of the removed Target_i386::may_need_copy_reloc.
13618 * options.h (copyreloc): New option with default value false.
13619 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13620 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
13621 instead of the removed Target_powerpc::may_need_copy_reloc.
13622 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
13623 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
13624 instead of the removed Target_sparc::may_need_copy_reloc.
13625 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
13626 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
13627 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
13628 instead of the removed Target_x86_64::may_need_copy_reloc.
13629
029ba973
ILT
136302009-09-30 Ian Lance Taylor <iant@google.com>
13631
13632 * object.h (class Object): Remove target_ field, and target,
13633 sized_target, and set_target methods.
13634 (Object::sized_target): Remove.
13635 (class Sized_relobj): Update declarations. Remove sized_target.
13636 * object.cc (Sized_relobj::setup): Remove target parameter.
13637 Change all callers.
13638 (Input_objects::add_object): Don't do anything with the target.
13639 (make_elf_sized_object): Add punconfigured parameter. Change all
13640 callers. Set or test parameter target.
13641 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
13642 Change all callers.
13643 * parameters.cc (Parameters::set_target): Change parameter type to
13644 be non-const.
13645 (Parameters::default_target): Remove.
13646 (set_parameters_target): Change parameter type to be non-const.
13647 (parameters_force_valid_target): New function.
13648 (parameters_clear_target): New function.
13649 * parameters.h (class Parameters): Update declarations. Remove
13650 default_target method. Add sized_target and clear_target
13651 methods. Change target_ to be non-const.
13652 (set_parameters_target): Update declaration.
13653 (parameters_force_valid_target): Declare.
13654 (parameters_clear_target): Declare.
13655 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
13656 as NULL if we aren't searching.
13657 (Add_symbols::run): Don't check for compatible target.
13658 * fileread.cc (Input_file::open_binary): Call
13659 parameters_force_valid_target.
13660 * gold.cc (queue_middle_tasks): Likewise.
13661 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
13662 set_target on object.
13663 * dynobj.h (class Sized_dynobj): Update declarations.
13664 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
13665 make_elf_object returns NULL.
13666 (Archive::include_member): Don't check whether object target is
13667 compatible.
13668 * output.cc (Output_section::add_input_section): Get target from
13669 parameters.
13670 (Output_section::relax_input_section): Likewise.
13671 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
13672 parameters.
13673 (Sized_relobj::do_scan_relocs): Likewise.
13674 (Sized_relobj::relocate_sections): Likewise.
13675 * resolve.cc (Symbol_table::resolve): Likewise.
13676 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
13677 parameter. Change all callers.
13678 (Symbol_table::add_from_object): Get target from parameters.
13679 (Symbol_table::add_from_relobj): Don't check object target.
13680 (Symbol_table::add_from_dynobj): Likewise.
13681 (Symbol_table::define_special_symbol): Get target from
13682 parameters.
13683 * symtab.h (class Symbol_table): Update declaration.
13684 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
13685 parameter. Change all callers. Clear parameter target.
13686 (Binary_test): Test target here.
13687 * testsuite/object_unittest.cc (gold_testsuite): Remove
13688 target_test_pointer parameter. Change all callers.
13689 (Object_test): Test target here.
13690
a6a22b83
ILT
136912009-09-26 Ian Lance Taylor <iant@google.com>
13692
13693 * testsuite/initpri1.c: Don't try to use constructor priorities if
13694 compiling with gcc before 4.3.
13695
6a8f49fe
ILT
136962009-09-22 Mikolaj Zalewski <mikolajz@google.com>
13697
13698 * testsuite/retain_symbols_file_test.sh (check_present): Change
13699 output file name to retain_symbols_file_test.stdout.
13700 (check_absent): Likewise.
13701
8c604651
CS
137022009-09-18 Craig Silverstein <csilvers@google.com>
13703
13704 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
13705 * options.cc: Include <cerrno> and <fstream>.
13706 (General_options::finalize): Parse -retain-symbols-file tag.
13707 * options.h: New flag.
13708 (General_options): New method should_retain_symbol, new
13709 variable symbols_to_retain.
13710 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
13711 should_retain_symbol map.
13712 * testsuite/Makefile.am (retain_symbols_file_test): New test.
13713 * testsuite/Makefile.in: Regenerate.
13714 * testsuite/retain_symbols_file_test.sh: New file.
13715
ca58b19f
NC
137162009-09-18 Nick Clifton <nickc@redhat.com>
13717
13718 * po/es.po: Updated Spanish translation.
13719
20e6d0d6
DK
137202009-09-17 Doug Kwan <dougkwan@google.com>
13721
13722 * debug.h (DEBUG_RELAXATION): New constant.
13723 (DEBUG_ALL): Add DEBUG_RELAXATION.
13724 (debug_string_to_enum): Add relaxation debug option.
13725 * layout.cc
13726 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
13727 Layout::Relaxation_debug_check::read_sections,
13728 Layout::Relaxation_debug_check::read_sections): New method definitions.
13729 (Layout::Layout): Initialize data members
13730 record_output_section_data_from_scrips_,
13731 script_output_section_data_list_ and relaxation_debug_check_.
13732 (Layout::save_segments, Layout::restore_segments,
13733 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13734 Layout::relaxation_loop_body): New method definitions.
13735 (Layout::finalize): Support relaxation. Move section layout code to
13736 Layout::relaxation_loop_body.
13737 (Layout::set_asection_address_from_script): Move code for orphan
13738 section placement out.
13739 (Layout::place_orphan_sections_in_script): New method definition.
13740 * layout.h (Output_segment_headers, Output_file_header):
13741 New forward class declarations.
13742 (Layout::~Layout): Define.
13743 (Layout::new_output_section_data_from_script): New method definition.
13744 (Layout::place_orphan_sections_in_script): New method declaration.
13745 (Layout::Segment_states): New type declaration.
13746 (Layout::save_segments, Layout::restore_segments,
13747 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
13748 Layout::relaxation_loop_body): New method declarations.
13749 (Layout::Output_section_data_list): New type declaration.
13750 (Layout::Relaxation_debug_check): New class definition.
13751 (Layout::record_output_section_data_from_script_,
13752 Layout::script_output_section_data_list_, Layout::segment_states_,
13753 Layout::relaxation_debug_check_): New data members.
13754 * output.cc: (Output_section_headers::do_size): New method definition.
13755 (Output_section_headers::Output_section_headers): Move size
13756 computation to Output_section_headers::do_size.
13757 (Output_segment_headers::do_size): New method definition.
e1df38aa 13758 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
13759 Output_file_header::do_size and call it.
13760 (Output_file_header::do_size): New method definition.
13761 (Output_data_group::Output_data_group): Adjust call to
13762 Output_section_data.
13763 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
13764 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 13765 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
13766 RELAXED_INPUT_SECTION_CODE.
13767 (Output_section::Output_section): Initialize data member checkpoint_.
13768 (Output_section::~Output_section): Delete checkpoint object pointed
13769 by checkpoint_.
13770 (Output_section::add_input_section): Always add an Input_section if
13771 relaxing.
13772 (Output_section::add_merge_input_section): Add assert.
13773 (Output_section::relax_input_section): New method definition.
13774 (Output_section::set_final_data_size): Set load address to zero for
13775 an unallocated section.
13776 (Output_section::do_address_and_file_offset_have_reset_values):
13777 New method definition.
13778 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
13779 Handle relaxed input section.
13780 (Output_section::sort_attached_input_sections): Checkpoint input
13781 section list lazily.
13782 (Output_section::get_input_sections): Change type of input_sections to
13783 list of Simple_input_section pointers. Checkpoint input section list
13784 lazily. Also handle relaxed input sections.
13785 (Output_section::add_input_section_for_script): Take a reference to
13786 a Simple_input_section object instead of Relobj pointer and section
13787 index as parameter. Handle relaxed input sections.
13788 (Output_section::save_states, Output_section::restore_states): New
13789 method definitions.
13790 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
13791 (Output_data::is_data_size_fixed): New method definition.
13792 (Output_data::reset_addresss_and_file_offset): Do not reset data size
13793 if it is fixed.
13794 (Output_data::address_and_file_offset_have_reset_values): New method
13795 definition.
13796 (Output_data::do_address_and_file_offset_have_reset_values): New method
13797 definition.
13798 (Output_data::set_data_size): Check that data size is not fixed.
13799 (Output_data::fix_data_size): New method definition.
13800 (Output_data::is_data_size_fixed_): New data member.
13801 (Output_section_headers::set_final_data_size): New method definition.
13802 (Output_section_headers::do_size): New method declaration.
13803 (Output_segment_headers::set_final_data_size): New method definition.
13804 (Output_segment_headers::do_size): New method declaration.
13805 (Output_file_header::set_final_data_size)::New method definition.
13806 (Output_file_header::do_size)::New method declaration.
13807 (Output_section_data::Output_section_data): Add new parameter
13808 is_data_size_fixed and use it to fix data size.
13809 (Output_data_const::Output_data_const): Adjust call to base class
13810 constructor and fix data size.
13811 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
13812 base class constructor and fix data size.
13813 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
13814 base class constructor and fix data size.
13815 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
13816 class constructor and fix data size.
13817 (Output_data_group::set_final_data_size): New method definition.
13818 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
13819 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
13820 class constructor and fix data size.
13821 (Output_relaxed_input_section): New class definition.
13822 (Output_section::Simple_input_section): New class definition.
13823 (Output_section::get_input_sections): Adjust parameter list.
13824 (Output_section::add_input_section_for_script): Same.
13825 (Output_section::save_states, Output_section::restore_states,
13826 Output_section::do_address_and_file_offset_have_reset_values,
13827 (Output_section::Input_section::Input_section): Handle
13828 RELAXED_INPUT_SECTION_CODE. Add new overload for
13829 Output_relaxed_input_section.
13830 (Output_section::Input_section::is_input_section,
13831 Output_section::Input_section::set_output_section): Handle relaxed
13832 input section.
13833 (Output_section::Input_section::is_relaxed_input_section,
13834 Output_section::Input_section::output_section_data,
13835 Output_section::Input_section::relaxed_input_section): New method
13836 definitions.
13837 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
13838 value.
13839 (Output_section::Input_section::u1_): Update comments.
13840 (Output_section::Input_section::u2_): Add new union member poris.
13841 (Output_section::Checkpoint_output_section): New classs definition.
13842 (Output_section::relax_input_section): New method declaration.
13843 (Output_section::checkpoint_): New data member.
13844 (Output_segment): Update comments.
13845 (Output_segment::Output_segment): Un-privatize copy constructor.
13846 (Output_segment::operator=): Un-privatize.
13847 * script-sections.cc (Output_section_element::Input_section_list):
13848 Change element type to Output_section::Simple_input_section.
13849 (Output_section_element_dot_assignment::set_section_addresses):
13850 Register output section data for relaxation clean up.
13851 (Output_data_exression::Output_data_expression): Adjust call to base
13852 constructor to fix data size.
13853 (Output_section_element_data::set_section_addresses): Register
13854 Output_data_expression object for relaxation clean up.
13855 (struct Input_section_info): Replace Relobj pointer and section index
13856 pair with Output_section::Simple_input_section and Convert struct to a
13857 class.
13858 (Input_section_sorter::operator()): Adjust access to
e1df38aa 13859 Input_section_info data member to use accessors.
20e6d0d6
DK
13860 (Output_section_element_input::set_section_addresses): Use layout
13861 parameter. Adjust code to use Output_section::Simple_input_section
13862 and Input_secction_info classes. Register filler for relaxation
13863 clean up.
13864 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
13865 and section index pair with Output_section::Simple_input_section
13866 class. Adjust code accordingly.
13867 (Phdrs_element::release_segment): New method definition.
13868 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
13869 segment list.
13870 (Script_sections::release_segments): New method definition.
13871 * gold/script-sections.h (Script_sections::release_segments): New
13872 method declaration.
13873 * gold/target.h (Target::may_relax, Target::relax,
13874 Target::do_may_relax, Target::do_relax): New method definitions.
13875
5e445df6
ILT
138762009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
13877
13878 * arm.cc (has_signed_unsigned_overflow): New function.
13879 (Arm_relocate_functions::abs8): New function.
13880 (Target_arm::Scan::local): Handle R_ARM_ABS8.
13881 (Target_arm::Scan::global): Likewise.
13882 (Target_arm::relocate::relocate): Likewise.
13883 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
13884 Likewise.
13885
8c604651 138862009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
13887
13888 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
13889 * testsuite/Makefile.in: Regenerate.
13890
1e9cc1c2
NC
138912009-09-11 Nick Clifton <nickc@redhat.com>
13892
13893 * po/gold.pot: Updated by the Translation project.
13894
6a89f575
CC
138952009-09-08 Cary Coutant <ccoutant@google.com>
13896
13897 * output.cc (Output_file::open): Add execute permission to empty file.
13898 * testsuite/Makefile.am (permission_test): New test.
13899 * testsuite/Makefile.in: Regenerate.
13900
fdcac5af
ILT
139012009-09-02 Ian Lance Taylor <iant@google.com>
13902
13903 * output.cc (Output_file::resize): Call map_no_anonymous rather
13904 than map.
13905
44453f85
ILT
139062009-09-01 Mikolaj Zalewski <mikolajz@google.com>
13907
13908 * gold.cc: Include "incremental.h".
13909 (queue_initial_tasks): Call Incremental_checker methods.
13910 * incremental.cc: Include "output.h".
13911 (Incremental_checker::can_incrementally_link_output_file): New
13912 method.
13913 * incremental.h (Incremental_checker): New class.
13914
13915 * output.cc (Output_file::open_for_modification): New method.
13916 (Output_file::map_anonymous): Changed return type to bool. Record
13917 map in base_ field.
13918 (Output_file::map_no_anonymous): New method, broken out of map.
13919 (Output_file::map): Use map_no_anonymous and map_anonymous.
13920 * output.h (class Output_file): Update declarations.
13921
293c1386
CC
139222009-08-24 Cary Coutant <ccoutant@google.com>
13923
13924 * options.h (Command_line::Pre_options): New class.
13925 (Command_line::pre_options): New member.
13926 * options.cc (gold::options::ready_to_register): New variable.
13927 (One_option::register_option): Do nothing if not registering options.
13928 Assert if same short option registered twice.
13929 (General_options::General_options): Turn off option registration when
13930 done constructing.
13931 (Command_line::Pre_options::Pre_options): New constructor.
13932
f773f3d2
CC
139332009-08-24 Cary Coutant <ccoutant@google.com>
13934
06a73cfe
CC
13935 * options.h (General_options::no_keep_memory): Remove incorrect
13936 short option.
f773f3d2 13937
a15af8e2
RW
139382009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13939
13940 * Makefile.am (am__skiplex, am__skipyacc): New.
13941 * Makefile.in: Regenerate.
13942
c462b41b
RW
139432009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
13944
14ec8efd
RW
13945 * Makefile.am (AM_CPPFLAGS): Renamed from ...
13946 (INCLUDES): ... this.
13947 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
13948 (AM_CPPFLAGS): Renamed from ...
13949 (INCLUDE): ... this.
13950 * Makefile.in, testsuite/Makefile.in: Regenerate.
13951
81ecdfbb
RW
13952 * Makefile.in: Regenerate.
13953 * aclocal.m4: Likewise.
13954 * config.in: Likewise.
13955 * configure: Likewise.
13956 * testsuite/Makefile.in: Likewise.
13957
c462b41b
RW
13958 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13959 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
13960 * Makefile.in: Regenerate.
13961 * testsuite/Makefile.in: Regenerate.
13962
2da73f13
CC
139632009-08-19 Cary Coutant <ccoutant@google.com>
13964
13965 * resolve.cc (Symbol_table::resolve): Don't complain about defined
13966 symbols in shared libraries overridden by hidden or internal symbols
13967 in the main program.
13968
2db70501
CD
139692009-08-19 Chris Demetriou <cgd@google.com>
13970
13971 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
13972 checking source file names in error messages.
13973
f733487b
DK
139742009-08-18 Doug Kwan <dougkwan@google.com>
13975
13976 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
13977 an elcpp::Ehdr as parameter. Adjust call to set_target.
13978 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
13979 an elfcpp::Ehdr as parameter.
13980 * object.cc (Object::set_target): Remove the version that looks up
13981 a target and sets it.
13982 (Sized_relobj::setup): Take a Target object instead of
13983 an elfcpp::Ehdr as parameter. Adjust call to set_target.
13984 (make_elf_sized_object): Find target and ask target to
13985 make an ELF object.
13986 * object.h: (Object::set_target): Remove the version that looks up
13987 a target and sets it.
13988 (Sized_relobj::setup): Take a Target object instead of
13989 an elfcpp:Ehdr as parameter.
13990 * target.cc: Include dynobj.h.
13991 (Target::do_make_elf_object_implementation): New.
2e702c99 13992 (Target::do_make_elf_object): New.
f733487b
DK
13993 * target.h (Target::make_elf_object): New template declaration.
13994 (Target::do_make_elf_object): New method declarations.
13995 (Target::do_make_elf_object_implementation): New template declaration.
13996
cc70f101
ILT
139972009-08-14 Ian Lance Taylor <iant@google.com>
13998
13999 * gold.h (FUNCTION_NAME): Define.
14000 (gold_unreachable): Use FUNCTION_NAME.
14001
ef5e0cb1
ST
140022009-08-12 Sriraman Tallam <tmsriram@google.com>
14003
14004 * icf.cc (Icf::find_identical_sections): Issue a warning when a
14005 symbol in the --keep-unique list is not found.
14006
48c187ce
ST
140072009-08-12 Sriraman Tallam <tmsriram@google.com>
14008
14009 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
14010 been maked as --keep-unique.
14011 (Icf::unfold_section): New function.
14012 * icf.h (Icf::unfold_section): New function.
14013 * options.h (General_options::keep_unique): New option.
14014 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
14015 * testsuite/Makefile.in: Regenerate.
14016 * testsuite/icf_keep_unique_test.sh: New file.
14017 * testsuite/icf_keep_unique_test.cc: New file.
14018
645afe0c
CC
140192009-08-12 Cary Coutant <ccoutant@google.com>
14020
14021 PR 10471
14022 * resolve.cc (Symbol_table::resolve): Check for references from
14023 dynamic objects to hidden and internal symbols.
14024 * testsuite/Makefile.am (hidden_test.sh): New test.
14025 * testsuite/Makefile.in: Regenerate.
14026 * testsuite/hidden_test.sh: New script.
14027 * testsuite/hidden_test_1.c: New test source.
14028 * testsuite/hidden_test_main.c: New test source.
14029
11af873f
DK
140302009-08-11 Doug Kwan <dougkwan@google.com>
14031
14032 * arm.cc: Update comments.
14033 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
14034 segment to locate the .ARM.exidx section if present.
14035
b9f7d72d
DK
140362009-08-09 Doug Kwan <dougkwan@google.com>
14037
14038 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
14039 patch.
14040
ddd3c53c
ST
140412009-08-07 Sriraman Tallam <tmsriram@google.com>
14042 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
14043 compiler warnings.
14044
27721062
ST
140452009-08-06 Sriraman Tallam <tmsriram@google.com>
14046
14047 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
14048 valid tls_segment only for non-debug-section relocations.
14049 * testsuite/Makefile.am: Add gc_tls_test.
14050 * testsuite/Makefile.in: Regenerate.
14051 * testsuite/gc_tls_test.cc: New file.
14052 * testsuite/gc_tls_test.sh: New file.
14053
ef15dade 140542009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 14055
ef15dade
ST
14056 * icf.cc: New file.
14057 * icf.h: New file.
14058 * Makefile.am (CCFILES): Add icf.cc.
14059 (HFILES): Add icf.h
14060 * Makefile.in: Regenerate.
14061 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
14062 * gc.h (gc_process_relocs): Populate lists used by icf to contain
14063 section, symbol and addend information for the relocs.
14064 * gold.cc (queue_middle_tasks): Call identical code folding.
14065 * gold.h: Add defines for multimap.
14066 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
14067 to the call of finalize_local_symbols.
14068 * main.cc (main): Create object of class Icf.
14069 * object.cc (Sized_relobj::do_layout): Allow this function to be
14070 called twice during icf.
14071 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
14072 to sections marked as identical by icf.
14073 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
14074 when available.
14075 (Sized_relobj::do_section_entsize): New function.
14076 * object.h (Object::section_entsize): New function.
14077 (Object::do_section_entsize): New pure virtual function.
14078 (Relobj::finalize_local_symbols): Add new parameter.
14079 (Relobj::do_section_entsize): New function.
14080 * options.h (General_options::icf): New option.
14081 (General_options::icf_iterations): New option.
14082 (General_options::print_icf_sections): New option.
14083 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
14084 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
14085 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
14086 icf.
14087 * symtab.cc (Symbol_table::is_section_folded): New function.
14088 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
14089 to sections marked as identical by icf.
14090 * symtab.h (Symbol_table::set_icf): New function.
14091 (Symbol_table::icf): New function.
14092 (Symbol_table::is_section_folded): New function.
14093 (Symbol_table::icf_): New data member.
14094 * target-reloc.h (relocate_section): Ignore sections folded by icf.
14095 * testsuite/Makefile.am: Add commands to build icf_test.
14096 * testsuite/Makefile.in: Regenerate.
14097 * testsuite/icf_test.sh: New file.
14098 * testsuite/icf_test.cc: New file.
14099
c3b65ac4
CD
141002009-07-24 Chris Demetriou <cgd@google.com>
14101
14102 * layout.cc (is_compressible_debug_section): Fix incorrect
14103 comment about compressed section names.
14104
1caf2c51
ILT
141052009-07-20 Ian Lance Taylor <ian@airs.com>
14106
14107 PR 10419
14108 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
14109
1ef4d87f
ILT
141102009-07-16 Ian Lance Taylor <iant@google.com>
14111
14112 PR 10400
14113 * layout.h: #include <map>.
14114 (class Kept_section): Change from struct to class. Add accessors
14115 and setters. Add section size to Comdat_group mapping. Change
14116 Comdat_group to std::map. Add is_comdat_ field. Add
14117 linkonce_size field in union.
14118 (class Layout): Update declaration of find_or_add_kept_section.
14119 Don't declare find_kept_object.
14120 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
14121 parameter. Add object, shndx, is_comdat, and is_group_name
14122 parameters. Change all callers. Adjust for new Kept_section.
14123 (Layout::find_kept_object): Remove.
14124 * object.cc (Sized_relobj::include_section_group): Update use of
14125 Kept_section. Rename secnum to shndx. Only record
14126 Kept_comdat_section if sections are the same size.
14127 (Sized_relobj::include_linkonce_section): Update use of
14128 Kept_section. Only record Kept_comdat_section if sections are the
14129 same size. Set size of linkonce section.
14130 (Sized_relobj::map_to_kept_section): Update call to
14131 get_kept_comdat_section.
14132 * object.h (class Sized_relobj): Rename fields in
14133 Kept_comdat_section to drop trailing underscores; change object
14134 field to Relobj*. Change Kept_comdat_section_table to store
14135 struct rather than pointer.
14136 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
14137 Add kept_object and kept_shndx parameters. Change all callers.
14138 (Sized_relobj::get_kept_comdat_section): Change return type to
14139 bool. Add kept_object and kept_shndx parameters. Change all
14140 callers.
14141 * plugin.cc (Pluginobj::include_comdat_group): Update call to
14142 Layout::find_or_add_kept_section.
14143
37c3b7b0
ILT
141442009-07-09 Ian Lance Taylor <iant@google.com>
14145
14146 * merge.cc (Object_merge_map::initialize_input_to_output_map):
14147 Reserve space in the hash table.
14148
98fa85cb
ILT
141492009-07-06 Mikolaj Zalewski <mikolajz@google.com>
14150
14151 * fileread.cc (File_read::get_mtime): New method.
14152 * fileread.h (Timespec): New structure.
14153 (File_read::get_mtime): New method.
14154 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
14155 Renamed from timestamp_nsec.
14156 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
14157 Elf_Xword.
e1df38aa 14158 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 14159 timestamp_nsec.
e1df38aa 14160 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
14161 (Incremental_inputs::report_obejct): Save mtime; style fix.
14162 (Incremental_inputs::report_script): Save mtime; style fix.
14163 (Incremental_inputs::finalize_inputs): Style fix.
14164 (Incremental_inputs::finalize): Style fix.
14165 (Incremental_inputs::create_input_section_data): Store inputs
14166 mtime.
14167 * incremental.h (Incremental_inputs::report_script): Add mtime
14168 argument.
14169 (Incremental_inputs::Input_info::Input_info): Intialize only one
14170 union member.
14171 (Incremental_inputs::Input_info::archive): Move to nameless
14172 union.
14173 (Incremental_inputs::Input_info::obejct): Move to nameless union.
14174 (Incremental_inputs::Input_info::script): Move to nameless union.
14175 (Incremental_inputs::mtime): New field.
14176 * script.cc (read_input_script): Pass file mtime to
14177 Incremental_input.
14178 * script.h (Script_info::inputs): Style fix.
14179
c9d70757
ILT
141802009-07-01 Ian Lance Taylor <ian@airs.com>
14181
14182 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
14183 instead of 32.
14184
9c547ec3
ILT
141852009-06-24 Ian Lance Taylor <iant@google.com>
14186
14187 PR 10156
14188 * layout.cc (Layout::choose_output_section): If we find an
14189 existing section, update the flags.
14190 (Layout::create_notes): New function, broken out of
14191 Layout::finalize.
14192 (Layout::finalize): Don't create note sections.
14193 (Layout::create_note): Don't crash if linker script discards
14194 section.
14195 (Layout::create_gold_note): Likewise.
14196 (Layout::create_build_id): Likewise. Don't set
14197 after_input_sections on the section.
14198 (Layout::create_executable_stack_info): Remove target parameter.
14199 Change caller.
14200 * layout.h (class Layout): Declare create_notes. Update
14201 declaration of create_executable_stack_info.
14202 * gold.cc (queue_middle_tasks): Call create_notes.
14203 * output.cc (Output_section::update_flags_for_input_section): Move
14204 here from output.h. If SHF_ALLOC flag is newly set, mark address
14205 invalid.
14206 * output.h (Output_data::mark_address_invalid): New function.
14207 (class Output_section): Only declare, not define,
14208 update_flags_for_input_section. Remove set_flags.
14209
55458500
ILT
142102009-06-24 Ian Lance Taylor <iant@google.com>
14211
14212 * script-sections.cc (Output_section_definition::
14213 set_section_addresses): Rename shadowing local load_address to
14214 laddr.
14215
1307d6cd
ILT
142162009-06-24 Ian Lance Taylor <iant@google.com>
14217
14218 PR 10244
14219 * reloc.cc (relocate_sections): Skip empty relocation sections.
14220
ec3f783e
ILT
142212009-06-23 Ian Lance Taylor <iant@google.com>
14222
14223 PR 10156
14224 * layout.cc (Layout::create_note): Use choose_output_section
14225 rather than make_output_section.
14226
459c9f1c
ILT
142272009-06-23 Ian Lance Taylor <iant@google.com>
14228
14229 PR 10237
14230 * options.cc (General_options::parse_V): Set printed_version_.
14231 (General_options::General_options): Initialize printed_version_.
14232 * options.h (class General_options): Add printed_version_ field.
14233 * gold.cc (queue_initial_tasks): If there are no input files,
14234 don't give a fatal error if we printed the version information.
14235 (queue_middle_tasks): If using -r with a shared object, give a
14236 fatal error rather than an ordinary error.
14237
1518dc8f
ILT
142382009-06-23 Ian Lance Taylor <iant@google.com>
14239
14240 PR 10219
14241 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
14242 (Layout::make_output_section): Set have_stabstr_section_ if we see
14243 a .stab*str section.
14244 (Layout::finalize): Call link_stabs_sections.
14245 (Layout::link_stabs_sections): New file.
14246 * layout.h (class Layout): Add have_stabstr_section_ field.
14247 Declare link_stabs_sections.
14248
3d857b98
DK
142492009-06-23 Doug Kwan <dougkwan@google.com>
14250
14251 * Makefile.am (libgold_a_LIBADD): New.
14252 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 14253 * Makefile.in: Regenerate.
3d857b98
DK
14254 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
14255 * configure: Regenerate.
14256 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
14257 * fileread.cc: Include sys/state.h
14258 * gold.h: Declare memmem and strndup if found missing.
14259 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
14260
0639a6f6
ILT
142612009-06-23 Ian Lance Taylor <iant@google.com>
14262
14263 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
14264 * configure: Rebuild.
14265
8d63875c
ILT
142662009-06-23 Ian Lance Taylor <iant@google.com>
14267
14268 PR 10147
14269 * object.cc (Object::section_contents): Don't try to get a view if
14270 the section has length zero.
14271 (Object::handle_gnu_warning_section): If the section is empty, use
14272 the name of the section as the warning.
14273
f7c8a183
ILT
142742009-06-23 Ian Lance Taylor <iant@google.com>
14275
14276 PR 10133
14277 * stringpool.h (class Stringpool_template): Add optimize_ field.
14278 (Stringpool_template::set_optimize): New function.
14279 * stringpool.cc (Stringpool_template::Stringpool_template):
14280 Initialize optimize_ field.
14281 (Stringpool_template::set_string_offsets): Test local optimize
14282 fild rather than parameter.
14283 * layout.cc (Layout::Layout): Call set_optimize on the section
14284 name stringpool.
14285
e6a307ba
ILT
142862009-06-22 Ian Lance Taylor <iant@google.com>
14287
14288 PR 10030
14289 * yyscript.y: Parse TARGET.
14290 * script.cc (script_set_target): New function.
14291 * script-c.h (script_set_target): Declare.
14292 * options.cc (General_options::string_to_object_format): Rename
14293 from string_to_object_format in anonymous namespace. Change
14294 callers.
14295 * options.h (class General_options): Declare
14296 string_to_object_format.
14297
3ee173de
ILT
142982009-06-22 Ian Lance Taylor <iant@google.com>
14299
14300 * script-sections.cc (Script_sections::create_segments): Don't put
14301 program headers in a PT_LOAD segment if -n or -N.
14302
143032009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
14304
14305 PR 10141
14306 * options.h (class General_options): Add -z lazy and -z now. Sort
14307 -z options into alphabetical order.
14308 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
14309
cd6739a1 143102009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
14311
14312 * layout.cc (Layout::make_output_section): Call
14313 Target::new_output_section.
14314 (Layout::attach_allocated_section_to_segment): Put large section
14315 sections in a separate load segment with the large segment flag
14316 set.
14317 (Layout::segment_precedes): Sort large data segments after other
14318 load segments.
14319 (align_file_offset): New static function.
14320 (Layout::set_segment_offsets): Use align_file_offset.
14321 * output.h (class Output_section): Add is_small_section_ and
14322 is_large_section_ fields.
14323 (Output_section::is_small_section): New function.
14324 (Output_section::set_is_small_section): New function.
14325 (Output_section::is_large_section): New function.
14326 (Output_section::set_is_large_section): New function.
14327 (Output_section::is_large_data_section): New function.
14328 (class Output_segment): Add is_large_data_segment_ field.
14329 (Output_segment::is_large_data_segment): New function.
14330 (Output_segment::set_is_large_data_segment): New function.
14331 * output.cc (Output_section::Output_section): Initialize new
14332 fields.
14333 (Output_segment::Output_segment): Likewise.
14334 (Output_segment::add_output_section): Add assertion that large
14335 data sections always go in large data segments. Force small data
14336 sections to the end of the list of data sections. Force small BSS
14337 sections to the start of the list of BSS sections. For large BSS
14338 sections to the end of the list of BSS sections.
14339 * symtab.h (class Symbol): Declare is_common_shndx.
14340 (Symbol::is_defined): Check Symbol::is_common_shndx.
14341 (Symbol::is_common): Likewise.
14342 (class Symbol_table): Define enum Commons_section_type. Update
14343 declarations. Add small_commons_ and large_commons_ fields.
14344 * symtab.cc (Symbol::is_common_shndx): New function.
14345 (Symbol_table::Symbol_table): Initialize new fields.
14346 (Symbol_table::add_from_object): Put small and large common
14347 symbols in the right list.
14348 (Symbol_table::sized_finalized_symbol): Check
14349 Symbol::is_common_shndx.
14350 (Symbol_table::sized_write_globals): Likewise.
14351 * common.cc (Symbol_table::do_allocate_commons): Allocate new
14352 common symbol lists. Don't call do_allocate_commons_list if the
14353 list is empty.
14354 (Symbol_table::do_allocate_commons_list): Remove is_tls
14355 parameter. Add comons_section_type parameter. Change all
14356 callers. Handle small and large common symbols.
14357 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
14358 Symbol::is_common_shndx.
14359 * resolve.cc (symbol_to_bits): Likewise.
14360 * target.h (Target::small_common_shndx): New function.
14361 (Target::small_common_section_flags): New function.
14362 (Target::large_common_shndx): New function.
14363 (Target::large_common_section_flags): New function.
14364 (Target::new_output_section): New function.
14365 (Target::Target_info): Add small_common_shndx, large_common_shndx,
14366 small_common_section_flags, and large_common_section_flags
14367 fields.
14368 (Target::do_new_output_section): New virtual function.
14369 * arm.cc (Target_arm::arm_info): Initialize new fields.
14370 * i386.cc (Target_i386::i386_info): Likewise.
14371 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
14372 Likewise.
14373 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
14374 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
14375 (Target_x86_64::do_new_output_section): New function.
14376 * configure.ac: Define conditional MCMODEL_MEDIUM.
14377 * testsuite/Makefile.am (check_PROGRAMS): Add large.
14378 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
14379 (large_LDFLAGS): Define.
14380 * testsuite/large.c: New file.
14381 * testsuite/testfile.cc (Target_test::test_target_info):
14382 Initialize new fields.
14383 * configure, testsuite/Makefile.in: Rebuild.
14384
bb04269c
DK
143852009-06-05 Doug Kwan <dougkwan@google.com>
14386
14387 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 14388 * Makefile.in: Regenerate.
bb04269c
DK
14389 * i386.cc (class Target_i386): Define new virtual method to
14390 override do_is_local_label_name in parent.
14391 * object.cc (Sized_relobj::do_count_local_symbols): Discard
14392 local symbols if --discard-locals or -X is given.
14393 * options.h (class General_options): Declare new options
14394 '--discard-locals' and '-X' for discarding locals.
14395 * target.h (class Target): Define new methods is_local_label_name.
14396 Declare new virtual method do_is_local_label_name.
14397 * target.cc: New file.
14398 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
14399 (check_SCRIPTS): Add discard_locals_test.sh.
14400 (check_DATA): Add discard_local_tests.syms.
14401 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
14402 (discard_local_tests.syms, discard_locals_test.o): New make rules.
14403 * testsuite/Makefile.in: Regenerate.
14404 * testsuite/discard_locals_test.c: New file.
14405 * testsuite/discard_locals_test.sh: Same.
14406
805bb01c
DK
144072009-06-05 Doug Kwan <dougkwan@google.com>
14408
14409 * object.cc (Sized_relobj::Sized_relobj): Initialize
14410 discarded_eh_frame_shndx_ to -1U.
14411 (Sized_relobj::do_layout): Record index of a discard .eh_frame
14412 section.
14413 (Sized_relobj::do_count_local_symbols): Skip local symbols in
14414 a discarded .eh_frame section.
14415 (Sized_relobj::do_finalize_local_symbols): Ditto.
14416 * object.h (class Sized_relobj): Declare new member
14417 discarded_eh_frame_shndx_.
14418 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
14419 (local_labels_test.o, local_labels_test): New rules.
14420 * testsuite/Makefile.in: Regenerate.
14421
1dcd334d
DK
144222009-06-04 Doug Kwan <dougkwan@google.com>
14423
14424 * layout.cc (Layout::section_name_mapping): Add mapping for
14425 special ARM sections.
14426
96d49306
DK
144272009-06-03 Doug Kwan <dougkwan@google.com>
14428
14429 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
14430 (utils::has_overflow): Same.
14431
dff16297
ILT
144322009-06-03 Ian Lance Taylor <iant@google.com>
14433
14434 * layout.cc (Layout::section_name_mapping): New array, replacing
14435 Layout::linkonce_mapping.
14436 (Layout::section_name_mapping_count): New variable, replacing
14437 Layout::linkonce_mapping_count.
14438 (Layout::linkonce_output_name): Remove.
14439 (Layout::output_section_name): Rewrite.
14440 * layout.h (class Layout): Rename Linkonce_mapping to
14441 Section_name_mapping, linkonce_mapping to section_name_mapping,
14442 linkonce_mapping_count to section_name_mapping_count. Don't
14443 declare linkonce_output_name.
14444
c121c671
DK
144452009-06-03 Doug Kwan <dougkwan@google.com>
14446
14447 * gold/arm.cc (namespace utils): New.
14448 (Target_arm::reloc_is_non_pic): Define new method.
14449 (class Arm_relocate_functions): New.
14450 (Target_arm::Relocate::relocate): Handle relocation types used by
14451 Android.
14452
07800fab
ILT
144532009-06-03 Ian Lance Taylor <iant@google.com>
14454
14455 * arm.cc (Target_arm::scan::global): Use || instead of |.
14456
c121c671
DK
144572009-06-02 Doug Kwan <dougkwan@google.com>
14458
14459 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
14460 issued_non_pic_error_.
14461 (class Target_arm::Scan): Declare new method check_non_pic.
14462 Define new method symbol_needs_plt_entry.
14463 Declare new data member issued_non_pic_error_.
14464 (class Target_arm::Relocate): Declare new method
14465 should_apply_static_reloc.
14466 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
14467 (Target_arm::Scan::check_non_pic): Define new method.
14468 (Target_arm::Scan::local): Handle a small subset of reloc types used
14469 by Android.
14470 (Target_arm::Scan::local): Same.
14471 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
14472
b19b0c6d
ILT
144732009-05-31 Mikolaj Zalewski <mikolajz@google.com>
14474
14475 * incremental.cc (Incremental_inputs::report_command_line): Filter
14476 out --incremental-* options.
14477
94cdfcff
DK
144782009-05-29 Doug Kwan <dougkwan@google.com>
14479
14480 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
14481 template class.
14482 (class Target_arm): Update comment.
14483 (Target_arm::Target_arm): Initialize new data members GOT_,
14484 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
14485 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
14486 and Target_arm::rel_dyn_section.
14487 Declare new_enum Target_arm::Got_type.
14488 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
14489 and DYNBSS_.
14490 Update commments for member do_dynsym_value.
14491 (Target_arm::got_size, Target_arm::plt_section,
14492 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
14493 new methods inside class defintion.
14494 (Target_arm::got_section): Define new method.
14495 (Target_arm::rel_dyn_section): Same.
14496 (Output_data_plt_arm): New template class.
14497 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
14498 (Output_data_plt_arm:do_adjust_output_section): Define new method.
14499 (Output_data_plt_arm::add_entry): Same.
14500 (Output_data_plt_arm::first_plt_entry): Define new
14501 static data member for PLT instruction template.
14502 (Output_data_plt_arm::plt_entry): Same.
14503 (Output_data_plt_arm::do_write): Define new method.
14504 (Target_arm::make_plt_entry): Same.
14505 (Target_arm::do_finalize_sections): Same.
14506 (Target_arm::do_dynsym_value): Same.
14507
4a657b0d
DK
145082009-05-28 Doug Kwan <dougkwan@google.com>
14509
14510 * Makefile.am (TARGETSOURCES): Add arm.cc.
14511 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
14512 * Makefile.in: Regenerate.
14513 * arm.cc: New file.
14514 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
14515
e7ae8c36
DK
145162009-05-26 Doug Kwan <dougkwan@google.com>
14517
14518 * options.cc (General_options::parse_exclude_libs). Fix a comment.
14519 (General_options::check_excluded_libs): Strip off directories in
14520 archive name before matching like GNU ld does.
14521 * testsuite/Makefile.am (MOSTLYCLEANFILES,
14522 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
14523 (exclude_libs_test_LDFLAGS): Add linker option
14524 -Wl,--exclude-libs,libexclude_libs_test_3
14525 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
14526 an explicit archive without using -l.
14527 (alt/libexclude_libs_test_3.a): New make rule.
14528 * testsuite/Makefile.in: Regenerate.
14529 * testsuite/exclude_libs_test.c : Declare lib3_default().
14530 (main): Call it.
14531 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
14532 * exclude_libs_test_3.c: New file.
14533
f12e7348
NC
145342009-05-26 Nick Clifton <nickc@redhat.com>
14535
14536 * po/id.po: New Indonesian translation.
14537 * po/gold.pot: Updated template file.
14538
4daadc0d
ST
145392009-05-22 Sriraman Tallam <tmsriram@google.com>
14540
e1df38aa 14541 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
14542 gc_comdat_test files. Add -Wl,--gc-sections to build
14543 gc_comdat_test.
14544 * testsuite/Makefile.in: Regenerate.
14545 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
14546
531813ad
ST
145472009-05-21 Sriraman Tallam <tmsriram@google.com>
14548
14549 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
14550 kept comdat section was garbage collected.
14551 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
14552 * testsuite/Makefile.in: Regenerate.
14553 * testsuite/gc_comdat_test.sh: New file.
14554 * testsuite/gc_comdat_test_1.cc: New file.
14555 * testsuite/gc_comdat_test_2.cc: New file.
14556
65514900
CC
145572009-05-19 Doug Kwan <dougkwan@google.com>
14558
14559 * archive.cc (Archive::Archive): Move constructor from archive.h
14560 to here. Initialize no_export_.
14561 (Archive::get_elf_object_for_member): Set no_export flag of object.
14562 * archive.h (Archive::Archive): Move constructor body to
14563 archive.cc.
14564 (Archive::no_export): New method.
14565 (Archive::no_export_): New field.
14566 * object.h (Object::Object): Initialize no_export_ to false.
14567 (Object::no_export, Object::set_no_export): New methods.
14568 (Object::no_export_): New field.
14569 * options.cc (General_options::parse_exclude_libs): New method.
14570 (General_options::check_excluded_libs) Same.
14571 * options.h (exclude_libs): New option.
14572 (General_options::check_excluded_libs): New method declaration.
14573 (General_options::excluded_libs_): New field.
14574 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
14575 default or protected visibility if an object has no-export flag set.
14576 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
14577 (check_SCRIPTS): Add exclude_libs_test.sh.
14578 (check_DATA): Add exclude_libs_test.syms.
14579 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
14580 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
14581 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
14582 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
14583 (exclude_libs_test.syms, libexclude_libs_test_1.a,
14584 libexclude_libs_test_2.a): New rules.
14585 * testsuite/Makefile.in: Regenerate.
14586 * testsuite/exclude_libs_test.c: New file.
14587 * testsuite/exclude_libs_test.sh: Ditto.
14588 * testsuite/exclude_libs_test_1.c: Ditto.
14589 * testsuite/exclude_libs_test_2.c: Ditto.
14590
1b77ea50
ILT
145912009-05-15 Ian Lance Taylor <iant@google.com>
14592
14593 * configure.ac: Check for declarations for cases where libiberty.h
14594 checks HAVE_DECL_xxx.
14595 * configure, config.in: Rebuild.
14596
072fe7ce
ILT
145972009-05-15 Mikolaj Zalewski <mikolajz@google.com>
14598
14599 * gold.h (Incremental_argument_list): Remove (invalid) forward
14600 declaration.
14601 * incremental.cc (Incremental_inputs::report_achive): New method.
14602 (Incremental_inputs::report_object): New method.
14603 (Incremental_inputs::report_script): New method.
14604 (Incremental_inputs::finalize_inputs): New method.
14605 (Incremental_inputs::finalize): Call finalize_inputs().
14606 (Incremental_inputs::sized_create_incremental_inputs_section_data):
14607 Create inputs entries.
14608 * incremental.h (Incremental_input_type): New enum.
14609 (Incremental_inputs::Incremental_input): Initialize new fields.
14610 (Incremental_inputs::report_inputs): New method.
14611 (Incremental_inputs::report_achive): New method.
14612 (Incremental_inputs::report_object): New method.
14613 (Incremental_inputs::report_script): New method.
14614 (Incremental_inputs::finalize_inputs): New method.
14615 (Incremental_inputs::Input_info): New struct.
14616 (Incremental_inputs::Input_info_map): New typedef.
14617 (Incremental_inputs::lock_): New field.
14618 (Incremental_inputs::Inputs_): New field.
14619 (Incremental_inputs::Inputs_map): New field.
14620 * main.cc (main): Call Incremental_input::report_inputs.
14621 * options.h (Input_argument_list): Typedef moved from
14622 Input_arguments.
14623 (Input_file_group::Files): Remove, use ::Input_argument_list.
14624 (Input_file_group::Input_argument_list): Remove, use
14625 ::Input_argument_list.
14626 * plugin.cc (Plugin_manager::add_input_file): Add error in
14627 incremental build.
14628 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
14629 functions.
14630 * script.cc (read_input_script): Call
14631 Incremental_input::report_script.
14632 * script.h (Script_info): New class.
14633
b0481b0b
ILT
146342009-04-27 Ian Lance Taylor <iant@google.com>
14635
14636 * x86_64.cc (do_adjust_output_section): Set entsize to
14637 plt_entry_size.
14638
b22a5a41 146392009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
14640
14641 * output.cc (Output_file::close): After short writes, continue
14642 writing from the correct offset in the buffer being written.
14643
40fde488
CD
146442009-04-23 Chris Demetriou <cgd@google.com>
14645
14646 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
14647 * configure: Regenerate.
14648 * config.in: Regenerate.
14649 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
14650 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
14651
3ce2c28e
ILT
146522009-04-21 Mikolaj Zalewski <mikolajz@google.com>
14653
14654 * incremental.cc (Incremental_inputs_header_data): Renamed from
14655 Incremental_input_header_data.
14656 (Incremental_inputs_header_data::data_size): New field.
14657 (Incremental_inputs_header_data::put_input_file_count): Renamed
14658 from input_file_count.
14659 (Incremental_inputs_header_data::put_command_line_offset): Renamed
14660 from command_line_offset.
14661 (Incremental_inputs_header_data::put_reserved): Renamed from
14662 put_reserved.
14663 (Incremental_inputs_entry_data): Renamed from
14664 Incremental_input_entry_data.
14665 (Incremental_inputs_entry_data::data_size): New field.
14666 (Incremental_inputs::report_command_line): New method.
14667 (Incremental_inputs::finalize): New method.
14668 (Incremental_inputs::create_incremental_inputs_data): New method.
14669 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
14670 * incremental.h: New file.
14671 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
703d02da 14672 (Layout::finalize): Create incremental inputs section in
3ce2c28e 14673 incremental builds.
703d02da 14674 (Layout::create_incremental_info_sections): New method.
3ce2c28e 14675 * layout.h (Layout::incremental_inputs): New method.
703d02da
AM
14676 (Layout::create_incremental_info_sections): New method.
14677 (Layout::incremental_inputs_): New field.
3ce2c28e
ILT
14678 * main.cc (main): Notify Incremental_input of the command line.
14679
e55bde5e
ILT
146802009-04-01 Ian Lance Taylor <iant@google.com>
14681 Mikolaj Zalewski <mikolajz@google.com>
14682
14683 * gold.h (reserve_unordered_map): Define, three versions, one for
14684 each version of Unordered_map.
14685 * layout.cc (Layout::Layout): Remove options parameter. Add
14686 number_of_input_files parameter. Don't initialize options_.
14687 Initialize number_of_input_files_ and resized_signatures_. Move
14688 sections_are_attached_.
14689 (Layout::layout_group): Reserve space for group_signatures_.
14690 (Layout::find_or_add_kept_section): Change name parameter to be a
14691 reference. Resize signatures_ map when it gets large enough.
14692 (Layout::layout_eh_frame): Use parameters->options() instead of
14693 this->options_.
14694 (Layout::make_output_section): Likewise.
14695 (Layout::attach_allocated_section_to_segment): Likewise.
14696 (Layout::finalize, Layout::create_executable_stack): Likewise.
14697 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
14698 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
14699 * layout.h (class Layout): Update declarations. Remove options_
14700 field. Add number_of_input_files_ and resized_signatures_
14701 fields. Move sections_are_attached_ field.
14702 * main.cc (main): Pass number of input files to Layout
14703 constructor. Don't pass options.
14704
154b857c
ILT
147052009-03-30 Ian Lance Taylor <iant@google.com>
14706
14707 * ffsll.c (ffsll): Correct implementation.
14708
2f35ab9b
ILT
147092009-03-27 Ian Lance Taylor <iant@google.com>
14710
fd03461a
ILT
14711 * ffsll.c: New file.
14712 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
14713 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
14714 * ftruncate.c (ftruncate): Declare before definition.
14715 * mremap.c (mremap): Likewise.
14716 * pread.c (pread): Likewise.
14717 * configure, Makefile.in, config.in: Rebuild.
14718
2f35ab9b
ILT
14719 * mremap.c: New file.
14720 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
14721 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
14722 (mremap): Declare if HAVE_MREMAP is not defined.
14723 * configure, Makefile.in, config.in: Rebuild.
14724
33aea2fd
CC
147252009-03-27 Cary Coutant <ccoutant@google.com>
14726
14727 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
14728 position independent.
14729 * sparc.cc (Target_sparc::check_non_pic): Likewise.
14730 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
14731
6d479619
CC
147322009-03-24 Cary Coutant <ccoutant@google.com>
14733
14734 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
14735 an executable.
14736 (needs_dynamic_reloc): Likewise.
14737
afc06bb8
ILT
147382009-03-24 Ian Lance Taylor <iant@google.com>
14739
14740 * yyscript.y (file_cmd): Recognize EXTERN.
14741 (extern_name_list, extern_name_list_body): New nonterminals.
14742 * script.cc (script_add_extern): Define.
14743 * script-c.h (script_add_extern): Declare.
14744
f6060a4d
ILT
147452009-03-24 Rafael Avila de Espindola <espindola@google.com>
14746
14747 * object.cc (is_elf_object): Define.
14748 * object.h (is_elf_object): Declare.
14749 * archive.cc (Archive::get_elf_object_for_member): Call
14750 is_elf_object.
33aea2fd 14751 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 14752
26736d8e
ILT
147532009-03-24 Elliott Hughes <enh@google.com>
14754
14755 * output.cc (Output_file::map_anonymous): Define.
14756 (Output_file::map): Use map_anonymous. If the regular mmap fails,
14757 try an anonymous one. Report the size if the mmap fails.
14758 * output.h (class Output_file): Declare map_anonymous.
14759
22fd9730
ILT
147602009-03-24 Ian Lance Taylor <iant@google.com>
14761
14762 * target-select.cc (instantiate_target): Don't acquire the lock if
14763 the instantiated_target_ field has already been set.
14764
cb010894
ILT
147652009-03-23 Ian Lance Taylor <iant@google.com>
14766
7f055c20
ILT
14767 * gold-threads.h (class Initialize_lock): Define.
14768 * gold-threads.cc (class Initialize_lock_once): Define.
14769 (initialize_lock_control): New static variable.
14770 (initialize_lock_pointer): New static variable.
14771 (initialize_lock_once): New static function.
14772 (Initialize_lock::Initialize_lock): Define.
14773 (Initialize_lock::initialize): Define.
14774 * target-select.h: Include "gold-threads.h".
14775 (class Target_selector): Add lock_ and initialize_lock_ fields.
14776 Don't define instantiate_target, just declare it.
14777 * target-select.cc (Target_selector::Target_selector): Initialize
14778 new fields.
14779 (Target_selector::instantiate_target): Define.
14780 * descriptors.h: Include "gold-threads.h".
14781 (class Descriptors): Add initialize_lock_ field.
14782 * descriptors.cc (Descriptors::Descriptors): Initialize new
14783 field.
14784 (Descriptors::open): Use initialize_lock_ field
14785 * errors.h (class Errors): Add initialize_lock_ field.
14786 * errors.cc (Errors::Errors): Initialize new field.
14787 (Errors::initialize_lock): Use initialize_lock_ field.
14788 * powerpc.cc (class Target_selector_powerpc): Remove
14789 instantiated_target_ field. In do_recognize call
14790 instantiate_target rather than do_instantiate_target. In
14791 do_instantiate_target just allocate a new target.
14792 * sparc.cc (class Target_selector_sparc): Likewise.
14793
36959681
ILT
14794 * freebsd.h: New file.
14795 * i386.cc: Include "freebsd.h".
14796 (Target_i386): Derive from Target_freebsd rather than
14797 Sized_target.
14798 (Target_selector_i386): Derive from Target_selector_freebsd rather
14799 than Target_selector.
14800 * x86_64.cc: Include "freebsd.h".
14801 (Target_x86_64): Derive from Target_freebsd rather than
14802 Sized_target.
14803 (Target_selector_x86_64): Derive from Target_selector_freebsd
14804 rather than Target_selector.
14805 * target.h (class Target): Add adjust_elf_header and
14806 do_adjust_elf_header.
14807 * output.cc (Output_file_header:: do_sized_write): Call target
14808 adjust_elf_header routine.
14809 * configure.tgt: Set targ_osabi.
14810 * configure.ac: Define GOLD_DEFAULT_OSABI.
14811 * parameters.cc (Parameters::default_target): Pass
14812 GOLD_DEFAULT_OSABI to select_target.
14813 * target-select.h (class Target_selector): Make instantiate_target
14814 protected rather than private.
14815 * Makefile.am (HFILES): Add freebsd.h.
14816 * configure, Makefile.in, config.in: Rebuild.
14817
cb010894
ILT
14818 * merge.cc (do_add_input_section): Correct pend value. Change
14819 message about last entry not being null terminated from error to
14820 warning.
14821
0e879927
ILT
148222009-03-20 Mikolaj Zalewski <mikolajz@google.com>
14823
14824 * incremental.cc: New file.
14825 * Makefile.am (CCFILES): Add incremental.cc.
14826 * Makefile.in: Rebuild.
14827
41105937
PP
148282009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
14829
14830 * layout.cc (Layout::output_section_name): Preserve names
14831 of '.note.' sections.
e1df38aa 14832
60439920
ILT
148332009-03-19 Ian Lance Taylor <iant@google.com>
14834
14835 * descriptors.cc (Descriptors::open): Check that the options are
14836 valid before using them.
14837
0d371ad3
ILT
148382009-03-18 Ian Lance Taylor <iant@google.com>
14839
14840 * script-sections.h: Include <list>.
14841 (class Script_sections): Change Sections_elements from std::vector
14842 to std::list. Typedef public Elements_iterator. Add
14843 orphan_section_placement_, data_segment_align_start_, and
14844 saw_data_segment_align_ fields. Remove data_segment_align_index_
14845 field.
14846 * script-sections.cc (class Orphan_section_placement): New class.
14847 (class Sections_element): Add virtual functions is_relro and
14848 orphan_section_init. Remove virtual function place_orphan_here.
14849 (class Output_section_definition): Add is_relro and
14850 orphan_section_init. Remove place_orphan_here.
14851 (class Orphan_output_section): Likewise.
14852 (Script_sections::Script_sections): Update for field changes.
14853 (Script_sections::data_segment_align): Set saw_data_segment_align_
14854 and data_segment_align_start_, not data_segment_align_index.
14855 (Script_sections::data_segment_relro_end): Check
14856 saw_data_segment_align_. Use data_segment_align_start_ rather
14857 than data_segment_align_index_.
14858 (Script_sections::place_orphan): Rewrite to use
14859 Orphan_section_placement.
14860
9201d894
ILT
148612009-03-17 Ian Lance Taylor <iant@google.com>
14862
9c5b8369
ILT
14863 * archive.cc (Archive::add_symbols): Check for a version attached
14864 to the symbol name in the archive map.
14865 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
14866 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
14867 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
14868 (ver_test_11.a): New target.
14869 * testsuite/Makefile.in: Rebuild.
14870
9201d894
ILT
14871 * configure.ac: Check for chsize and posix_fallocate. Replace
14872 ftruncate.
14873 * ftruncate.c: New file, from gnulib.
14874 * output.cc (posix_fallocate): Define dummy version if not
14875 HAVE_POSIX_FALLOCATE.
14876 (Output_file::map): Call posix_fallocate rather than lseek and
14877 write.
14878 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
14879 * configure, Makefile.in, config.in: Rebuild.
14880
ef4ab7a8 148812009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 14882
ef4ab7a8
PP
14883 * layout.h (Layout::create_note): Add section_name parameter.
14884 * layout.cc (Layout::create_note): Likewise.
14885 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 14886
8c500701
ILT
148872009-03-17 Ian Lance Taylor <iant@google.com>
14888
e85b18e1
ILT
14889 * descriptors.cc: Include "options.h".
14890 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
14891 (Descriptors::open): Always use O_CLOEXEC when opening a new
14892 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
14893 then set FD_CLOEXEC.
14894
9efe6174
ILT
14895 * sparc.cc (class Target_sparc): Add has_got_section.
14896 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
14897 make sure we have a GOT section.
14898
14899 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
14900 (Target_sparc::Scan::local): Likewise.
14901 (Target_sparc::Scan::global): Likewise.
14902 (Target_sparc::Relocate::relocate): Likewise.
14903 (Target_sparc::Relocate::relocate_tls): Likewise.
14904
8c500701
ILT
14905 * symtab.cc (Symbol_table::define_default_version): New function,
14906 broken out of add_from_object.
14907 (Symbol_table::add_from_object): Call define_default_version.
14908 (Symbol_table::define_special_symbol): Add resolve_oldsym
14909 parameter. Change all callers. If the version for a symbol comes
14910 from a version script, resolve it with the symbol with the same
14911 name with no version. Also add the symbol without a version if
14912 appropriate.
14913 (do_define_in_output_data): If resolving with oldsym, don't delete
14914 sym.
14915 (do_define_in_output_segment): Likewise.
14916 (do_define_as_constant): Likewise.
14917 * symtab.h (class Symbol_table): Update declarations.
14918
f1ed28fb
ILT
149192009-03-13 Ian Lance Taylor <iant@google.com>
14920
15f8229b
ILT
14921 * readsyms.cc (Read_symbols::incompatible_warning): New function.
14922 (Read_symbols::requeue): New function.
14923 (Read_symbols::do_read_symbols): If make_elf_object fails because
14924 the target type is not configured, and the file was searched for,
14925 issue a warning and retry with the next directory.
14926 (Add_symbols::run): If the file has an incompatible format, and
14927 it was searched for, requeue the Read_symbols task. On error,
14928 release the object.
14929 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
14930 dirindex parameter to constructor. Change all callers. Declare
14931 incompatible_warning and requeue.
14932 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
14933 input_argument_ and input_group_ fields. Add them to
14934 constructor. Change all callers.
14935 (class Read_script): Add dirindex_ field. Add it to constructor.
14936 Change all callers.
14937 * archive.cc (Archive::setup): Remove input_objects parameter.
14938 Change all callers.
14939 (Archive::get_file_and_offset): Likewise.
14940 (Archive::read_all_symbols): Likewise.
14941 (Archive::read_symbols): Likewise.
14942 (Archive::get_elf_object_for_member): Remove input_objects
14943 parameter. Add punconfigured parameter. Change all callers.
14944 (Archive::add_symbols): Change return type to bool. Check return
14945 value of include_member.
14946 (Archive::include_all_members): Likewise.
14947 (Archive::include_member): Change return type to bool. Return
14948 false if first included object has incompatible target. Set
14949 included_member_ field.
14950 (Add_archive_symbols::run): If add_symbols returns false, requeue
14951 Read_symbols task.
14952 * archive.h (class Archive): Add included_member_ field.
14953 Initialize it in constructor. Add input_file and searched_for
14954 methods. Update declarations.
14955 (class Add_archive_symbols): Add dirpath_, dirindex_, and
14956 input_argument_ fields. Add them to constructor. Change all
14957 callers.
14958 * script.cc: Include "target-select.h".
14959 (class Parser_closure): Add skip_on_incompatible_target_ and
14960 found_incompatible_target_ fields. Add
14961 skip_on_incompatible_target parameter to constructor. Change all
14962 callers. Add methods skip_on_incompatible_target,
14963 clear_skip_on_incompatible_target, found_incompatible_target, and
14964 set_found_incompatible_target.
14965 (read_input_script): Add dirindex parameter. Change all callers.
14966 If parser finds an incompatible target, requeue Read_symbols
14967 task.
14968 (script_set_symbol): Clear skip_on_incompatible_target in
14969 closure.
14970 (script_add_assertion, script_parse_option): Likewise.
14971 (script_start_sections, script_add_phdr): Likewise.
14972 (script_check_output_format): New function.
14973 * script.h (read_input_script): Update declaration.
14974 * script-c.h (script_check_output_format): Declare.
14975 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
14976 (ignore_cmd): Remove OUTPUT_FORMAT.
14977 * fileread.cc (Input_file::Input_file): Add explicit this.
14978 (Input_file::will_search_for): New function.
14979 (Input_file::open): Add pindex parameter. Change all callers.
14980 * fileread.h (class Input_file): Add input_file_argument method.
14981 Declare will_search_for. Update declarations.
14982 * object.cc (make_elf_object): Add punconfigured parameter.
14983 Change all callers.
14984 * object.h (class Object): Make input_file public. Add
14985 searched_for method.
14986 (make_elf_object): Update declaration.
14987 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
14988 restart search.
14989 * dirsearch.h (class Dirsearch): Update declaration.
14990 * options.h (class General_options): Add --warn-search-mismatch.
14991 * parameters.cc (Parameters::is_compatible_target): New function.
14992 * parameters.h (class Parameters): Declare is_compatible_target.
14993 * workqueue.cc (Workqueue::add_blocker): New function.
14994 * workqueue.h (class Workqueue): Declare add_blocker.
14995
f1ed28fb
ILT
14996 * fileread.cc (Input_file::open): Remove options parameter.
14997 Change all callers.
14998 (Input_file::open_binary): Likewise.
14999 * script.cc (read_input_script): Likewise.
15000 * readsyms.h (class Read_symbols): Remove options_ field. Remove
15001 options parameter from constructor. Change all callers.
15002 (class Read_script): Likewise.
15003 * fileread.h (class Input_file): Update declarations.
15004 * script.h (read_input_script): Update declaration.
15005
34dd024a
NC
150062009-03-10 Nick Clifton <nickc@redhat.com>
15007
15008 * po/es.po: New Spanish translation.
15009
6d71b17c
CC
150102009-03-06 Cary Coutant <ccoutant@google.com>
15011
15012 * options.cc (parse_short_option): Keep dash_z from registering itself.
15013
031cdbed
ILT
150142009-03-03 Ian Lance Taylor <iant@google.com>
15015
15016 PR 9918
15017 * target-reloc.h (relocate_section): Pass output_section to
15018 relocate.
15019 * i386.cc (Target_i386::should_apply_static_reloc): Add
15020 output_section parameter. Change all callers.
15021 (Target_i386::Relocate::relocate): Add output_section parameter.
15022 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15023 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
15024 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
15025 * testsuite/two_file_shared.sh: New script.
15026 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
15027 (check_DATA): Add two_file_shared.dbg.
15028 (two_file_shared.dbg): New target.
15029 * testsuite/Makefile.in: Rebuild.
15030
15d5fa16
ILT
150312009-03-01 Ian Lance Taylor <iant@google.com>
15032
15033 * configure.ac: Check for byteswap.h.
15034 * configure: Rebuild.
15035 * config.in: Rebuild.
15036
8a4c0b0d
ILT
150372009-03-01 Mikolaj Zalewski <mikolajz@google.com>
15038
15039 * layout.cc (Layout::find_or_add_kept_section): New function.
15040 (Layout::add_comdat): Removed.
15041 * layout.h (struct Kept_section): Move out of class Layout.
15042 Remove trailing underscores from field names. Add group_sections
15043 field. Rename group_ field to is_group. Change all uses.
15044 (class Layout): Declare find_or_add_kept_section, not add_comdat.
15045 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
15046 comdat_groups_ field.
15047 (Sized_relobj::include_section_group): Use
15048 find_or_add_kept_section and Kept_section::group_sections.
15049 (Sized_relobj::include_linkonce_section): Likewise.
15050 * object.cc (class Sized_relobj): Don't define Comdat_group or
15051 Comdat_group_table. Remove find_comdat_group and
15052 add_comdat_group. Remove comdat_groups_ field.
15053 * plugin.cc (include_comdat_group): Use
15054 Layout::find_or_add_kept_section.
15055
b4ecf66b
ILT
150562009-02-28 Ian Lance Taylor <iant@google.com>
15057
14359ca0
ILT
15058 * README: --gc-sections and map files are now supported. Document
15059 some build requirements.
15060
b4ecf66b
ILT
15061 PR 6992
15062 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
15063 relocatable link set the value of the section symbol to zero.
15064 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
15065 relocatable link don't include the section address in the local
15066 symbol value.
15067
0602e05a
ILT
150682009-02-27 Ian Lance Taylor <iant@google.com>
15069
fd9d194f
ILT
15070 PR 6811
15071 * options.h (class Search_directory): Add is_system_directory.
15072 (class General_options): Declare is_in_system_directory.
15073 * options.cc (get_relative_sysroot): Make static.
15074 (get_default_sysroot): Make static.
15075 (General_optoins::is_in_system_directory): New function.
15076 * fileread.cc (Input_file::is_in_system_directory): New function.
15077 * fileread.h (class Input_file): Declare is_in_system_directory.
15078 * object.h (class Object): Add is_in_system_directory.
15079 (class Input_objects): Remove system_library_directory_ field.
15080 * object.cc (Input_objects::add_object): Don't set
15081 system_library_directory_.
15082 (input_objects::found_in_system_library_directory): Remove.
15083 * symtab.cc (Symbol_table::write_globals): Remove input_objects
15084 parameter. Change all callers.
15085 (Symbol_table::sized_write_globals): Likewise.
15086 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
15087 Call Object::is_in_system_directory.
15088 * symtab.h (class Symbol_table): Update declarations.
15089
61edd21f
ILT
15090 PR 5990
15091 * descriptors.h (Open_descriptor): Add is_on_stack field.
15092 * descriptors.cc (Descriptors::open): If the descriptor is on the
15093 top of the stack, remove it. Initialize is_on_stack field.
15094 (Descriptors::release): Only add pod to stack if it is not on the
15095 stack already.
15096 (Descriptors::close_some_descriptor): Clear stack_next and
15097 is_on_stack fields.
15098
e29e076a
ILT
15099 PR 7091
15100 * output.cc (Output_section::find_starting_output_address): Rename
15101 from starting_output_address; add PADDR parameter; change return
15102 type.
15103 * output.h (class Output_section): Declare
15104 find_starting_output_address instead of starting_output_address.
15105 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
15106 section symbol for which we can't find a merge section.
15107
0602e05a
ILT
15108 PR 9836
15109 * symtab.cc (Symbol_table::add_from_object): If the visibility is
15110 hidden or internal, force the symbol to be local.
15111 * resolve.cc (Symbol::override_visibility): Define.
15112 (Symbol::override_base): Use override_visibility.
15113 (Symbol_table::resolve): Likewise.
15114 (Symbol::override_base_with_special): Likewise.
15115 (Symbol_table::override_with_special): If the visibility is hidden
15116 or internal, force the symbol to be local.
15117 * symtab.h (class Symbol): Add set_visibility and
15118 override_visibility.
15119 * testsuite/ver_test_1.sh: New file.
15120 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
15121 (check_DATA): Add ver_test_1.syms.
15122 (ver_test_1.syms): New target.
15123 * testsuite/Makefile.in: Rebuild.
15124
401a9a73
CC
151252009-02-25 Cary Coutant <ccoutant@google.com>
15126
15127 * layout.cc (Layout::choose_output_section): Don't rename sections
15128 when using a linker script that has a SECTIONS clause.
15129 * Makefile.in: Regenerate.
15130
15131 * testsuite/Makefile.am (script_test_5.sh): New test case.
15132 * testsuite/Makefile.in: Regenerate.
15133 * testsuite/script_test_5.cc: New file.
15134 * testsuite/script_test_5.sh: New file.
15135 * testsuite/script_test_5.t: New file.
15136
f488e4b0
CC
151372009-02-13 Rafael Avila de Espindola <espindola@google.com>
15138
15139 * archive.cc (Archive::include_member): Update calls to add_symbols.
15140 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
15141 the Layout argument.
15142 * dynobj.h (do_add_symbols): Add the Layout argument.
15143 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
15144 Layout argument.
15145 * object.h (Object::add_symbols): Add the Layout argument.
15146 (Object::do_add_symbols): Add the Layout argument.
15147 (Sized_relobj::do_add_symbols): Add the Layout argument.
15148 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
15149 Unify the two versions.
15150 (Add_plugin_symbols): Remove.
15151 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
15152 (Sized_pluginobj::do_add_symbols): Unify the two versions.
15153 (Add_plugin_symbols): Remove.
15154 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
15155 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
15156 (Add_symbols::run): Make it work with Pulginobj.
15157
89dd1680
ILT
151582009-02-06 Ian Lance Taylor <iant@google.com>
15159
15160 * object.cc (Sized_relobj::do_layout): Make info message start
15161 with lower case letter.
15162
266d0a74
ILT
151632009-02-06 Mikolaj Zalewski <mikolajz@google.com>
15164
602b464e
ILT
15165 * binary.cc: Fix file comment.
15166
266d0a74
ILT
15167 * options.h (enum Incremental_disposition): Define.
15168 (class General_options): Add new options: --incremental,
15169 --incremental_changed, --incremental_unchanged,
15170 --incremental_unknown. Add incremental_disposition_ and
15171 implicit_incremental_ fields.
15172 (General_options::incremental_disposition): New function.
15173 (class Position_dependent_options): Add incremental_disposition
15174 option.
15175 (Position_dependent_options::copy_from_options): Set incremental
15176 dispositions.
15177 * options.cc (General_options::parse_incremental_changed): New
15178 function.
2e702c99
RM
15179 (General_options::parse_incremental_unchanged): New function.
15180 (General_options::parse_incremental_unknown): New function.
15181 (General_options::General_options): Initialize new fields
266d0a74 15182 incremental_disposition_ and implicit_incremental_.
2e702c99 15183 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
15184 without --incremental.
15185
f073bbf7
CD
151862009-02-06 Chris Demetriou <cgd@google.com>
15187
15188 * gold.h (gold_undefined_symbol): Change to take only a Symbol
15189 pointer and to report location as the file name associated with
15190 the symbol.
15191 (gold_undefined_symbol_at_location): New function to replace the
15192 old gold_undefined_symbol functionality.
15193 * target-reloc.h (relocate_section): Update to use
15194 gold_undefined_symbol_at_location.
15195 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
15196 Call gold_undefined_symbol function rather than gold_error.
15197 * errors.h (Errors::undefined_symbol): Take location as a
15198 string, rather than calculating it from a relocation.
15199 * errors.cc (Errors::fatal): Print "fatal error:" before the
15200 formatted message.
15201 (Errors::error, Errors::error_at_location): Print "error: "
15202 before the formatted message.
15203 (Errors::undefined_symbol): Take location as a string, rather
15204 than calculating it from a relocation.
15205 (gold_undefined_symbol_at_location): New function akin to
15206 old gold_undefined_symbol, calculates location from relocation.
15207 (gold_undefined_symbol): Change to take only a Symbol pointer
15208 and to report location as the file name associated with the symbol.
15209 * testsuite/debug_msg.sh: Update for changed error messages.
15210 * testsuite/undef_symbol.sh: Likewise.
15211
8e94a90c
ILT
152122009-02-04 Duncan Sands <baldrick@free.fr>
15213
15214 PR 9812
15215 * reduced_debug_output.h
15216 (Output_reduced_debug_abbrev_section::failed): Use format for
15217 gold_warning.
15218 (Output_reduced_debug_info_section::faild): Likewise.
15219
88a0e15b
ILT
152202009-01-31 Mikolaj Zalewski <mikolajz@google.com>
15221
15222 * script.cc (Lazy_demangler): New class.
2e702c99 15223 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
15224 symbol only once.
15225
5efc7cd2
CC
152262009-01-29 Cary Coutant <ccoutant@google.com>
15227
15228 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
15229 to __tls_get_addr.
15230 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
15231
e0ebcf42
ILT
152322009-01-28 Ian Lance Taylor <iant@google.com>
15233
5efc7cd2 15234 * version.cc (version_string): Bump to 1.9.
75fe7426 15235
e0ebcf42
ILT
15236 * gold.h: Include <cstring> and <stdint.h>.
15237 * version.cc: Include <cstdio>.
15238 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
15239 warning.
15240 * reduced_debug_output.cc (insert_into_vector): Rename from
15241 Insert_into_vector; change all callers. Use Swap_unaligned to
15242 avoid aliasing issue; remove union since it is unnecessary.
15243
8e2813be 152442009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
15245
15246 * Makefile.am (CCFILES): Add gc.cc.
15247 (HFILES): Add gc.h.
15248 * Makefile.in: Regenerate.
15249 * gold.cc (Gc_runner): New class.
15250 (queue_initial_tasks): Call garbage collection related tasks
15251 when corresponding options are invoked.
15252 (queue_middle_gc_tasks): New function.
15253 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
15254 processed early before laying out sections during garbage collection.
15255 * gold.h (queue_middle_gc_tasks): New function.
15256 (is_prefix_of): Move from "layout.cc".
15257 * i386.cc (Target_i386::gc_process_relocs): New function.
15258 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
15259 * main.cc (main): Create object of class "Garbage_collection".
15260 * object.cc (Relobj::copy_symbols_data): New function.
15261 (Relobj::is_section_name_included): New function.
e1df38aa
NC
15262 (Sized_relobj::do_layout): Allow this function to be called twice
15263 during garbage collection and defer layout of section during the
6d03d481
ST
15264 first call.
15265 * object.h (Relobj::get_symbols_data): New function.
15266 (Relobj::is_section_name_included): New function.
15267 (Relobj::copy_symbols_data): New function.
15268 (Relobj::set_symbols_data): New function.
15269 (Relobj::get_relocs_data): New function.
15270 (Relobj::set_relocs_data): New function.
15271 (Relobj::is_output_section_offset_invalid): New pure virtual function.
15272 (Relobj::gc_process_relocs): New function.
15273 (Relobj::do_gc_process_relocs): New pure virtual function.
15274 (Relobj::sd_): New data member.
15275 (Sized_relobj::is_output_section_offset_invalid): New function.
15276 (Sized_relobj::do_gc_process_relocs): New function.
15277 * options.h (General_options::gc_sections): Modify to not be a no-op.
15278 (General_options::print_gc_sections): New option.
15279 * plugin.cc (Plugin_finish::run): Remove function call to
15280 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
15281 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
15282 * reloc.cc (Read_relocs::run): Add task to process relocs and
15283 determine unreferenced sections when doing garbage collection.
15284 (Gc_process_relocs): New class.
15285 (Sized_relobj::do_gc_process_relocs): New function.
15286 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
15287 sections that are garbage collected.
15288 * reloc.h (Gc_process_relocs): New class.
15289 * sparc.cc (Target_sparc::gc_process_relocs): New function.
15290 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
15291 symbols whose corresponding sections are garbage collected.
15292 (Symbol_table::Symbol_table): Add new parameter for the garbage
15293 collection object.
15294 (Symbol_table::gc_mark_undef_symbols): New function.
15295 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15296 (Symbol_table::gc_mark_dyn_syms): New function.
15297 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
15298 as garbage.
15299 (Symbol_table::add_from_object): Likewise.
15300 (Symbol_table::add_from_relobj): When building shared objects, do not
15301 treat externally visible symbols as garbage.
15302 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
15303 table information for static and relocatable links.
15304 * symtab.h (Symbol_table::set_gc): New function.
15305 (Symbol_table::gc): New function.
15306 (Symbol_table::gc_mark_undef_symbols): New function.
15307 (Symbol_table::gc_mark_symbol_for_shlib): New function.
15308 (Symbol_table::gc_mark_dyn_syms): New function.
15309 (Symbol_table::gc_): New data member.
e1df38aa 15310 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
15311 function.
15312 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
15313 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
15314
3b293544
CF
153152009-01-20 Chris Faylor <me.sourceware@sourceware.org>
15316
15317 * options.h (General_options::gc_sections): Define as a no-op for now.
15318 (General_options::no_keep_memory): Ditto.
15319 (General_options::Bshareable): Define.
15320 * options.cc (General_options::finalize): Honor -Bshareable.
15321
83d22aa8
AS
153222009-01-20 Andreas Schwab <schwab@suse.de>
15323
15324 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
15325 read the value in the contents, since we don't use it. Use the
15326 template endianness when writing.
15327 (Relocate::relocate): Use it for R_PPC_REL16_HA.
15328
cd536b21
AS
153292009-01-19 Andreas Schwab <schwab@suse.de>
15330
15331 * configure.tgt (powerpc64-*): Fix targ_obj.
15332
99e9a495
ILT
153332009-01-15 Ian Lance Taylor <iant@google.com>
15334
15335 * object.cc (Sized_relobj::write_local_symbols): Don't write out
15336 local symbols when stripping all symbols.
15337
bbbfea06
CC
153382009-01-14 Cary Coutant <ccoutant@google.com>
15339
99e9a495 15340 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 15341
0f7c0701
CC
153422009-01-14 Cary Coutant <ccoutant@google.com>
15343
15344 * archive.cc (Archive::get_elf_object_for_member): Remove call
15345 to File_read::claim_for_plugin.
15346 * descriptors.cc (Descriptors::open): Remove reference to
15347 is_claimed.
15348 (Descriptors::claim_for_plugin): Remove.
15349 * descriptors.h (Descriptors::claim_for_plugin): Remove.
15350 (Descriptors::is_claimed): Remove.
15351 (claim_descriptor_for_plugin): Remove.
15352 * fileread.cc (File_read::claim_for_plugin): Remove.
15353 * fileread.h (File_read::claim_for_plugin): Remove.
15354 (File_read::descriptor): Reopen descriptor if necessary.
15355 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
15356 (Plugin_manager::all_symbols_read): Add task parameter. Change
15357 all callers.
15358 (Plugin_manager::get_input_file): New function.
15359 (Plugin_manager::release_input_file): New function.
15360 (Pluginobj::Pluginobj): Add filesize parameter and initialize
15361 corresponding data member.
15362 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
15363 and pass to base constructor. Change all callers.
15364 (get_input_file, release_input_file): New functions.
15365 (make_sized_plugin_object): Add filesize parameter. Change all callers.
15366 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
15367 (Plugin_manager::all_symbols_read): Add task parameter.
15368 (Plugin_manager::get_input_file): New function.
15369 (Plugin_manager::release_input_file): New function.
15370 (Plugin_manager::task_): New data member.
15371 (Pluginobj::Pluginobj): Add filesize parameter.
15372 (Pluginobj::filename): New function.
15373 (Pluginobj::descriptor): New function.
15374 (Pluginobj::filesize): New function.
15375 (Pluginobj::filesize_): New data member.
15376 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
15377 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
15378 File_read::claim_for_plugin; use Object::unlock to unlock the file.
15379
15380 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
15381 with archive libraries.
15382 * testsuite/Makefile.in: Regenerate.
15383 * testsuite/plugin_test.c (struct sym_info): New type.
15384 (get_input_file, release_input_file): New static variables.
15385 (onload): Capture new transfer vector entries.
15386 (claim_file_hook): Stop reading at end of file according to filesize.
15387 Factor out parsing of readelf output into separate function.
15388 (all_symbols_read_hook): Exercise get_input_file and release_input_file
15389 APIs and get the source file name from the symbol table. Convert
15390 source file name to corresponding object file name. Print info
15391 message when adding new input files.
15392 (parse_readelf_line): New function.
15393 * testsuite/plugin_test_1.sh: Add checks for new info messages.
15394 * testsuite/plugin_test_2.sh: Likewise.
15395 * testsuite/plugin_test_3.sh: Likewise.
15396 * testsuite/plugin_test_4.sh: New test case.
15397
62a6d109
ILT
153982009-01-07 Ian Lance Taylor <iant@google.com>
15399
15400 * version.cc (version_string): Bump to 1.8.
15401
483620e8
CC
154022008-12-23 Cary Coutant <ccoutant@google.com>
15403
15404 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
15405 * plugin.cc (Plugin_manager::finish): Rename as
15406 layout_deferred_objects. Move cleanup to separate function.
15407 (Plugin_manager::cleanup): New function.
15408 (Plugin_finish::run): Call layout_deferred_objects and cleanup
15409 separately.
15410 * plugin.h (Plugin_manager::finish): Rename as
15411 layout_deferred_objects.
15412 (Plugin_manager::cleanup): New function.
15413 (Plugin_manager::cleanup_done): New field.
15414
d66a9eb3
CC
154152008-12-23 Cary Coutant <ccoutant@google.com>
15416
15417 * plugin.cc (is_visible_from_outside): New function.
15418 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
15419 so we don't return "IR only" status for exported symbols or -r links.
15420
15421 * testsuite/Makefile.am (plugin_test_3): New test case.
15422 * testsuite/Makefile.in: Regenerate.
15423 * testsuite/plugin_test_3.sh: New file.
15424
5995b570
CC
154252008-12-22 Cary Coutant <ccoutant@google.com>
15426
15427 * object.cc (Sized_relobj::layout_section): New function.
15428 (Sized_relobj::do_layout): Defer layout of input sections until after
15429 plugin has provided replacement files.
15430 (Sized_relobj::do_layout_deferred_sections): New function.
15431 * object.h (Relobj::set_section_offset): Remove virtual keyword.
15432 (Relobj::layout_deferred_sections): New function.
15433 (Relobj::do_layout_deferred_sections): New function.
15434 (Sized_relobj::do_layout_deferred_sections): New function.
15435 (Sized_relobj::layout_section): New function.
15436 (Sized_relobj::Deferred_layout): New structure.
15437 (Sized_relobj::deferred_layout_): New field.
15438 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
15439 Change all callers. Layout deferred sections.
15440 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
15441 references.
15442 (Plugin_hook::run): Move code from do_plugin_hook inline.
15443 (Plugin_hook::do_plugin_hook): Remove.
15444 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
15445 (Plugin_manager::finish): Renamed, was cleanup.
15446 (Plugin_manager::should_defer_layout): New function.
15447 (Plugin_manager::add_deferred_layout_object): New function.
15448 (Plugin_manager::Deferred_layout_list): New type.
15449 (Plugin_manager::deferred_layout_objects_): New field.
15450 (Plugin_hook::do_plugin_hook): Remove.
15451
ee769c88
ILT
154522008-12-17 Ian Lance Taylor <iant@google.com>
15453
15454 * options.h (class General_options): Add --no case for
15455 --export-dynamic.
15456
abc8dcba
CC
154572008-12-16 Cary Coutant <ccoutant@google.com>
15458
15459 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
15460 vector.
15461 (Plugin_manager::claim_file): Create plugin object even if
15462 plugin did not call the add_symbols callback.
15463 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
15464 asking for more symbols than were added.
15465 * testsuite/Makefile.am (plugin_test_1): Add test case with
15466 no global symbols.
15467 (empty.syms): New target.
15468 * testsuite/Makefile.in: Regenerate.
15469 * testsuite/plugin_test.c (claim_file_hook): Add new debug
15470 message. Don't call add_symbols if no globals.
15471 (all_symbols_read_hook): Don't provide replacement for empty
15472 claimed file.
15473
b0074644
ILT
154742008-12-12 Ian Lance Taylor <iant@google.com>
15475
68943102
ILT
15476 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
15477 r_type == 0 for a local symbol with r_sym == 0.
15478 (scan_relocatable_relocs): Pass r_sym to
15479 local_non_section_strategy.
15480 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
15481 r_sym parameter.
15482
b0074644
ILT
15483 * configure.ac: Update test for TLS descriptors: they are
15484 supported as of glibc 2.9.
15485 * configure: Rebuild.
15486
c2508178
ILT
154872008-12-11 Ian Lance Taylor <iant@google.com>
15488
15489 PR 7091
15490 * target-reloc.h (Default_scan_relocatable_relocs): For each
15491 function, map r_type == 0 to RELOC_DISCARD.
15492
2756a258
CC
154932008-12-10 Cary Coutant <ccoutant@google.com>
15494
15495 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
15496 object to override a kept COMDAT group from a plugin object.
15497
bb6f53d3
ILT
154982008-12-09 Ian Lance Taylor <iant@google.com>
15499
fbc558e1
ILT
15500 PR 7088
15501 * yyscript.y (file_cmd): Handle INPUT.
15502
bb6f53d3
ILT
15503 * testsuite/initpri1.c: Change all declarations to be full
15504 prototypes by adding void, to avoid compiler warnings.
15505
4674ecfc
CC
155062008-12-05 Rafael Avila de Espindola <espindola@google.com>
15507
15508 * options.cc (General_options::parse_plugin_opt): New.
15509 (General_options::add_plugin): The argument now is just the filename.
15510 (General_options::add_plugin_option): New.
15511 * options.h (plugin_opt): New.
15512 (add_plugin): Change argument name.
15513 (add_plugin_option): New.
15514 * plugin.cc (Plugin::load): Don't parse the plugin option.
15515 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
15516 (Plugin::add_option): New.
15517 (Plugin::args_): Change type.
15518 (Plugin::filename_): New.
15519 (Plugin_manager::add_plugin_option): New.
15520 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
15521 * testsuite/Makefile.in: Regenerate.
15522
fd06b4aa
CC
155232008-12-05 Cary Coutant <ccoutant@google.com>
15524
15525 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
15526 Handle --strip-lto-sections option.
15527 * options.h (strip_lto_sections): New option.
15528
6c52134c
CC
155292008-12-01 Cary Coutant <ccoutant@google.com>
15530
15531 * plugin.cc (ld_plugin_message): Change format parameter to const.
15532 Fix mismatch between new[] and delete.
15533
a45248e0
CC
155342008-11-14 Cary Coutant <ccoutant@google.com>
15535
15536 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
15537 instead of -1U.
15538
c82fbeee
CS
155392008-11-05 Craig Silverstein <csilvers@google.com>
15540
15541 * options.cc (General_options::parse_dynamic_list): New function.
15542 * options.h (General_options): New flags dynamic_list,
15543 dynamic_list_data, dynamic_list_cpp_new, and
15544 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
15545 (General_options::in_dynamic_list): New function.
15546 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
15547 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
15548 (Lex::can_continue_name): Likewise.
15549 (yylex): Likewise.
15550 (read_script_file): New parameter script_options.
15551 (read_dynamic_list): New function.
15552 (Script_options::define_dynamic_list): New function.
15553 (dynamic_list_keyword_parsecodes): New variable.
15554 (dynamic_list_keywords): New variable.
15555 * script.h (Script_options::define_dynamic_list): New function
15556 prototype.
15557 (read_dynamic_list): New function prototype.
15558 * symtab.cc (strprefix): New macro.
15559 (Symbol::should_add_dynsym_entry): Support dynamic_list,
15560 dynamic_list_data, dynamic_list_cpp_new, and
15561 dynamic_list_cpp_typeinfo.
15562 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
15563 (dynamic_list_expr): New rule.
15564 (dynamic_list_nodes): Likewise.
15565 (dynamic_list_node): Likewise.
15566 * testsuite/Makefile.am (dynamic_list): New test.
15567 * testsuite/Makefile.in: Regenerated.
15568 * testsuite/dynamic_list.t: New file.
15569 * testsuite/dynamic_list.sh: New file.
15570
e0bb29a5
CS
155712008-11-05 Craig Silverstein <csilvers@google.com>
15572
15573 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
15574 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
15575 (t11_last): Likewise.
15576 * testsuite/ver_test_6.c (main): Likewise.
15577
4e1e25e0
CC
155782008-10-07 Cary Coutant <ccoutant@google.com>
15579
15580 * options.c (General_options::finalize): Add check for -static and
15581 -shared.
15582 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
15583 is not empty.
15584
92f03fcb
CC
155852008-10-02 Cary Coutant <ccoutant@google.com>
15586
15587 * plugin.cc (make_sized_plugin_object): Fix conditional
15588 compilation to work when not all targets are enabled.
15589
fbd8a257
CC
155902008-09-29 Cary Coutant <ccoutant@google.com>
15591
15592 * archive.cc (Archive::get_file_and_offset): Use filename instead
15593 of name to get library path.
15594 (Archive::include_member): Unlock external member of a thin archive.
15595
15596 * testsuite/Makefile.am (TEST_AR): New variable.
15597 (thin_archive_test_1): New test.
15598 (thin_archive_test_2): New test.
81636b3f
CC
15599 * testsuite/Makefile.in: Regenerate.
15600 * testsuite/thin_archive_main.cc: New file.
15601 * testsuite/thin_archive_test_1.cc: New file.
15602 * testsuite/thin_archive_test_2.cc: New file.
15603 * testsuite/thin_archive_test_3.cc: New file.
15604 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 15605
eff45813
CC
156062008-09-29 Cary Coutant <ccoutant@google.com>
15607
15608 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
15609 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
15610 instead of -1U.
15611 (Sized_relobj::do_finalize_local_symbols): Likewise.
15612 (Sized_relobj::map_to_kept_section): Likewise.
15613 * object.h (Sized_relobj::invalid_address): New constant.
15614 (Sized_relobj::do_output_section_offset): Check for invalid_address
15615 and return -1ULL.
15616 * output.cc (Output_reloc::local_section_offset): Use constant
15617 invalid_address instead of -1U.
15618 (Output_reloc::get_address): Likewise.
15619 (Output_section::output_address): Change -1U to -1ULL.
15620 * output.h (Output_reloc::invalid_address): New constant.
15621 * reloc.cc (Sized_relobj::write_sections): Use constant
15622 invalid_address instead of -1U.
15623 (Sized_relobj::relocate_sections): Likewise.
15624 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
15625 values for merge sections.
15626 * target-reloc.h (relocate_for_relocatable): Use constant
15627 invalid_address instead of -1U.
15628
89fc3421
CC
156292008-09-19 Cary Coutant <ccoutant@google.com>
15630
15631 Add plugin functionality for link-time optimization (LTO).
15632 * configure.ac (plugins): Add --enable-plugins option.
15633 * configure: Regenerate.
15634 * config.in: Regenerate.
15635 * Makefile.am (LIBDL): New variable.
15636 (CCFILES): Add plugin.cc.
15637 (HFILES): Add plugin.h.
15638 (ldadd_var): Add LIBDL.
15639 * Makefile.in: Regenerate.
15640
15641 * archive.cc: Include "plugin.h".
15642 (Archive::setup): Don't preread archive symbols when using a plugin.
15643 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
15644 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
15645 files.
15646 (Archive::include_member): Add symbols from plugin objects.
15647 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
15648 * descriptors.cc (Descriptors::open): Check for file descriptors
15649 abandoned by plugins.
15650 (Descriptors::claim_for_plugin): New function.
15651 * descriptors.h (Descriptors::claim_for_plugin): New function.
15652 (Open_descriptor::is_claimed): New field.
15653 (claim_descriptor_for_plugin): New function.
15654 * fileread.cc (File_read::claim_for_plugin): New function.
15655 * fileread.h (File_read::claim_for_plugin): New function.
15656 (File_read::descriptor): New function.
15657 * gold.cc: Include "plugin.h".
15658 (queue_initial_tasks): Add task to call plugin hooks for generating
15659 new object files.
15660 * main.cc: Include "plugin.h".
15661 (main): Load plugin libraries.
15662 * object.h (Pluginobj): Declare.
15663 (Object::pluginobj): New function.
15664 (Object::do_pluginobj): New function.
15665 (Object::set_target): New function.
15666 * options.cc: Include "plugin.h".
15667 (General_options::parse_plugin): New function.
15668 (General_options::General_options): Initialize plugins_ field.
15669 (General_options::add_plugin): New function.
15670 * options.h (Plugin_manager): Declare.
15671 (General_options): Add --plugin option.
15672 (General_options::has_plugins): New function.
15673 (General_options::plugins): New function.
15674 (General_options::add_plugin): New function.
15675 (General_options::plugins_): New field.
15676 * plugin.cc: New file.
15677 * plugin.h: New file.
15678 * readsyms.cc: Include "plugin.h".
15679 (Read_symbols::do_read_symbols): Check for archive before checking
15680 for ELF file. Call plugin hooks to claim files.
15681 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
15682 from a real object file; force override when processing replacement
15683 files.
15684 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
15685 (Symbol::init_base_object): Likewise.
15686 (Symbol::init_base_output_data): Likewise.
15687 (Symbol::init_base_output_segment): Likewise.
15688 (Symbol::init_base_constant): Likewise.
15689 (Symbol::init_base_undefined): Likewise.
15690 (Symbol::output_section): Assert that object is not a plugin.
15691 (Symbol_table::add_from_pluginobj): New function.
15692 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
15693 undefined.
15694 (Symbol_table::sized_write_globals): Likewise.
15695 (Symbol_table::add_from_pluginobj): Instantiate template.
15696 * symtab.h (Sized_pluginobj): Declare.
15697 (Symbol::in_real_elf): New function.
15698 (Symbol::set_in_real_elf): New function.
15699 (Symbol::in_real_elf_): New field.
15700 (Symbol_table::add_from_pluginobj): New function.
15701
15702 * testsuite/Makefile.am (AM_CFLAGS): New variable.
15703 (LIBDL): New variable.
15704 (LDADD): Add LIBDL.
15705 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
15706 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
15707 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
15708 (MOSTLYCLEANFILES): Likewise.
15709 * testsuite/Makefile.in: Regenerate.
15710 * testsuite/plugin_test.c: New file.
15711 * testsuite/plugin_test_1.sh: New file.
15712 * testsuite/plugin_test_2.sh: New file.
15713
de31bda5
ILT
157142008-09-16 Ian Lance Taylor <iant@google.com>
15715
9c2d0ef9
ILT
15716 * target-reloc.h (relocate_section): Check whether a symbol is
15717 defined by the ABI before reporting an undefined symbol error.
15718 * target.h (Target::is_defined_by_abi): Make parameter const.
15719 (Target::do_is_defined_by_abi): Likewise.
15720 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
15721 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
15722 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
15723 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
15724 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
15725 * testsuite/Makefile.in: Rebuild.
15726
de31bda5
ILT
15727 * fileread.cc (make_view): Add casts to avoid warning.
15728
9fa33bee
AO
157292008-09-16 Alexandre Oliva <aoliva@redhat.com>
15730
15731 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
15732 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15733
183fd0e3
AO
157342008-09-16 Alexandre Oliva <aoliva@redhat.com>
15735
15736 * options.h (General_options::output_is_executable): New.
15737 (General_options::output_is_pie): New.
15738 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
15739 for shared libraries.
15740 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
15741
7be8330a
CD
157422008-09-11 Chris Demetriou <cgd@google.com>
15743
15744 * options.h (origin): New -z option.
15745 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
15746 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
15747 in DT_FLAGS_1.
15748
a9caad02
CC
157492008-09-05 Cary Coutant <ccoutant@google.com>
15750
15751 * fileread.cc (File_read::make_view): Add check for attempt to map
15752 beyond end of file.
15753
ae6dce4d
CC
157542008-09-05 Cary Coutant <ccoutant@google.com>
15755
15756 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
15757 explicit instantiations.
15758
d7ab2a47
KVH
157592008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
15760
15761 PR gold/6858
15762 * options.cc (General_options::finalize): Allow undefined symbols
15763 in shlibs if linking -shared.
15764
15765 PR gold/6859
15766 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
15767 symbols as not needing a dynsym entry.
15768
1e52a9c1
CS
157692008-08-20 Craig Silverstein <csilvers@google.com>
15770
15771 * fileread.cc (File_read::open): Do not lock the file unless it
15772 was successfully opened.
15773
d85c80a3
CC
157742008-08-14 Cary Coutant <ccoutant@google.com>
15775
15776 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
15777 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
15778 * testsuite/tls_test.cc (struct int128): 128-bit struct
15779 for testing TLS relocs with non-zero addend.
15780 (v12): New TLS variable.
15781 (t12): New test.
15782 (t_last): Add check for v12.
15783 * testsuite/tls_test.h (t12): New function.
15784 * testsuite/tls_test_main.cc (thread_routine): Call new test.
15785
2d924fd9
ILT
157862008-08-13 Ian Lance Taylor <iant@google.com>
15787
15788 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
15789 set tls_segment_ or relro_segment_.
15790 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
15791 when appropriate.
15792 * output.h (Output_section::clear_is_relro): New function.
15793 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
15794 sections specially even when output_data_ is empty.
15795 (Output_segment::maximum_alignment): When first section is relro,
15796 only force alignment for PT_LOAD segments.
15797 * script.cc (script_data_segment_align): New function.
15798 (script_data_segment_relro_end): New function.
15799 * script-c.h (script_data_segment_align): Declare.
15800 (script_data_segment_relro_end): Declare.
15801 * script-sections.h (class Script_sections): Declare
15802 data_segment_align and data_segment_relro_end. Add fields
15803 segment_align_index_ and saw_relro_end_.
15804 * script-sections.cc (class Sections_element): Add set_is_relro
15805 virtual function. Add new bool* parameter to place_orphan_here.
15806 Add get_output_section virtual function.
15807 (class Output_section_definition): Add set_is_relro. Add new
15808 bool* parameter to place_orphan_here. Add get_output_section.
15809 Add is_relro_ field.
15810 (Output_section_definition::Output_section_definition): Initialize
15811 evaluated_address_, evaluated_load_address, evaluated_addralign_,
15812 and is_relro_ fields.
15813 (Output_section_definition::place_orphan_here): Add is_relro
15814 parameter.
15815 (Output_section_definition::set_section_addresses): Set relro for
15816 output section.
15817 (Output_section_definition::alternate_constraint): Likewise.
15818 (class Orphan_output_section): Add new bool* parameter to
15819 place_orphan_here. Add get_output_section.
15820 (Orphan_output_section::place_orphan_here): Add is_relro
15821 parameter.
15822 (Script_sections::Script_sections): Initialize
15823 data_segment_align_index_ and saw_relro_end_.
15824 (Script_sections::data_segment_align): New function.
15825 (Script_sections::data_segment_relro_end): New function.
15826 (Script_sections::place_orphan): Set or clear is_relro.
15827 (Script_sections::set_section_addresses): Force alignment of first
15828 TLS section.
15829 * yyscript.y (exp): Call script_data_segment_align and
15830 script_data_segment_relro_end.
15831 * testsuite/relro_script_test.t: New file.
15832 * testsuite/relro_test.cc (using_script): Declare.
15833 (t1, t2): Test using_script.
15834 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
15835 (relro_script_test_SOURCES): Define.
15836 (relro_script_test_DEPENDENCIES): Define.
15837 (relro_script_test_LDFLAGS): Define.
15838 (relro_script_test_LDADD): Define.
15839 (relro_script_test.so): New target.
15840 * testsuite/Makefile.in: Rebuild.
15841
f827c9a9
CC
158422008-08-06 Cary Coutant <ccoutant@google.com>
15843
15844 * archive.cc (Archive::total_archives, Archive::total_members)
15845 (Archive::total_members_loaded): New variables.
15846 (Archive::setup): Add parameter. Add option to preread
15847 archive symbols.
15848 (Archive::read_armap): Add counter.
15849 (Archive::get_file_and_offset): New function.
15850 (Archive::get_elf_object_for_member): New function.
15851 (Archive::read_all_symbols): New function.
15852 (Archive::read_symbols): New function.
15853 (Archive::add_symbols): Add counters.
15854 (Archive::include_all_members): Use armap to find members if it's
15855 already built.
15856 (Archive::include_member): Skip reading symbols if already read.
15857 Factored code into Archive::get_file_and_offset and
15858 Archive::get_elf_object_for_member. Changed call to
15859 Mapfile::report_include_archive_member.
15860 (Archive::print_stats): New function.
15861 * archive.h: Declare Object and Read_symbols_data classes.
15862 (Archive::Archive): Add initializers for new members.
15863 (Archive::setup): Add parameter.
15864 (Archive::print_stats): New function.
15865 (Archive::total_archives, Archive::total_members)
15866 (Archive::total_members_loaded): New variables.
15867 (Archive::get_file_and_offset): New function.
15868 (Archive::get_elf_object_for_member): New function.
15869 (Archive::read_all_symbols): New function.
15870 (Archive::read_symbols): New function.
15871 (Archive::Archive_member): New class.
15872 (Archive::members_): New member.
15873 (Archive::num_members_): New member.
15874 * main.cc: Include archive.h.
15875 (main): Call Archive::print_stats.
15876 * mapfile.cc (Mapfile::report_include_archive_member): Delete
15877 archive parameter; member_name is now the fully-decorated name.
15878 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
15879 * options.h: (General_options): Add --preread-archive-symbols option.
15880 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
15881 Archive::setup.
15882
de4c45bd
ILT
158832008-08-04 Ian Lance Taylor <iant@google.com>
15884
15885 * symtab.h (Symbol::use_plt_offset): New function.
15886 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
15887 * powerpc.cc (Relocate::relocate): Likewise.
15888 * sparc.cc (Relocate::relocate): Likewise.
15889 * x86_64.cc (Relocate::relocate): Likewise.
15890 * testsuite/weak_plt.sh: New test.
15891 * testsuite/weak_plt_main.cc: New test.
15892 * testsuite/weak_plt_shared.cc: New test.
15893 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
15894 (check_PROGRAMS): Add weak_plt.
15895 (check_DATA): Add weak_plt_shared.so.
15896 (weak_plt_main_pic.o, weak_plt): New targets.
15897 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
15898 * testsuite/Makefile.in: Rebuild.
15899
15900 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
15901 gcctestdir/ld.
15902 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
15903 * testsuite/Makefile.in: Rebuild.
15904
323ee3f4
AM
159052008-08-04 Alan Modra <amodra@bigpond.net.au>
15906
15907 * Makefile.am (POTFILES.in): Set LC_ALL=C.
15908 * Makefile.in: Regenerate.
15909 * po/POTFILES.in: Regenerate.
15910
7c07ecec
ILT
159112008-07-29 Ian Lance Taylor <iant@google.com>
15912
15913 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
15914 symbols before other symbols.
15915 * testsuite/script_test_2.cc (test_addr): Declare.
15916 (test_addr_alias): Declare.
15917 (main): Check that test_addr and test_addr_alias have the right
cd536b21 15918 values.
7c07ecec
ILT
15919 * testsuite/script_test_2.t: Define test_addr_alias and
15920 test_addr.
15921
5778530e
ILT
159222008-07-24 Ian Lance Taylor <iant@google.com>
15923
2a00e4fb
ILT
15924 PR 5990
15925 * descriptors.cc: New file.
15926 * descriptors.h: New file.
15927 * gold-threads.h (class Hold_optional_lock): New class.
15928 * fileread.cc: Include "descriptors.h".
15929 (File_read::~File_read): Release descriptor rather than closing
15930 it.
15931 (File_read::open) [file]: Call open_descriptor rather than open.
15932 Set is_descriptor_opened_.
15933 (File_read::open) [memory]: Assert that descriptor is not open.
15934 (File_read::reopen_descriptor): New function.
15935 (File_read::release): Release descriptor.
15936 (File_read::do_read): Make non-const. Reopen descriptor.
15937 (File_read::read): Make non-const.
15938 (File_read::make_view): Reopen descriptor.
15939 (File_read::do_readv): Likewise.
15940 * fileread.h (class File_read): Add is_descriptor_opened_ field.
15941 Update declarations.
15942 * layout.cc: Include "descriptors.h".
15943 (Layout::create_build_id): Use open_descriptor rather than open.
15944 * output.cc: Include "descriptors.h".
15945 (Output_file::open): Use open_descriptor rather than open.
15946 * archive.cc (Archive::const_iterator): Change Archive to be
15947 non-const.
15948 (Archive::begin, Archive::end): Make non-const.
15949 (Archive::count_members): Likewise.
15950 * archive.h (class Archive): Update declarations.
15951 * object.h (Object::read): Make non-const.
15952 * Makefile.am (CCFILES): Add descriptors.cc.
15953 (HFILES): Add descriptors.h.
15954 * Makefile.in: Rebuild.
15955
801647d1
ILT
15956 PR 6716
15957 * gold.h: Always include <clocale>. Add Solaris workarounds
15958 following code in binutils/sysdep.h.
15959
5edd166e
ILT
15960 PR 6048
15961 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
15962 this->eh_frame_hdr_ is NULL before using it.
15963
c89ad728
ILT
15964 * dynobj.cc (Versions::Versions): Update comment.
15965
aa86f06b
ILT
15966 * dynobj.cc (Versions::Versions): If there is an soname, use it as
15967 the base version name.
15968
5778530e
ILT
15969 * stringpool.cc (Stringpool_template::add_with_length): Set key to
15970 array size plus one.
15971 (Stringpool_template::set_string_offsets): Subtract one from key
15972 before using it as an array index.
15973 (Stringpool_template::get_offset_with_length): Likewise.
15974 (Stringpool_template::write_to_buffer): Likewise.
15975 * stringpool.h (Stringpool_template::get_offset_from_key):
15976 Likewise.
15977
057ead22
ILT
159782008-07-23 Ian Lance Taylor <iant@google.com>
15979
7f649c59
ILT
15980 PR 6658
15981 * object.h (Merged_symbol_value::value): Do our best to handle a
15982 negative addend.
15983
057ead22
ILT
15984 PR 6647
15985 * script.cc (Version_script_info::get_versions): Don't add empty
15986 version tag to return value.
15987 (Version_script_info::get_symbol_version_helper): Change return
15988 type to bool. Add pversion parameter. Change all callers.
15989 (script_register_vers_node): Don't require a non-NULL tag.
15990 * script.h (class Version_script_info): Update declarations.
15991 (Version_script_info::get_symbol_version): Change return type to
15992 bool. Add version parameter. Change all callers.
15993 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
15994 handling. Handle an empty version from a version script.
15995 (Symbol_table::define_special_symbol): Likewise.
15996 * testsuite/ver_test_10.script: New file.
15997 * testsuite/ver_test_10.sh: New file.
15998 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
15999 (check_DATA): Add ver_test_10.syms.
16000 (ver_test_10.syms, ver_test_10.so): New target.
16001 * testsuite/Makefile.in: Rebuild.
16002
58e54ac2
CD
160032008-07-23 Simon Baldwin <simonb@google.com>
16004
16005 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
16006 to zero for undefined symbols from dynamic libraries.
16007
95d14cd3
ILT
160082008-07-23 Ian Lance Taylor <iant@google.com>
16009
16010 * symtab.cc (Symbol_table::resolve): Remove version parameter.
16011 Change all callers.
16012 * symtab.h (class Symbol_table): Update declaration.
16013 * testsuite/ver_test_9.cc: New file.
16014 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
16015 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
16016 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
16017 (ver_test_9.so, ver_test_9.o): New targets.
16018 * testsuite/Makefile.in: Rebuild.
16019
92de84a6
ILT
160202008-07-22 Ian Lance Taylor <iant@google.com>
16021
34810851
ILT
16022 * options.h (class General_options): Define --check-sections.
16023 * layout.cc (Layout::set_segment_offsets): Handle
16024 --check-sections.
16025
af6156ef
ILT
16026 * options.h (class General_options): Define -n/--nmagic and
16027 -N/--omagic.
16028 * options.cc (General_options::finalize): For -n/--nmagic or
16029 -N/--omagic, set -static.
16030 * layout.cc (Layout::attach_allocated_section_to_segment): If
16031 -N/--omagic, don't put read-only and read-write sections in
16032 different segments.
16033 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
16034 finding a read-only segment.
16035 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
16036 don't set the minimum segment alignment to the common page size,
16037 and don't set the file offset to the address modulo the page size.
16038 * script-sections.cc (Script_sections::create_segments): If
16039 -n/--omagic, don't put read-only and read-write sections in
16040 different segments.
16041
92de84a6
ILT
16042 * cref.cc: New file.
16043 * cref.h: New file.
16044 * options.h (class General_options): Add --print-symbol-counts.
16045 * main.cc (main): Issue defined symbol report if requested.
16046 * archive.cc (Archive::interpret_header): Make into a const member
16047 function.
16048 (Archive::add_symbols): Call Input_objects::archive_start and
16049 archive_stop.
16050 (Archive::const_iterator): Define new class.
16051 (Archive::begin, Archive::end): New functions.
16052 (Archive::include_all_members): Rewrite to use iterator.
16053 (Archive::count_members): New function.
16054 * archive.h (class Archive): Update declarations.
16055 (Archive::filename): New function.
16056 * object.cc: Include "cref.h".
16057 (Sized_relobj::Sized_relobj): Initialize defined_count_.
16058 (Sized_relobj::do_get_global_symbol_counts): New function.
16059 (Input_objects::add_object): Add object to cross-referencer.
16060 (Input_objects::archive_start): New function.
16061 (Input_objects::archive_stop): New function.
16062 (Input_objects::print_symbol_counts): New function.
16063 * object.h: Declare Cref and Archive.
16064 (Object::get_global_symbol_counts): New function.
16065 (Object::do_get_global_symbol_counts): New pure virtual function.
16066 (class Sized_relobj): Add defined_count_ field. Update
16067 declarations.
16068 (class Input_objects): Add cref_ field. Update constructor.
16069 Update declarations.
16070 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
16071 defined_count_.
16072 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
16073 symbol counts.
16074 (Sized_dynobj::do_get_global_symbol_counts): New function.
16075 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
16076 defined_count_. Update declarations. Define Symbols typedef.
16077 * symtab.cc (Symbol_table::add_from_relobj): Add defined
16078 parameter. Change all callers.
16079 (Symbol_table::add_from_dynobj): Add sympointers and defined
16080 parameters. Change all callers.
16081 * symtab.h (class Symbol_table): Update declarations.
16082 * Makefile.am (CCFILES): Add cref.cc.
16083 (HFILES): Add cref.h.
16084 * Makefile.in: Rebuild.
16085
3f7c5e1d
CD
160862008-07-22 Simon Baldwin <simonb@google.com>
16087
16088 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
16089 to zero when writing undefined symbols.
16090
e0b64032
ILT
160912008-07-22 Ian Lance Taylor <iant@google.com>
16092
16093 * output.cc (Output_section::add_input_section): Don't try to
16094 merge empty merge sections.
16095
096b02cf
CS
160962008-07-21 Craig Silverstein <csilvers@google.com>
16097
16098 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
16099 Include symbol version in error message.
cd536b21 16100
1d1f116d
CD
161012008-07-20 Chris Demetriou <cgd@google.com>
16102
cd536b21 16103 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
16104 (RANDOM_SEED_CFLAGS): New substituted variable.
16105 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16106 * configure: Rebuild.
16107 * Makefile.in: Likewise.
16108 * testsuite/Makefile.in: Likewise.
16109
a18f591e
ILT
161102008-07-18 Ian Lance Taylor <iant@google.com>
16111
16112 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
16113 where we see NAME/NULL and NAME/VERSION as separate symbols.
16114 * testsuite/ver_test_main.cc (main): Call t4.
16115 (t4, t4_2a): Define.
16116 * testsuite/ver_test_2.cc (t4_2): Define.
16117 * testsuite/ver_test_2.script: Put t4_2a in VER2.
16118 * testsuite/ver_test_4.cc (t4_2a): Define.
16119 * testsuite/ver_test_4.script: Put t4_2a in VER2.
16120 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
16121
c6e3f6ed
ILT
161222008-07-17 Ian Lance Taylor <iant@google.com>
16123
16124 * dynobj.cc (Versions::add_def): If we give an error about a
16125 missing version, go ahead and create the version anyhow.
16126
ef9beddf
ILT
161272008-07-10 Ian Lance Taylor <iant@google.com>
16128
16129 Handle output sections with more than 0x7fffffff bytes.
16130 * object.h (class Relobj): Change map_to_output_ to
16131 output_sections_, and just keep a section pointer. Change all
16132 uses. Move comdat group support to Sized_relobj.
16133 (Relobj::is_section_specially_mapped): Remove.
16134 (Relobj::output_section): Remove poff parameter. Change all
16135 callers.
16136 (Relobj::output_section_offset): New function.
16137 (Relobj::set_section_offset): Rewrite.
16138 (Relobj::map_to_output): Remove.
16139 (Relobj::output_sections): New function.
16140 (Relobj::do_output_section_offset): New pure virtual function.
16141 (Relobj::do_set_section_offset): Likewise.
16142 (class Sized_relobj): Add section_offsets_ field. Add comdat
16143 group support from Relobj. Update declarations.
16144 (Sized_relobj::get_output_section_offset): New function.
16145 (Sized_relobj::do_output_section_offset): New function.
16146 (Sized_relobj::do_set_section_offset): New function.
16147 * object.cc (Relobj::output_section_address): Remove.
16148 (Sized_relobj::Sized_relobj): Initialize new fields.
16149 (Sized_relobj::include_section_group): Cast find_kept_object to
16150 Sized_relobj.
16151 (Sized_relobj::include_linkonce_section): Likewise.
16152 (Sized_relobj::do_layout): Use separate arrays for output section
16153 and output offset.
16154 (Sized_relobj::do_count_local_symbols): Change map_to_output to
16155 output_sections.
16156 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
16157 output_sections and section_offsets.
16158 (Sized_relobj::write_local_symbols): Likewise.
16159 (map_to_kept_section): Compute output address directly.
16160 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
16161 output_sections and section_offsets.
16162 (Sized_relobj::write_sections): Likewise.
16163 (Sized_relobj::relocate_sections): Likewise.
16164 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
16165 * output.h (class Output_reloc): Update declarations. Change
16166 u2_.relobj to Sized_relobj*.
16167 (class Output_data_reloc): Change add functions to use
16168 Sized_relobj*.
16169 * output.cc (Output_reloc::Output_reloc): Change relobj to
16170 Sized_relobj*.
16171 (Output_reloc::local_section_offset): Change return type to
16172 Elf_Addr. Use get_output_section_offset.
16173 (Output_reloc::get_address): Likewise.
16174 (Output_section::is_input_address_mapped): Don't call
16175 is_section_specially_mapped.
16176 (Output_section::output_offset): Likewise.
16177 (Output_section::output_address): Likewise.
16178 (Output_section::starting_output_address): Likewise.
16179 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
16180 parameter to Sized_relobj*.
16181 (Copy_relocs::need_copy_reloc): Likewise.
16182 (Copy_relocs::save): Likewise.
16183 * copy-relocs.h (class Copy_relocs): Update declarations.
16184 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
16185 Sized_relobj*. Change relobj_ field to Sized_relobj*.
16186 * target-reloc.h (relocate_for_relocatable): Change
16187 offset_in_output_section type to Elf_Addr. Change code that uses
16188 it as well.
16189 * layout.cc (Layout::layout): Always set *off.
16190 * mapfile.cc (Mapfile::print_input_section): Use
16191 output_section_offset.
16192 * i386.cc (Target_i386::copy_reloc): Change object parameter to
16193 Sized_relobj*.
16194 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
16195 * sparc.cc (Target_sparc::copy_reloc): Likewise.
16196 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
16197
5cb66f97
ILT
161982008-07-03 Ian Lance Taylor <iant@google.com>
16199
16200 * layout.cc (Layout::include_section): Do not discard unrecognized
16201 SHT_STRTAB sections.
16202
afe47622
CS
162032008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
16204
16205 * script.cc (Lex::can_continue_name): Make '?' allowable in
16206 version-script names.
16207 * testsuite/version_script.map: Change glob pattern to use '?'
16208
5adf9721
ILT
162092008-06-30 Manish Singh <yosh@gimp.org>
16210
16211 PR 6585
16212 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
16213 Correct typo.
16214
e6fde208
ILT
162152008-06-30 Ian Lance Taylor <iant@google.com>
16216
16217 PR 6660
16218 PR 6682
16219 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
16220 versions]: Don't try to read the value in the contents, since we
16221 don't use it. Use the template endianness when writing.
16222
3f2e6a2d
CC
162232008-06-25 Cary Coutant <ccoutant@google.com>
16224
16225 * fileread.cc (File_read::make_view): Assert on zero-length view.
16226 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
16227 symbol table when there are no symbols to read.
16228
c43d3a48
CS
162292008-06-23 Craig Silverstein <csilvers@google.com>
16230
16231 * version.cc (version_string): Bump to 1.7
16232
5f494ea0
CS
162332008-06-18 Craig Silverstein <csilvers@google.com>
16234
16235 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
16236 constant 0xFFFF to type Valtype.
16237 (Powerpc_relocate_functions::rel16_ha): Likewise.
16238
c42e122e
ILT
162392008-06-17 Ian Lance Taylor <iant@google.com>
16240
f34787f8
ILT
16241 * output.h (Output_section::Input_section): Initialize p2align_ to
16242 zero for Output_section_data constructors.
16243 (Output_section::Input_section::addralign): If not an input
16244 section, return the alignment of the Output_section_data.
16245 * testsuite/copy_test.cc: New file.
16246 * testsuite/copy_test_1.cc: New file.
16247 * testsuite/copy_test_2.cc: New file.
16248 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
16249 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
16250 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
16251 (copy_test_1_pic.o, copy_test_1.so): New targets.
16252 (copy_test_2_pic.o, copy_test_2.so): New targets.
16253 * testsuite/Makefile.in: Rebuild.
16254
c42e122e
ILT
16255 * script-sections.cc (Script_sections::place_orphan): Initialize
16256 local variable exact.
16257
ce3ac18a
DE
162582008-06-13 David Edelsohn <edelsohn@gnu.org>
16259
16260 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
16261
42cacb20
DE
162622008-06-12 David Edelsohn <edelsohn@gnu.org>
16263 David S. Miller <davem@davemloft.net>
16264
16265 * powerpc.cc: New file.
16266 * Makefile.am (TARGETSOURCES): Add powerpc.cc
16267 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
16268 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
16269 * Makefile.in: Rebuild.
16270
7b308235
ILT
162712008-06-09 Ian Lance Taylor <iant@google.com>
16272
16273 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
16274 <exception>.
16275 (throwing, orig_terminate): New static variables.
16276 (terminate_handler): New static function.
16277 (t2): Set terminate handler.
16278
f0b886e3
ILT
162792008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
16280
16281 PR 6584
cd536b21 16282 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
16283 alignment.
16284
3e90f135
CC
162852008-05-30 Cary Coutant <ccoutant@google.com>
16286
16287 * archive.cc (Archive::include_all_members) Correct to step
16288 over symbol table and extended name table in thin archives.
16289
e09ad04a
ILT
162902008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
16291
16292 PR 6407
16293 * target-reloc.h (relocate_for_relocatable): Fix new_offset
16294 calculation.
16295
62b01cb5
ILT
162962008-05-28 Caleb Howe <cshowe@google.com>
16297
16298 * reduced_debug_output.cc: New file.
16299 * reduced_debug_output.h: New file.
92de84a6 16300 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
16301 * options.cc (General_options::finalize): Add strip_debug_non_line
16302 to the strip heirarchy.
16303 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
16304 fields.
16305 * layout.cc: Include "reduced_debug_output.h".
16306 (Layout::Layout): Initialize new fields.
16307 (line_only_debug_sections): New static array.
16308 (is_lines_only_debug_sections): New static inline function.
16309 (Layout::include_section): Handle --strip-debug-non-line.
16310 (Layout::make_output_section): If --strip-debug-non-line, build
16311 new output sections for .debug_abbrev and .debug_info.
16312 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
16313 gold. Warn about possible overflow.
16314 (read_signed_LEB_128): Likewise.
16315 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
16316 (read_signed_LEB_128): Declare.
16317 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
16318 (HFILES): Add reduced_debug_output.h.
16319 * Makefile.in: Rebuild.
16320
7d9e3d98
ILT
163212008-05-21 Ian Lance Taylor <iant@google.com>
16322
16323 * mapfile.cc: New file.
16324 * mapfile.h: New file.
16325 * options.h (class General_options): Add -M/--print-map and -Map.
16326 * options.cc (General_options::finalize): Make -M equivalent to
16327 -Map -.
16328 * main.cc: Include <cstdio> and "mapfile.h".
16329 (main): Open mapfile if requested.
16330 * gold.cc (class Middle_runner): Add mapfile_ field. Update
16331 constructor. Change caller.
16332 (queue_initial_tasks): Add mapfile parameter. Change caller.
16333 (queue_middle_tasks): Likewise.
16334 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
16335 declarations.
16336 * archive.cc: Include "mapfile.h".
16337 (Archive::add_symbols): Add mapfile parameter. Change all
16338 callers. Pass mapfile, symbol, and reason to include_member.
16339 (Archive::include_all_members): Add mapfile parameter. Change all
16340 callers.
16341 (Archive::include_member): Add mapfile, sym, and why parameters.
16342 Change all callers. Report inclusion to map file.
16343 * archive.h: Include "fileread.h".
16344 (class Archive): Update declarations.
16345 (Archive::file): New const method.
16346 (class Add_archive_symbols): Add mapfile_ field. Update
16347 constructor. Change all callers.
16348 * readsyms.h (class Read_symbols): Likewise.
16349 (class Finish_group): Likewise.
16350 (class Read_script): Likewise.
16351 * common.cc: Include "mapfile.h".
16352 (Symbol_table::allocate_commons): Add mapfile parameter. Change
16353 all callers.
16354 (Symbol_table::do_allocate_commons): Likewise.
16355 (Symbol_table::do_allocate_commons_list): Likewise. Report common
16356 symbol allocation to mapfile.
16357 * common.h (class Allocate_commons_task): Add mapfile_ field.
16358 Update constructor. Change all callers.
16359 * symtab.h (class Symbol_table): Update declarations.
16360 * layout.cc: Include "mapfile.h".
16361 (Layout_task_runner::run): Print information to mapfile.
16362 (Layout::create_gold_note): Change Output_data_fixed_space to
16363 Output_data_zero_fill.
16364 (Layout::create_build_id): Likewise.
16365 (Layout::print_to_mapfile): New function.
16366 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
16367 constructor. Change caller.
16368 (class Layout): Declare print_to_mapfile.
16369 * output.cc (Output_section::Input_section::print_to_mapfile): New
16370 function.
16371 (Output_section::add_input_section): If producing a map, always
16372 add to input_sections_ list.
16373 (Output_section::do_print_to_mapfile): New function.
16374 (Output_segment::print_sections_to_mapfile): New function.
16375 (Output_segment::print_section_list_to_mapfile): New function.
16376 * output.h: Include "mapfile.h".
16377 (Output_data::print_to_mapfile): New function.
16378 (Output_data::do_print_to_mapfile): New virtual function.
16379 (Output_segment_headers::do_print_to_mapfile): New function.
16380 (Output_file_header::do_print_to_mapfile): New function.
16381 (Output_data_const::do_print_to_mapfile): New function.
16382 (class Output_data_const_buffer): Add map_name_ field. Update
16383 constructor. Change all callers. Add do_print_to_mapfile
16384 function.
16385 (class Output_data_fixed_space): Likewise.
16386 (class Output_data_space): Likewise.
16387 (class Output_data_zero_fill): New class.
16388 (Output_data_strtab::do_print_to_mapfile): New function.
16389 (Output_data_reloc_base::do_print_to_mapfile): New function.
16390 (Output_relocatable_relocs::do_print_to_mapfile): New function.
16391 (Output_data_group::do_print_to_mapfile): New function.
16392 (Output_data_got::do_print_to_mapfile): New function.
16393 (Output_data_dynamic::do_print_to_mapfile): New function.
16394 (Output_symtab_xindex::do_print_to_mapfile): New function.
16395 (class Output_section): Declare do_print_to_mapflie. Declare
16396 print_to_mapfile in Input_section.
16397 (class Output_segment): Declare new functions.
16398 * object.h (Sized_relobj::symbol_count): New function.
16399 * script-sections.cc
16400 (Output_section_element_dot_assignment::set_section_addresses):
16401 Change Output_data_fixed_space to Output_data_zero_fill.
16402 (Output_data_expression::do_print_to_mapfile): New function.
16403 * script.cc (read_input_script): Add mapfile parameter. Change
16404 all callers.
16405 * script.h (read_input_script): Update declaration.
16406 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
16407 (Eh_frame::do_print_to_mapfile): New function.
16408 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
16409 (Output_merge_string::do_print_to_mapfile): New function.
16410 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
16411 function.
16412 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
16413 function.
16414 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
16415 function.
16416 * Makefile.am (CCFILES): Add mapfile.cc.
16417 (HFILES): Add mapfile.h.
16418 * Makefile.in: Rebuild.
16419
9f1d377b
ILT
164202008-05-19 Ian Lance Taylor <iant@google.com>
16421
16422 * options.h (class General_options): Add -z relro.
16423 * layout.cc (Layout::Layout): Initialize relro_segment_.
16424 (Layout::add_output_section_data): Return the output section.
16425 (Layout::make_output_section): Rcognize relro sections and mark
16426 them appropriately.
16427 (Layout::attach_allocated_section_to_segment): Put relro sections
16428 in a PT_GNU_RELRO segment.
16429 (Layout::create_initial_dynamic_sections): Mark the .dynamic
16430 section as relro.
16431 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
16432 PT_TLS segments.
16433 (Layout::linkonce_mapping): Map d.rel.ro.local to
16434 .data.rel.ro.local.
16435 (Layout::output_section_name): Us .data.rel.ro.local for any
16436 section which begins with that.
16437 * layout.h (class Layout): Update add_output_section_data
16438 declaration. Add relro_segment_ field.
16439 * output.cc (Output_section::Output_section): Initialize is_relro_
16440 and is_relro_local_ fields.
16441 (Output_segment::add_output_section): Group relro sections.
16442 (Output_segment::is_first_section_relro): New function.
16443 (Output_segment::maximum_alignment): If there is a relro section,
16444 align the segment to the common page size.
16445 (Output_segment::set_section_addresses): Track whether we are
16446 looking at relro sections. If the last section is a relro
16447 section, align to the common page size.
16448 (Output_segment::set_section_list_addresses): Add in_relro
16449 parameter. Change all callers. Align to the page size when
16450 moving from relro to non-relro section.
16451 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
16452 segment.
16453 * output.h (class Output_section): Add is_relro_ and
16454 is_relro_local_ fields.
16455 (Output_section::is_relro): New function.
16456 (Output_section::set_is_relro): New function.
16457 (Output_section::is_relro_local): New function.
16458 (Output_section::set_is_relro_local): New function.
16459 (class Output_segment): Update declarations.
16460 * i386.cc (Target_i386::got_section): Mark .got section as relro.
16461 * sparc.cc (Target_sparc::got_section): Likewise.
16462 * x86_64.cc (Target_x86_64::got_section): Likewise.
16463 * testsuite/relro_test_main.cc: New file.
16464 * testsuite/relro_test.cc: New file.
16465 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
16466 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
16467 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
16468 (relro_test.so, relro_test_pic.o): New targets.
16469 * testsuite/Makefile.in: Rebuild.
16470
a984ee1d
ILT
164712008-05-16 Ian Lance Taylor <iant@google.com>
16472
01676dcd
ILT
16473 * output.cc (Output_segment::add_output_section): Remove front
16474 parameter.
16475 * output.h (class Output_segment): Remove
16476 add_initial_output_section and overloaded add_output_section.
16477 Update declaration of remaining add_output_section.
16478 * layout.cc (Layout::create_interp): Call add_output_section
16479 rather than add_initial_output_section.
16480 (Layout::finish_dynamic_section): Likewise.
16481
497897f9
ILT
16482 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
16483 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
16484 know the dynamic type.
16485 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
16486 field. Initialize it in constructor.
16487 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
16488 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
16489 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
16490 reloc.
16491
a984ee1d
ILT
16492 * output.cc (Output_reloc::get_address): Change return type to
16493 Elf_Addr.
16494 * output.h (class Output_reloc): Update get_address declaration.
16495 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
16496 for section addresses.
16497
55ba0940
ILT
164982008-05-09 Ian Lance Taylor <iant@google.com>
16499
16500 PR 6493
16501 * gold.cc (gold_nomem): Use return value of write.
16502
75517b77
ILT
165032008-05-08 Ian Lance Taylor <iant@google.com>
16504
16505 * symtab.c (Symbol::init_base_output_data): Add version
16506 parameter. Change all callers.
16507 (Symbol::init_base_output_segment): Likewise.
16508 (Symbol::init_base_constant): Likewise.
16509 (Symbol::init_base_undefined): Likewise.
16510 (Sized_symbol::init_output_data): Likewise.
16511 (Sized_symbol::init_output_segment): Likewise.
16512 (Sized_symbol::init_constant): Likewise.
16513 (Sized_symbol::init_undefined): Likewise.
16514 (Symbol_table::do_define_in_output_data): If the new symbol has a
16515 version, mark it as the default.
16516 (Symbol_table::do_define_in_output_segment): Likewise.
16517 (Symbol_table::do_define_as_constant): Likewise.
16518 * symtab.h (class Symbol): Update declarations.
16519 (class Sized_symbol): Likewise.
16520 * resolve.cc (Symbol::override_version): New function.
c42e122e 16521 (Symbol::override_base): Call override_version.
75517b77
ILT
16522 (Symbol::override_base_with_special): Likewise.
16523 * testsuite/ver_script_8.script: New file.
16524 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
16525 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
16526 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
16527 (ver_test_8_1.so, ver_test_8_2.so): New targets.
16528
f1f70eae
ILT
165292008-05-06 Ian Lance Taylor <iant@google.com>
16530
f3e9c5c5
ILT
16531 PR 6049
16532 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
16533 functions.
16534 (class General_options): Remove existing --undefined, and add
16535 --no-undefined instead. Add new --undefined as synonym for -u.
16536 * archive.cc (Archive::add_symbols): Check whether symbol was
16537 named with -u.
16538 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
16539 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
16540 all uses. Add IS_UNDEFINED. Update declarations to split
16541 different versions of init_base. Declare init_base_undefined.
16542 (Symbol::is_defined): Handle IS_UNDEFINED.
16543 (Symbol::is_undefined): Likewise.
16544 (Symbol::is_weak_undefined): Call is_undefined.
16545 (Symbol::is_absolute): Handle IS_CONSTANT.
16546 (class Sized_symbol): Update declarations to split different
16547 versions of init. Declare init_undefined.
16548 (class Symbol_table): Declare new functions.
16549 * symtab.cc (Symbol::init_base_object): Rename from init_base.
16550 Change all callers.
16551 (Symbol::init_base_output_data): Likewise.
16552 (Symbol::init_base_output_segment): Likewise.
16553 (Symbol::init_base_constant): Likewise.
16554 (Symbol::init_base_undefined): New function.
16555 (Sized_symbol::init_object): Rename from init. Change all
16556 callers.
16557 (Sized_symbol::init_output_data): Likewise.
16558 (Sized_symbol::init_output_segment): Likewise.
16559 (Sized_symbol::init_constant): Likewise.
16560 (Sized_symbol::init_undefined): New function.
16561 (Symbol_table::add_undefined_symbols_from_command_line): New
16562 function.
16563 (Symbol_table::do_add_undefined_symbols_from_command_line): New
16564 function.
16565 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
16566 (Symbol::output_section): Likewise.
16567 (Symbol::set_output_section): Likewise.
16568 (Symbol_table::sized_finalize_symbol): Likewise.
16569 (Symbol_table::sized_write_globals): Likewise.
16570 * resolve.cc (Symbol_table::should_override): Likewise.
16571 (Symbol::override_base_with_special): Likewise.
16572
8bdcdf2c
ILT
16573 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
16574 symbol, change it to have default visibility.
16575 * testsuite/protected_1.cc: New file.
16576 * testsuite/protected_2.cc: New file.
16577 * testsuite/protected_3.cc: New file.
16578 * testsuite/protected_main_1.cc: New file.
16579 * testsuite/protected_main_2.cc: New file.
16580 * testsuite/protected_main_3.cc: New file.
16581 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
16582 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
16583 (protected_1_LDFLAGS, protected_1_LDADD): Define.
16584 (protected_1.so): New target.
16585 (protected_1_pic.o, protected_2_pic.o): New targets.
16586 (protected_3_pic.o): New target.
16587 (check_PROGRAMS): Add protected_2.
16588 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
16589 (protected_2_LDFLAGS, protected_2_LDADD): Define.
16590 * testsuite/Makefile.in: Rebuild.
16591
2b706932
ILT
16592 * options.h (DEFINE_var): Add set_user_set_##varname__.
16593 (DEFINE_bool_alias): New macro.
16594 (class General_options): Define -Bstatic using DEFINE_bool_alias
16595 rather than DEFINE_special. Add --undefined as an alias for -z
16596 defs.
16597 * options.cc (General_options::parse_Bstatic): Remove.
16598
d82a5bcc
ILT
16599 * options.h (class General_options): Add --fatal-warnings.
16600 * main.cc (main): Implement --fatal-warnings.
16601 * errors.h (Errors::warning_count): New function.
16602
f1f70eae
ILT
16603 * options.h (class General_options): Add -Bsymbolic-functions.
16604 * symtab.h (Symbol::is_preemptible): Check for
16605 -Bsymbolic-functions.
16606
8825ac63
ILT
166072008-05-05 Ian Lance Taylor <iant@google.com>
16608
d98bc257
ILT
16609 * options.h (DEFINE_bool): For DASH_Z, create the negative option
16610 as noVARNAME rather than no-VARNAME.
16611 (class General_options): Add option -z combreloc.
16612 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
16613 get_address.
16614 (Output_reloc::sort_before) [SHT_REL]: New function.
16615 (Output_reloc::sort_before) [SHT_RELA]: New function.
16616 (class Output_data_reloc_base): Add sort_relocs_ field. Define
16617 Sort_relocs_comparison.
16618 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
16619 parameter. Change all callers.
16620 (Output_data_reloc::Output_data_reloc) [both versions]: Add
16621 sort_relocs parameter. Change all callers.
16622 * output.cc (Output_reloc::get_address): New function, broken out
16623 of write_rel.
16624 (Output_reloc::write_rel): Call it.
16625 (Output_reloc::compare): New function.
16626 (Output_data_reloc_base::do_write): Optionally sort relocs.
16627
60b2b4e7
ILT
16628 * configure.ac: If targ_extra_obj is set, link it in.
16629 * configure.tgt: Initialize all variables.
16630 (x86_64*): Set targ_extra_obj and targ_extra_size.
16631 * configure: Rebuild.
16632
8825ac63
ILT
16633 * object.cc (Sized_relobj::include_section_group): Adjust section
16634 indexes read from group data. Build vector to pass to
16635 layout_group.
16636 * layout.cc (Layout::layout_group): Add flags and shndxes
16637 parameters. Remove contents parameter. Change caller. Update
16638 explicit instantiations.
16639 * layout.h (class Layout): Update layout_group declaration.
16640 * output.cc (Output_data_group::Output_data_group): Add flags and
16641 input_shndxes parameters. Remove contents parameter. Change
16642 caller.
16643 (Output_data_group::do_write): Change input_sections_ to
16644 input_shndxes_.
16645 * output.h (class Output_data_group): Update constructor
16646 declaration. Rename input_sections_ to input_shndxes_.
16647 * testsuite/many_sections_test.cc: Add template.
16648
e94cf127
CC
166492008-04-30 Cary Coutant <ccoutant@google.com>
16650
4418b2d5
CC
16651 * target-reloc.h (relocate_section): Fix dead-pointer bug.
16652
e94cf127
CC
16653 * layout.cc (Layout::include_section): Refactored check for debug
16654 info section.
16655 (Layout::add_comdat): Add new parameters. Change type
16656 of signature parameter. Add object and shndx to signatures table.
16657 (Layout::find_kept_object): New function.
16658 * layout.h: Include <cstring>.
16659 (Layout::is_debug_info_section): New function.
16660 (Layout::add_comdat): Add new parameters.
16661 (Layout::find_kept_object): New function.
16662 (Layout::Kept_section): New struct.
16663 (Layout::Signatures): Change type of map range.
16664 * object.cc (Relobj::output_section_address): New function.
16665 (Sized_relobj::include_section_group): Add new parameters. Change
16666 calls to Layout::add_comdat. Change to build table of kept comdat
16667 groups and table mapping discarded sections to kept sections.
16668 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
16669 (Sized_relobj::do_layout): Change calls to include_section_group and
16670 include_linkonce_section.
16671 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
16672 value to zero when section is discarded.
16673 (Sized_relobj::map_to_kept_section): New function.
16674 * object.h (Relobj::output_section_address): New function.
16675 (Relobj::Comdat_group): New type.
16676 (Relobj::find_comdat_group): New function.
16677 (Relobj::Comdat_group_table): New type.
16678 (Relobj::Kept_comdat_section): New type.
16679 (Relobj::Kept_comdat_section_table): New type.
16680 (Relobj::add_comdat_group): New function.
16681 (Relobj::set_kept_comdat_section): New function.
16682 (Relobj::get_kept_comdat_section): New function.
16683 (Relobj::comdat_groups_): New field.
16684 (Relobj::kept_comdat_sections_): New field.
16685 (Symbol_value::input_value): Update comment.
16686 (Sized_relobj::map_to_kept_section) New function.
16687 (Sized_relobj::include_linkonce_section): Add new parameter.
16688 * target-reloc.h (Comdat_behavior): New type.
16689 (get_comdat_behavior): New function.
16690 (relocate_section): Add code to map a discarded section to the
16691 corresponding kept section when applying a relocation.
16692
e4e5049b
CS
166932008-04-30 Craig Silverstein <csilvers@google.com>
16694
16695 * dwarf_reader.cc (next_generation_count): New static var.
16696 (Addr2line_cache_entry): New struct.
16697 (addr2line_cache): New static var.
16698 (Dwarf_line_info::one_addr2line): Added caching.
16699 (Dwarf_line_info::clear_addr2line_cache): New function.
16700 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
16701 cache-size parameter.
16702 (Dwarf_line_info::one_addr2line_cache): New function.
16703 * symtab.cc (Symbol_table::detect_odr_violations): Pass
16704 new cache-size argument to one_addr2line(), and clear cache.
16705
d09e9154
CC
167062008-04-28 Cary Coutant <ccoutant@google.com>
16707
16708 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
16709 R_386_PC8 relocations.
16710
7ef73768
ILT
167112008-04-23 Ian Lance Taylor <iant@google.com>
16712
55438702
ILT
16713 * object.cc (Sized_relobj::include_section_group): Check for
16714 invalid section group.
16715
c165fb93
ILT
16716 * object.cc (make_elf_object): Correct test for 64-bit ELF file
16717 header size.
16718
7ef73768
ILT
16719 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
16720 than read for file header.
16721 * archive.cc (Archive::include_member): Likewise.
16722
6194aaab
L
167232008-04-23 Paolo Bonzini <bonzini@gnu.org>
16724
16725 * aclocal.m4: Regenerate.
16726 * configure: Regenerate.
16727
d491d34e
ILT
167282008-04-19 Ian Lance Taylor <iant@google.com>
16729
5ea2bac6
ILT
16730 * version.cc (version_string): Bump to 1.6.
16731
7bc3e21a
ILT
16732 * testsuite/Makefile.am (many_sections_r_test): New target.
16733 (many_sections_r_test_SOURCES): Remove.
16734 (many_sections_r_test_DEPENDENCIES): Remove.
16735 (many_sections_r_test_LDFLAGS): Remove.
16736 (many_sections_r_test_LDADD): Remove.
16737
7fcd3aa9
ILT
16738 * object.cc (Sized_relobj::do_add_symbols): Always pass
16739 local_symbol_count_ to add_from_relobj.
16740
4c94d6ae
ILT
16741 * testsuite/Makefile.am (many_sections_check.h): Only check one in
16742 every thousand variables.
16743 * testsuite/Makefile.in: Rebuild.
16744
d491d34e
ILT
16745 * object.cc (Xindex::initialize_symtab_xindex): New function.
16746 (Xindex::read_symtab_xindex): New function.
16747 (Xindex::sym_xindex_to_shndx): New function.
16748 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
16749 available.
16750 (Sized_relobj::do_initialize_xindex): New function.
16751 (Sized_relobj::do_read_symbols): Adjust section links.
16752 (Sized_relobj::symbol_section_and_value): Add is_ordinary
16753 parameter. Change all callers.
16754 (Sized_relobj::include_section_group): Adjust section links and
16755 symbol section indexes.
16756 (Sized_relobj::do_layout): Adjust section links.
16757 (Sized_relobj::do_count_local_symbols): Adjust section links and
16758 symbol section indexes.
16759 (Sized_relobj::do_finalize_local_symbols): Distinguish between
16760 ordinary and special symbols.
16761 (Sized_relobj::write_local_symbols): Add symtab_xindex and
16762 dynsym_xindex parameters. Change all callers. Adjust section
16763 links. Use SHN_XINDEX when needed.
16764 (Sized_relobj::get_symbol_location_info): Adjust section links.
16765 Don't get fooled by special symbols.
16766 * object.h (class Xindex): Define.
16767 (class Object): Add xindex_ parameter. Declare virtual functoin
16768 do_initialize_xindex.
16769 (Object::adjust_sym_shndx): New function.
16770 (Object::set_xindex): New protected function.
16771 (class Symbol_value): Add is_ordinary_shndx_ field.
16772 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
16773 (Symbol_value::value): Assert ordinary section.
16774 (Symbol_value::initialize_input_to_output_map): Likewise.
16775 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
16776 Change all callers.
16777 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
16778 all callers.
16779 (class Sized_relobj): Update declarations.
16780 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
16781 parameter. Change all callers.
16782 (Sized_relobj::adjust_shndx): New function.
16783 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
16784 field.
16785 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
16786 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
16787 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
16788 (Sized_dynobj::read_dynsym_section): Adjust section links.
16789 (Sized_dynobj::read_dynamic): Likewise.
16790 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
16791 section links.
16792 (Sized_dynobj::do_initialize_xindex): New function.
16793 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
16794 do_initialize_xindex.
16795 (Sized_dynobj::adjust_shndx): New function.
16796 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
16797 dynsym_xindex_ fields.
16798 (Layout::finalize): Add a call to set_section_indexes before
16799 creating the symtab sections.
16800 (Layout::set_section_indexes): Don't do anything if the section
16801 already has a section index.
16802 (Layout::create_symtab_sections): Add shnum parameter. Change
16803 caller. Create .symtab_shndx section if needed.
16804 (Layout::create_shdrs): Add shstrtab_section parameter. Change
16805 caller.
16806 (Layout::allocated_output_section_count): New function.
16807 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
16808 needed.
16809 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
16810 fields. Update declarations.
16811 (Layout::symtab_xindex): New function.
16812 (Layout::dynsym_xindex): New function.
16813 (class Write_symbols_task): Add layout_ field.
16814 (Write_symbols_task::Write_symbols_task): Add layout parameter.
16815 Change caller.
16816 * output.cc (Output_section_headers::Output_section_headers): Add
16817 shstrtab_section parameter. Change all callers.
16818 (Output_section_headers::do_sized_write): Store overflow values
16819 for section count and section string table section index in
16820 section header zero.
16821 (Output_file_header::do_sized_write): Check for overflow of
16822 section count and section string table section index.
16823 (Output_symtab_xindex::do_write): New function.
16824 (Output_symtab_xindex::endian_do_write): New function.
16825 * output.h (class Output_section_headers): Add shstrtab_section_.
16826 Update declarations.
16827 (class Output_symtab_xindex): Define.
16828 (Output_section::has_out_shndx): New function.
16829 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
16830 field.
16831 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
16832 Change all callers.
16833 (Sized_symbol::init): Likewise.
16834 (Symbol::output_section): Check for ordinary symbol.
16835 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
16836 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
16837 callers.
16838 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
16839 Change all callers. Simplify handling of symbols from sections
16840 not included in the link.
16841 (Symbol_table::add_from_dynobj): Handle ordinary symbol
16842 distinction.
16843 (Weak_alias_sorter::operator()): Assert that symbols are
16844 ordinary.
16845 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
16846 distinction.
16847 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
16848 parameters. Change all callers.
16849 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
16850 symbol distinction. Use SHN_XINDEX when needed.
16851 (Symbol_table::write_section_symbol): Add symtab_xindex
16852 parameter. Change all callers.
16853 (Symbol_table::sized_write_section_symbol): Likewise. Use
16854 SHN_XINDEX when needed.
16855 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
16856 declarations.
16857 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
16858 (Symbol::is_defined): Check is_ordinary.
16859 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
16860 (Symbol::is_absolute, Symbol::is_common): Likewise.
16861 (class Sized_symbol): Update declarations.
16862 (class Symbol_table): Update declarations.
16863 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
16864 parameters. Change all callers.
16865 (Sized_symbol::override): Likewise.
16866 (Symbol_table::override): Likewise.
16867 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
16868 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
16869 is_ordinary, and orig_st_shndx parameters. Change all callers.
16870 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
16871 to be in an ordinary section.
16872 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
16873 object and is_ordinary parameters. Change all callers.
16874 (Sized_dwarf_line_info::read_relocs): Add object parameter.
16875 Change all callers. Don't add undefined or non-ordinary symbols
16876 to reloc_map_.
16877 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
16878 Change all callers.
16879 * dwarf_reader.h (class Sized_dwarf_line_info): Update
16880 declarations.
16881 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
16882 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
16883 (Sized_relobj::relocate_sections): Likewise.
16884 * target-reloc.h (scan_relocs): Adjust section symbol index.
16885 (scan_relocatable_relocs): Likewise.
16886 * i386.cc (Scan::local): Check for ordinary symbols.
16887 * sparc.cc (Scan::local): Likewise.
16888 * x86_64.cc (Scan::local): Likewise.
16889 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
16890 to symbol_section_and_value.
16891 * testsuite/many_sections_test.cc: New file.
16892 * testsuite/Makefile.am (BUILT_SOURCES): Define.
16893 (check_PROGRAMS): Add many_sections_test.
16894 (many_sections_test_SOURCES): Define.
16895 (many_sections_test_DEPENDENCIES): Define.
16896 (many_sections_test_LDFLAGS): Define.
16897 (BUILT_SOURCES): Add many_sections_define.h.
16898 (many_sections_define.h): New target.
16899 (BUILT_SOURCES): Add many_sections_check.h.
16900 (many_sections_check.h): New target.
16901 (check_PROGRAMS): Add many_sections_r_test.
16902 (many_sections_r_test_SOURCES): Define.
16903 (many_sections_r_test_DEPENDENCIES): Define.
16904 (many_sections_r_test_LDFLAGS): Define.
16905 (many_sections_r_test_LDADD): Define.
16906 (many_sections_r_test.o): New target.
16907 * testsuite/Makefile.in: Rebuild.
16908
c5818ff1
CC
169092008-04-17 Cary Coutant <ccoutant@google.com>
16910
16911 * errors.cc (Errors::info): New function.
16912 (gold_info): New function.
16913 * errors.h (Errors::info): New function.
16914 * gold.h (gold_info): New function.
16915 * object.cc (Input_objects::add_object): Print trace output.
16916 * options.cc (options::parse_set): New function.
16917 (General_options::parse_wrap): Deleted.
16918 (General_options::General_options): Deleted initializer.
16919 * options.h (options::String_set): New typedef.
16920 (options::parse_set): New function.
16921 (DEFINE_set): New macro.
16922 (General_options::wrap): Changed to use DEFINE_set. Changed
16923 callers of any_wrap_symbols and is_wrap_symbol.
16924 (General_options::trace, General_options::trace_symbol):
16925 New options.
16926 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
16927 (General_options::wrap_symbols_): Deleted.
16928 * symtab.cc (Symbol_table::add_from_object): Print trace output.
16929
b5be4a7c
DM
169302008-04-17 David S. Miller <davem@davemloft.net>
16931
16932 * options.cc (General_options::parse_V): New function.
16933 * options.h: Add entries for -V and -Qy.
16934
155a0dd7
ILT
169352008-04-17 Ian Lance Taylor <iant@google.com>
16936
16937 * common.cc (Symbol_table::allocate_commons): Remove options
16938 parameter. Change caller.
16939 (Symbol_table::do_allocate_commons): Remove options parameter.
16940 Change caller. Just call do_allocate_commons_list twice.
16941 (Symbol_table::do_allocate_commons_list): New function, broken out
16942 of do_allocate_commons.
16943 * common.h (class Allocate_commons_task): Remove options_ field.
16944 Update constructor.
16945 * symtab.cc (Symbol_table::Symbol_table): Initialize
16946 tls_commons_.
16947 (Symbol_table::add_from_object): Put TLS common symbols on
16948 tls_commons_ list.
16949 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
16950 which are IN_OUTPUT_DATA.
16951 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
16952 allocate_commons and do_allocate_commons declarations. Declare
16953 do_allocate_commons_list.
16954 * gold.cc (queue_middle_tasks): Update creation of
16955 Allocate_commons_task to not pass options.
16956 * testsuite/Makefile.am (INCLUDES): Add -I.. .
16957 (TLS_TEST_C_FLAGS): New variable.
16958 (tls_test_c_pic.o): New target.
16959 (tls_test_shared.so): Link in tls_test_c_pic.o.
16960 (tls_test_c_pic_ie.o): New target.
16961 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
16962 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
16963 (tls_test_c.o): New target.
16964 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
16965 (tls_pic_test_LDADD): Likewise.
16966 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
16967 (tls_shared_gd_to_ie_test_LDADD): Likewise.
16968 (tls_test_c_gnu2.o): New target.
16969 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
16970 tls_test_c_gnu2.o.
16971 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
16972 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
16973 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
16974 * testsuite/tls_test.cc: Include "config.h".
16975 (t_last): Call t11_last.
16976 * testsuite/tls_test.h (t11, t11_last): Declare.
16977 * testsuite/tls_test_c.c: New file.
16978 * testsuite/tls_test_main.cc (thread_routine): Call t11.
16979 * configure.ac: Check for OpenMP support.
16980 * configure, config.in, Makefile.in: Rebuild.
16981 * testsuite/Makefile.in: Rebuild.
16982
edfbb029
CC
169832008-04-16 Cary Coutant <ccoutant@google.com>
16984
16985 * i386.cc (Target_i386::define_tls_base_symbol): New function.
16986 (Target_i386::tls_base_symbol_defined_): New field.
16987 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16988 (Target_i386::Scan::global): Likewise.
16989 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
16990 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
16991 (Target_x86_64::tls_base_symbol_defined_): New field.
16992 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
16993 (Target_x86_64::Scan::global): Likewise.
16994
f3c69fca
CC
169952008-04-16 Cary Coutant <ccoutant@google.com>
16996
16997 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
16998 (Symbol::needs_plt_entry): Allow weak undefined symbols.
16999 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
17000 building shared libraries.
17001 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
17002 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
17003 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
17004 * testsuite/Makefile.in: Rebuild.
17005 * testsuite/weak_undef.h: New file.
17006 * testsuite/weak_undef_file1.cc: Add extra test cases.
17007 * testsuite/weak_undef_file2.cc: Likewise.
17008 * testsuite/weak_undef_test.cc: Likewise.
17009
7c414435
DM
170102008-04-16 David S. Miller <davem@davemloft.net>
17011
32b769e1
DM
17012 * sparc.cc (Target_sparc::Scan): Change from struct to class.
17013 Add issued_non_pic_error_ field. Declare check_non_pic.
17014 (Target_sparc::Scan::check_non_pic): New function.
17015 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
17016 (Target_sparc::Scan::global): Likewise.
17017
11936fb1
DM
17018 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
17019 * configure: Rebuild.
17020
7c414435
DM
17021 * options.h (DEFINE_enable): New macro.
17022 (new_dtags): New enable option.
17023 (initfirst, interpose, loadfltr, nodefaultlib,
17024 nodelete, nodlopen, nodump): New -z options.
17025 * layout.cc (Layout:finish_dynamic_section): If new
17026 dtags enabled, emit DT_RUNPATH. Also, emit a
17027 DT_FLAGS_1 containing any specified -z flags.
17028
85c7bf8b
ILT
170292008-04-16 Ian Lance Taylor <iant@google.com>
17030
12c0daef
ILT
17031 * copy-relocs.cc: New file.
17032 * copy-relocs.h: New file.
17033 * reloc.cc: Remove Copy_relocs code.
17034 * reloc.h: Likewise.
17035 * reloc-types.h (struct Reloc_types) [both versions]: Add
17036 get_reloc_addend_noerror.
17037 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
17038 variants of add_global which take an addend which must be zero.
17039 * i386.cc: Include "copy-relocs.h".
17040 (class Target_i386): Change type of copy_relocs_ to variable,
17041 update initializer.
17042 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
17043 Change all callers.
17044 (Target_i386::do_finalize_sections): Change handling of
17045 copy_relocs_.
17046 * sparc.cc: Include "copy-relocs.h".
17047 (class Target_sparc): Change type of copy_relocs_ to variable,
17048 update initializer.
17049 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
17050 Change all callers.
17051 (Target_sparc::do_finalize_sections): Change handling of
17052 copy_relocs_.
17053 * x86_64.cc: Include "copy-relocs.h".
17054 (class Target_x86_64): Change type of copy_relocs_ to variable,
17055 update initializer.
17056 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
17057 class. Change all callers.
17058 (Target_x86_64::do_finalize_sections): Change handling of
17059 copy_relocs_.
17060 * Makefile.am (CCFILES): Add copy-relocs.cc.
17061 (HFILES): Add copy-relocs.h.
17062
4f4995b6
ILT
17063 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
17064
85c7bf8b
ILT
17065 * testsuite/script_test_4.sh: Permit leading zeroes.
17066
4f2a9edd
ILT
170672008-04-15 Ian Lance Taylor <iant@google.com>
17068
e6188289
ILT
17069 * script-sections.cc (Script_sections::create_segments): Use
17070 header_size_adjustment even when there is enough room for the
17071 headers.
17072 * testsuite/script_test_4.sh: New file.
17073 * testsuite/script_test_4.t: New file.
17074 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
17075 (check_DATA): Add script_test_4.stdout.
17076 (MOSTLYCLEANFILES): Likewise.
17077 (script_test_4): New target.
17078 (script_test_4.stdout): New target.
17079 * testsuite/Makefile.in: Rebuild.
17080
4f2a9edd
ILT
17081 * sparc.cc: Add definitions for Output_data_plt_sparc class
17082 constants.
17083
f5314dd5
DM
170842008-04-14 David S. Miller <davem@davemloft.net>
17085
17086 * sparc.cc: New file.
17087 * Makefile.am (TARGETSOURCES): Add sparc.cc
17088 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
17089 * configure.tgt: Document targ_extra_size and
17090 targ_extra_big_endian. Add entries for sparc-* and
17091 sparc64-*.
17092 * configure.ac: Handle targ_extra_size and
17093 targ_extra_big_endian.
17094 * Makefile.in: Rebuild.
17095 * configure: Likewise.
17096 * po/POTFILES.in: Likewise.
17097 * po/gold.pot: Likewise.
17098
154e0e9a
ILT
170992008-04-14 Ian Lance Taylor <iant@google.com>
17100
17101 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
17102 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
17103 in the name/type/flags to section mapping. Don't call
17104 allocate_output_section.
17105 (Layout::choose_output_section): Change parameter from adjust_name
17106 to is_input_section. Don't permit input sections after sections
17107 are attached to segments. Don't call allocate_output_section.
17108 (Layout::layout_eh_frame): Call update_flags_for_input_section,
17109 not write_enable_output_section.
17110 (Layout::make_output_section): Don't push to
17111 unattached_section_list_ nor call attach_to_segment. Call
17112 attach_section_to_segment if sections are attached.
17113 (Layout::attach_sections_to_segments): New function.
17114 (Layout::attach_section_to_segment): New function.
17115 (Layout::attach_allocated_section_to_segment): Rename from
17116 attach_to_segment. Remove flags parameter.
17117 (Layout::allocate_output_section): Remove function.
17118 (Layout::write_enable_output_section): Remove function.
17119 * layout.h (class Layout): Update for above changes. Add new
17120 field sections_are_attached_.
17121 * output.h (Output_section::update_flags_for_input_section): New
17122 function.
17123 * output.cc (Output_section::add_input_section): Call
17124 update_flags_for_input_section.
17125 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
17126
009a67a2
CC
171272008-04-11 Cary Coutant <ccoutant@google.com>
17128
17129 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
17130 thought unnecessary.
17131 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
17132
759b1a24
ILT
171332008-04-11 Ian Lance Taylor <iant@google.com>
17134
17135 * output.h (class Output_section_data): Remove inline definition
17136 of set_addralign.
17137 * output.cc (Output_section_data::set_addralign): New function.
17138
c2b45e22
CC
171392008-04-11 Cary Coutant <ccoutant@google.com>
17140
17141 Add support for TLS descriptors for i386 and x86_64.
17142 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
17143 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
17144 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
17145 GOT_TYPE_TLS_DESC.
17146 (Target_i386::got_mod_index_entry): Remove unnecessary code.
17147 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
17148 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
17149 relocations.
17150 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
17151 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
17152 Fix problem with initial-exec relocations.
17153 (Target_i386::Relocate::relocate_tls): Likewise.
17154 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
17155 relaxation.
17156 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
17157 support for section-plus-offset dynamic table entries.
17158 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
17159 (Output_data_dynamic::Dynamic_entry): Add support for
17160 section-plus-offset dynamic table entries.
17161 (Output_data_dynamic::Classification): Likewise.
17162 (Output_data_dynamic::classification_): Renamed offset_.
17163 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
17164 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
17165 (Target_x86_64::make_plt_section): New function.
17166 (Target_x86_64::reserve_tlsdesc_entries): New function.
17167 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
17168 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
17169 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
17170 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
17171 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
17172 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
17173 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
17174 add extra PLT entry for TLS descriptors.
17175 (Output_data_plt_x86_64::got_): New field.
17176 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
17177 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
17178 fields.
17179 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
17180 descriptors.
17181 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
17182 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
17183 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
17184 R_386_TLS_DESC_CALL relocations.
17185 (Target_x86_64::Scan::global): Likewise.
17186 (Target_x86_64::do_finalize_sections): Add dynamic table entries
17187 for TLS descriptors.
17188 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
17189 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
17190 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
17191 GD-to-IE relaxation.
17192 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
17193 and TLS_DESCRIPTORS.
17194 * Makefile.in: Rebuild.
17195 * configure: Rebuild.
17196 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
17197 (tls_test_shared2.so): New target.
17198 (tls_shared_gd_to_ie_test_SOURCES): New variable.
17199 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
17200 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
17201 (tls_shared_gd_to_ie_test_LDADD): New variable.
17202 (tls_shared_gnu2_gd_to_ie_test): New target.
17203 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
17204 New targets.
17205 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
17206 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
17207 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
17208 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
17209 (tls_shared_gnu2_test): New target.
17210 (tls_test_gnu2_shared.so): New target.
17211 (tls_shared_gnu2_test_SOURCES): New variable.
17212 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
17213 (tls_shared_gnu2_test_LDFLAGS): New variable.
17214 (tls_shared_gnu2_test_LDADD): New variable.
17215 * testsuite/Makefile.in: Rebuild.
17216 * testsuite/Makefile.
17217
83bfb6b7
ILT
172182008-04-11 Ian Lance Taylor <iant@google.com>
17219
17220 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
17221 justsyms.t.
17222 * testsuite/Makefile.in: Rebuild.
17223
17224 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
17225 long.
17226 * testsuite/script_test_2.cc (main): Adjust test.
17227
706e1f5e
ILT
172282008-04-11 David S. Miller <davem@davemloft.net>
17229 Ian Lance Taylor <iant@google.com>
17230
17231 * options.h (General_options): Add entries for '-Y' and
17232 '-relax'.
17233 * options.cc (General_options:finalize): If -Y was used, add those
17234 entries to the library path instead of the default "/lib" and
17235 "/usr/lib".
17236
7c98e6bb
DM
172372008-04-11 David S. Miller <davem@davemloft.net>
17238
17239 * testsuite/justsyms.t: Start at 0x100.
17240 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
17241 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
17242 long.
17243 * testsuite/script_test_2.cc: Adjust string and section length
17244 checks.
7c98e6bb 17245
99a37bfd
ILT
172462008-04-09 Ian Lance Taylor <iant@google.com>
17247
2cefc357
ILT
17248 PR gold/5996
17249 * script-sections.cc (Sections_element::allocate_to_segment): Add
17250 orphan parameter.
17251 (Output_section_definition::allocate_to_segment): Likewise.
17252 (Orphan_output_section::allocate_to_segment): Likewise.
17253 (Script_sections::attach_sections_using_phdrs_clause): Don't
17254 propagate non-PT_LOAD segments to orphan sections.
17255 * testsuite/Makefile.am (script_test_3.stdout): Generate using
17256 readelf rather than objdump.
17257 * testsuite/script_test_3.sh: Adjust accordingly. Test that
17258 .interp section and PT_INTERP segment are the same size.
17259 * testsuite/Makefile.in: Rebuild.
17260
99a37bfd
ILT
17261 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
17262 aliases for symbols defined in the same object.
17263 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
17264 (weak_alias_test_SOURCES): New variable.
17265 (weak_alias_test_DEPENDENCIES): New variable.
17266 (weak_alias_test_LDFLAGS): New variable.
17267 (weak_alias_test_LDADD): New variable.
17268 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
17269 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
17270 (weak_alias_test_3.o): New target.
17271 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
17272 * testsuite/weak_alias_test_main.cc: New file.
17273 * testsuite/weak_alias_test_1.cc: New file.
17274 * testsuite/weak_alias_test_2.cc: New file.
17275 * testsuite/weak_alias_test_3.cc: New file.
17276
780e49c5
ILT
172772008-04-08 Ian Lance Taylor <iant@google.com>
17278
cdb0b8f5
ILT
17279 * options.h (class General_options): Add --noinhibit-exec option.
17280 * main.cc (main): Check --noinhibit-exec.
17281
0864d551
ILT
17282 * options.h (class General_options): Define --wrap as a special
17283 option. Add wrap_symbols_ field.
17284 (General_options::any_wrap_symbols): New function.
17285 (General_options::is_wrap_symbol): New function.
17286 * options.cc (General_options::parse_wrap): New function.
17287 (General_options::General_options): Initialize wrap_symbols_.
17288 * symtab.cc (Symbol_table::wrap_symbol): New function.
17289 (Symbol_table::add_from_object): Handle --wrap.
17290 * symtab.h (class Symbol_table): Declare wrap_symbol.
17291 * target.h (Target::wrap_char): New function.
17292 (Target::Target_info): Add wrap_char field.
17293 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
17294 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
17295 * testsuite/testfile.cc (Target_test::test_target_info):
17296 Likewise.
17297
789aa6de
ILT
17298 * errors.cc (Errors::undefined_symbol): Mention symbol version if
17299 there is one.
17300
2c38906f
ILT
17301 * layout.h (class Layout): Add added_eh_frame_data_ field.
17302 * layout.cc (Layout::Layout): Initialize new field.
17303 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
17304 output section until we find a section we merged successfully.
17305 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
17306 that the size be non-zero.
17307
780e49c5
ILT
17308 * merge.cc (Object_merge_map::get_output_offset): Remove inline
17309 qualifier.
17310
7fcd0256
ILT
173112008-04-08 Craig Silverstein <csilvers@google.com>
17312
17313 * configure.ac: Export new conditional variable HAVE_ZLIB.
17314 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17315 on HAVE_ZLIB.
17316 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
17317 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17318
6835af53
ILT
173192008-04-07 Ian Lance Taylor <iant@google.com>
17320
e24f324c
ILT
17321 * version.cc (version_string): Set to "1.5".
17322
a036edd8
ILT
17323 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
17324 Add issued_non_pic_error_ field. Declare check_non_pic.
17325 (Target_x86_64::Scan::check_non_pic): New function.
17326 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
17327 (Target_x86_64::Scan::global): Likewise.
17328
624f8810
ILT
17329 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
17330 addend parameter. Change caller. Handle merge sections.
17331 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
17332 Address to Addend. Don't add in the result of
17333 local_section_offset, pass down the addend and use the returned
17334 value.
17335 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
17336 Update declarations of local_section_offset and symbol_value.
17337 * testsuite/two_file_test_1.cc (t18): New function.
17338 * testsuite/two_file_test_2.cc (f18): New function.
17339 * testsuite/two_file_test_main.cc (main): Call t18.
17340 * testsuite/two_file_test.h (t18, f18): Declare.
17341
6835af53
ILT
17342 * configure.ac: Don't test for objdump, c++filt, or readelf.
17343 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
17344 conditionals.
17345 (TEST_READELF): New variable.
17346 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
17347 (check_PROGRAMS): Add two_file_strip_test.
17348 (two_file_strip_test): New target.
17349 (check_PROGRAMS): Add two_file_same_shared_strip_test.
17350 (two_file_same_shared_strip_test_SOURCES): New variable.
17351 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
17352 (two_file_same_shared_strip_test_LDFLAGS): New variable.
17353 (two_file_same_shared_strip_test_LDADD): New variable.
17354 (two_file_shared_strip.so): New target.
17355 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
17356 (ver_test_5.syms, ver_test_7.syms): Likewise.
17357 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
17358 (strip_test_3.stdout): Use TEST_OBJDUMP.
17359 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17360
86925eef
CC
173612008-04-04 Cary Coutant <ccoutant@google.com>
17362
17363 * symtab.h (Symbol::is_weak_undefined): New function.
17364 (Symbol::is_strong_undefined): New function.
17365 (Symbol::is_absolute): New function.
17366 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
17367 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
17368 absolute symbols.
17369 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
17370 (weak_undef_test): New target.
17371 * testsuite/Makefile.in: Rebuild.
17372 * testsuite/weak_undef_file1.cc: New file.
17373 * testsuite/weak_undef_file2.cc: New file.
17374 * testsuite/weak_undef_test.cc: New file.
17375
126f3ece
ILT
173762008-04-03 Craig Silverstein <csilvers@google.com>
17377
17378 * compressed_output.h (class Output_compressed_section): Use
17379 unsigned buffer.
17380 * compressed_output.cc (zlib_compress): Use unsigned buffers,
17381 add zlib header.
17382 (zlib_compressed_suffix): Removed.
17383 (Output_compressed_section::set_final_data_size): Use unsigned
17384 buffers.
17385 * testsuite/Makefile.am (flagstest_compress_debug_sections):
17386 Fix linker invocation.
17387 (flagstest_o_specialfile_and_compress_debug_sections):
17388 Likewise.
17389 * testsuite/Makefile.in: Regenerated.
17390
deae2a14
DM
173912008-04-02 David S. Miller <davem@davemloft.net>
17392
17393 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
17394 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
17395
70752818
ILT
173962008-04-02 Craig Silverstein <csilvers@google.com>
17397
17398 * TODO: New file.
17399
39d0cb0e
ILT
174002008-04-02 Ian Lance Taylor <iant@google.com>
17401
17402 * fileread.cc (File_read::find_view): Add byteshift and vshifted
17403 parameters. Update for new key type to views_. Change all
17404 callers.
17405 (File_read::read): Adjust for byteshift in returned view.
17406 (File_read::add_view): New function, broken out of
17407 find_and_make_view.
17408 (File_read::make_view): New function, broken out of
17409 find_and_make_view.
17410 (File_read::find_or_make_view): Add offset and aligned
17411 parameters. Rewrite accordingly. Change all callers.
17412 (File_read::get_view): Add offset and aligned parameters. Adjust
17413 for byteshift in return value.
17414 (File_read::get_lasting_view): Likewise.
17415 * fileread.h (class File_read): Update declarations.
17416 (class File_read::View): Add byteshift_ field. Add byteshift to
17417 constructor. Add byteshift method.
17418 * archive.h (Archive::clear_uncached_views): New function.
17419 (Archive::get_view): Add aligned parameter. Change all callers.
17420 * object.h (Object::get_view): Add aligned parameter. Change all
17421 callers.
17422 (Object::get_lasting_view): Likewise.
17423
17424 * fileread.cc (File_read::release): Don't call clear_views if
17425 there are multiple objects.
17426 * fileread.h (File_read::clear_uncached_views): New function.
17427 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
17428 on the archive.
17429
a1207466
CC
174302008-03-31 Cary Coutant <ccoutant@google.com>
17431
17432 Add thin archive support.
17433 * archive.cc (Archive::armagt): New const.
17434 (Archive::setup): Remove task parameter and calls to unlock.
17435 (Archive::unlock_nested_archives): New function.
17436 (Archive::read_header): Add nested_off parameter. Change
17437 all callers.
17438 (Archive::interpret_header): Likewise.
17439 (Archive::include_all_members): Change to handle thin
17440 archives.
17441 (Archive::include_member): Likewise.
17442 * archive.h (Archive::Archive): Add new parameters and
17443 initializers.
17444 (Archive::armagt): New const.
17445 (Archive::setup): Remove task parameter.
17446 (Archive::unlock_nested_archives): New function.
17447 (Archive::read_header): Add nested_off parameter.
17448 (Archive::interpret_header): Likewise.
17449 (Archive::Nested_archive_table): New typedef.
17450 (Archive::is_thin_archive_): New field.
17451 (Archive::nested_archives_): New field.
17452 (Archive::options_): New field.
17453 (Archive::dirpath_): New field.
17454 (Archive::task_): New field.
17455 * readsyms.cc (Read_symbols::do_read_symbols): Add check
17456 for thin archives. Pass additional parameters to
17457 Archive::Archive. Unlock the archive file after calling
17458 Archive::setup.
cd536b21 17459
479f6503
ILT
174602008-03-29 Ian Lance Taylor <iant@google.com>
17461
686c8caf
ILT
17462 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
17463 version symbol to be local.
17464 * testsuite/ver_test_4.sh: New file.
17465 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
17466 (check_DATA): Add ver_test_4.syms.
17467 (ver_test_4.syms): New target.
17468 * testsuite/Makefile.in: Rebuild.
17469
ab794b6b
ILT
17470 * output.cc
17471 (Output_section::Input_section_sort_entry::has_priority): New
17472 function.
17473 (Output_section::Input_section_sort_entry::match_file_name): New
17474 function.
17475 (Output_section::Input_section_sort_entry::match_section_name):
17476 Remove.
17477 (Output_section::Input_section_sort_entry::match_section_name_prefix):
17478 Remove.
17479 (Output_section::Input_section_sort_entry::match_section_file):
17480 Remove.
17481 (Output_section::Input_section_sort_compare::operator()): Rewrite
17482 using new Input_section_sort_entry functions. Sort crtbegin and
17483 crtend first. Sort sections with no priority before sections with
17484 a priority.
17485 * testsuite/initpri1.c (d3): Check j != 4.
17486 (cd5): New constructor/destructor function.
17487 (main): Check j != 2.
17488
479f6503
ILT
17489 * symtab.cc (Symbol_table::add_from_object): If we don't use the
17490 new symbol when resolving, don't call set_is_default.
17491 * testsuite/ver_test_7.cc: New file.
17492 * testsuite/ver_test_7.sh: New file.
17493 * testsuite/Makefile.am (ver_test_7.so): New target.
17494 (ver_test_7.o): New target.
17495 (check_SCRIPTS): Add ver_test_7.sh.
17496 (check_DATA): Add ver_test_7.syms.
17497 (ver_test_7.syms): New target.
17498
2fd32231
ILT
174992008-03-28 Ian Lance Taylor <iant@google.com>
17500
17501 * layout.cc (Layout::layout): If we see an input section with a
17502 name that needs sorting, set the must_sort flag for the output
17503 section.
17504 (Layout::make_output_section): If the name of the output section
17505 indicates that it might require sorting, set the may_sort flag.
17506 * output.h (Output_section::may_sort_attached_input_sections): New
17507 function.
17508 (Output_section::set_may_sort_attached_input_sections): New
17509 function.
17510 (Output_section::must_sort_attached_input_sections): New
17511 function.
17512 (Output_section::set_must_sort_attached_input_sections): New
17513 function.
17514 (class Output_section): Declare Input_section_sort_entry. Define
17515 Input_section_sort_compare. Declare
17516 sort_attached_input_sections. Add new fields:
17517 may_sort_attached_input_sections_,
17518 must_sort_attached_input_sections_,
17519 attached_input_sections_are_sorted_.
17520 * output.cc (Output_section::Output_section): Initialize new
17521 fields.
17522 (Output_section::add_input_section): Add an entry to
17523 input_sections_ if may_sort or must_sort are true.
17524 (Output_section::set_final_data_size): Call
17525 sort_attached_input_sections if necessary.
17526 (Output_section::Input_section_sort_entry): Define new class.
17527 (Output_section::Input_section_sort_compare::operator()): New
17528 function.
17529 (Output_section::sort_attached_input_sections): New function.
17530 * configure.ac: Check whether the compiler supports constructor
17531 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
17532 * testsuite/initpri1.c: New file.
17533 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
17534 CONSTRUCTOR_PRIORITY.
17535 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
17536 (initpri1_LDFLAGS): New variable.
17537 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
17538
18e6b24e
ILT
175392008-03-27 Ian Lance Taylor <iant@google.com>
17540
49bdd526
ILT
17541 * common.cc (Sort_commons::operator): Correct sorting algorithm.
17542 * testsuite/common_test_1.c: New file.
17543 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
17544 (common_test_1_SOURCES): New variable.
17545 (common_test_1_DEPENDENCIES): New variable.
17546 (common_test_1_LDFLAGS): New variable.
17547
18e6b24e
ILT
17548 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
17549 and commons_ correctly when NAME/VERSION does not override
17550 NAME/NULL.
17551 * testsuite/ver_test_6.c: New file.
17552 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
17553 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
17554 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
17555
04bf7072
ILT
175562008-03-26 Ian Lance Taylor <iant@google.com>
17557
5871526f
ILT
17558 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
17559 of an undefined symbol from a version script.
17560 * testsuite/Makefile.am (ver_test_5.so): New target.
17561 (ver_test_5.o): New target.
17562 (check_SCRIPTS): Add ver_test_5.sh.
17563 (check_DATA): Add ver_test_5.syms.
17564 (ver_test_5.syms): New target.
17565 * testsuite/ver_test_5.cc: New file.
17566 * testsuite/ver_test_5.script: New file.
17567 * testsuite/ver_test_5.sh: New file.
17568 * Makefile.in, testsuite/Makefile.in: Rebuild.
17569
04bf7072
ILT
17570 PR gold/5986
17571 Fix problems building gold with gcc 4.3.0.
17572 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
17573 (gold_error_at_location, gold_warning_at_location): Use it.
17574 * configure.ac: Check whether we can compile and use a template
17575 function with a printf attribute.
17576 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
17577 when jumping over bytes.
17578 * object.cc: Instantiate Object::read_section_data.
17579 * debug.h: Include <cstring>
17580 * dwarf_reader.cc: Include <algorithm>
17581 * main.cc: Include <cstring>.
17582 * options.cc: Include <cstring>.
17583 * output.cc: Include <cstring>.
17584 * script.cc: Include <cstring>.
17585 * script.h: Include <string>.
17586 * symtab.cc: Include <cstring> and <algorithm>.
17587 * target-select.cc: Include <cstring>.
17588 * version.cc: Include <string>.
17589 * testsuite/testmain.cc: Include <cstdlib>.
17590 * configure, config.in: Rebuild.
17591
874c5b28
ILT
175922008-03-25 Ian Lance Taylor <iant@google.com>
17593
819d6c3a
ILT
17594 * options.cc: Include "../bfd/bfdver.h".
17595 (options::help): Print bug reporting address.
17596
f4b2c6f5
ILT
17597 * version.cc (print_version): Adjust output for current value of
17598 BFD_VERSION_STRING.
17599
17600 * NEWS: New file.
17601
e96caa79
ILT
17602 * options.cc (options::help): Print list of supported targets.
17603 * target-select.h: Include <vector>.
17604 (class Target_selector): Make machine_, size_, and is_big_endian_
17605 fields const. Add bfd_name_ and instantiated_target_ fields.
17606 (Target_selector::Target_selector): Add bfd_name parameter.
17607 (Target_selector::recognize): Make non-virtual, call
17608 do_recognize.
17609 (Target_selector::recognize_by_name): Make non-virtual, call
17610 do_recognize_by_name.
17611 (Target_selector::supported_names): New function.
17612 (Target_selector::bfd_name): New function.
17613 (Target_selector::do_instantiate_target): New pure virtual
17614 function.
17615 (Target_selector::do_recognize): New virtual function.
17616 (Target_selector::do_recognize_by_name): New virtual function.
17617 (Target_selector::instantiate_target): New private function.
17618 (supported_target_names): Declare.
17619 * target-select.cc (Target_selector::Target_selector): Update for
17620 new parameter and fields.
17621 (select_target_by_name): Check that the name matches before
17622 calling recognize_by_name.
17623 (supported_target_names): New function.
17624 * i386.cc (class Target_selector_i386): Update Target_selector
17625 constructor call. Remove recognize and recognize_by_name. Add
17626 do_instantiate_target.
17627 * x86_64.cc (class Target_selector_x86_64): Likewise.
17628 * testsuite/testfile.cc (class Target_selector_test): Update for
17629 changes to Target_selector.
17630
874c5b28
ILT
17631 * README: Rewrite, with some notes on unsupported features.
17632
0a65a3a7
CC
176332008-03-24 Cary Coutant <ccoutant@google.com>
17634
17635 * i386.cc (Target_i386::Got_type): New enum declaration.
17636 (Target_i386::Scan::local): Updated callers of Output_data_got
17637 member functions.
17638 (Target_i386::Scan::global): Likewise.
17639 (Target_i386::Relocate::relocate): Likewise.
17640 (Target_i386::Relocate::relocate_tls): Likewise.
17641 * object.h (Got_offset_list): New class.
17642 (Sized_relobj::local_has_got_offset): Added got_type parameter.
17643 (Sized_relobj::local_got_offset): Likewise.
17644 (Sized_relobj::set_local_got_offset): Likewise.
17645 (Sized_relobj::local_has_tls_got_offset): Removed.
17646 (Sized_relobj::local_tls_got_offset): Removed.
17647 (Sized_relobj::set_local_tls_got_offset): Removed.
17648 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
17649 * output.cc (Output_data_got::add_global): Added got_type parameter.
17650 (Output_data_got::add_global_with_rel): Likewise.
17651 (Output_data_got::add_global_with_rela): Likewise.
17652 (Output_data_got::add_global_pair_with_rel): New function.
17653 (Output_data_got::add_global_pair_with_rela): New function.
17654 (Output_data_got::add_local): Added got_type parameter.
17655 (Output_data_got::add_local_with_rel): Likewise.
17656 (Output_data_got::add_local_with_rela): Likewise.
17657 (Output_data_got::add_local_pair_with_rel): New function.
17658 (Output_data_got::add_local_pair_with_rela): New function.
17659 (Output_data_got::add_global_tls): Removed.
17660 (Output_data_got::add_global_tls_with_rel): Removed.
17661 (Output_data_got::add_global_tls_with_rela): Removed.
17662 (Output_data_got::add_local_tls): Removed.
17663 (Output_data_got::add_local_tls_with_rel): Removed.
17664 (Output_data_got::add_local_tls_with_rela): Removed.
17665 * output.h (Output_data_got::add_global): Added got_type parameter.
17666 (Output_data_got::add_global_with_rel): Likewise.
17667 (Output_data_got::add_global_with_rela): Likewise.
17668 (Output_data_got::add_global_pair_with_rel): New function.
17669 (Output_data_got::add_global_pair_with_rela): New function.
17670 (Output_data_got::add_local): Added got_type parameter.
17671 (Output_data_got::add_local_with_rel): Likewise.
17672 (Output_data_got::add_local_with_rela): Likewise.
17673 (Output_data_got::add_local_pair_with_rel): New function.
17674 (Output_data_got::add_local_pair_with_rela): New function.
17675 (Output_data_got::add_global_tls): Removed.
17676 (Output_data_got::add_global_tls_with_rel): Removed.
17677 (Output_data_got::add_global_tls_with_rela): Removed.
17678 (Output_data_got::add_local_tls): Removed.
17679 (Output_data_got::add_local_tls_with_rel): Removed.
17680 (Output_data_got::add_local_tls_with_rela): Removed.
17681 * resolve.cc (Symbol::override_base_with_special): Removed
17682 reference to has_got_offset_ field.
17683 * symtab.cc (Symbol::init_fields): Replaced initialization
17684 of got_offset_ with got_offsets_. Removed initialization
17685 of has_got_offset_
53fcba31 17686 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
17687 (Symbol::got_offset): Likewise.
17688 (Symbol::set_got_offset): Likewise.
17689 (Symbol::has_tls_got_offset): Removed.
17690 (Symbol::tls_got_offset): Removed.
17691 (Symbol::set_tls_got_offset): Removed.
17692 (Symbol::got_offset_): Removed.
17693 (Symbol::tls_mod_got_offset_): Removed.
17694 (Symbol::tls_pair_got_offset_): Removed.
17695 (Symbol::got_offsets_): New field.
17696 (Symbol::has_got_offset): Removed.
17697 (Symbol::has_tls_mod_got_offset): Removed.
17698 (Symbol::has_tls_pair_got_offset): Removed.
17699 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
17700 (Target_x86_64::Scan::local): Updated callers of Output_data_got
17701 member functions.
17702 (Target_x86_64::Scan::global): Likewise.
17703 (Target_x86_64::Relocate::relocate): Likewise.
17704 (Target_x86_64::Relocate::relocate_tls): Likewise.
17705
bd52eafb
BE
177062008-03-25 Ben Elliston <bje@au.ibm.com>
17707
17708 * yyscript.y: Fix spelling error in comment.
17709
8b105e34
ILT
177102008-03-24 Ian Lance Taylor <iant@google.com>
17711
8ed814a9
ILT
17712 * options.h (class General_options): Define build_id option.
17713 * layout.h (class Layout): Declare write_build_id, create_note,
17714 create_build_id. Add build_id_note_ member.
17715 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
17716 "libiberty.h", "md5.h", "sha1.h".
17717 (Layout::Layout): Initialize eh_frame_data_,
17718 eh_frame_hdr_section_, and build_id_note_.
17719 (Layout::finalize): Call create_build_id.
17720 (Layout::create_note): New function, broken out of
17721 Layout::create_gold_note.
17722 (Layout::create_gold_note): Call create_note.
17723 (Layout::create_build_id): New function.
17724 (Layout::write_build_id): New function.
17725 (Close_task_runner::run): Call write_build_id.
17726
8b105e34
ILT
17727 * x86_64.cc: Correct license to GPLv3.
17728
086a1841
ILT
177292008-03-23 Ian Lance Taylor <iant@google.com>
17730
17731 * options.cc: Include "demangle.h".
17732 (parse_optional_string): New function.
17733 (parse_long_option): Handle takes_optional_argument.
17734 (parse_short_option): Update dash_z initializer. Handle
17735 takes_optional_argument.
17736 (General_options::General_options): Initialize do_demangle_.
17737 (General_options::finalize): Set do_demangle_. Handle demangling
17738 style.
17739 * options.h (parse_optional_string): Declare.
17740 (struct One_option): Add optional_arg field. Update constructor.
17741 Update call constructor calls. Add takes_optional_argument
17742 function.
17743 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
17744 (DEFINE_optional_string): Define.
17745 (General_options::demangle): Change from DEFINE_bool to
17746 DEFINE_optional_string.
17747 (General_options::no_demangle): New function.
17748 (General_options::do_demangle): New function.
17749 (General_options::set_do_demangle): New function.
17750 (General_options::execstack_status_): Move definition to end of
17751 class definition.
17752 (General_options::static_): Likewise.
17753 (General_options::do_demangle_): New field.
17754 * object.cc (big_endian>::get_symbol_location_info): Call
17755 Options::do_demangle, not Options::demangle.
17756 * symtab.cc (demangle): Likewise.
17757
cbb93e63
ILT
177582008-03-22 Ian Lance Taylor <iant@google.com>
17759
17760 * gold.h: Include <cstddef> and <sys/types.h>
17761 * options.h: Include <cstring>.
17762
ec531623
ILT
177632008-03-21 Ian Lance Taylor <iant@google.com>
17764
17765 * Added source code to GNU binutils.
752937aa 17766\f
b90efa5b 17767Copyright (C) 2008-2015 Free Software Foundation, Inc.
752937aa
NC
17768
17769Copying and distribution of this file, with or without modification,
17770are permitted in any medium without royalty provided the copyright
17771notice and this notice are preserved.
17772
17773Local Variables:
17774mode: change-log
17775left-margin: 8
17776fill-column: 74
17777version-control: never
17778End:
This page took 1.173551 seconds and 4 git commands to generate.